Make code safe for -Wredundant-decls

Adds that warning to configure.ac

Includes a tiny change of the GST_BOILERPLATE_FULL() macro:
The get_type() function is no longer declared before being defined.

https://bugzilla.gnome.org/show_bug.cgi?id=611692
This commit is contained in:
Benjamin Otte 2010-03-02 23:51:18 +01:00
parent f067d38d1d
commit e8f65e8bff
30 changed files with 11 additions and 62 deletions

View file

@ -578,7 +578,7 @@ GST_PKG_DEPS="glib-2.0, gobject-2.0, gmodule-no-export-2.0, gthread-2.0"
AC_SUBST(GST_PKG_DEPS)
dnl define an ERROR_CFLAGS Makefile variable
AG_GST_SET_ERROR_CFLAGS($GST_GIT)
AG_GST_SET_ERROR_CFLAGS($GST_GIT, [-Wredundant-decls])
dnl define correct level for debugging messages
AG_GST_SET_LEVEL_DEFAULT($GST_GIT)

View file

@ -1962,8 +1962,6 @@ gst_registry_find_feature
gst_registry_lookup_feature
gst_registry_add_path
gst_registry_scan_path
gst_registry_binary_read_cache
gst_registry_binary_write_cache
gst_registry_lookup
gst_registry_remove_feature
gst_registry_add_feature

View file

@ -88,8 +88,6 @@ enum
LAST_SIGNAL
};
static void gst_bus_class_init (GstBusClass * klass);
static void gst_bus_init (GstBus * bus);
static void gst_bus_dispose (GObject * object);
static void gst_bus_set_main_context (GstBus * bus, GMainContext * ctx);

View file

@ -167,8 +167,6 @@ G_STMT_START { \
GST_OBJECT_UNLOCK (clock); \
} G_STMT_END;
static void gst_clock_class_init (GstClockClass * klass);
static void gst_clock_init (GstClock * clock);
static void gst_clock_dispose (GObject * object);
static void gst_clock_finalize (GObject * object);

View file

@ -69,8 +69,6 @@
GST_DEBUG_CATEGORY_STATIC (element_factory_debug);
#define GST_CAT_DEFAULT element_factory_debug
static void gst_element_factory_class_init (GstElementFactoryClass * klass);
static void gst_element_factory_init (GstElementFactory * factory);
static void gst_element_factory_finalize (GObject * object);
void __gst_element_details_clear (GstElementDetails * dp);
static void gst_element_factory_cleanup (GstElementFactory * factory);

View file

