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:
Diffstat (limited to 'source/blender/makesrna/intern/makesrna.c')
-rw-r--r--source/blender/makesrna/intern/makesrna.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c
index 838f8a33f07..8a4022de104 100644
--- a/source/blender/makesrna/intern/makesrna.c
+++ b/source/blender/makesrna/intern/makesrna.c
@@ -82,7 +82,7 @@ static void rna_generate_static_parameter_prototypes(FILE *f, StructRNA *srna, F
fprintf(f, param); \
} (void)0
-static int replace_if_different(char *tmpfile, const char *dep_files[])
+static int replace_if_different(const char *tmpfile, const char *dep_files[])
{
/* return 0; *//* use for testing had edited rna */
@@ -2692,7 +2692,11 @@ static void rna_generate_static_parameter_prototypes(FILE *f, StructRNA *srna, F
}
+ /* ensure func(void) if there are no args */
+ if (first) fprintf(f, "void");
+
fprintf(f, ")");
+
if (close_prototype)
fprintf(f, ";\n");
}
@@ -2764,7 +2768,7 @@ static void rna_generate_struct_prototypes(FILE *f)
static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, PropertyRNA *prop)
{
- char *strnest = "", *errnest = "";
+ char *strnest = (char *)"", *errnest = (char *)"";
int len, freenest = 0;
if (nest != NULL) {
@@ -3330,6 +3334,12 @@ static void rna_generate(BlenderRNA *brna, FILE *f, const char *filename, const
fprintf(f, "#include \"%s\"\n", api_filename);
fprintf(f, "\n");
+ /* we want the included C files to have warnings enabled but for the generated code
+ * ignore unused-parameter warnings which are hard to prevent */
+#ifdef __GNUC__
+ fprintf(f, "#pragma GCC diagnostic ignored \"-Wunused-parameter\"\n\n");
+#endif
+
fprintf(f, "/* Autogenerated Functions */\n\n");
for (ds = DefRNA.structs.first; ds; ds = ds->cont.next) {