[gst-devel] more warning stricture

vishnu at pobox.com vishnu at pobox.com
Fri Sep 14 12:51:02 CEST 2001


1. Add more warnings for the gst core only.  Various trival fixes
to quiet the warnings.

2. Fix GstBufferCopyFunc prototype.

3. Re-apply the reverted type!=0 assertion in gst_elementfactory_new.

OK to commit?

-- 
Victory to the Divine Mother!!
  http://sahajayoga.org
-------------- next part --------------
? p1
? elements/README
Index: Makefile.am
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/gst/Makefile.am,v
retrieving revision 1.75
diff -u -p -r1.75 Makefile.am
--- Makefile.am	2001/09/13 21:16:25	1.75
+++ Makefile.am	2001/09/14 18:56:43
@@ -200,7 +200,13 @@ CFLAGS = \
 	$(LIBGST_CFLAGS) \
 	-D_GNU_SOURCE \
 	-DG_LOG_DOMAIN=g_log_domain_gstreamer \
-	-DGST_CONFIG_DIR=\""$(GST_CONFIG_DIR)"\"
+	-DGST_CONFIG_DIR=\""$(GST_CONFIG_DIR)"\" \
+	\
+	-W -Wpointer-arith -Wbad-function-cast \
+	-Wcast-align -Wsign-compare \
+	-Wmissing-prototypes -Wmissing-declarations \
+	-Wnested-externs \
+	-Winline -Wno-unused
 
 LIBS = $(LIBGST_LIBS)
 LDFLAGS = ""
Index: cothreads.h
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/gst/cothreads.h,v
retrieving revision 1.15
diff -u -p -r1.15 cothreads.h
--- cothreads.h	2001/05/27 14:37:29	1.15
+++ cothreads.h	2001/09/14 18:56:43
@@ -66,7 +66,7 @@ struct _cothread_state {
 };
 
 
-cothread_context*		cothread_init();
+cothread_context*		cothread_init           (void);
 cothread_state*			cothread_create		(cothread_context *ctx);
 void				cothread_setfunc	(cothread_state *thread, cothread_func func,
 						         int argc, char **argv);
Index: gstautoplug.c
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/gst/gstautoplug.c,v
retrieving revision 1.22
diff -u -p -r1.22 gstautoplug.c
--- gstautoplug.c	2001/08/21 20:16:45	1.22
+++ gstautoplug.c	2001/09/14 18:56:43
@@ -58,6 +58,7 @@ GType gst_autoplug_get_type(void)
       sizeof(GstAutoplug),
       4,
       (GInstanceInitFunc)gst_autoplug_init,
+      NULL
     };
     autoplug_type = g_type_register_static (GST_TYPE_OBJECT, "GstAutoplug", &autoplug_info, G_TYPE_FLAG_ABSTRACT);
   }
@@ -189,6 +190,7 @@ gst_autoplugfactory_get_type (void) 
       sizeof(GstAutoplugFactory),
       0,
       (GInstanceInitFunc) gst_autoplugfactory_init,
+      NULL
     };
     autoplugfactory_type = g_type_register_static (GST_TYPE_PLUGIN_FEATURE, 
 		    				  "GstAutoplugFactory", &autoplugfactory_info, 0);
Index: gstbin.c
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/gst/gstbin.c,v
retrieving revision 1.90
diff -u -p -r1.90 gstbin.c
--- gstbin.c	2001/09/13 20:13:51	1.90
+++ gstbin.c	2001/09/14 18:56:43
@@ -87,6 +87,7 @@ gst_bin_get_type (void)
       sizeof(GstBin),
       8,
       (GInstanceInitFunc)gst_bin_init,
+      NULL
     };
     bin_type = g_type_register_static (GST_TYPE_ELEMENT, "GstBin", &bin_info, 0);
   }
@@ -170,7 +171,7 @@ gst_bin_reset_element_sched (GstElement 
 //    GST_SCHEDULE_ADD_ELEMENT (sched, element);
 }
 
