Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-09-15 05:52:28 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-09-15 05:52:28 +0400
commite75f5c8208c94621ab769d79cdfad458706f846e (patch)
tree01ce4209eefebe73cdb31a8bc0ebd10879981a2d /source/blender/python
parent37748b1e083db2f9643a2c30a1b15db32278df85 (diff)
quiet -Wmissing-prototypes warnings, and enable this warning by default for C with gcc.
helps for finding unused functions and making functions static, also did some minor code cleanup.
Diffstat (limited to 'source/blender/python')
-rw-r--r--source/blender/python/bmesh/bmesh_py_ops.c4
-rw-r--r--source/blender/python/intern/CMakeLists.txt1
-rw-r--r--source/blender/python/intern/bpy.c4
-rw-r--r--source/blender/python/intern/bpy.h5
-rw-r--r--source/blender/python/intern/bpy_app_ffmpeg.c5
-rw-r--r--source/blender/python/intern/bpy_app_handlers.c2
-rw-r--r--source/blender/python/intern/bpy_interface_atexit.c1
-rw-r--r--source/blender/python/intern/bpy_library.c3
-rw-r--r--source/blender/python/intern/bpy_library.h32
-rw-r--r--source/blender/python/intern/bpy_rna.c18
-rw-r--r--source/blender/python/intern/bpy_rna.h4
-rw-r--r--source/blender/python/intern/gpu.c3
-rw-r--r--source/blender/python/intern/stubs.c11
13 files changed, 70 insertions, 23 deletions
diff --git a/source/blender/python/bmesh/bmesh_py_ops.c b/source/blender/python/bmesh/bmesh_py_ops.c
index c16b1fb901f..fb5b94249e6 100644
--- a/source/blender/python/bmesh/bmesh_py_ops.c
+++ b/source/blender/python/bmesh/bmesh_py_ops.c
@@ -42,6 +42,8 @@
#include "bmesh.h"
+#include "bmesh_py_ops.h" /* own include */
+
#include "bmesh_py_types.h"
#include "bmesh_py_utils.h" /* own include */
@@ -69,7 +71,7 @@ typedef struct {
const char *opname;
} BPy_BMeshOpFunc;
-PyObject *bpy_bmesh_op_CreatePyObject(const char *opname)
+static PyObject *bpy_bmesh_op_CreatePyObject(const char *opname)
{
BPy_BMeshOpFunc *self = PyObject_New(BPy_BMeshOpFunc, &bmesh_op_Type);
diff --git a/source/blender/python/intern/CMakeLists.txt b/source/blender/python/intern/CMakeLists.txt
index 05583e133dc..604166eed3c 100644
--- a/source/blender/python/intern/CMakeLists.txt
+++ b/source/blender/python/intern/CMakeLists.txt
@@ -71,6 +71,7 @@ set(SRC
bpy_app_handlers.h
bpy_driver.h
bpy_intern_string.h
+ bpy_library.h
bpy_operator.h
bpy_operator_wrap.h
bpy_props.h
diff --git a/source/blender/python/intern/bpy.c b/source/blender/python/intern/bpy.c
index 0f0250fb8d5..f2222825c42 100644
--- a/source/blender/python/intern/bpy.c
+++ b/source/blender/python/intern/bpy.c
@@ -37,6 +37,7 @@
#include "bpy_rna.h"
#include "bpy_app.h"
#include "bpy_props.h"
+#include "bpy_library.h"
#include "bpy_operator.h"
#include "BLI_path_util.h"
@@ -238,7 +239,6 @@ static PyObject *bpy_import_test(const char *modname)
void BPy_init_modules(void)
{
extern BPy_StructRNA *bpy_context_module;
- extern int bpy_lib_init(PyObject *);
PointerRNA ctx_ptr;
PyObject *mod;
@@ -273,7 +273,7 @@ void BPy_init_modules(void)
PyModule_AddObject(mod, "StructMetaPropGroup", (PyObject *)&pyrna_struct_meta_idprop_Type);
/* needs to be first so bpy_types can run */
- bpy_lib_init(mod);
+ BPY_library_module(mod);
bpy_import_test("bpy_types");
PyModule_AddObject(mod, "data", BPY_rna_module()); /* imports bpy_types by running this */
diff --git a/source/blender/python/intern/bpy.h b/source/blender/python/intern/bpy.h
index 2412d65aa21..fe877d161ff 100644
--- a/source/blender/python/intern/bpy.h
+++ b/source/blender/python/intern/bpy.h
@@ -23,10 +23,13 @@
* \ingroup pythonintern
*/
-
+#ifndef __BPY_H__
+
void BPy_init_modules(void);
extern PyObject *bpy_package_py;
/* bpy_interface_atexit.c */
void BPY_atexit_register(void);
void BPY_atexit_unregister(void);
+
+#endif /* __BPY_H__ */
diff --git a/source/blender/python/intern/bpy_app_ffmpeg.c b/source/blender/python/intern/bpy_app_ffmpeg.c
index 44bba4c098f..68fd9a99712 100644
--- a/source/blender/python/intern/bpy_app_ffmpeg.c
+++ b/source/blender/python/intern/bpy_app_ffmpeg.c
@@ -26,11 +26,8 @@
#include <Python.h>
#include "BLI_utildefines.h"
-#include "BLI_callbacks.h"
-#include "RNA_types.h"
-#include "RNA_access.h"
-#include "bpy_rna.h"
+#include "bpy_app_ffmpeg.h"
#ifdef WITH_FFMPEG
#include <libavcodec/avcodec.h>
diff --git a/source/blender/python/intern/bpy_app_handlers.c b/source/blender/python/intern/bpy_app_handlers.c
index bab5a83a6ed..4d7f2080bbc 100644
--- a/source/blender/python/intern/bpy_app_handlers.c
+++ b/source/blender/python/intern/bpy_app_handlers.c
@@ -37,6 +37,8 @@
#include "bpy_rna.h"
#include "bpy_app_handlers.h"
+#include "BPY_extern.h"
+
void bpy_app_generic_callback(struct Main *main, struct ID *id, void *arg);
static PyTypeObject BlenderAppCbType;
diff --git a/source/blender/python/intern/bpy_interface_atexit.c b/source/blender/python/intern/bpy_interface_atexit.c
index db97d361c73..13d8cedf907 100644
--- a/source/blender/python/intern/bpy_interface_atexit.c
+++ b/source/blender/python/intern/bpy_interface_atexit.c
@@ -32,6 +32,7 @@
#include <Python.h>
#include "bpy_util.h"
+#include "bpy.h" /* own include */
#include "WM_api.h"
diff --git a/source/blender/python/intern/bpy_library.c b/source/blender/python/intern/bpy_library.c
index 40ec8136eb7..7571fe0f75e 100644
--- a/source/blender/python/intern/bpy_library.c
+++ b/source/blender/python/intern/bpy_library.c
@@ -55,6 +55,7 @@
#include "DNA_space_types.h" /* FILE_LINK, FILE_RELPATH */
#include "bpy_util.h"
+#include "bpy_library.h"
#ifdef USE_RNA_DATABLOCKS
# include "bpy_rna.h"
@@ -426,7 +427,7 @@ static PyObject *bpy_lib_dir(BPy_Library *self)
}
-int bpy_lib_init(PyObject *mod_par)
+int BPY_library_module(PyObject *mod_par)
{
static PyMethodDef load_meth = {"load", (PyCFunction)bpy_lib_load,
METH_STATIC | METH_VARARGS | METH_KEYWORDS,
diff --git a/source/blender/python/intern/bpy_library.h b/source/blender/python/intern/bpy_library.h
new file mode 100644
index 00000000000..1b68007b704
--- /dev/null
+++ b/source/blender/python/intern/bpy_library.h
@@ -0,0 +1,32 @@
+/*
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributor(s): Campbell Barton
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/** \file blender/python/intern/bpy_library.h
+ * \ingroup pythonintern
+ */
+
+#ifndef __BPY_LIBRARY_H__
+#define __BPY_LIBRARY_H__
+
+int BPY_library_module(PyObject *);
+
+#endif /* __BPY_LIBRARY_H__ */
diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c
index 4ae8e821298..8ec8c4c41ba 100644
--- a/source/blender/python/intern/bpy_rna.c
+++ b/source/blender/python/intern/bpy_rna.c
@@ -37,6 +37,8 @@
#include "RNA_types.h"
+#include "BPY_extern.h"
+
#include "bpy_rna.h"
#include "bpy_rna_anim.h"
#include "bpy_props.h"
@@ -45,7 +47,7 @@
#include "bpy_intern_string.h"
#ifdef USE_PYRNA_INVALIDATE_WEAKREF
-#include "MEM_guardedalloc.h"
+# include "MEM_guardedalloc.h"
#endif
#include "BLI_dynstr.h"
@@ -55,7 +57,7 @@
#include "BLI_utildefines.h"
#ifdef USE_PYRNA_INVALIDATE_WEAKREF
-#include "BLI_ghash.h"
+# include "BLI_ghash.h"
#endif
#include "RNA_enum_types.h"
@@ -78,7 +80,7 @@
#include "../generic/py_capi_utils.h"
#ifdef WITH_INTERNATIONAL
-#include "BLF_translation.h"
+# include "BLF_translation.h"
#endif
#define USE_PEDANTIC_WRITE
@@ -2150,10 +2152,10 @@ static PyObject *pyrna_prop_collection_subscript_str(BPy_PropertyRNA *self, cons
* -1: exception set
* 0: not found
* 1: found */
-int pyrna_prop_collection_subscript_str_lib_pair_ptr(BPy_PropertyRNA *self, PyObject *key,
- const char *err_prefix, const short err_not_found,
- PointerRNA *r_ptr
- )
+static int pyrna_prop_collection_subscript_str_lib_pair_ptr(BPy_PropertyRNA *self, PyObject *key,
+ const char *err_prefix, const short err_not_found,
+ PointerRNA *r_ptr
+ )
{
char *keyname;
@@ -5908,7 +5910,7 @@ PyTypeObject pyrna_prop_collection_iter_Type = {
NULL
};
-PyObject *pyrna_prop_collection_iter_CreatePyObject(PointerRNA *ptr, PropertyRNA *prop)
+static PyObject *pyrna_prop_collection_iter_CreatePyObject(PointerRNA *ptr, PropertyRNA *prop)
{
BPy_PropertyCollectionIterRNA *self = PyObject_New(BPy_PropertyCollectionIterRNA, &pyrna_prop_collection_iter_Type);
diff --git a/source/blender/python/intern/bpy_rna.h b/source/blender/python/intern/bpy_rna.h
index 113367788b6..1fb4b116872 100644
--- a/source/blender/python/intern/bpy_rna.h
+++ b/source/blender/python/intern/bpy_rna.h
@@ -175,6 +175,10 @@ PyObject *BPY_rna_types(void);
PyObject *pyrna_struct_CreatePyObject(PointerRNA *ptr);
PyObject *pyrna_prop_CreatePyObject(PointerRNA *ptr, PropertyRNA *prop);
+/* extern'd by other modules which don't deal closely with RNA */
+PyObject *pyrna_id_CreatePyObject(struct ID *id);
+int pyrna_id_FromPyObject(PyObject *obj, struct ID **id);
+
/* operators also need this to set args */
int pyrna_pydict_to_props(PointerRNA *ptr, PyObject *kw, int all_args, const char *error_prefix);
PyObject *pyrna_prop_to_py(PointerRNA *ptr, PropertyRNA *prop);
diff --git a/source/blender/python/intern/gpu.c b/source/blender/python/intern/gpu.c
index 7e2da5b1818..69fe0c48a41 100644
--- a/source/blender/python/intern/gpu.c
+++ b/source/blender/python/intern/gpu.c
@@ -74,8 +74,7 @@ static struct PyModuleDef gpumodule = {
NULL, NULL, NULL, NULL, NULL
};
-PyMODINIT_FUNC
-PyInit_gpu(void)
+static PyObject *PyInit_gpu(void)
{
PyObject *m;
diff --git a/source/blender/python/intern/stubs.c b/source/blender/python/intern/stubs.c
index 50d2e88f210..e0508359e13 100644
--- a/source/blender/python/intern/stubs.c
+++ b/source/blender/python/intern/stubs.c
@@ -28,12 +28,15 @@
* \ingroup pythonintern
*/
+#include "BLI_utildefines.h"
+
+#include "BPY_extern.h"
/* python, will come back */
//void BPY_script_exec(void) {}
//void BPY_python_start(void) {}
//void BPY_text_free_code(void) {}
-void BPY_pyconstraint_exec(void) {}
-void BPY_pyconstraint_target(void) {}
-int BPY_is_pyconstraint(void) { return 0;}
-void BPY_pyconstraint_update(void) {}
+void BPY_pyconstraint_exec(struct bPythonConstraint *UNUSED(con), struct bConstraintOb *UNUSED(cob), struct ListBase *UNUSED(targets)) {}
+void BPY_pyconstraint_target(struct bPythonConstraint *UNUSED(con), struct bConstraintTarget *UNUSED(ct)) {}
+int BPY_is_pyconstraint(struct Text *UNUSED(text)) { return 0;}
+void BPY_pyconstraint_update(struct Object *UNUSED(owner), struct bConstraint *UNUSED(con)) {}