[#18961] Use const char * where appropriate (2.5)
from Sean Bartell (wtachi) added own changes bpy_props.c
This commit is contained in:
@@ -122,7 +122,7 @@ extern "C" {
|
|||||||
void MEM_printmemlist_stats(void);
|
void MEM_printmemlist_stats(void);
|
||||||
|
|
||||||
/** Set the callback function for error output. */
|
/** Set the callback function for error output. */
|
||||||
void MEM_set_error_callback(void (*func)(char *));
|
void MEM_set_error_callback(void (*func)(const char *));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Are the start/end block markers still correct ?
|
* Are the start/end block markers still correct ?
|
||||||
|
@@ -135,7 +135,7 @@ static volatile uintptr_t mem_in_use= 0, mmap_in_use= 0;
|
|||||||
|
|
||||||
static volatile struct localListBase _membase;
|
static volatile struct localListBase _membase;
|
||||||
static volatile struct localListBase *membase = &_membase;
|
static volatile struct localListBase *membase = &_membase;
|
||||||
static void (*error_callback)(char *) = NULL;
|
static void (*error_callback)(const char *) = NULL;
|
||||||
static void (*thread_lock_callback)(void) = NULL;
|
static void (*thread_lock_callback)(void) = NULL;
|
||||||
static void (*thread_unlock_callback)(void) = NULL;
|
static void (*thread_unlock_callback)(void) = NULL;
|
||||||
|
|
||||||
@@ -197,7 +197,7 @@ int MEM_check_memory_integrity()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void MEM_set_error_callback(void (*func)(char *))
|
void MEM_set_error_callback(void (*func)(const char *))
|
||||||
{
|
{
|
||||||
error_callback = func;
|
error_callback = func;
|
||||||
}
|
}
|
||||||
|
@@ -47,6 +47,12 @@
|
|||||||
#include <config.h>
|
#include <config.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static void mem_error_cb(const char *errorStr)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "%s", errorStr);
|
||||||
|
fflush(stderr);
|
||||||
|
}
|
||||||
|
|
||||||
int main (int argc, char *argv[])
|
int main (int argc, char *argv[])
|
||||||
{
|
{
|
||||||
int verbose = 0;
|
int verbose = 0;
|
||||||
@@ -75,7 +81,7 @@ int main (int argc, char *argv[])
|
|||||||
/* Round one, do a normal allocation, and free the blocks again. */
|
/* Round one, do a normal allocation, and free the blocks again. */
|
||||||
/* ----------------------------------------------------------------- */
|
/* ----------------------------------------------------------------- */
|
||||||
/* flush mem lib output to stderr */
|
/* flush mem lib output to stderr */
|
||||||
MEM_set_error_callback(stderr);
|
MEM_set_error_callback(mem_error_cb);
|
||||||
|
|
||||||
for (i = 0; i < NUM_BLOCKS; i++) {
|
for (i = 0; i < NUM_BLOCKS; i++) {
|
||||||
int blocksize = 10000;
|
int blocksize = 10000;
|
||||||
|
@@ -2590,7 +2590,7 @@ static int rna_preprocess(char *outfile)
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void mem_error_cb(char *errorStr)
|
static void mem_error_cb(const char *errorStr)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "%s", errorStr);
|
fprintf(stderr, "%s", errorStr);
|
||||||
fflush(stderr);
|
fflush(stderr);
|
||||||
|
@@ -122,7 +122,7 @@ PyObject *BPy_BoolProperty(PyObject *self, PyObject *args, PyObject *kw)
|
|||||||
char *pysubtype= NULL;
|
char *pysubtype= NULL;
|
||||||
int subtype= PROP_NONE;
|
int subtype= PROP_NONE;
|
||||||
|
|
||||||
if (!PyArg_ParseTupleAndKeywords(args, kw, "s|ssiO!s:BoolProperty", kwlist, &id, &name, &description, &def, &PySet_Type, &pyopts, &pysubtype))
|
if (!PyArg_ParseTupleAndKeywords(args, kw, "s|ssiO!s:BoolProperty", (char **)kwlist, &id, &name, &description, &def, &PySet_Type, &pyopts, &pysubtype))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if(pyopts && pyrna_set_to_enum_bitfield(property_flag_items, pyopts, &opts, "BoolProperty(options={...}):"))
|
if(pyopts && pyrna_set_to_enum_bitfield(property_flag_items, pyopts, &opts, "BoolProperty(options={...}):"))
|
||||||
@@ -173,7 +173,7 @@ PyObject *BPy_BoolVectorProperty(PyObject *self, PyObject *args, PyObject *kw)
|
|||||||
return NULL; /* self's type was compatible but error getting the srna */
|
return NULL; /* self's type was compatible but error getting the srna */
|
||||||
}
|
}
|
||||||
else if(srna) {
|
else if(srna) {
|
||||||
static char *kwlist[] = {"attr", "name", "description", "default", "options", "subtype", "size", NULL};
|
static const char *kwlist[] = {"attr", "name", "description", "default", "options", "subtype", "size", NULL};
|
||||||
char *id=NULL, *name="", *description="";
|
char *id=NULL, *name="", *description="";
|
||||||
int def[PYRNA_STACK_ARRAY]={0};
|
int def[PYRNA_STACK_ARRAY]={0};
|
||||||
int size=3;
|
int size=3;
|
||||||
@@ -184,7 +184,7 @@ PyObject *BPy_BoolVectorProperty(PyObject *self, PyObject *args, PyObject *kw)
|
|||||||
char *pysubtype= NULL;
|
char *pysubtype= NULL;
|
||||||
int subtype= PROP_NONE;
|
int subtype= PROP_NONE;
|
||||||
|
|
||||||
if (!PyArg_ParseTupleAndKeywords(args, kw, "s|ssOO!si:BoolVectorProperty", kwlist, &id, &name, &description, &pydef, &PySet_Type, &pyopts, &pysubtype, &size))
|
if (!PyArg_ParseTupleAndKeywords(args, kw, "s|ssOO!si:BoolVectorProperty", (char **)kwlist, &id, &name, &description, &pydef, &PySet_Type, &pyopts, &pysubtype, &size))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if(pyopts && pyrna_set_to_enum_bitfield(property_flag_items, pyopts, &opts, "BoolVectorProperty(options={...}):"))
|
if(pyopts && pyrna_set_to_enum_bitfield(property_flag_items, pyopts, &opts, "BoolVectorProperty(options={...}):"))
|
||||||
@@ -244,7 +244,7 @@ PyObject *BPy_IntProperty(PyObject *self, PyObject *args, PyObject *kw)
|
|||||||
return NULL; /* self's type was compatible but error getting the srna */
|
return NULL; /* self's type was compatible but error getting the srna */
|
||||||
}
|
}
|
||||||
else if(srna) {
|
else if(srna) {
|
||||||
static char *kwlist[] = {"attr", "name", "description", "default", "min", "max", "soft_min", "soft_max", "step", "options", "subtype", NULL};
|
static const char *kwlist[] = {"attr", "name", "description", "default", "min", "max", "soft_min", "soft_max", "step", "options", "subtype", NULL};
|
||||||
char *id=NULL, *name="", *description="";
|
char *id=NULL, *name="", *description="";
|
||||||
int min=INT_MIN, max=INT_MAX, soft_min=INT_MIN, soft_max=INT_MAX, step=1, def=0;
|
int min=INT_MIN, max=INT_MAX, soft_min=INT_MIN, soft_max=INT_MAX, step=1, def=0;
|
||||||
PropertyRNA *prop;
|
PropertyRNA *prop;
|
||||||
@@ -253,7 +253,7 @@ PyObject *BPy_IntProperty(PyObject *self, PyObject *args, PyObject *kw)
|
|||||||
char *pysubtype= NULL;
|
char *pysubtype= NULL;
|
||||||
int subtype= PROP_NONE;
|
int subtype= PROP_NONE;
|
||||||
|
|
||||||
if (!PyArg_ParseTupleAndKeywords(args, kw, "s|ssiiiiiiO!s:IntProperty", kwlist, &id, &name, &description, &def, &min, &max, &soft_min, &soft_max, &step, &PySet_Type, &pyopts, &pysubtype))
|
if (!PyArg_ParseTupleAndKeywords(args, kw, "s|ssiiiiiiO!s:IntProperty", (char **)kwlist, &id, &name, &description, &def, &min, &max, &soft_min, &soft_max, &step, &PySet_Type, &pyopts, &pysubtype))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if(pyopts && pyrna_set_to_enum_bitfield(property_flag_items, pyopts, &opts, "IntProperty(options={...}):"))
|
if(pyopts && pyrna_set_to_enum_bitfield(property_flag_items, pyopts, &opts, "IntProperty(options={...}):"))
|
||||||
@@ -305,7 +305,7 @@ PyObject *BPy_IntVectorProperty(PyObject *self, PyObject *args, PyObject *kw)
|
|||||||
return NULL; /* self's type was compatible but error getting the srna */
|
return NULL; /* self's type was compatible but error getting the srna */
|
||||||
}
|
}
|
||||||
else if(srna) {
|
else if(srna) {
|
||||||
static char *kwlist[] = {"attr", "name", "description", "default", "min", "max", "soft_min", "soft_max", "step", "options", "subtype", "size", NULL};
|
static const char *kwlist[] = {"attr", "name", "description", "default", "min", "max", "soft_min", "soft_max", "step", "options", "subtype", "size", NULL};
|
||||||
char *id=NULL, *name="", *description="";
|
char *id=NULL, *name="", *description="";
|
||||||
int min=INT_MIN, max=INT_MAX, soft_min=INT_MIN, soft_max=INT_MAX, step=1, def[PYRNA_STACK_ARRAY]={0};
|
int min=INT_MIN, max=INT_MAX, soft_min=INT_MIN, soft_max=INT_MAX, step=1, def[PYRNA_STACK_ARRAY]={0};
|
||||||
int size=3;
|
int size=3;
|
||||||
@@ -316,7 +316,7 @@ PyObject *BPy_IntVectorProperty(PyObject *self, PyObject *args, PyObject *kw)
|
|||||||
char *pysubtype= NULL;
|
char *pysubtype= NULL;
|
||||||
int subtype= PROP_NONE;
|
int subtype= PROP_NONE;
|
||||||
|
|
||||||
if (!PyArg_ParseTupleAndKeywords(args, kw, "s|ssOiiiiO!si:IntVectorProperty", kwlist, &id, &name, &description, &pydef, &min, &max, &soft_min, &soft_max, &PySet_Type, &pyopts, &pysubtype, &size))
|
if (!PyArg_ParseTupleAndKeywords(args, kw, "s|ssOiiiiO!si:IntVectorProperty", (char **)kwlist, &id, &name, &description, &pydef, &min, &max, &soft_min, &soft_max, &PySet_Type, &pyopts, &pysubtype, &size))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if(pyopts && pyrna_set_to_enum_bitfield(property_flag_items, pyopts, &opts, "IntVectorProperty(options={...}):"))
|
if(pyopts && pyrna_set_to_enum_bitfield(property_flag_items, pyopts, &opts, "IntVectorProperty(options={...}):"))
|
||||||
@@ -380,7 +380,7 @@ PyObject *BPy_FloatProperty(PyObject *self, PyObject *args, PyObject *kw)
|
|||||||
return NULL; /* self's type was compatible but error getting the srna */
|
return NULL; /* self's type was compatible but error getting the srna */
|
||||||
}
|
}
|
||||||
else if(srna) {
|
else if(srna) {
|
||||||
static char *kwlist[] = {"attr", "name", "description", "default", "min", "max", "soft_min", "soft_max", "step", "precision", "options", "subtype", "unit", NULL};
|
static const char *kwlist[] = {"attr", "name", "description", "default", "min", "max", "soft_min", "soft_max", "step", "precision", "options", "subtype", "unit", NULL};
|
||||||
char *id=NULL, *name="", *description="";
|
char *id=NULL, *name="", *description="";
|
||||||
float min=-FLT_MAX, max=FLT_MAX, soft_min=-FLT_MAX, soft_max=FLT_MAX, step=3, def=0.0f;
|
float min=-FLT_MAX, max=FLT_MAX, soft_min=-FLT_MAX, soft_max=FLT_MAX, step=3, def=0.0f;
|
||||||
int precision= 2;
|
int precision= 2;
|
||||||
@@ -392,7 +392,7 @@ PyObject *BPy_FloatProperty(PyObject *self, PyObject *args, PyObject *kw)
|
|||||||
char *pyunit= NULL;
|
char *pyunit= NULL;
|
||||||
int unit= PROP_UNIT_NONE;
|
int unit= PROP_UNIT_NONE;
|
||||||
|
|
||||||
if (!PyArg_ParseTupleAndKeywords(args, kw, "s|ssffffffiO!ss:FloatProperty", kwlist, &id, &name, &description, &def, &min, &max, &soft_min, &soft_max, &step, &precision, &PySet_Type, &pyopts, &pysubtype, &pyunit))
|
if (!PyArg_ParseTupleAndKeywords(args, kw, "s|ssffffffiO!ss:FloatProperty", (char **)kwlist, &id, &name, &description, &def, &min, &max, &soft_min, &soft_max, &step, &precision, &PySet_Type, &pyopts, &pysubtype, &pyunit))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if(pyopts && pyrna_set_to_enum_bitfield(property_flag_items, pyopts, &opts, "FloatProperty(options={...}):"))
|
if(pyopts && pyrna_set_to_enum_bitfield(property_flag_items, pyopts, &opts, "FloatProperty(options={...}):"))
|
||||||
@@ -449,7 +449,7 @@ PyObject *BPy_FloatVectorProperty(PyObject *self, PyObject *args, PyObject *kw)
|
|||||||
return NULL; /* self's type was compatible but error getting the srna */
|
return NULL; /* self's type was compatible but error getting the srna */
|
||||||
}
|
}
|
||||||
else if(srna) {
|
else if(srna) {
|
||||||
static char *kwlist[] = {"attr", "name", "description", "default", "min", "max", "soft_min", "soft_max", "step", "precision", "options", "subtype", "size", NULL};
|
static const char *kwlist[] = {"attr", "name", "description", "default", "min", "max", "soft_min", "soft_max", "step", "precision", "options", "subtype", "size", NULL};
|
||||||
char *id=NULL, *name="", *description="";
|
char *id=NULL, *name="", *description="";
|
||||||
float min=-FLT_MAX, max=FLT_MAX, soft_min=-FLT_MAX, soft_max=FLT_MAX, step=3, def[PYRNA_STACK_ARRAY]={0.0f};
|
float min=-FLT_MAX, max=FLT_MAX, soft_min=-FLT_MAX, soft_max=FLT_MAX, step=3, def[PYRNA_STACK_ARRAY]={0.0f};
|
||||||
int precision= 2, size=3;
|
int precision= 2, size=3;
|
||||||
@@ -460,7 +460,7 @@ PyObject *BPy_FloatVectorProperty(PyObject *self, PyObject *args, PyObject *kw)
|
|||||||
char *pysubtype= NULL;
|
char *pysubtype= NULL;
|
||||||
int subtype= PROP_NONE;
|
int subtype= PROP_NONE;
|
||||||
|
|
||||||
if (!PyArg_ParseTupleAndKeywords(args, kw, "s|ssOfffffiO!si:FloatVectorProperty", kwlist, &id, &name, &description, &pydef, &min, &max, &soft_min, &soft_max, &step, &precision, &PySet_Type, &pyopts, &pysubtype, &size))
|
if (!PyArg_ParseTupleAndKeywords(args, kw, "s|ssOfffffiO!si:FloatVectorProperty", (char **)kwlist, &id, &name, &description, &pydef, &min, &max, &soft_min, &soft_max, &step, &precision, &PySet_Type, &pyopts, &pysubtype, &size))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if(pyopts && pyrna_set_to_enum_bitfield(property_flag_items, pyopts, &opts, "FloatVectorProperty(options={...}):"))
|
if(pyopts && pyrna_set_to_enum_bitfield(property_flag_items, pyopts, &opts, "FloatVectorProperty(options={...}):"))
|
||||||
@@ -521,7 +521,7 @@ PyObject *BPy_StringProperty(PyObject *self, PyObject *args, PyObject *kw)
|
|||||||
return NULL; /* self's type was compatible but error getting the srna */
|
return NULL; /* self's type was compatible but error getting the srna */
|
||||||
}
|
}
|
||||||
else if(srna) {
|
else if(srna) {
|
||||||
static char *kwlist[] = {"attr", "name", "description", "default", "maxlen", "options", "subtype", NULL};
|
static const char *kwlist[] = {"attr", "name", "description", "default", "maxlen", "options", "subtype", NULL};
|
||||||
char *id=NULL, *name="", *description="", *def="";
|
char *id=NULL, *name="", *description="", *def="";
|
||||||
int maxlen=0;
|
int maxlen=0;
|
||||||
PropertyRNA *prop;
|
PropertyRNA *prop;
|
||||||
@@ -530,7 +530,7 @@ PyObject *BPy_StringProperty(PyObject *self, PyObject *args, PyObject *kw)
|
|||||||
char *pysubtype= NULL;
|
char *pysubtype= NULL;
|
||||||
int subtype= PROP_NONE;
|
int subtype= PROP_NONE;
|
||||||
|
|
||||||
if (!PyArg_ParseTupleAndKeywords(args, kw, "s|sssiO!s:StringProperty", kwlist, &id, &name, &description, &def, &maxlen, &PySet_Type, &pyopts, &pysubtype))
|
if (!PyArg_ParseTupleAndKeywords(args, kw, "s|sssiO!s:StringProperty", (char **)kwlist, &id, &name, &description, &def, &maxlen, &PySet_Type, &pyopts, &pysubtype))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if(pyopts && pyrna_set_to_enum_bitfield(property_flag_items, pyopts, &opts, "StringProperty(options={...}):"))
|
if(pyopts && pyrna_set_to_enum_bitfield(property_flag_items, pyopts, &opts, "StringProperty(options={...}):"))
|
||||||
@@ -627,7 +627,7 @@ PyObject *BPy_EnumProperty(PyObject *self, PyObject *args, PyObject *kw)
|
|||||||
return NULL; /* self's type was compatible but error getting the srna */
|
return NULL; /* self's type was compatible but error getting the srna */
|
||||||
}
|
}
|
||||||
else if(srna) {
|
else if(srna) {
|
||||||
static char *kwlist[] = {"attr", "items", "name", "description", "default", "options", NULL};
|
static const char *kwlist[] = {"attr", "items", "name", "description", "default", "options", NULL};
|
||||||
char *id=NULL, *name="", *description="", *def="";
|
char *id=NULL, *name="", *description="", *def="";
|
||||||
int defvalue=0;
|
int defvalue=0;
|
||||||
PyObject *items= Py_None;
|
PyObject *items= Py_None;
|
||||||
@@ -636,7 +636,7 @@ PyObject *BPy_EnumProperty(PyObject *self, PyObject *args, PyObject *kw)
|
|||||||
PyObject *pyopts= NULL;
|
PyObject *pyopts= NULL;
|
||||||
int opts=0;
|
int opts=0;
|
||||||
|
|
||||||
if (!PyArg_ParseTupleAndKeywords(args, kw, "sO|sssO!:EnumProperty", kwlist, &id, &items, &name, &description, &def, &PySet_Type, &pyopts))
|
if (!PyArg_ParseTupleAndKeywords(args, kw, "sO|sssO!:EnumProperty", (char **)kwlist, &id, &items, &name, &description, &def, &PySet_Type, &pyopts))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if(pyopts && pyrna_set_to_enum_bitfield(property_flag_items, pyopts, &opts, "EnumProperty(options={...}):"))
|
if(pyopts && pyrna_set_to_enum_bitfield(property_flag_items, pyopts, &opts, "EnumProperty(options={...}):"))
|
||||||
@@ -702,7 +702,7 @@ PyObject *BPy_PointerProperty(PyObject *self, PyObject *args, PyObject *kw)
|
|||||||
return NULL; /* self's type was compatible but error getting the srna */
|
return NULL; /* self's type was compatible but error getting the srna */
|
||||||
}
|
}
|
||||||
else if(srna) {
|
else if(srna) {
|
||||||
static char *kwlist[] = {"attr", "type", "name", "description", "options", NULL};
|
static const char *kwlist[] = {"attr", "type", "name", "description", "options", NULL};
|
||||||
char *id=NULL, *name="", *description="";
|
char *id=NULL, *name="", *description="";
|
||||||
PropertyRNA *prop;
|
PropertyRNA *prop;
|
||||||
StructRNA *ptype;
|
StructRNA *ptype;
|
||||||
@@ -710,7 +710,7 @@ PyObject *BPy_PointerProperty(PyObject *self, PyObject *args, PyObject *kw)
|
|||||||
PyObject *pyopts= NULL;
|
PyObject *pyopts= NULL;
|
||||||
int opts=0;
|
int opts=0;
|
||||||
|
|
||||||
if (!PyArg_ParseTupleAndKeywords(args, kw, "sO|ssO!:PointerProperty", kwlist, &id, &type, &name, &description, &PySet_Type, &pyopts))
|
if (!PyArg_ParseTupleAndKeywords(args, kw, "sO|ssO!:PointerProperty", (char **)kwlist, &id, &type, &name, &description, &PySet_Type, &pyopts))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if(pyopts && pyrna_set_to_enum_bitfield(property_flag_items, pyopts, &opts, "PointerProperty(options={...}):"))
|
if(pyopts && pyrna_set_to_enum_bitfield(property_flag_items, pyopts, &opts, "PointerProperty(options={...}):"))
|
||||||
@@ -757,7 +757,7 @@ PyObject *BPy_CollectionProperty(PyObject *self, PyObject *args, PyObject *kw)
|
|||||||
return NULL; /* self's type was compatible but error getting the srna */
|
return NULL; /* self's type was compatible but error getting the srna */
|
||||||
}
|
}
|
||||||
else if(srna) {
|
else if(srna) {
|
||||||
static char *kwlist[] = {"attr", "type", "name", "description", "options", NULL};
|
static const char *kwlist[] = {"attr", "type", "name", "description", "options", NULL};
|
||||||
char *id=NULL, *name="", *description="";
|
char *id=NULL, *name="", *description="";
|
||||||
PropertyRNA *prop;
|
PropertyRNA *prop;
|
||||||
StructRNA *ptype;
|
StructRNA *ptype;
|
||||||
@@ -765,7 +765,7 @@ PyObject *BPy_CollectionProperty(PyObject *self, PyObject *args, PyObject *kw)
|
|||||||
PyObject *pyopts= NULL;
|
PyObject *pyopts= NULL;
|
||||||
int opts=0;
|
int opts=0;
|
||||||
|
|
||||||
if (!PyArg_ParseTupleAndKeywords(args, kw, "sO|ssO!:CollectionProperty", kwlist, &id, &type, &name, &description, &PySet_Type, &pyopts))
|
if (!PyArg_ParseTupleAndKeywords(args, kw, "sO|ssO!:CollectionProperty", (char **)kwlist, &id, &type, &name, &description, &PySet_Type, &pyopts))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if(pyopts && pyrna_set_to_enum_bitfield(property_flag_items, pyopts, &opts, "CollectionProperty(options={...}):"))
|
if(pyopts && pyrna_set_to_enum_bitfield(property_flag_items, pyopts, &opts, "CollectionProperty(options={...}):"))
|
||||||
|
@@ -1053,7 +1053,7 @@ static void error_cb(char *err)
|
|||||||
printf("%s\n", err); /* XXX do this in WM too */
|
printf("%s\n", err); /* XXX do this in WM too */
|
||||||
}
|
}
|
||||||
|
|
||||||
static void mem_error_cb(char *errorStr)
|
static void mem_error_cb(const char *errorStr)
|
||||||
{
|
{
|
||||||
fputs(errorStr, stderr);
|
fputs(errorStr, stderr);
|
||||||
fflush(stderr);
|
fflush(stderr);
|
||||||
|
@@ -30,7 +30,7 @@ template <class PyObj> class BlendType
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/// constructor
|
/// constructor
|
||||||
BlendType (char * name) : m_name(name) {}
|
BlendType (const char * name) : m_name(name) {}
|
||||||
|
|
||||||
/// check blender type and return pointer to contained object or NULL (if type is not valid)
|
/// check blender type and return pointer to contained object or NULL (if type is not valid)
|
||||||
PyObj * checkType (PyObject * obj)
|
PyObj * checkType (PyObject * obj)
|
||||||
@@ -68,7 +68,7 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
/// name of Python type
|
/// name of Python type
|
||||||
char * m_name;
|
const char * m_name;
|
||||||
/// pointer to Python type
|
/// pointer to Python type
|
||||||
PyTypeObject * m_objType;
|
PyTypeObject * m_objType;
|
||||||
};
|
};
|
||||||
|
@@ -41,7 +41,7 @@ ExpDesc errNFoundDesc (ErrNotFound, "Error description not found");
|
|||||||
// implementation of ExpDesc
|
// implementation of ExpDesc
|
||||||
|
|
||||||
// constructor
|
// constructor
|
||||||
ExpDesc::ExpDesc (ExceptionID & exp, char * desc, RESULT hres)
|
ExpDesc::ExpDesc (ExceptionID & exp, const char * desc, RESULT hres)
|
||||||
: m_expID(exp), m_hRslt(hres), m_description(desc)
|
: m_expID(exp), m_hRslt(hres), m_description(desc)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -60,7 +60,7 @@ std::vector<ExpDesc*> ExpDesc::m_expDescs;
|
|||||||
std::string Exception::m_lastError;
|
std::string Exception::m_lastError;
|
||||||
|
|
||||||
// log file name
|
// log file name
|
||||||
char * Exception::m_logFile = NULL;
|
const char * Exception::m_logFile = NULL;
|
||||||
|
|
||||||
|
|
||||||
// basic constructor
|
// basic constructor
|
||||||
@@ -98,7 +98,7 @@ const char * Exception::what()
|
|||||||
|
|
||||||
|
|
||||||
// debug version - with file and line of exception
|
// debug version - with file and line of exception
|
||||||
Exception::Exception (ExceptionID & expID, RESULT rslt, char * fil, int lin)
|
Exception::Exception (ExceptionID & expID, RESULT rslt, const char * fil, int lin)
|
||||||
: m_expID (&expID), m_hRslt (rslt)
|
: m_expID (&expID), m_hRslt (rslt)
|
||||||
{
|
{
|
||||||
// set file and line
|
// set file and line
|
||||||
@@ -108,7 +108,7 @@ Exception::Exception (ExceptionID & expID, RESULT rslt, char * fil, int lin)
|
|||||||
|
|
||||||
|
|
||||||
// set file and line
|
// set file and line
|
||||||
void Exception::setFileLine (char * fil, int lin)
|
void Exception::setFileLine (const char * fil, int lin)
|
||||||
{
|
{
|
||||||
if (fil != NULL) m_fileName = fil;
|
if (fil != NULL) m_fileName = fil;
|
||||||
m_line = lin;
|
m_line = lin;
|
||||||
|
@@ -91,7 +91,7 @@ class ExpDesc
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// constructor a destructor
|
// constructor a destructor
|
||||||
ExpDesc (ExceptionID & exp, char * desc, RESULT hres = S_OK);
|
ExpDesc (ExceptionID & exp, const char * desc, RESULT hres = S_OK);
|
||||||
~ExpDesc (void);
|
~ExpDesc (void);
|
||||||
|
|
||||||
// comparision function
|
// comparision function
|
||||||
@@ -132,7 +132,7 @@ private:
|
|||||||
// result
|
// result
|
||||||
RESULT m_hRslt;
|
RESULT m_hRslt;
|
||||||
// description
|
// description
|
||||||
char * m_description;
|
const char * m_description;
|
||||||
|
|
||||||
// not allowed
|
// not allowed
|
||||||
ExpDesc (const ExpDesc & obj) : m_expID (ErrNotFound) {}
|
ExpDesc (const ExpDesc & obj) : m_expID (ErrNotFound) {}
|
||||||
@@ -157,9 +157,9 @@ public:
|
|||||||
virtual const char * what(void);
|
virtual const char * what(void);
|
||||||
|
|
||||||
// debug version of constructor
|
// debug version of constructor
|
||||||
Exception (ExceptionID & expID, RESULT rslt, char * fil, int lin);
|
Exception (ExceptionID & expID, RESULT rslt, const char * fil, int lin);
|
||||||
// set source file and line of exception
|
// set source file and line of exception
|
||||||
void setFileLine (char * fil, int lin);
|
void setFileLine (const char * fil, int lin);
|
||||||
|
|
||||||
// get description in string
|
// get description in string
|
||||||
std::string & getDesc (void) throw() { return m_desc; }
|
std::string & getDesc (void) throw() { return m_desc; }
|
||||||
@@ -174,7 +174,7 @@ public:
|
|||||||
static std::string m_lastError;
|
static std::string m_lastError;
|
||||||
|
|
||||||
/// log file name
|
/// log file name
|
||||||
static char * m_logFile;
|
static const char * m_logFile;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// exception identification
|
// exception identification
|
||||||
|
@@ -282,9 +282,10 @@ static int ImageRender_init (PyObject * pySelf, PyObject * args, PyObject * kwds
|
|||||||
// camera object
|
// camera object
|
||||||
PyObject * camera;
|
PyObject * camera;
|
||||||
// parameter keywords
|
// parameter keywords
|
||||||
static char *kwlist[] = {"sceneObj", "cameraObj", NULL};
|
static const char *kwlist[] = {"sceneObj", "cameraObj", NULL};
|
||||||
// get parameters
|
// get parameters
|
||||||
if (!PyArg_ParseTupleAndKeywords(args, kwds, "OO", kwlist, &scene, &camera))
|
if (!PyArg_ParseTupleAndKeywords(args, kwds, "OO",
|
||||||
|
const_cast<char**>(kwlist), &scene, &camera))
|
||||||
return -1;
|
return -1;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -428,9 +429,10 @@ static int ImageMirror_init (PyObject * pySelf, PyObject * args, PyObject * kwds
|
|||||||
// material of the mirror
|
// material of the mirror
|
||||||
short materialID = 0;
|
short materialID = 0;
|
||||||
// parameter keywords
|
// parameter keywords
|
||||||
static char *kwlist[] = {"scene", "observer", "mirror", "material", NULL};
|
static const char *kwlist[] = {"scene", "observer", "mirror", "material", NULL};
|
||||||
// get parameters
|
// get parameters
|
||||||
if (!PyArg_ParseTupleAndKeywords(args, kwds, "OOO|h", kwlist, &scene, &observer, &mirror, &materialID))
|
if (!PyArg_ParseTupleAndKeywords(args, kwds, "OOO|h",
|
||||||
|
const_cast<char**>(kwlist), &scene, &observer, &mirror, &materialID))
|
||||||
return -1;
|
return -1;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@@ -186,11 +186,12 @@ int Texture_init (Texture *self, PyObject *args, PyObject *kwds)
|
|||||||
// texture object with shared texture ID
|
// texture object with shared texture ID
|
||||||
Texture * texObj = NULL;
|
Texture * texObj = NULL;
|
||||||
|
|
||||||
static char *kwlist[] = {"gameObj", "materialID", "textureID", "textureObj", NULL};
|
static const char *kwlist[] = {"gameObj", "materialID", "textureID", "textureObj", NULL};
|
||||||
|
|
||||||
// get parameters
|
// get parameters
|
||||||
if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|hhO!", kwlist, &obj, &matID,
|
if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|hhO!",
|
||||||
&texID, &TextureType, &texObj))
|
const_cast<char**>(kwlist), &obj, &matID, &texID, &TextureType,
|
||||||
|
&texObj))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
// if parameters are available
|
// if parameters are available
|
||||||
|
@@ -1074,11 +1074,11 @@ static int VideoFFmpeg_init (PyObject * pySelf, PyObject * args, PyObject * kwds
|
|||||||
// capture rate, only if capt is >= 0
|
// capture rate, only if capt is >= 0
|
||||||
float rate = 25.f;
|
float rate = 25.f;
|
||||||
|
|
||||||
static char *kwlist[] = {"file", "capture", "rate", "width", "height", NULL};
|
static const char *kwlist[] = {"file", "capture", "rate", "width", "height", NULL};
|
||||||
|
|
||||||
// get parameters
|
// get parameters
|
||||||
if (!PyArg_ParseTupleAndKeywords(args, kwds, "s|hfhh", kwlist, &file, &capt,
|
if (!PyArg_ParseTupleAndKeywords(args, kwds, "s|hfhh",
|
||||||
&rate, &width, &height))
|
const_cast<char**>(kwlist), &file, &capt, &rate, &width, &height))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
try
|
try
|
||||||
|
Reference in New Issue
Block a user