[Gstreamer-bugs] [Bug 99815] Changed - gstreamer should use ISO __VAR_ARGS__

bugzilla-daemon at widget.gnome.org bugzilla-daemon at widget.gnome.org
Thu Nov 28 06:37:29 PST 2002


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

http://bugzilla.gnome.org/show_bug.cgi?id=99815

Changed by brian.cameron at ireland.sun.com.

--- shadow/99815	Thu Nov 28 09:09:14 2002
+++ shadow/99815.tmp.1313	Thu Nov 28 09:37:29 2002
@@ -33,6 +33,74 @@
 the GST_PROPS_LIST() in gst/gstprops.h and some macros in gst/gstinfo.h
 will need some extra attention.
 
 You can read more information about this here:
 
 http://gcc.gnu.org/onlinedocs/gcc-3.2/gcc/Variadic-Macros.html#Variadic%20Macros
+
+------- Additional Comments From brian.cameron at ireland.sun.com  2002-11-28 09:37 -------
+
+The following macros would need to be addressed to resolve this
+problem.  There is only one macro that uses ## that would require
+anything more than trivial rework and that is GST_PROPS_LIST.
+
+GST_PROPS_LIST in gstprops.h
+
+   Note: the above uses ## so will need to be reworked.  I notice
+   that there are only 18 references to this macro, all in 
+   testsuite/caps/compatibility.c, testsuite/caps/intersection.c,
+   and testsuite/caps/normalization.c.
+
+   All this macro is doing is the following:
+
+      #define GST_PROPS_LIST(a...) GST_PROPS_LIST_TYPE,##a,NULL
+
+   Which really isn't much.  Therefore, the easiest thing to do
+   would just be to simply get rid of this macro altogether and
+   replace the macro references with what the macro is doing.
+
+The others are:
+
+GST_CAPS_NEW in gstcaps.h
+GST_CAPS_FACTORY in gstcaps.h
+gst_caps_set in gstcaps.h
+gst_caps_get in gstcaps.h
+
+  (note for the above two, the ## could be eliminated as follows
+  #define gst_caps_set(caps, ...) 
+     gst_props_set((caps)->properties, __VAR_ARGS__)
+
+GST_FORMATS_FUNCTION in gstformat.h
+GST_EVENT_MASK_FUNCTION in gstevent.h
+GST_PAD_QUERY_TYPE_FUNCTION in gstpad.h
+GST_PAD_TEMPLATE_NEW in gstpad.h
+GST_PAD_TEMPLATE_FACTORY in gstpad.h
+
+GST_SHOW_INFO in gstlog.h
+GST_DEBUG and GST_DEBUG_ELEMENT in gstinfo.h
+GST_INFO and GST_INFO_ELEMENT in gstinfo.h
+GST_ERROR and GST_ERROR_OBJECT in gstinfo.h
+
+  Note: There's also some commented out convenience macros which
+        would also be nice to support.
+  Note: All the above gstlog.h and gstinfo.h macros use ##, but can
+        easily be worked around as follows
+
+        #define GST_DEBUG(cat, ...) G_STMT_START{ \
+           if ((1<<cat) & _gst_debug_categories) \     
+           _gst_debug_handler(cat,_GST_DEBUG_INCORE,__FILE__,
+           __PRETTY_FUNCTION__,__LINE__,_debug_string, \	
+           NULL,g_strdup_printf( __VAR_ARGS__ )); \
+           }G_STMT_END
+
+Also gst/parse/parse.l has this problem on lines 8-12
+
+     8  #ifdef DEBUG
+     9  # define PRINT(a...) printf(##a)
+    10	#else
+    11  #define PRINT(a...)
+    12	#endif
+
+Note that this PRINT macro uses ##, but I think it is unnecessary
+since every single reference to PRINT has at least one argument
+passed in.
+





More information about the Gstreamer-bugs mailing list