@ -58,8 +58,6 @@ enum
GST_DEBUG_CATEGORY_STATIC (index_debug);
#define GST_CAT_DEFAULT index_debug
static void gst_index_class_init (GstIndexClass * klass);
static void gst_index_init (GstIndex * index);
static void gst_index_finalize (GObject * object);
static void gst_index_set_property (GObject * object, guint prop_id,

View file

@ -37,7 +37,6 @@
#include "gstmarshal.h"
#include "gstregistry.h"
static void gst_index_factory_class_init (GstIndexFactoryClass * klass);
static void gst_index_factory_finalize (GObject * object);
static GstPluginFeatureClass *factory_parent_class = NULL;

View file

@ -1493,12 +1493,9 @@ _gst_debug_get_category (const gchar * name)
static GHashTable *__gst_function_pointers; /* NULL */
static GStaticMutex __dbg_functions_mutex = G_STATIC_MUTEX_INIT;
const gchar *
_gst_debug_nameof_funcptr (GstDebugFuncPtr ptr)
G_GNUC_NO_INSTRUMENT;
/* This function MUST NOT return NULL */
const gchar *_gst_debug_nameof_funcptr (GstDebugFuncPtr func)
const gchar *
_gst_debug_nameof_funcptr (GstDebugFuncPtr func)
{
gchar *ptrname;

View file

@ -1098,7 +1098,7 @@ typedef void (* GstDebugFuncPtr) (void);
void _gst_debug_register_funcptr (GstDebugFuncPtr func,
const gchar * ptrname);
G_CONST_RETURN gchar *
_gst_debug_nameof_funcptr (GstDebugFuncPtr func);
_gst_debug_nameof_funcptr (GstDebugFuncPtr func) G_GNUC_NO_INSTRUMENT;
/**
* GST_DEBUG_REGISTER_FUNCPTR:

View file

@ -133,8 +133,6 @@ typedef struct _GstSignalObject GstSignalObject;
typedef struct _GstSignalObjectClass GstSignalObjectClass;
static GType gst_signal_object_get_type (void);
static void gst_signal_object_class_init (GstSignalObjectClass * klass);
static void gst_signal_object_init (GstSignalObject * object);
#ifndef GST_DISABLE_LOADSAVE
static guint gst_signal_object_signals[SO_LAST_SIGNAL] = { 0 };

View file

@ -125,8 +125,6 @@ struct _GstPipelinePrivate
};
static void gst_pipeline_base_init (gpointer g_class);
static void gst_pipeline_dispose (GObject * object);
static void gst_pipeline_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec);

View file

@ -513,8 +513,6 @@ _gst_plugin_fault_handler_setup (void)
}
#endif /* HAVE_SIGACTION */
static void _gst_plugin_fault_handler_setup ();
static GStaticMutex gst_plugin_loading_mutex = G_STATIC_MUTEX_INIT;
#define CHECK_PLUGIN_DESC_FIELD(desc,field,fn) \

View file

@ -114,11 +114,7 @@
#include "gst-i18n-lib.h"
/* needed for fast retrieval of element and typefind factory lists */
extern GType gst_type_find_factory_get_type (void);
#define GST_TYPE_TYPE_FIND_FACTORY (gst_type_find_factory_get_type())
extern GType gst_element_factory_get_type (void);
#define GST_TYPE_ELEMENT_FACTORY (gst_element_factory_get_type())
#include "gst.h"
#ifdef G_OS_WIN32
#include <windows.h>

View file

@ -70,10 +70,6 @@ typedef struct _GstBinaryRegistryMagic
gchar version[GST_MAGIC_BINARY_VERSION_LEN];
} GstBinaryRegistryMagic;
/* Function prototypes */
gboolean gst_registry_binary_write_cache(GstRegistry *registry, const char *location);
gboolean gst_registry_binary_read_cache(GstRegistry *registry, const char *location);
G_END_DECLS
#endif /* !__GST_REGISTRYBINARY_H__ */

View file

@ -93,8 +93,6 @@ enum
/* the one instance of the systemclock */
static GstClock *_the_system_clock = NULL;
static void gst_system_clock_class_init (GstSystemClockClass * klass);
static void gst_system_clock_init (GstSystemClock * clock);
static void gst_system_clock_dispose (GObject * object);
static void gst_system_clock_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec);

View file

@ -92,8 +92,6 @@ struct _GstTaskPrivate
GstTaskPool *pool_id;
};
static void gst_task_class_init (GstTaskClass * klass);
static void gst_task_init (GstTask * task);
static void gst_task_finalize (GObject * object);
static void gst_task_func (GstTask * task);

View file

@ -40,8 +40,6 @@
GST_DEBUG_CATEGORY_STATIC (taskpool_debug);
#define GST_CAT_DEFAULT (taskpool_debug)
static void gst_task_pool_class_init (GstTaskPoolClass * klass);
static void gst_task_pool_init (GstTaskPool * pool);
static void gst_task_pool_finalize (GObject * object);
#define _do_init \

View file

