audio: const gpointer is not the same as gconstpointer/const void *
authorSebastian Dröge <sebastian@centricular.com>
Sun, 4 Nov 2018 19:17:28 +0000 (21:17 +0200)
committerSebastian Dröge <slomo@coaxion.net>
Mon, 5 Nov 2018 08:16:16 +0000 (08:16 +0000)
See https://bugzilla.gnome.org/show_bug.cgi?id=664491

gst-libs/gst/audio/audio-format.c
gst-libs/gst/audio/audio-format.h

index 6358e32..c41a0dd 100644 (file)
 #define MAKE_ORC_PACK_UNPACK(fmt,fmt_t)                         \
 static void unpack_ ##fmt (const GstAudioFormatInfo *info,      \
     GstAudioPackFlags flags, gpointer dest,                     \
-    const gpointer data, gint length) {                         \
+    gconstpointer data, gint length) {                          \
   if (flags & GST_AUDIO_PACK_FLAG_TRUNCATE_RANGE)               \
     audio_orc_unpack_ ##fmt_t (dest, data, length);             \
   else                                                          \
     audio_orc_unpack_ ##fmt (dest, data, length);               \
 }                                                               \
 static void pack_ ##fmt (const GstAudioFormatInfo *info,        \
-    GstAudioPackFlags flags, const gpointer src,                \
+    GstAudioPackFlags flags, gconstpointer src,                 \
     gpointer data, gint length) {                               \
   audio_orc_pack_ ##fmt (data, src, length);                    \
 }
@@ -161,21 +161,21 @@ MAKE_ORC_PACK_UNPACK (s8, s8_trunc)
 #define MAKE_PACK_UNPACK(name, stride, sign, scale, READ_FUNC, WRITE_FUNC)     \
 static void unpack_ ##name (const GstAudioFormatInfo *info,             \
     GstAudioPackFlags flags, gpointer dest,                             \
-    const gpointer data, gint length)                                   \
+    gconstpointer data, gint length)                                    \
 {                                                                       \
   guint32 *d = dest;                                                    \
-  guint8 *s = data;                                                     \
+  const guint8 *s = data;                                               \
   for (;length; length--) {                                             \
     *d++ = (((gint32) READ_FUNC (s)) << scale) ^ (sign);                \
     s += stride;                                                        \
   }                                                                     \
 }                                                                       \
 static void pack_ ##name (const GstAudioFormatInfo *info,               \
-    GstAudioPackFlags flags, const gpointer src,                        \
+    GstAudioPackFlags flags, gconstpointer src,                         \
     gpointer data, gint length)                                         \
 {                                                                       \
   gint32 tmp;                                                           \
-  guint32 *s = src;                                                     \
+  const guint32 *s = src;                                               \
   guint8 *d = data;                                                     \
   for (;length; length--) {                                             \
     tmp = (*s++ ^ (sign)) >> scale;                                     \
index d907478..8488157 100644 (file)
@@ -200,7 +200,7 @@ typedef enum
  */
 typedef void (*GstAudioFormatUnpack)         (const GstAudioFormatInfo *info,
                                               GstAudioPackFlags flags, gpointer dest,
-                                              const gpointer data, gint length);
+                                              gconstpointer data, gint length);
 /**
  * GstAudioFormatPack:
  * @info: a #GstAudioFormatInfo
@@ -215,7 +215,7 @@ typedef void (*GstAudioFormatUnpack)         (const GstAudioFormatInfo *info,
  * and will be packed into @data.
  */
 typedef void (*GstAudioFormatPack)           (const GstAudioFormatInfo *info,
-                                              GstAudioPackFlags flags, const gpointer src,
+                                              GstAudioPackFlags flags, gconstpointer src,
                                               gpointer data, gint length);
 
 /**