-void
+static void
 gst_bin_set_element_sched (GstElement *element,GstSchedule *sched)
 {
   GList *children;
@@ -211,7 +212,7 @@ gst_bin_set_element_sched (GstElement *e
 }
 
 
-void
+static void
 gst_bin_unset_element_sched (GstElement *element)
 {
   GList *children;
Index: gstbuffer.c
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/gst/gstbuffer.c,v
retrieving revision 1.36
diff -u -p -r1.36 gstbuffer.c
--- gstbuffer.c	2001/09/10 20:11:22	1.36
+++ gstbuffer.c	2001/09/14 18:56:43
@@ -357,7 +357,7 @@ gst_buffer_copy (GstBuffer *buffer)
 
   // if a copy function exists, use it, else copy the bytes
   if (buffer->copy != NULL) {
-    (buffer->copy)(buffer,newbuf);
+    newbuf = (buffer->copy)(buffer);
   } else {
     // copy the absolute size
     newbuf->size = buffer->size;
Index: gstbuffer.h
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/gst/gstbuffer.h,v
retrieving revision 1.26
diff -u -p -r1.26 gstbuffer.h
--- gstbuffer.h	2001/09/10 19:46:00	1.26
+++ gstbuffer.h	2001/09/14 18:56:43
@@ -86,8 +86,8 @@ typedef enum {
 typedef struct _GstBuffer GstBuffer;
 
 
-typedef void	(*GstBufferFreeFunc)	(GstBuffer *buf);
-typedef void	(*GstBufferCopyFunc)	(GstBuffer *srcbuf,GstBuffer *dstbuf);
+typedef void       (*GstBufferFreeFunc)	(GstBuffer *buf);
+typedef GstBuffer *(*GstBufferCopyFunc)	(GstBuffer *srcbuf);
 
 
 #include <gst/gstbufferpool.h>
Index: gstbufferpool.c
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/gst/gstbufferpool.c,v
retrieving revision 1.18
diff -u -p -r1.18 gstbufferpool.c
--- gstbufferpool.c	2001/08/31 16:40:03	1.18
+++ gstbufferpool.c	2001/09/14 18:56:43
@@ -194,7 +194,8 @@ gst_buffer_pool_set_buffer_free_function
  * @destroy: the copy function
  *
  * Sets the function that will be called when a buffer is copied.
- * You can use the default GstBuffer implementation (gst_buffer_copy) if you like.
+ *
+ * You may use the default GstBuffer implementation (gst_buffer_copy).
  */
 void 
 gst_buffer_pool_set_buffer_copy_function (GstBufferPool *pool, 
Index: gstelement.c
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/gst/gstelement.c,v
retrieving revision 1.75
diff -u -p -r1.75 gstelement.c
--- gstelement.c	2001/09/13 20:13:51	1.75
+++ gstelement.c	2001/09/14 18:56:43
@@ -83,6 +83,7 @@ GType gst_element_get_type(void) {
       sizeof(GstElement),
       0,
       (GInstanceInitFunc)gst_element_init,
+      NULL
     };
     element_type = g_type_register_static(GST_TYPE_OBJECT, "GstElement", &element_info, G_TYPE_FLAG_ABSTRACT);
   }
Index: gstelementfactory.c
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/gst/gstelementfactory.c,v
retrieving revision 1.45
diff -u -p -r1.45 gstelementfactory.c
--- gstelementfactory.c	2001/09/14 17:32:27	1.45
+++ gstelementfactory.c	2001/09/14 18:56:43
@@ -57,6 +57,7 @@ gst_elementfactory_get_type (void) 
       sizeof(GstElementFactory),
       0,
       (GInstanceInitFunc) gst_elementfactory_init,
+      NULL
     };
     elementfactory_type = g_type_register_static (GST_TYPE_PLUGIN_FEATURE, 
 		    				  "GstElementFactory", &elementfactory_info, 0);
@@ -176,6 +177,7 @@ gst_elementfactory_new (const gchar *nam
   GstElementFactory *factory;
 
   g_return_val_if_fail(name != NULL, NULL);
+  g_return_val_if_fail (type, NULL);
   g_return_val_if_fail (details, NULL);
 
   factory = gst_elementfactory_find (name);
Index: gstextratypes.c
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/gst/gstextratypes.c,v
retrieving revision 1.5
diff -u -p -r1.5 gstextratypes.c
--- gstextratypes.c	2001/06/25 01:20:08	1.5
+++ gstextratypes.c	2001/09/14 18:56:43
@@ -41,6 +41,7 @@ gst_extra_get_filename_type (void) 
       0, //sizeof(GstElement),
       0,
       NULL,
+      NULL
     };
     filename_type = g_type_register_static (G_TYPE_STRING, "GstFilename", &filename_info, 0);
   }
Index: gstobject.c
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/gst/gstobject.c,v
retrieving revision 1.23
diff -u -p -r1.23 gstobject.c
--- gstobject.c	2001/08/21 20:16:45	1.23
+++ gstobject.c	2001/09/14 18:56:43
@@ -78,6 +78,7 @@ gst_object_get_type (void)
       sizeof (GstObject),
       32,
       (GInstanceInitFunc) gst_object_init,
+      NULL
     };
     object_type = g_type_register_static (G_TYPE_OBJECT, "GstObject", &object_info, G_TYPE_FLAG_ABSTRACT);
   }
