RNA compile error and warning fixes for MSVC.
This commit is contained in:
@@ -510,7 +510,7 @@ static void rna_generate_struct(BlenderRNA *brna, StructRNA *strct, FILE *f)
|
|||||||
}
|
}
|
||||||
case PROP_BOOLEAN: {
|
case PROP_BOOLEAN: {
|
||||||
BooleanPropertyRNA *bprop= (BooleanPropertyRNA*)prop;
|
BooleanPropertyRNA *bprop= (BooleanPropertyRNA*)prop;
|
||||||
int i;
|
unsigned int i;
|
||||||
|
|
||||||
if(bprop->defaultarray) {
|
if(bprop->defaultarray) {
|
||||||
fprintf(f, "static int rna_%s_%s_default[%d] = {", strct->cname, prop->cname, prop->arraylength);
|
fprintf(f, "static int rna_%s_%s_default[%d] = {", strct->cname, prop->cname, prop->arraylength);
|
||||||
@@ -527,7 +527,7 @@ static void rna_generate_struct(BlenderRNA *brna, StructRNA *strct, FILE *f)
|
|||||||
}
|
}
|
||||||
case PROP_INT: {
|
case PROP_INT: {
|
||||||
IntPropertyRNA *iprop= (IntPropertyRNA*)prop;
|
IntPropertyRNA *iprop= (IntPropertyRNA*)prop;
|
||||||
int i;
|
unsigned int i;
|
||||||
|
|
||||||
if(iprop->defaultarray) {
|
if(iprop->defaultarray) {
|
||||||
fprintf(f, "static int rna_%s_%s_default[%d] = {", strct->cname, prop->cname, prop->arraylength);
|
fprintf(f, "static int rna_%s_%s_default[%d] = {", strct->cname, prop->cname, prop->arraylength);
|
||||||
@@ -544,7 +544,7 @@ static void rna_generate_struct(BlenderRNA *brna, StructRNA *strct, FILE *f)
|
|||||||
}
|
}
|
||||||
case PROP_FLOAT: {
|
case PROP_FLOAT: {
|
||||||
FloatPropertyRNA *fprop= (FloatPropertyRNA*)prop;
|
FloatPropertyRNA *fprop= (FloatPropertyRNA*)prop;
|
||||||
int i;
|
unsigned int i;
|
||||||
|
|
||||||
if(fprop->defaultarray) {
|
if(fprop->defaultarray) {
|
||||||
fprintf(f, "static float rna_%s_%s_default[%d] = {", strct->cname, prop->cname, prop->arraylength);
|
fprintf(f, "static float rna_%s_%s_default[%d] = {", strct->cname, prop->cname, prop->arraylength);
|
||||||
|
@@ -383,7 +383,7 @@ void rna_iterator_array_begin(CollectionPropertyIterator *iter, void *ptr, int i
|
|||||||
|
|
||||||
internal= MEM_callocN(sizeof(ArrayIterator), "ArrayIterator");
|
internal= MEM_callocN(sizeof(ArrayIterator), "ArrayIterator");
|
||||||
internal->ptr= ptr;
|
internal->ptr= ptr;
|
||||||
internal->endptr= ptr+length*itemsize;
|
internal->endptr= ((char*)ptr)+length*itemsize;
|
||||||
|
|
||||||
iter->internal= internal;
|
iter->internal= internal;
|
||||||
iter->valid= (internal->ptr != internal->endptr);
|
iter->valid= (internal->ptr != internal->endptr);
|
||||||
|
@@ -272,11 +272,11 @@ PropertyRNA *RNA_def_property(StructRNA *strct, const char *cname, int type, int
|
|||||||
fprop= MEM_callocN(sizeof(FloatPropertyRNA), "FloatPropertyRNA");
|
fprop= MEM_callocN(sizeof(FloatPropertyRNA), "FloatPropertyRNA");
|
||||||
prop= &fprop->property;
|
prop= &fprop->property;
|
||||||
|
|
||||||
fprop->hardmin= (subtype == PROP_UNSIGNED)? 0: -FLT_MAX;
|
fprop->hardmin= (subtype == PROP_UNSIGNED)? 0.0f: -FLT_MAX;
|
||||||
fprop->hardmax= FLT_MAX;
|
fprop->hardmax= FLT_MAX;
|
||||||
|
|
||||||
fprop->softmin= (subtype == PROP_UNSIGNED)? 0: -10000; /* rather arbitrary .. */
|
fprop->softmin= (subtype == PROP_UNSIGNED)? 0.0f: -10000.0f; /* rather arbitrary .. */
|
||||||
fprop->softmax= 10000;
|
fprop->softmax= 10000.0f;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case PROP_STRING: {
|
case PROP_STRING: {
|
||||||
@@ -421,16 +421,16 @@ void RNA_def_property_range(PropertyRNA *prop, double min, double max)
|
|||||||
IntPropertyRNA *iprop= (IntPropertyRNA*)prop;
|
IntPropertyRNA *iprop= (IntPropertyRNA*)prop;
|
||||||
iprop->hardmin= (int)min;
|
iprop->hardmin= (int)min;
|
||||||
iprop->hardmax= (int)max;
|
iprop->hardmax= (int)max;
|
||||||
iprop->softmin= MAX2(min, iprop->hardmin);
|
iprop->softmin= MAX2((int)min, iprop->hardmin);
|
||||||
iprop->softmax= MIN2(max, iprop->hardmax);
|
iprop->softmax= MIN2((int)max, iprop->hardmax);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case PROP_FLOAT: {
|
case PROP_FLOAT: {
|
||||||
FloatPropertyRNA *fprop= (FloatPropertyRNA*)prop;
|
FloatPropertyRNA *fprop= (FloatPropertyRNA*)prop;
|
||||||
fprop->hardmin= (float)min;
|
fprop->hardmin= (float)min;
|
||||||
fprop->hardmax= (float)max;
|
fprop->hardmax= (float)max;
|
||||||
fprop->softmin= MAX2(min, fprop->hardmin);
|
fprop->softmin= MAX2((float)min, fprop->hardmin);
|
||||||
fprop->softmax= MIN2(max, fprop->hardmax);
|
fprop->softmax= MIN2((float)max, fprop->hardmax);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
Reference in New Issue
Block a user