diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-09-20 10:35:28 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-09-20 10:35:28 +0400 |
commit | 203c6effd57cdf3ed3b21ed74f80e0a5bc6441a3 (patch) | |
tree | 1f66faf7e90ef6fd49babdf2df0bc0cf7e086511 /source/blender/makesrna/intern/makesrna.c | |
parent | 24b43043341ee35ac31c2f2005732073f6e8c0c4 (diff) |
code cleanup: quiet rna warnings, remove remove_strict_flags() for cmake/rna.
also set_source_files_properties() wasn't working for rna_*_gen.c files,
set dna.c and generated data files with generated property too.
Diffstat (limited to 'source/blender/makesrna/intern/makesrna.c')
-rw-r--r-- | source/blender/makesrna/intern/makesrna.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index 838f8a33f07..a908b403c03 100644 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@ -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) { |