@@ -608,6 +609,7 @@ gst_signal_object_get_type (void)
       sizeof(GstSignalObject),
       16,
       (GInstanceInitFunc)gst_signal_object_init,
+      NULL
     };
     signal_object_type = g_type_register_static(G_TYPE_OBJECT, "GstSignalObject", &signal_object_info, 0);
   }
Index: gstpad.c
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/gst/gstpad.c,v
retrieving revision 1.107
diff -u -p -r1.107 gstpad.c
--- gstpad.c	2001/09/14 01:57:09	1.107
+++ gstpad.c	2001/09/14 18:56:44
@@ -55,6 +55,7 @@ gst_pad_get_type(void) {
       sizeof(GstPad),
       32,
       (GInstanceInitFunc)gst_pad_init,
+      NULL
     };
     pad_type = g_type_register_static(GST_TYPE_OBJECT, "GstPad", &pad_info, 0);
   }
@@ -124,6 +125,7 @@ gst_real_pad_get_type(void) {
       sizeof(GstRealPad),
       32,
       (GInstanceInitFunc)gst_real_pad_init,
+      NULL
     };
     pad_type = g_type_register_static(GST_TYPE_PAD, "GstRealPad", &pad_info, 0);
   }
@@ -1425,7 +1427,9 @@ gst_pad_push (GstPad *pad, GstBuffer *bu
           GST_DEBUG_FUNCPTR_NAME (peer->chainhandler), GST_DEBUG_PAD_NAME (((GstPad*)peer)));
     (peer->chainhandler) (((GstPad*)peer), buf);
   } else
-    GST_DEBUG (GST_CAT_DATAFLOW, "no chainhandler\n");
+    {
+      GST_DEBUG (GST_CAT_DATAFLOW, "no chainhandler\n");
+    }
 }
 #endif
 
@@ -1616,6 +1620,7 @@ gst_padtemplate_get_type (void)
       sizeof(GstPadTemplate),
       32,
       (GInstanceInitFunc)gst_padtemplate_init,
+      NULL
     };
     padtemplate_type = g_type_register_static(GST_TYPE_OBJECT, "GstPadTemplate", &padtemplate_info, 0);
   }
@@ -1865,6 +1870,7 @@ gst_ghost_pad_get_type(void) {
       sizeof(GstGhostPad),
       8,
       (GInstanceInitFunc)gst_ghost_pad_init,
+      NULL
     };
     pad_type = g_type_register_static(GST_TYPE_PAD, "GstGhostPad", &pad_info, 0);
   }
Index: gstpad.h
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/gst/gstpad.h,v
retrieving revision 1.62
diff -u -p -r1.62 gstpad.h
--- gstpad.h	2001/08/22 21:45:25	1.62
+++ gstpad.h	2001/09/14 18:56:44
@@ -399,6 +399,9 @@ GstCaps*		gst_padtemplate_get_caps_by_na
 xmlNodePtr		gst_padtemplate_save_thyself	(GstPadTemplate *templ, xmlNodePtr parent);
 GstPadTemplate*		gst_padtemplate_load_thyself	(xmlNodePtr parent);
 
+xmlNodePtr              gst_pad_ghost_save_thyself   (GstPad *pad,
+						      GstElement *bin,
+						      xmlNodePtr parent);
 
 #ifdef __cplusplus
 }
