Merging r50470 through r50477 from trunk into soc-2011-tomato
[blender.git] / source / blender / makesrna / intern / makesrna.c
index 31d477d..ef3c7f4 100644 (file)
 #  define __func__ __FUNCTION__
 #endif
 
+/* copied from BLI_utildefines.h ugh */
+#ifdef __GNUC__
+#  define UNUSED(x) UNUSED_ ## x __attribute__((__unused__))
+#else
+#  define UNUSED(x) x
+#endif
+
 /* Replace if different */
 #define TMP_EXT ".tmp"
 
@@ -310,7 +317,7 @@ static void rna_print_data_get(FILE *f, PropertyDefRNA *dp)
                fprintf(f, "    %s *data= (%s*)(ptr->data);\n", dp->dnastructname, dp->dnastructname);
 }
 
-static void rna_print_id_get(FILE *f, PropertyDefRNA *dp)
+static void rna_print_id_get(FILE *f, PropertyDefRNA *UNUSED(dp))
 {
        fprintf(f, "    ID *id= ptr->id.data;\n");
 }
@@ -525,7 +532,8 @@ static char *rna_def_property_get_func(FILE *f, StructRNA *srna, PropertyRNA *pr
        func = rna_alloc_function_name(srna->identifier, rna_safe_id(prop->identifier), "get");
 
        switch (prop->type) {
-               case PROP_STRING: {
+               case PROP_STRING:
+               {
                        StringPropertyRNA *sprop = (StringPropertyRNA *)prop;
                        fprintf(f, "void %s(PointerRNA *ptr, char *value)\n", func);
                        fprintf(f, "{\n");
@@ -558,7 +566,8 @@ static char *rna_def_property_get_func(FILE *f, StructRNA *srna, PropertyRNA *pr
                        fprintf(f, "}\n\n");
                        break;
                }
-               case PROP_POINTER: {
+               case PROP_POINTER:
+               {
                        fprintf(f, "PointerRNA %s(PointerRNA *ptr)\n", func);
                        fprintf(f, "{\n");
                        if (manualfunc) {
@@ -577,7 +586,8 @@ static char *rna_def_property_get_func(FILE *f, StructRNA *srna, PropertyRNA *pr
                        fprintf(f, "}\n\n");
                        break;
                }
-               case PROP_COLLECTION: {
+               case PROP_COLLECTION:
+               {
                        CollectionPropertyRNA *cprop = (CollectionPropertyRNA *)prop;
 
                        fprintf(f, "static PointerRNA %s(CollectionPropertyIterator *iter)\n", func);
@@ -778,7 +788,8 @@ static char *rna_def_property_set_func(FILE *f, StructRNA *srna, PropertyRNA *pr
        func = rna_alloc_function_name(srna->identifier, rna_safe_id(prop->identifier), "set");
 
        switch (prop->type) {
-               case PROP_STRING: {
+               case PROP_STRING:
+               {
                        StringPropertyRNA *sprop = (StringPropertyRNA *)prop;
                        fprintf(f, "void %s(PointerRNA *ptr, const char *value)\n", func);
                        fprintf(f, "{\n");
@@ -810,7 +821,8 @@ static char *rna_def_property_set_func(FILE *f, StructRNA *srna, PropertyRNA *pr
                        fprintf(f, "}\n\n");
                        break;
                }
-               case PROP_POINTER: {
+               case PROP_POINTER:
+               {
                        fprintf(f, "void %s(PointerRNA *ptr, PointerRNA value)\n", func);
                        fprintf(f, "{\n");
                        if (manualfunc) {
@@ -1179,7 +1191,7 @@ static char *rna_def_property_lookup_int_func(FILE *f, StructRNA *srna, Property
        return func;
 }
 
-static char *rna_def_property_next_func(FILE *f, StructRNA *srna, PropertyRNA *prop, PropertyDefRNA *dp,
+static char *rna_def_property_next_func(FILE *f, StructRNA *srna, PropertyRNA *prop, PropertyDefRNA *UNUSED(dp),
                                         const char *manualfunc)
 {
        char *func, *getfunc;
@@ -1206,7 +1218,7 @@ static char *rna_def_property_next_func(FILE *f, StructRNA *srna, PropertyRNA *p
        return func;
 }
 
-static char *rna_def_property_end_func(FILE *f, StructRNA *srna, PropertyRNA *prop, PropertyDefRNA *dp,
+static char *rna_def_property_end_func(FILE *f, StructRNA *srna, PropertyRNA *prop, PropertyDefRNA *UNUSED(dp),
                                        const char *manualfunc)
 {
        char *func;
@@ -1268,7 +1280,8 @@ static void rna_def_property_funcs(FILE *f, StructRNA *srna, PropertyDefRNA *dp)
        prop = dp->prop;
 
        switch (prop->type) {
-               case PROP_BOOLEAN: {
+               case PROP_BOOLEAN:
+               {
                        BoolPropertyRNA *bprop = (BoolPropertyRNA *)prop;
 
                        if (!prop->arraydimension) {
@@ -1284,7 +1297,8 @@ static void rna_def_property_funcs(FILE *f, StructRNA *srna, PropertyDefRNA *dp)
                        }
                        break;
                }
-               case PROP_INT: {
+               case PROP_INT:
+               {
                        IntPropertyRNA *iprop = (IntPropertyRNA *)prop;
 
                        if (!prop->arraydimension) {
@@ -1303,7 +1317,8 @@ static void rna_def_property_funcs(FILE *f, StructRNA *srna, PropertyDefRNA *dp)
                        }
                        break;
                }
-               case PROP_FLOAT: {
+               case PROP_FLOAT:
+               {
                        FloatPropertyRNA *fprop = (FloatPropertyRNA *)prop;
 
                        if (!prop->arraydimension) {
@@ -1322,14 +1337,16 @@ static void rna_def_property_funcs(FILE *f, StructRNA *srna, PropertyDefRNA *dp)
                        }
                        break;
                }
-               case PROP_ENUM: {
+               case PROP_ENUM:
+               {
                        EnumPropertyRNA *eprop = (EnumPropertyRNA *)prop;
 
                        eprop->get = (void *)rna_def_property_get_func(f, srna, prop, dp, (const char *)eprop->get);
                        eprop->set = (void *)rna_def_property_set_func(f, srna, prop, dp, (const char *)eprop->set);
                        break;
                }
-               case PROP_STRING: {
+               case PROP_STRING:
+               {
                        StringPropertyRNA *sprop = (StringPropertyRNA *)prop;
 
                        sprop->get = (void *)rna_def_property_get_func(f, srna, prop, dp, (const char *)sprop->get);
@@ -1337,7 +1354,8 @@ static void rna_def_property_funcs(FILE *f, StructRNA *srna, PropertyDefRNA *dp)
                        sprop->set = (void *)rna_def_property_set_func(f, srna, prop, dp, (const char *)sprop->set);
                        break;
                }
-               case PROP_POINTER: {
+               case PROP_POINTER:
+               {
                        PointerPropertyRNA *pprop = (PointerPropertyRNA *)prop;
 
                        pprop->get = (void *)rna_def_property_get_func(f, srna, prop, dp, (const char *)pprop->get);
@@ -1349,7 +1367,8 @@ static void rna_def_property_funcs(FILE *f, StructRNA *srna, PropertyDefRNA *dp)
                        }
                        break;
                }
-               case PROP_COLLECTION: {
+               case PROP_COLLECTION:
+               {
                        CollectionPropertyRNA *cprop = (CollectionPropertyRNA *)prop;
                        const char *nextfunc = (const char *)cprop->next;
 
@@ -1414,7 +1433,8 @@ static void rna_def_property_funcs_header(FILE *f, StructRNA *srna, PropertyDefR
 
        switch (prop->type) {
                case PROP_BOOLEAN:
-               case PROP_INT: {
+               case PROP_INT:
+               {
                        if (!prop->arraydimension) {
                                fprintf(f, "int %sget(PointerRNA *ptr);\n", func);
                                /*fprintf(f, "void %sset(PointerRNA *ptr, int value);\n", func); */
@@ -1429,7 +1449,8 @@ static void rna_def_property_funcs_header(FILE *f, StructRNA *srna, PropertyDefR
                        }
                        break;
                }
-               case PROP_FLOAT: {
+               case PROP_FLOAT:
+               {
                        if (!prop->arraydimension) {
                                fprintf(f, "float %sget(PointerRNA *ptr);\n", func);
                                /*fprintf(f, "void %sset(PointerRNA *ptr, float value);\n", func); */
@@ -1444,7 +1465,8 @@ static void rna_def_property_funcs_header(FILE *f, StructRNA *srna, PropertyDefR
                        }
                        break;
                }
-               case PROP_ENUM: {
+               case PROP_ENUM:
+               {
                        EnumPropertyRNA *eprop = (EnumPropertyRNA *)prop;
                        int i;
 
@@ -1464,7 +1486,8 @@ static void rna_def_property_funcs_header(FILE *f, StructRNA *srna, PropertyDefR
 
                        break;
                }
-               case PROP_STRING: {
+               case PROP_STRING:
+               {
                        StringPropertyRNA *sprop = (StringPropertyRNA *)prop;
 
                        if (sprop->maxlength) {
@@ -1477,12 +1500,14 @@ static void rna_def_property_funcs_header(FILE *f, StructRNA *srna, PropertyDefR
 
                        break;
                }
-               case PROP_POINTER: {
+               case PROP_POINTER:
+               {
                        fprintf(f, "PointerRNA %sget(PointerRNA *ptr);\n", func);
                        /*fprintf(f, "void %sset(PointerRNA *ptr, PointerRNA value);\n", func); */
                        break;
                }
-               case PROP_COLLECTION: {
+               case PROP_COLLECTION:
+               {
                        fprintf(f, "void %sbegin(CollectionPropertyIterator *iter, PointerRNA *ptr);\n", func);
                        fprintf(f, "void %snext(CollectionPropertyIterator *iter);\n", func);
                        fprintf(f, "void %send(CollectionPropertyIterator *iter);\n", func);
@@ -1513,28 +1538,32 @@ static void rna_def_property_funcs_header_cpp(FILE *f, StructRNA *srna, Property
                fprintf(f, "\t/* */\n");
 
        switch (prop->type) {
-               case PROP_BOOLEAN: {
+               case PROP_BOOLEAN:
+               {
                        if (!prop->arraydimension)
                                fprintf(f, "\tinline bool %s(void);", rna_safe_id(prop->identifier));
                        else if (prop->totarraylength)
                                fprintf(f, "\tinline Array<int, %u> %s(void);", prop->totarraylength, rna_safe_id(prop->identifier));
                        break;
                }
-               case PROP_INT: {
+               case PROP_INT:
+               {
                        if (!prop->arraydimension)
                                fprintf(f, "\tinline int %s(void);", rna_safe_id(prop->identifier));
                        else if (prop->totarraylength)
                                fprintf(f, "\tinline Array<int, %u> %s(void);", prop->totarraylength, rna_safe_id(prop->identifier));
                        break;
                }
-               case PROP_FLOAT: {
+               case PROP_FLOAT:
+               {
                        if (!prop->arraydimension)
                                fprintf(f, "\tinline float %s(void);", rna_safe_id(prop->identifier));
                        else if (prop->totarraylength)
                                fprintf(f, "\tinline Array<float, %u> %s(void);", prop->totarraylength, rna_safe_id(prop->identifier));
                        break;
                }
-               case PROP_ENUM: {
+               case PROP_ENUM:
+               {
                        EnumPropertyRNA *eprop = (EnumPropertyRNA *)prop;
                        int i;
 
@@ -1552,11 +1581,13 @@ static void rna_def_property_funcs_header_cpp(FILE *f, StructRNA *srna, Property
                        fprintf(f, "\tinline %s_enum %s(void);", rna_safe_id(prop->identifier), rna_safe_id(prop->identifier));
                        break;
                }
-               case PROP_STRING: {
+               case PROP_STRING:
+               {
                        fprintf(f, "\tinline std::string %s(void);", rna_safe_id(prop->identifier));
                        break;
                }
-               case PROP_POINTER: {
+               case PROP_POINTER:
+               {
                        PointerPropertyRNA *pprop = (PointerPropertyRNA *)dp->prop;
 
                        if (pprop->type)
@@ -1565,7 +1596,8 @@ static void rna_def_property_funcs_header_cpp(FILE *f, StructRNA *srna, Property
                                fprintf(f, "\tinline %s %s(void);", "UnknownType", rna_safe_id(prop->identifier));
                        break;
                }
-               case PROP_COLLECTION: {
+               case PROP_COLLECTION:
+               {
                        CollectionPropertyRNA *cprop = (CollectionPropertyRNA *)dp->prop;
 
                        if (cprop->item_type)
@@ -1591,7 +1623,8 @@ static void rna_def_property_funcs_impl_cpp(FILE *f, StructRNA *srna, PropertyDe
                return;
 
        switch (prop->type) {
-               case PROP_BOOLEAN: {
+               case PROP_BOOLEAN:
+               {
                        if (!prop->arraydimension)
                                fprintf(f, "\tBOOLEAN_PROPERTY(%s, %s)", srna->identifier, rna_safe_id(prop->identifier));
                        else if (prop->totarraylength)
@@ -1599,7 +1632,8 @@ static void rna_def_property_funcs_impl_cpp(FILE *f, StructRNA *srna, PropertyDe
                                        rna_safe_id(prop->identifier));
                        break;
                }
-               case PROP_INT: {
+               case PROP_INT:
+               {
                        if (!prop->arraydimension)
                                fprintf(f, "\tINT_PROPERTY(%s, %s)", srna->identifier, rna_safe_id(prop->identifier));
                        else if (prop->totarraylength)
@@ -1607,7 +1641,8 @@ static void rna_def_property_funcs_impl_cpp(FILE *f, StructRNA *srna, PropertyDe
                                        rna_safe_id(prop->identifier));
                        break;
                }
-               case PROP_FLOAT: {
+               case PROP_FLOAT:
+               {
                        if (!prop->arraydimension)
                                fprintf(f, "\tFLOAT_PROPERTY(%s, %s)", srna->identifier, rna_safe_id(prop->identifier));
                        else if (prop->totarraylength)
@@ -1615,17 +1650,20 @@ static void rna_def_property_funcs_impl_cpp(FILE *f, StructRNA *srna, PropertyDe
                                        rna_safe_id(prop->identifier));
                        break;
                }
-               case PROP_ENUM: {
+               case PROP_ENUM:
+               {
                        fprintf(f, "\tENUM_PROPERTY(%s_enum, %s, %s)", rna_safe_id(prop->identifier), srna->identifier,
                                rna_safe_id(prop->identifier));
 
                        break;
                }
-               case PROP_STRING: {
+               case PROP_STRING:
+               {
                        fprintf(f, "\tSTRING_PROPERTY(%s, %s)", srna->identifier, rna_safe_id(prop->identifier));
                        break;
                }
-               case PROP_POINTER: {
+               case PROP_POINTER:
+               {
                        PointerPropertyRNA *pprop = (PointerPropertyRNA *)dp->prop;
 
                        if (pprop->type)
@@ -1636,7 +1674,8 @@ static void rna_def_property_funcs_impl_cpp(FILE *f, StructRNA *srna, PropertyDe
                                        rna_safe_id(prop->identifier));
                        break;
                }
-               case PROP_COLLECTION: {
+               case PROP_COLLECTION:
+               {
 #if 0
                        CollectionPropertyRNA *cprop = (CollectionPropertyRNA *)dp->prop;
 
@@ -2006,7 +2045,7 @@ static void rna_generate_blender(BlenderRNA *brna, FILE *f)
        fprintf(f, "};\n\n");
 }
 
-static void rna_generate_property_prototypes(BlenderRNA *brna, StructRNA *srna, FILE *f)
+static void rna_generate_property_prototypes(BlenderRNA *UNUSED(brna), StructRNA *srna, FILE *f)
 {
        PropertyRNA *prop;
        StructRNA *base;
@@ -2029,7 +2068,7 @@ static void rna_generate_property_prototypes(BlenderRNA *brna, StructRNA *srna,
        fprintf(f, "\n");
 }
 
-static void rna_generate_parameter_prototypes(BlenderRNA *brna, StructRNA *srna, FunctionRNA *func, FILE *f)
+static void rna_generate_parameter_prototypes(BlenderRNA *UNUSED(brna), StructRNA *srna, FunctionRNA *func, FILE *f)
 {
        PropertyRNA *parm;
 
@@ -2068,7 +2107,7 @@ static void rna_generate_function_prototypes(BlenderRNA *brna, StructRNA *srna,
                fprintf(f, "\n");
 }
 
-static void rna_generate_static_parameter_prototypes(BlenderRNA *brna, StructRNA *srna, FunctionDefRNA *dfunc, FILE *f)
+static void rna_generate_static_parameter_prototypes(BlenderRNA *UNUSED(brna), StructRNA *srna, FunctionDefRNA *dfunc, FILE *f)
 {
        FunctionRNA *func;
        PropertyDefRNA *dparm;
@@ -2211,7 +2250,8 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr
        }
 
        switch (prop->type) {
-               case PROP_ENUM: {
+               case PROP_ENUM:
+               {
                        EnumPropertyRNA *eprop = (EnumPropertyRNA *)prop;
                        int i, defaultfound = 0, totflag = 0;
 
@@ -2263,7 +2303,8 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr
                        }
                        break;
                }
-               case PROP_BOOLEAN: {
+               case PROP_BOOLEAN:
+               {
                        BoolPropertyRNA *bprop = (BoolPropertyRNA *)prop;
                        unsigned int i;
 
@@ -2284,7 +2325,8 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr
                        }
                        break;
                }
-               case PROP_INT: {
+               case PROP_INT:
+               {
                        IntPropertyRNA *iprop = (IntPropertyRNA *)prop;
                        unsigned int i;
 
@@ -2305,7 +2347,8 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr
                        }
                        break;
                }
-               case PROP_FLOAT: {
+               case PROP_FLOAT:
+               {
                        FloatPropertyRNA *fprop = (FloatPropertyRNA *)prop;
                        unsigned int i;
 
@@ -2373,7 +2416,8 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr
        fprintf(f, "},\n");
 
        switch (prop->type) {
-               case PROP_BOOLEAN: {
+               case PROP_BOOLEAN:
+               {
                        BoolPropertyRNA *bprop = (BoolPropertyRNA *)prop;
                        fprintf(f, "\t%s, %s, %s, %s, %d, ",
                                rna_function_string(bprop->get),
@@ -2386,7 +2430,8 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr
                        else fprintf(f, "NULL\n");
                        break;
                }
-               case PROP_INT: {
+               case PROP_INT:
+               {
                        IntPropertyRNA *iprop = (IntPropertyRNA *)prop;
                        fprintf(f, "\t%s, %s, %s, %s, %s,\n\t",
                                rna_function_string(iprop->get),
@@ -2405,7 +2450,8 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr
                        else fprintf(f, "NULL\n");
                        break;
                }
-               case PROP_FLOAT: {
+               case PROP_FLOAT:
+               {
                        FloatPropertyRNA *fprop = (FloatPropertyRNA *)prop;
                        fprintf(f, "\t%s, %s, %s, %s, %s, ",
                                rna_function_string(fprop->get),
@@ -2425,7 +2471,8 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr
                        else fprintf(f, "NULL\n");
                        break;
                }
-               case PROP_STRING: {
+               case PROP_STRING:
+               {
                        StringPropertyRNA *sprop = (StringPropertyRNA *)prop;
                        fprintf(f, "\t%s, %s, %s, %d, ",
                                rna_function_string(sprop->get),
@@ -2435,7 +2482,8 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr
                        rna_print_c_string(f, sprop->defaultvalue); fprintf(f, "\n");
                        break;
                }
-               case PROP_ENUM: {
+               case PROP_ENUM:
+               {
                        EnumPropertyRNA *eprop = (EnumPropertyRNA *)prop;
                        fprintf(f, "\t%s, %s, %s, NULL, ",
                                rna_function_string(eprop->get),
@@ -2448,7 +2496,8 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr
                        fprintf(f, "%d, %d\n", eprop->totitem, eprop->defaultvalue);
                        break;
                }
-               case PROP_POINTER: {
+               case PROP_POINTER:
+               {
                        PointerPropertyRNA *pprop = (PointerPropertyRNA *)prop;
                        fprintf(f, "\t%s, %s, %s, %s,", rna_function_string(pprop->get),
                                rna_function_string(pprop->set),
@@ -2458,7 +2507,8 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr
                        else fprintf(f, "NULL\n");
                        break;
                }
-               case PROP_COLLECTION: {
+               case PROP_COLLECTION:
+               {
                        CollectionPropertyRNA *cprop = (CollectionPropertyRNA *)prop;
                        fprintf(f, "\t%s, %s, %s, %s, %s, %s, %s, %s, ",
                                rna_function_string(cprop->begin),
@@ -2483,7 +2533,7 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr
        }
 }
 
-static void rna_generate_struct(BlenderRNA *brna, StructRNA *srna, FILE *f)
+static void rna_generate_struct(BlenderRNA *UNUSED(brna), StructRNA *srna, FILE *f)
 {
        FunctionRNA *func;
        FunctionDefRNA *dfunc;
@@ -2681,6 +2731,7 @@ static RNAProcessItem PROCESS_ITEMS[] = {
        {"rna_world.c", NULL, RNA_def_world},
        {"rna_movieclip.c", NULL, RNA_def_movieclip},
        {"rna_tracking.c", NULL, RNA_def_tracking},
+       {"rna_mask.c", NULL, RNA_def_mask},
        {NULL, NULL}
 };
 
@@ -2760,7 +2811,7 @@ static void rna_generate(BlenderRNA *brna, FILE *f, const char *filename, const
        }
 }
 
-static void rna_generate_header(BlenderRNA *brna, FILE *f)
+static void rna_generate_header(BlenderRNA *UNUSED(brna), FILE *f)
 {
        StructDefRNA *ds;
        PropertyDefRNA *dp;
@@ -2857,7 +2908,7 @@ static const char *cpp_classes = ""
 "\n"
 "class Pointer {\n"
 "public:\n"
-"      Pointer(const PointerRNAp) : ptr(p) { }\n"
+"      Pointer(const PointerRNA &p) : ptr(p) { }\n"
 "      operator const PointerRNA&() { return ptr; }\n"
 "      bool is_a(StructRNA *type) { return RNA_struct_is_a(ptr.type, type)? true: false; }\n"
 "      operator void*() { return ptr.data; }\n"
@@ -2873,8 +2924,8 @@ static const char *cpp_classes = ""
 "      T data[Tsize];\n"
 "\n"
 "   Array() {}\n"
-"      Array(const Array<T, Tsize>& other) { memcpy(data, other.data, sizeof(T)*Tsize); }\n"
-"      const Array<T, Tsize>& operator=(const Array<T, Tsize>& other) { memcpy(data, other.data, sizeof(T)*Tsize); "
+"      Array(const Array<T, Tsize>& other) { memcpy(data, other.data, sizeof(T) * Tsize); }\n"
+"      const Array<T, Tsize>& operator=(const Array<T, Tsize>& other) { memcpy(data, other.data, sizeof(T) * Tsize); "
 "return *this; }\n"
 "\n"
 "      operator T*() { return data; }\n"
@@ -2901,7 +2952,7 @@ static const char *cpp_classes = ""
 "      bool operator!=(const CollectionIterator<T, Tbegin, Tnext, Tend>& other) "
 "{ return iter.valid != other.iter.valid; }\n"
 "\n"
-"      void begin(const Pointerptr)\n"
+"      void begin(const Pointer &ptr)\n"
 "      { if (init) Tend(&iter); Tbegin(&iter, (PointerRNA*)&ptr.ptr); t = T(iter.ptr); init = true; }\n"
 "\n"
 "private:\n"
@@ -2916,7 +2967,7 @@ static const char *cpp_classes = ""
 "template<typename Tp, typename T, TBeginFunc Tbegin, TNextFunc Tnext, TEndFunc Tend>\n"
 "class Collection {\n"
 "public:\n"
-"      Collection(const PointerRNAp) : ptr(p) {}\n"
+"      Collection(const PointerRNA &p) : ptr(p) {}\n"
 "\n"
 "      void begin(CollectionIterator<T, Tbegin, Tnext, Tend>& iter)\n"
 "      { iter.begin(ptr); }\n"
@@ -2928,7 +2979,7 @@ static const char *cpp_classes = ""
 "};\n"
 "\n";
 
-static void rna_generate_header_cpp(BlenderRNA *brna, FILE *f)
+static void rna_generate_header_cpp(BlenderRNA *UNUSED(brna), FILE *f)
 {
        StructDefRNA *ds;
        PropertyDefRNA *dp;
@@ -2960,12 +3011,12 @@ static void rna_generate_header_cpp(BlenderRNA *brna, FILE *f)
 
                fprintf(f, "class %s : public %s {\n", srna->identifier, (srna->base) ? srna->base->identifier : "Pointer");
                fprintf(f, "public:\n");
-               fprintf(f, "\t%s(const PointerRNA& ptr) :\n\t\t%s(ptr)", srna->identifier,
+               fprintf(f, "\t%s(const PointerRNA &ptr_arg) :\n\t\t%s(ptr_arg)", srna->identifier,
                        (srna->base) ? srna->base->identifier : "Pointer");
                for (dp = ds->cont.properties.first; dp; dp = dp->next)
                        if (!(dp->prop->flag & (PROP_IDPROPERTY | PROP_BUILTIN)))
                                if (dp->prop->type == PROP_COLLECTION)
-                                       fprintf(f, ",\n\t\t%s(ptr)", dp->prop->identifier);
+                                       fprintf(f, ",\n\t\t%s(ptr_arg)", dp->prop->identifier);
                fprintf(f, "\n\t\t{}\n\n");
 
                for (dp = ds->cont.properties.first; dp; dp = dp->next)
@@ -3122,7 +3173,7 @@ int main(int argc, char **argv)
                return_status = 1;
        }
        else {
-               fprintf(stderr, "Running makesrna");
+               fprintf(stderr, "Running makesrna\n");
                makesrna_path = argv[0];
                return_status = rna_preprocess(argv[1]);
        }