Merged changes in the trunk up to revision 34201.

This commit is contained in:
2011-01-09 17:56:26 +00:00
32 changed files with 543 additions and 580 deletions

View File

@@ -269,7 +269,7 @@ void BPY_python_start( int argc, char **argv )
Py_DECREF(mod);
}
else {
BKE_assert(!"unable to load 'imp' module.");
BLI_assert(!"unable to load 'imp' module.");
}
}
@@ -319,7 +319,7 @@ static int python_script_exec(bContext *C, const char *fn, struct Text *text, st
PyObject *py_dict= NULL, *py_result= NULL;
PyGILState_STATE gilstate;
BKE_assert(fn || text);
BLI_assert(fn || text);
if (fn==NULL && text==NULL) {
return 0;

View File

@@ -552,7 +552,7 @@ static EnumPropertyItem *enum_items_from_py(PyObject *value, PyObject *def, int
return NULL;
}
seq_len= PySequence_Length(value);
seq_len= PySequence_Size(value);
if(is_enum_flag) {
if(seq_len > RNA_ENUM_BITFLAG_SIZE) {

View File

@@ -75,7 +75,7 @@ static int rna_id_write_error(PointerRNA *ptr, PyObject *key)
else pyname= "<UNKNOWN>";
/* make a nice string error */
BKE_assert(idtype != NULL);
BLI_assert(idtype != NULL);
PyErr_Format(PyExc_RuntimeError, "Writing to ID classes in this context is not allowed: %.200s, %.200s datablock, error setting %.200s.%.200s", id->name+2, idtype, RNA_struct_identifier(ptr->type), pyname);
return TRUE;
@@ -1250,7 +1250,7 @@ static int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, void *data, PyOb
return -1;
}
seq_len = PySequence_Length(value);
seq_len = PySequence_Size(value);
for(i=0; i<seq_len; i++) {
item= PySequence_GetItem(value, i);
@@ -1572,7 +1572,7 @@ static PyObject *pyrna_prop_array_subscript_slice(BPy_PropertyArrayRNA *self, Po
break;
}
default:
BKE_assert(!"Invalid array type");
BLI_assert(!"Invalid array type");
PyErr_SetString(PyExc_TypeError, "not an array type");
Py_DECREF(tuple);
@@ -2779,7 +2779,7 @@ static PyObject *pyrna_struct_getattro( BPy_StructRNA *self, PyObject *pyname )
break;
default:
/* should never happen */
BKE_assert(!"Invalid context type");
BLI_assert(!"Invalid context type");
PyErr_Format(PyExc_AttributeError, "bpy_struct: Context type invalid %d, can't get \"%.200s\" from context", newtype, name);
ret= NULL;
@@ -3279,7 +3279,7 @@ static int foreach_parse_args(
return -1;
}
*tot= PySequence_Length(*seq); // TODO - buffer may not be a sequence! array.array() is tho.
*tot= PySequence_Size(*seq); // TODO - buffer may not be a sequence! array.array() is tho.
if(*tot>0) {
foreach_attr_type(self, *attr, raw_type, attr_tot, attr_signed);
@@ -3400,7 +3400,7 @@ static PyObject *foreach_getset(BPy_PropertyRNA *self, PyObject *args, int set)
break;
case PROP_RAW_UNSET:
/* should never happen */
BKE_assert(!"Invalid array type - set");
BLI_assert(!"Invalid array type - set");
break;
}
@@ -3455,7 +3455,7 @@ static PyObject *foreach_getset(BPy_PropertyRNA *self, PyObject *args, int set)
break;
case PROP_RAW_UNSET:
/* should never happen */
BKE_assert(!"Invalid array type - get");
BLI_assert(!"Invalid array type - get");
break;
}
@@ -3813,7 +3813,7 @@ static PyObject * pyrna_func_call(PyObject *self, PyObject *args, PyObject *kw)
void *retdata_single= NULL;
/* Should never happen but it does in rare cases */
BKE_assert(self_ptr != NULL);
BLI_assert(self_ptr != NULL);
if(self_ptr==NULL) {
PyErr_SetString(PyExc_RuntimeError, "rna functions internal rna pointer is NULL, this is a bug. aborting");

View File

@@ -57,7 +57,7 @@ static int validate_array_type(PyObject *seq, int dim, int totdim, int dimsize[]
if (dim + 1 < totdim) {
/* check that a sequence contains dimsize[dim] items */
for (i= 0; i < PySequence_Length(seq); i++) {
for (i= 0; i < PySequence_Size(seq); i++) {
PyObject *item;
int ok= 1;
item= PySequence_GetItem(seq, i);
@@ -72,7 +72,7 @@ static int validate_array_type(PyObject *seq, int dim, int totdim, int dimsize[]
dimsize[2]=5
dim=0 */
else if (PySequence_Length(item) != dimsize[dim + 1]) {
else if (PySequence_Size(item) != dimsize[dim + 1]) {
/* BLI_snprintf(error_str, error_str_size, "sequences of dimension %d should contain %d items", (int)dim + 1, (int)dimsize[dim + 1]); */
PyErr_Format(PyExc_ValueError, "%s sequences of dimension %d should contain %d items", error_prefix, (int)dim + 1, (int)dimsize[dim + 1]);
ok= 0;
@@ -89,7 +89,7 @@ static int validate_array_type(PyObject *seq, int dim, int totdim, int dimsize[]
}
else {
/* check that items are of correct type */
for (i= 0; i < PySequence_Length(seq); i++) {
for (i= 0; i < PySequence_Size(seq); i++) {
PyObject *item= PySequence_GetItem(seq, i);
if (!check_item_type(item)) {
@@ -114,7 +114,7 @@ static int count_items(PyObject *seq)
if (PySequence_Check(seq)) {
int i;
for (i= 0; i < PySequence_Length(seq); i++) {
for (i= 0; i < PySequence_Size(seq); i++) {
PyObject *item= PySequence_GetItem(seq, i);
totitem += count_items(item);
Py_DECREF(item);
@@ -211,7 +211,7 @@ static char *copy_values(PyObject *seq, PointerRNA *ptr, PropertyRNA *prop, int
unsigned int i;
int totdim= RNA_property_array_dimension(ptr, prop, NULL);
for (i= 0; i < PySequence_Length(seq); i++) {
for (i= 0; i < PySequence_Size(seq); i++) {
PyObject *item= PySequence_GetItem(seq, i);
if (dim + 1 < totdim) {