Index: gstparse.c
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/gst/gstparse.c,v
retrieving revision 1.22
diff -u -p -r1.22 gstparse.c
--- gstparse.c	2001/09/12 11:28:09	1.22
+++ gstparse.c	2001/09/14 18:56:44
@@ -88,9 +88,11 @@ dynamic_connect (GstElement *element, Gs
 static gchar *
 gst_parse_unique_name(gchar *type,gst_parse_priv *priv)
 {
+  gpointer tmp;
   gint count;
 
-  count = GPOINTER_TO_INT(g_hash_table_lookup(priv->elementcounts,type));
+  tmp = g_hash_table_lookup (priv->elementcounts,type);
+  count = GPOINTER_TO_INT (tmp);
   count++;
   g_hash_table_insert(priv->elementcounts,type,GINT_TO_POINTER(count));
 
@@ -469,9 +471,10 @@ GST_DEBUG_PAD_NAME(temppad),GST_ELEMENT_
 
   if (retval) return retval;
 
-  if (closingchar != '\0')
-    DEBUG("returning IN THE WRONG PLACE\n");
-  else DEBUG("ending pipeline\n");
+  DEBUG (closingchar != '\0'?
+	 "returning IN THE WRONG PLACE\n" : 
+	 "ending pipeline\n");
+
   return i+1;
 }
 
Index: gstpipeline.c
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/gst/gstpipeline.c,v
retrieving revision 1.52
diff -u -p -r1.52 gstpipeline.c
--- gstpipeline.c	2001/06/25 01:20:08	1.52
+++ gstpipeline.c	2001/09/14 18:56:44
@@ -75,6 +75,7 @@ gst_pipeline_get_type (void) {
       sizeof(GstPipeline),
       0,
       (GInstanceInitFunc)gst_pipeline_init,
+      NULL
     };
     pipeline_type = g_type_register_static (GST_TYPE_BIN, "GstPipeline", &pipeline_info, 0);
   }
Index: gstplugin.c
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/gst/gstplugin.c,v
retrieving revision 1.64
diff -u -p -r1.64 gstplugin.c
--- gstplugin.c	2001/08/21 20:16:45	1.64
+++ gstplugin.c	2001/09/14 18:56:44
@@ -674,7 +674,7 @@ gst_plugin_find_feature_func (GstPlugin 
   return NULL;
 }
 
-GstPluginFeature*
+static GstPluginFeature*
 gst_plugin_find_feature (const gchar *name, GType type)
 {
   GList *plugins;
Index: gstpluginfeature.c
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/gst/gstpluginfeature.c,v
retrieving revision 1.2
diff -u -p -r1.2 gstpluginfeature.c
--- gstpluginfeature.c	2001/09/10 19:46:01	1.2
+++ gstpluginfeature.c	2001/09/14 18:56:44
@@ -51,6 +51,7 @@ gst_plugin_feature_get_type (void)
       sizeof (GstObject),
       32,
       (GInstanceInitFunc) gst_plugin_feature_init,
+      NULL
     };
     plugin_feature_type = g_type_register_static (GST_TYPE_OBJECT, "GstPluginFeature", 
 		    				  &plugin_feature_info, G_TYPE_FLAG_ABSTRACT);
Index: gstqueue.c
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/gst/gstqueue.c,v
retrieving revision 1.16
diff -u -p -r1.16 gstqueue.c
--- gstqueue.c	2001/08/21 20:16:45	1.16
+++ gstqueue.c	2001/09/14 18:56:44
@@ -121,6 +121,7 @@ gst_queue_get_type(void) 
       sizeof(GstQueue),
       4,
       (GInstanceInitFunc)gst_queue_init,
+      NULL
     };
     queue_type = g_type_register_static (GST_TYPE_ELEMENT, "GstQueue", &queue_info, 0);
   }
Index: gstscheduler.c
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/gst/gstscheduler.c,v
retrieving revision 1.31
diff -u -p -r1.31 gstscheduler.c
--- gstscheduler.c	2001/08/10 17:34:59	1.31
+++ gstscheduler.c	2001/09/14 18:56:45
@@ -842,6 +842,7 @@ GType gst_schedule_get_type(void) {
       sizeof(GstSchedule),
       0,
       (GInstanceInitFunc)gst_schedule_init,
+      NULL
     };
     schedule_type = g_type_register_static(GST_TYPE_OBJECT, "GstSchedule", &schedule_info, 0);
   }
@@ -910,7 +911,7 @@ GstElement *gst_schedule_check_pad (GstS
 }
 */
 
