[pygobject] Fix function prototypes and static functions



commit 137679426ff39507e15f08e9e6428d851fee06b7
Author: Martin Pitt <martinpitt gnome org>
Date:   Tue Jan 15 09:46:01 2013 +0100

    Fix function prototypes and static functions
    
    These cause errors/warnings with -Wstrict-prototypes.

 gi/_glib/pyglib-python-compat.h |    2 ++
 gi/pygi-foreign.c               |    2 +-
 gi/pygi-marshal-from-py.c       |    4 ++--
 gi/pygi-marshal-to-py.c         |    4 ++--
 gi/pygi-source.c                |    2 +-
 gi/pygi-source.h                |    2 +-
 6 files changed, 9 insertions(+), 7 deletions(-)
---
diff --git a/gi/_glib/pyglib-python-compat.h b/gi/_glib/pyglib-python-compat.h
index 5af14f8..96a20c0 100644
--- a/gi/_glib/pyglib-python-compat.h
+++ b/gi/_glib/pyglib-python-compat.h
@@ -146,6 +146,7 @@ static int _pyglib_init_##modname(PyObject *module)
 #endif
 
 #define PYGLIB_MODULE_START(symbol, modname)	        \
+DL_EXPORT(void) init##symbol(void); \
 DL_EXPORT(void) init##symbol(void)			\
 {                                                       \
     PyObject *module;                                   \
@@ -184,6 +185,7 @@ PyTypeObject symbol = {                                 \
     NULL,                                               \
     NULL                                                \
 };                                                      \
+PyMODINIT_FUNC PyInit_##symbol(void);                   \
 PyMODINIT_FUNC PyInit_##symbol(void)                    \
 {                                                       \
     PyObject *module;                                   \
diff --git a/gi/pygi-foreign.c b/gi/pygi-foreign.c
index ef5abaa..7537399 100644
--- a/gi/pygi-foreign.c
+++ b/gi/pygi-foreign.c
@@ -42,7 +42,7 @@ typedef struct {
 static GPtrArray *foreign_structs = NULL;
 
 static void
-init_foreign_structs ()
+init_foreign_structs (void)
 {
     foreign_structs = g_ptr_array_new ();
 }
diff --git a/gi/pygi-marshal-from-py.c b/gi/pygi-marshal-from-py.c
index 4ddfbb4..a676123 100644
--- a/gi/pygi-marshal-from-py.c
+++ b/gi/pygi-marshal-from-py.c
@@ -32,7 +32,7 @@
 #include "pygi-marshal-cleanup.h"
 #include "pygi-marshal-from-py.h"
 
-gboolean
+static gboolean
 gi_argument_from_py_ssize_t (GIArgument   *arg_out,
                              Py_ssize_t    size_in,
                              GITypeTag     type_tag)                             
@@ -134,7 +134,7 @@ gi_argument_from_py_ssize_t (GIArgument   *arg_out,
     return FALSE;
 }
 
-gboolean
+static gboolean
 gi_argument_from_c_long (GIArgument *arg_out,
                          long        c_long_in,
                          GITypeTag   type_tag)
diff --git a/gi/pygi-marshal-to-py.c b/gi/pygi-marshal-to-py.c
index d5a0734..a6d90c2 100644
--- a/gi/pygi-marshal-to-py.c
+++ b/gi/pygi-marshal-to-py.c
@@ -34,7 +34,7 @@
 #include "pygi-marshal-cleanup.h"
 #include "pygi-marshal-to-py.h"
 
-gboolean
+static gboolean
 gi_argument_to_c_long (GIArgument *arg_in,
                        long *c_long_out,
                        GITypeTag type_tag)
@@ -72,7 +72,7 @@ gi_argument_to_c_long (GIArgument *arg_in,
     }
 }
 
-gboolean
+static gboolean
 gi_argument_to_gsize (GIArgument *arg_in,
                       gsize      *gsize_out,
                       GITypeTag   type_tag)
diff --git a/gi/pygi-source.c b/gi/pygi-source.c
index 73772bd..b713b73 100644
--- a/gi/pygi-source.c
+++ b/gi/pygi-source.c
@@ -232,7 +232,7 @@ pyg_source_set_callback(PyGObject *self_module, PyObject *args)
  * GSourceFuncs which call back to Python.
  */
 PyObject*
-pyg_source_new ()
+pyg_source_new (void)
 {
     PyGRealSource *source = NULL;
     PyObject      *py_type;
diff --git a/gi/pygi-source.h b/gi/pygi-source.h
index 024cf15..a602767 100644
--- a/gi/pygi-source.h
+++ b/gi/pygi-source.h
@@ -24,7 +24,7 @@
 #ifndef __PYGI_SOURCE_H__
 #define __PYGI_SOURCE_H__
 
-PyObject *pyg_source_new ();
+PyObject *pyg_source_new (void);
 PyObject *pyg_source_set_callback (PyGObject *self, PyObject *args);
 
 #endif /* __PYGI_SOURCE_H__ */



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