@ -131,8 +131,6 @@ type_as_function ## _class_init_trampoline (gpointer g_class, \
type_as_function ## _class_init ((type ## Class *)g_class); \
} \
\
GType type_as_function ## _get_type (void); \
\
GType \
type_as_function ## _get_type (void) \
{ \

View file

@ -47,8 +47,6 @@ enum
LAST_SIGNAL
};
static void gst_xml_class_init (GstXMLClass * klass);
static void gst_xml_init (GstXML * xml);
static void gst_xml_dispose (GObject * object);
static void gst_xml_object_loaded (GstObject * private, GstObject * object,

View file

@ -37,7 +37,6 @@ struct yy_buffer_state * _gst_parse_yy_scan_string (char* , yyscan_t);
void _gst_parse_yypush_buffer_state (void * new_buffer ,yyscan_t yyscanner );
void _gst_parse_yypop_buffer_state (yyscan_t yyscanner );
#ifdef __GST_PARSE_TRACE
static guint __strings;
static guint __links;

View file

@ -93,8 +93,6 @@ static void gst_collect_pads_clear (GstCollectPads * pads,
static GstFlowReturn gst_collect_pads_chain (GstPad * pad, GstBuffer * buffer);
static gboolean gst_collect_pads_event (GstPad * pad, GstEvent * event);
static void gst_collect_pads_finalize (GObject * object);
static void gst_collect_pads_init (GstCollectPads * pads,
GstCollectPadsClass * g_class);
static void ref_data (GstCollectData * data);
static void unref_data (GstCollectData * data);
static void gst_collect_pads_check_pads_unlocked (GstCollectPads * pads);

View file

@ -49,9 +49,6 @@
#define GST_CAT_DEFAULT controller_debug
GST_DEBUG_CATEGORY_EXTERN (GST_CAT_DEFAULT);
static void gst_control_source_class_init (GstControlSourceClass * klass);
static void gst_control_source_init (GstControlSource * self);
G_DEFINE_ABSTRACT_TYPE (GstControlSource, gst_control_source, G_TYPE_OBJECT);
static GObjectClass *parent_class = NULL;

View file

@ -47,12 +47,6 @@
#define GST_CAT_DEFAULT controller_debug
GST_DEBUG_CATEGORY_EXTERN (GST_CAT_DEFAULT);
static void gst_interpolation_control_source_init (GstInterpolationControlSource
* self);
static void
gst_interpolation_control_source_class_init (GstInterpolationControlSourceClass
* klass);
G_DEFINE_TYPE (GstInterpolationControlSource, gst_interpolation_control_source,
GST_TYPE_CONTROL_SOURCE);

View file

@ -602,10 +602,6 @@ gst_lfo_waveform_get_type (void)
return gtype;
}
static void gst_lfo_control_source_init (GstLFOControlSource * self);
static void
gst_lfo_control_source_class_init (GstLFOControlSourceClass * klass);
G_DEFINE_TYPE (GstLFOControlSource, gst_lfo_control_source,
GST_TYPE_CONTROL_SOURCE);

View file

@ -44,7 +44,6 @@ G_BEGIN_DECLS
#define GST_DP_HEADER_CRC_HEADER(x) GST_READ_UINT16_BE (x + 58)
#define GST_DP_HEADER_CRC_PAYLOAD(x) GST_READ_UINT16_BE (x + 60)
void gst_dp_init (void);
void gst_dp_dump_byte_array (guint8 *array, guint length);
G_END_DECLS

View file

@ -864,6 +864,7 @@ GST_END_TEST;
typedef GstPushSrc OOBSource;
typedef GstPushSrcClass OOBSourceClass;
GType oob_source_get_type (void);
GST_BOILERPLATE (OOBSource, oob_source, GstPushSrc, GST_TYPE_PUSH_SRC);
static void

View file

@ -32,6 +32,7 @@ typedef struct
typedef GstElementClass GstDummyObjClass;
GType gst_dummy_obj_get_type (void);
GST_BOILERPLATE (GstDummyObj, gst_dummy_obj, GstElement, GST_TYPE_ELEMENT);
static void

View file

@ -29,6 +29,7 @@ typedef GstElementClass GstDummyEncClass;
static void gst_dummy_enc_add_interfaces (GType enc_type);
GType gst_dummy_enc_get_type (void);
GST_BOILERPLATE_FULL (GstDummyEnc, gst_dummy_enc, GstElement,
GST_TYPE_ELEMENT, gst_dummy_enc_add_interfaces);
@ -221,6 +222,7 @@ GST_START_TEST (test_merge_modes_skip_empty)
}
}
}
GST_END_TEST static Suite *
gst_tag_setter_suite (void)
{

View file

@ -55,6 +55,8 @@ struct _GstTestTransClass
GstBaseTransformClass parent_class;
};
GType gst_test_trans_get_type (void);
GST_BOILERPLATE (GstTestTrans, gst_test_trans, GstBaseTransform,
GST_TYPE_BASE_TRANSFORM);

View file

@ -21,8 +21,6 @@
#include "testrtpool.h"
static void test_rt_pool_class_init (TestRTPoolClass * klass);
static void test_rt_pool_init (TestRTPool * pool);
static void test_rt_pool_finalize (GObject * object);
typedef struct