[pygobject] Add missing static declarations



commit aae4e77482c02e21154ab02b159f380f5f0f74be
Author: Martin Pitt <martinpitt gnome org>
Date:   Fri Jul 27 23:06:39 2012 +0200

    Add missing static declarations
    
    This fixes a lot of -Wmissing-prototype warnings.
    
    Also remove _pygi_marshal_cleanup_closure_unref() which is not used anywhere.

 gi/_gobject/gobjectmodule.c |    4 ++--
 gi/_gobject/pygobject.c     |    2 +-
 gi/pygi-cache.c             |    2 +-
 gi/pygi-foreign-cairo.c     |   24 ++++++++++++------------
 gi/pygi-foreign.c           |    2 +-
 gi/pygi-marshal-cleanup.c   |    9 ---------
 tests/test-unknown.c        |    2 +-
 tests/testhelpermodule.c    |    4 ++--
 8 files changed, 20 insertions(+), 29 deletions(-)
---
diff --git a/gi/_gobject/gobjectmodule.c b/gi/_gobject/gobjectmodule.c
index 526a8be..441b9c7 100644
--- a/gi/_gobject/gobjectmodule.c
+++ b/gi/_gobject/gobjectmodule.c
@@ -749,7 +749,7 @@ create_property (const gchar  *prop_name,
     return pspec;
 }
 
-GParamSpec *
+static GParamSpec *
 pyg_param_spec_from_object (PyObject *tuple)
 {
     gint val_length;
@@ -1810,7 +1810,7 @@ pyg_threads_init (PyObject *unused, PyObject *args, PyObject *kwargs)
 }
 
 /* Only for backwards compatibility */