-GstScheduleChain *
+static GstScheduleChain *
 gst_schedule_chain_new (GstSchedule *sched)
 {
   GstScheduleChain *chain = g_new (GstScheduleChain, 1);
@@ -934,7 +935,7 @@ gst_schedule_chain_new (GstSchedule *sch
   return chain;
 }
 
-void
+static void
 gst_schedule_chain_destroy (GstScheduleChain *chain)
 {
   GstSchedule *sched = chain->sched;
@@ -951,7 +952,7 @@ gst_schedule_chain_destroy (GstScheduleC
   GST_INFO (GST_CAT_SCHEDULING, "destroyed chain %p, now are %d chains in sched %p",chain,sched->num_chains,sched);
 }
 
-void
+static void
 gst_schedule_chain_add_element (GstScheduleChain *chain, GstElement *element)
 {
   GST_INFO (GST_CAT_SCHEDULING, "adding element \"%s\" to chain %p", GST_ELEMENT_NAME (element),chain);
@@ -964,7 +965,7 @@ gst_schedule_chain_add_element (GstSched
   chain->num_elements++;
 }
 
-void
+static void
 gst_schedule_chain_enable_element (GstScheduleChain *chain, GstElement *element)
 {
   GST_INFO (GST_CAT_SCHEDULING, "enabling element \"%s\" in chain %p", GST_ELEMENT_NAME (element),chain);
@@ -979,7 +980,7 @@ gst_schedule_chain_enable_element (GstSc
   gst_schedule_cothreaded_chain(GST_BIN(chain->sched->parent),chain);
 }
 
-void
+static void
 gst_schedule_chain_disable_element (GstScheduleChain *chain, GstElement *element)
 {
   GST_INFO (GST_CAT_SCHEDULING, "disabling element \"%s\" in chain %p", GST_ELEMENT_NAME (element),chain);
@@ -995,7 +996,7 @@ gst_schedule_chain_disable_element (GstS
 //  gst_schedule_cothreaded_chain(GST_BIN(chain->sched->parent),chain);
 }
 
-void
+static void
 gst_schedule_chain_remove_element (GstScheduleChain *chain, GstElement *element)
 {
   GST_INFO (GST_CAT_SCHEDULING, "removing element \"%s\" from chain %p", GST_ELEMENT_NAME (element),chain);
@@ -1017,7 +1018,7 @@ gst_schedule_chain_remove_element (GstSc
   element->sched = NULL;
 }
 
-void
+static void
 gst_schedule_chain_elements (GstSchedule *sched, GstElement *element1, GstElement *element2)
 {
   GList *chains;
@@ -1103,7 +1104,7 @@ GST_ELEMENT_SCHED(srcelement),GST_ELEMEN
 }
 
 // find the chain within the schedule that holds the element, if any
-GstScheduleChain *
+static GstScheduleChain *
 gst_schedule_find_chain (GstSchedule *sched, GstElement *element)
 {
   GList *chains;
@@ -1125,7 +1126,7 @@ gst_schedule_find_chain (GstSchedule *sc
   return NULL;
 }
 
-void
+static void
 gst_schedule_chain_recursive_add (GstScheduleChain *chain, GstElement *element)
 {
   GList *pads;
Index: gstthread.c
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/gst/gstthread.c,v
retrieving revision 1.53
diff -u -p -r1.53 gstthread.c
--- gstthread.c	2001/09/14 05:02:27	1.53
+++ gstthread.c	2001/09/14 18:56:45
@@ -95,6 +95,7 @@ gst_thread_get_type(void) {
       sizeof(GstThread),
       4,
       (GInstanceInitFunc)gst_thread_init,
+      NULL
     };
     thread_type = g_type_register_static(GST_TYPE_BIN, "GstThread", &thread_info, 0);
   }
Index: gsttype.c
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/gst/gsttype.c,v
retrieving revision 1.30
diff -u -p -r1.30 gsttype.c
--- gsttype.c	2001/09/10 19:46:01	1.30
+++ gsttype.c	2001/09/14 18:56:48
@@ -69,6 +69,7 @@ gst_typefactory_get_type (void)
       sizeof(GstTypeFactory),
       0,
       (GInstanceInitFunc) gst_typefactory_init,
+      NULL
     };
     typefactory_type = g_type_register_static (GST_TYPE_PLUGIN_FEATURE,
                                                "GstTypeFactory", &typefactory_info, 0);
Index: gsttypefind.c
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/gst/gsttypefind.c,v
retrieving revision 1.10
diff -u -p -r1.10 gsttypefind.c
--- gsttypefind.c	2001/08/21 20:16:45	1.10
+++ gsttypefind.c	2001/09/14 18:56:48
@@ -81,6 +81,7 @@ gst_typefind_get_type (void)
       sizeof(GstTypeFind),
       0,
       (GInstanceInitFunc)gst_typefind_init,
+      NULL
     };
     typefind_type = g_type_register_static (GST_TYPE_ELEMENT, "GstTypeFind", &typefind_info, 0);
   }
Index: gstutils.c
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/gst/gstutils.c,v
retrieving revision 1.15
diff -u -p -r1.15 gstutils.c
--- gstutils.c	2001/07/04 20:49:06	1.15
+++ gstutils.c	2001/09/14 18:56:48
@@ -28,6 +28,8 @@
 
 #include "gstextratypes.h"
 
+#define ZERO(mem) memset(&mem, 0, sizeof(mem))
+
 /**
  * gst_util_get_int_arg:
  * @object: the object to query
@@ -40,8 +42,9 @@
 gint
 gst_util_get_int_arg (GObject *object, const gchar *argname) 
 {
-  GValue value = {0, };
+  GValue value;
 
+  ZERO (value);
   g_value_init (&value, G_TYPE_INT);
   g_object_get_property(G_OBJECT(object),argname,&value);
 
@@ -60,8 +63,9 @@ gst_util_get_int_arg (GObject *object, c
 gint
 gst_util_get_bool_arg (GObject *object, const gchar *argname) 
 {
-  GValue value = {0, };
+  GValue value;
 
+  ZERO (value);
   g_value_init (&value, G_TYPE_BOOLEAN);
   g_object_get_property(G_OBJECT(object),argname,&value);
 
@@ -80,8 +84,9 @@ gst_util_get_bool_arg (GObject *object, 
 glong
 gst_util_get_long_arg (GObject *object, const gchar *argname) 
 {
-  GValue value = {0, };
+  GValue value;
 
+  ZERO (value);
   g_value_init (&value, G_TYPE_LONG);
   g_object_get_property(G_OBJECT(object),argname,&value);
 
@@ -100,8 +105,9 @@ gst_util_get_long_arg (GObject *object, 
 gfloat
 gst_util_get_float_arg (GObject *object, const gchar *argname) 
 {
-  GValue value = {0, };
+  GValue value;
 
+  ZERO (value);
   g_value_init (&value, G_TYPE_FLOAT);
   g_object_get_property(G_OBJECT(object),argname,&value);
 
@@ -120,8 +126,9 @@ gst_util_get_float_arg (GObject *object,
 gdouble 
 gst_util_get_double_arg (GObject *object, const gchar *argname) 
 {
-  GValue value = {0, };
+  GValue value;
 
+  ZERO (value);
   g_value_init (&value, G_TYPE_DOUBLE);
   g_object_get_property(G_OBJECT(object),argname,&value);
 
@@ -140,12 +147,13 @@ gst_util_get_double_arg (GObject *object
  const gchar*
 gst_util_get_string_arg (GObject *object, const gchar *argname) 
 {
-  GValue value = {0, };
+  GValue value;
 
+  ZERO (value);
   g_value_init (&value, G_TYPE_STRING);
   g_object_get_property(G_OBJECT(object),argname,&value);
 
-  return g_value_get_string(&value);
+  return g_value_get_string(&value);  // memleak?
 }
 
 /**
@@ -160,8 +168,9 @@ gst_util_get_string_arg (GObject *object
 gpointer
 gst_util_get_pointer_arg (GObject *object, const gchar *argname) 
 {
-  GValue value = {0, };
+  GValue value;
 
+  ZERO (value);
   g_value_init (&value, G_TYPE_POINTER);
   g_object_get_property(G_OBJECT(object),argname,&value);
 
Index: gstxml.c
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/gst/gstxml.c,v
retrieving revision 1.22
diff -u -p -r1.22 gstxml.c
--- gstxml.c	2001/08/13 18:45:55	1.22
+++ gstxml.c	2001/09/14 18:56:48
@@ -54,6 +54,7 @@ gst_xml_get_type(void)
       sizeof(GstXML),
       0,
       (GInstanceInitFunc)gst_xml_init,
+      NULL
     };
     xml_type = g_type_register_static (GST_TYPE_OBJECT, "GstXml", &xml_info, 0);
   }


More information about the gstreamer-devel mailing list