-int
+static int
 pygobject_enable_threads(void)
 {
     if (!pyglib_enable_threads())
diff --git a/gi/_gobject/pygobject.c b/gi/_gobject/pygobject.c
index 1b98ea0..fd6bd4b 100644
--- a/gi/_gobject/pygobject.c
+++ b/gi/_gobject/pygobject.c
@@ -671,7 +671,7 @@ pyg_type_get_bases(GType gtype)
  *
  * Returns: a PyTypeObject for the new type or NULL if it couldn't be created
  */
-PyTypeObject *
+static PyTypeObject *
 pygobject_new_with_interfaces(GType gtype)
 {
     PyGILState_STATE state;
diff --git a/gi/pygi-cache.c b/gi/pygi-cache.c
index 5d496d5..f42aa64 100644
--- a/gi/pygi-cache.c
+++ b/gi/pygi-cache.c
@@ -43,7 +43,7 @@ PyGIArgCache * _arg_cache_new_for_interface (GIInterfaceInfo *iface_info,
                                              gssize c_arg_index,
                                              gssize py_arg_index);
 /* cleanup */
-void
+static void
 _pygi_arg_cache_free (PyGIArgCache *cache)
 {
     if (cache == NULL)
diff --git a/gi/pygi-foreign-cairo.c b/gi/pygi-foreign-cairo.c
index ef3b0ab..d1846c5 100644
--- a/gi/pygi-foreign-cairo.c
+++ b/gi/pygi-foreign-cairo.c
@@ -36,7 +36,7 @@ static Pycairo_CAPI_t *Pycairo_CAPI;
 
 #include <pyglib-python-compat.h>
 
-PyObject *
+static PyObject *
 cairo_context_to_arg (PyObject        *value,
                       GIInterfaceInfo *interface_info,
                       GITransfer       transfer,
@@ -55,7 +55,7 @@ cairo_context_to_arg (PyObject        *value,
     Py_RETURN_NONE;
 }
 
-PyObject *
+static PyObject *
 cairo_context_from_arg (GIInterfaceInfo *interface_info, gpointer data)
 {
     cairo_t *context = (cairo_t*) data;
@@ -65,7 +65,7 @@ cairo_context_from_arg (GIInterfaceInfo *interface_info, gpointer data)
     return PycairoContext_FromContext (context, &PycairoContext_Type, NULL);
 }
 
-PyObject *
+static PyObject *
 cairo_context_release (GIBaseInfo *base_info,
                        gpointer    struct_)
 {
@@ -74,7 +74,7 @@ cairo_context_release (GIBaseInfo *base_info,
 }
 
 
-PyObject *
+static PyObject *
 cairo_surface_to_arg (PyObject        *value,
                       GIInterfaceInfo *interface_info,
                       GITransfer       transfer,
@@ -94,7 +94,7 @@ cairo_surface_to_arg (PyObject        *value,
     Py_RETURN_NONE;
 }
 
-PyObject *
+static PyObject *
 cairo_surface_from_arg (GIInterfaceInfo *interface_info, gpointer data)
 {
     cairo_surface_t *surface = (cairo_surface_t*) data;
@@ -104,7 +104,7 @@ cairo_surface_from_arg (GIInterfaceInfo *interface_info, gpointer data)
     return PycairoSurface_FromSurface (surface, NULL);
 }
 
-PyObject *
+static PyObject *
 cairo_surface_release (GIBaseInfo *base_info,
                        gpointer    struct_)
 {
@@ -113,7 +113,7 @@ cairo_surface_release (GIBaseInfo *base_info,
 }
 
 
-PyObject *
+static PyObject *
 cairo_path_to_arg (PyObject        *value,
                    GIInterfaceInfo *interface_info,
                    GITransfer       transfer,
@@ -133,7 +133,7 @@ cairo_path_to_arg (PyObject        *value,
     Py_RETURN_NONE;
 }
 
-PyObject *
+static PyObject *
 cairo_path_from_arg (GIInterfaceInfo *interface_info, gpointer data)
 {
     cairo_path_t *path = (cairo_path_t*) data;
@@ -141,7 +141,7 @@ cairo_path_from_arg (GIInterfaceInfo *interface_info, gpointer data)
     return PycairoPath_FromPath (path);
 }
 
-PyObject *
+static PyObject *
 cairo_path_release (GIBaseInfo *base_info,
                     gpointer    struct_)
 {
@@ -149,7 +149,7 @@ cairo_path_release (GIBaseInfo *base_info,
     Py_RETURN_NONE;
 }
 
-PyObject *
+static PyObject *
 cairo_font_options_to_arg (PyObject        *value,
                            GIInterfaceInfo *interface_info,
                            GITransfer       transfer,
@@ -169,7 +169,7 @@ cairo_font_options_to_arg (PyObject        *value,
     Py_RETURN_NONE;
 }
 
-PyObject *
+static PyObject *
 cairo_font_options_from_arg (GIInterfaceInfo *interface_info, gpointer data)
 {
     cairo_font_options_t *font_options = (cairo_font_options_t*) data;
@@ -177,7 +177,7 @@ cairo_font_options_from_arg (GIInterfaceInfo *interface_info, gpointer data)
     return PycairoFontOptions_FromFontOptions (cairo_font_options_copy (font_options));
 }
 
-PyObject *
+static PyObject *
 cairo_font_options_release (GIBaseInfo *base_info,
                             gpointer    struct_)
 {
diff --git a/gi/pygi-foreign.c b/gi/pygi-foreign.c
index 0398450..14d20af 100644
--- a/gi/pygi-foreign.c
+++ b/gi/pygi-foreign.c
@@ -41,7 +41,7 @@ typedef struct {
 
 static GPtrArray *foreign_structs = NULL;
 
-void
+static void
 init_foreign_structs ()
 {
     foreign_structs = g_ptr_array_new ();
diff --git a/gi/pygi-marshal-cleanup.c b/gi/pygi-marshal-cleanup.c
index 0f27ba7..503c61d 100644
--- a/gi/pygi-marshal-cleanup.c
+++ b/gi/pygi-marshal-cleanup.c
@@ -171,15 +171,6 @@ pygi_marshal_cleanup_args_to_py_parameter_fail (PyGIInvokeState   *state,
     state->failed = TRUE;
 }
 
-void 
-_pygi_marshal_cleanup_closure_unref (PyGIInvokeState *state,
-                                     PyGIArgCache    *arg_cache,
-                                     gpointer         data,
-                                     gboolean         was_processed)
-{
-    g_closure_unref ( (GClosure *)data);
-}
-
 void
 _pygi_marshal_cleanup_from_py_utf8 (PyGIInvokeState *state,
                                     PyGIArgCache    *arg_cache,
diff --git a/tests/test-unknown.c b/tests/test-unknown.c
index 85aba73..f1c3139 100644
--- a/tests/test-unknown.c
+++ b/tests/test-unknown.c
@@ -53,7 +53,7 @@ test_interface_get_type (void)
   return gtype;
 }
 
-void test_unknown_iface_method (TestInterface *iface)
+static void test_unknown_iface_method (TestInterface *iface)
 {
 }
 
diff --git a/tests/testhelpermodule.c b/tests/testhelpermodule.c
index 592c503..d26ec9f 100644
--- a/tests/testhelpermodule.c
+++ b/tests/testhelpermodule.c
@@ -14,7 +14,7 @@ static PyObject * _wrap_TestInterface__do_iface_method(PyObject *cls,
 						       PyObject *args,
 						       PyObject *kwargs);
 
-GType
+static GType
 test_type_get_type(void)
 {
     static GType gtype = 0;
@@ -339,7 +339,7 @@ test_object_callback (GObject *object, GObject *o)
   return o;
 }
 
-void
+static void
 connectcallbacks (GObject *object)
 {
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]