forked from bartvdbraak/blender
- use %u rather tham %d for unsigned ints in string formatting funcs.
- replace (strlen(str) == 0) with str[0]=='\0'
This commit is contained in:
parent
6926060185
commit
c96f28a718
@ -133,7 +133,7 @@ std::istream& operator >> (std::istream& is,Vector& v)
|
|||||||
{ IOTrace("Stream input Vector (vector or ZERO)");
|
{ IOTrace("Stream input Vector (vector or ZERO)");
|
||||||
char storage[10];
|
char storage[10];
|
||||||
EatWord(is,"[]",storage,10);
|
EatWord(is,"[]",storage,10);
|
||||||
if (strlen(storage)==0) {
|
if (storage[0]=='\0') {
|
||||||
Eat(is,'[');
|
Eat(is,'[');
|
||||||
is >> v(0);
|
is >> v(0);
|
||||||
Eat(is,',');
|
Eat(is,',');
|
||||||
@ -194,7 +194,7 @@ std::istream& operator >> (std::istream& is,Rotation& r)
|
|||||||
{ IOTrace("Stream input Rotation (Matrix or EULERZYX, EULERZYZ,RPY, ROT, IDENTITY)");
|
{ IOTrace("Stream input Rotation (Matrix or EULERZYX, EULERZYZ,RPY, ROT, IDENTITY)");
|
||||||
char storage[10];
|
char storage[10];
|
||||||
EatWord(is,"[]",storage,10);
|
EatWord(is,"[]",storage,10);
|
||||||
if (strlen(storage)==0) {
|
if (storage[0]=='\0') {
|
||||||
Eat(is,'[');
|
Eat(is,'[');
|
||||||
for (int i=0;i<3;i++) {
|
for (int i=0;i<3;i++) {
|
||||||
is >> r(i,0);
|
is >> r(i,0);
|
||||||
@ -255,7 +255,7 @@ std::istream& operator >> (std::istream& is,Frame& T)
|
|||||||
{ IOTrace("Stream input Frame (Rotation,Vector) or DH[...]");
|
{ IOTrace("Stream input Frame (Rotation,Vector) or DH[...]");
|
||||||
char storage[10];
|
char storage[10];
|
||||||
EatWord(is,"[",storage,10);
|
EatWord(is,"[",storage,10);
|
||||||
if (strlen(storage)==0) {
|
if (storage[0]=='\0') {
|
||||||
Eat(is,'[');
|
Eat(is,'[');
|
||||||
is >> T.M;
|
is >> T.M;
|
||||||
is >> T.p;
|
is >> T.p;
|
||||||
|
@ -80,7 +80,7 @@ static void edge_store_from_mface_quad(EdgeUUID es[4], MFace *mf)
|
|||||||
edge_store_assign(es[3].verts, mf->v4, mf->v1);
|
edge_store_assign(es[3].verts, mf->v4, mf->v1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void edge_store_from_mface_tri(EdgeUUID es[3], MFace *mf)
|
static void edge_store_from_mface_tri(EdgeUUID es[4], MFace *mf)
|
||||||
{
|
{
|
||||||
edge_store_assign(es[0].verts, mf->v1, mf->v2);
|
edge_store_assign(es[0].verts, mf->v1, mf->v2);
|
||||||
edge_store_assign(es[1].verts, mf->v2, mf->v3);
|
edge_store_assign(es[1].verts, mf->v2, mf->v3);
|
||||||
@ -143,30 +143,30 @@ int BKE_mesh_validate_arrays(Mesh *me, MVert *UNUSED(mverts), unsigned int totve
|
|||||||
|
|
||||||
BLI_assert(!(do_fixes && me == NULL));
|
BLI_assert(!(do_fixes && me == NULL));
|
||||||
|
|
||||||
PRINT("ED_mesh_validate: verts(%d), edges(%d), faces(%d)\n", totvert, totedge, totface);
|
PRINT("ED_mesh_validate: verts(%u), edges(%u), faces(%u)\n", totvert, totedge, totface);
|
||||||
|
|
||||||
if(totedge == 0 && totface != 0) {
|
if(totedge == 0 && totface != 0) {
|
||||||
PRINT(" locical error, %d faces and 0 edges\n", totface);
|
PRINT(" locical error, %u faces and 0 edges\n", totface);
|
||||||
do_edge_recalc= TRUE;
|
do_edge_recalc= TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
for(i=0, med= medges; i<totedge; i++, med++) {
|
for(i=0, med= medges; i<totedge; i++, med++) {
|
||||||
int remove= FALSE;
|
int remove= FALSE;
|
||||||
if(med->v1 == med->v2) {
|
if(med->v1 == med->v2) {
|
||||||
PRINT(" edge %d: has matching verts, both %d\n", i, med->v1);
|
PRINT(" edge %u: has matching verts, both %u\n", i, med->v1);
|
||||||
remove= do_fixes;
|
remove= do_fixes;
|
||||||
}
|
}
|
||||||
if(med->v1 >= totvert) {
|
if(med->v1 >= totvert) {
|
||||||
PRINT(" edge %d: v1 index out of range, %d\n", i, med->v1);
|
PRINT(" edge %u: v1 index out of range, %u\n", i, med->v1);
|
||||||
remove= do_fixes;
|
remove= do_fixes;
|
||||||
}
|
}
|
||||||
if(med->v2 >= totvert) {
|
if(med->v2 >= totvert) {
|
||||||
PRINT(" edge %d: v2 index out of range, %d\n", i, med->v2);
|
PRINT(" edge %u: v2 index out of range, %u\n", i, med->v2);
|
||||||
remove= do_fixes;
|
remove= do_fixes;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(BLI_edgehash_haskey(edge_hash, med->v1, med->v2)) {
|
if(BLI_edgehash_haskey(edge_hash, med->v1, med->v2)) {
|
||||||
PRINT(" edge %d: is a duplicate of, %d\n", i, GET_INT_FROM_POINTER(BLI_edgehash_lookup(edge_hash, med->v1, med->v2)));
|
PRINT(" edge %u: is a duplicate of, %u\n", i, GET_INT_FROM_POINTER(BLI_edgehash_lookup(edge_hash, med->v1, med->v2)));
|
||||||
remove= do_fixes;
|
remove= do_fixes;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -187,41 +187,41 @@ int BKE_mesh_validate_arrays(Mesh *me, MVert *UNUSED(mverts), unsigned int totve
|
|||||||
do {
|
do {
|
||||||
fv[fidx]= *(&(mf->v1) + fidx);
|
fv[fidx]= *(&(mf->v1) + fidx);
|
||||||
if(fv[fidx] >= totvert) {
|
if(fv[fidx] >= totvert) {
|
||||||
PRINT(" face %d: 'v%d' index out of range, %d\n", i, fidx + 1, fv[fidx]);
|
PRINT(" face %u: 'v%d' index out of range, %u\n", i, fidx + 1, fv[fidx]);
|
||||||
remove= do_fixes;
|
remove= do_fixes;
|
||||||
}
|
}
|
||||||
} while (fidx--);
|
} while (fidx--);
|
||||||
|
|
||||||
if(remove == FALSE) {
|
if(remove == FALSE) {
|
||||||
if(mf->v4) {
|
if(mf->v4) {
|
||||||
if(mf->v1 == mf->v2) { PRINT(" face %d: verts invalid, v1/v2 both %d\n", i, mf->v1); remove= do_fixes; }
|
if(mf->v1 == mf->v2) { PRINT(" face %u: verts invalid, v1/v2 both %u\n", i, mf->v1); remove= do_fixes; }
|
||||||
if(mf->v1 == mf->v3) { PRINT(" face %d: verts invalid, v1/v3 both %d\n", i, mf->v1); remove= do_fixes; }
|
if(mf->v1 == mf->v3) { PRINT(" face %u: verts invalid, v1/v3 both %u\n", i, mf->v1); remove= do_fixes; }
|
||||||
if(mf->v1 == mf->v4) { PRINT(" face %d: verts invalid, v1/v4 both %d\n", i, mf->v1); remove= do_fixes; }
|
if(mf->v1 == mf->v4) { PRINT(" face %u: verts invalid, v1/v4 both %u\n", i, mf->v1); remove= do_fixes; }
|
||||||
|
|
||||||
if(mf->v2 == mf->v3) { PRINT(" face %d: verts invalid, v2/v3 both %d\n", i, mf->v2); remove= do_fixes; }
|
if(mf->v2 == mf->v3) { PRINT(" face %u: verts invalid, v2/v3 both %u\n", i, mf->v2); remove= do_fixes; }
|
||||||
if(mf->v2 == mf->v4) { PRINT(" face %d: verts invalid, v2/v4 both %d\n", i, mf->v2); remove= do_fixes; }
|
if(mf->v2 == mf->v4) { PRINT(" face %u: verts invalid, v2/v4 both %u\n", i, mf->v2); remove= do_fixes; }
|
||||||
|
|
||||||
if(mf->v3 == mf->v4) { PRINT(" face %d: verts invalid, v3/v4 both %d\n", i, mf->v3); remove= do_fixes; }
|
if(mf->v3 == mf->v4) { PRINT(" face %u: verts invalid, v3/v4 both %u\n", i, mf->v3); remove= do_fixes; }
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if(mf->v1 == mf->v2) { PRINT(" faceT %d: verts invalid, v1/v2 both %d\n", i, mf->v1); remove= do_fixes; }
|
if(mf->v1 == mf->v2) { PRINT(" faceT %u: verts invalid, v1/v2 both %u\n", i, mf->v1); remove= do_fixes; }
|
||||||
if(mf->v1 == mf->v3) { PRINT(" faceT %d: verts invalid, v1/v3 both %d\n", i, mf->v1); remove= do_fixes; }
|
if(mf->v1 == mf->v3) { PRINT(" faceT %u: verts invalid, v1/v3 both %u\n", i, mf->v1); remove= do_fixes; }
|
||||||
|
|
||||||
if(mf->v2 == mf->v3) { PRINT(" faceT %d: verts invalid, v2/v3 both %d\n", i, mf->v2); remove= do_fixes; }
|
if(mf->v2 == mf->v3) { PRINT(" faceT %u: verts invalid, v2/v3 both %u\n", i, mf->v2); remove= do_fixes; }
|
||||||
}
|
}
|
||||||
|
|
||||||
if(remove == FALSE) {
|
if(remove == FALSE) {
|
||||||
if(totedge) {
|
if(totedge) {
|
||||||
if(mf->v4) {
|
if(mf->v4) {
|
||||||
if(!BLI_edgehash_haskey(edge_hash, mf->v1, mf->v2)) { PRINT(" face %d: edge v1/v2 (%d,%d) is missing egde data\n", i, mf->v1, mf->v2); do_edge_recalc= TRUE; }
|
if(!BLI_edgehash_haskey(edge_hash, mf->v1, mf->v2)) { PRINT(" face %u: edge v1/v2 (%u,%u) is missing egde data\n", i, mf->v1, mf->v2); do_edge_recalc= TRUE; }
|
||||||
if(!BLI_edgehash_haskey(edge_hash, mf->v2, mf->v3)) { PRINT(" face %d: edge v2/v3 (%d,%d) is missing egde data\n", i, mf->v2, mf->v3); do_edge_recalc= TRUE; }
|
if(!BLI_edgehash_haskey(edge_hash, mf->v2, mf->v3)) { PRINT(" face %u: edge v2/v3 (%u,%u) is missing egde data\n", i, mf->v2, mf->v3); do_edge_recalc= TRUE; }
|
||||||
if(!BLI_edgehash_haskey(edge_hash, mf->v3, mf->v4)) { PRINT(" face %d: edge v3/v4 (%d,%d) is missing egde data\n", i, mf->v3, mf->v4); do_edge_recalc= TRUE; }
|
if(!BLI_edgehash_haskey(edge_hash, mf->v3, mf->v4)) { PRINT(" face %u: edge v3/v4 (%u,%u) is missing egde data\n", i, mf->v3, mf->v4); do_edge_recalc= TRUE; }
|
||||||
if(!BLI_edgehash_haskey(edge_hash, mf->v4, mf->v1)) { PRINT(" face %d: edge v4/v1 (%d,%d) is missing egde data\n", i, mf->v4, mf->v1); do_edge_recalc= TRUE; }
|
if(!BLI_edgehash_haskey(edge_hash, mf->v4, mf->v1)) { PRINT(" face %u: edge v4/v1 (%u,%u) is missing egde data\n", i, mf->v4, mf->v1); do_edge_recalc= TRUE; }
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if(!BLI_edgehash_haskey(edge_hash, mf->v1, mf->v2)) { PRINT(" face %d: edge v1/v2 (%d,%d) is missing egde data\n", i, mf->v1, mf->v2); do_edge_recalc= TRUE; }
|
if(!BLI_edgehash_haskey(edge_hash, mf->v1, mf->v2)) { PRINT(" face %u: edge v1/v2 (%u,%u) is missing egde data\n", i, mf->v1, mf->v2); do_edge_recalc= TRUE; }
|
||||||
if(!BLI_edgehash_haskey(edge_hash, mf->v2, mf->v3)) { PRINT(" face %d: edge v2/v3 (%d,%d) is missing egde data\n", i, mf->v2, mf->v3); do_edge_recalc= TRUE; }
|
if(!BLI_edgehash_haskey(edge_hash, mf->v2, mf->v3)) { PRINT(" face %u: edge v2/v3 (%u,%u) is missing egde data\n", i, mf->v2, mf->v3); do_edge_recalc= TRUE; }
|
||||||
if(!BLI_edgehash_haskey(edge_hash, mf->v3, mf->v1)) { PRINT(" face %d: edge v3/v1 (%d,%d) is missing egde data\n", i, mf->v3, mf->v1); do_edge_recalc= TRUE; }
|
if(!BLI_edgehash_haskey(edge_hash, mf->v3, mf->v1)) { PRINT(" face %u: edge v3/v1 (%u,%u) is missing egde data\n", i, mf->v3, mf->v1); do_edge_recalc= TRUE; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -261,10 +261,10 @@ int BKE_mesh_validate_arrays(Mesh *me, MVert *UNUSED(mverts), unsigned int totve
|
|||||||
if(do_verbose) {
|
if(do_verbose) {
|
||||||
mf_prev= mfaces + sf_prev->index;
|
mf_prev= mfaces + sf_prev->index;
|
||||||
if(mf->v4) {
|
if(mf->v4) {
|
||||||
PRINT(" face %d & %d: are duplicates (%d,%d,%d,%d) (%d,%d,%d,%d)\n", sf->index, sf_prev->index, mf->v1, mf->v2, mf->v3, mf->v4, mf_prev->v1, mf_prev->v2, mf_prev->v3, mf_prev->v4);
|
PRINT(" face %u & %u: are duplicates (%u,%u,%u,%u) (%u,%u,%u,%u)\n", sf->index, sf_prev->index, mf->v1, mf->v2, mf->v3, mf->v4, mf_prev->v1, mf_prev->v2, mf_prev->v3, mf_prev->v4);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
PRINT(" face %d & %d: are duplicates (%d,%d,%d) (%d,%d,%d)\n", sf->index, sf_prev->index, mf->v1, mf->v2, mf->v3, mf_prev->v1, mf_prev->v2, mf_prev->v3);
|
PRINT(" face %u & %u: are duplicates (%u,%u,%u) (%u,%u,%u)\n", sf->index, sf_prev->index, mf->v1, mf->v2, mf->v3, mf_prev->v1, mf_prev->v2, mf_prev->v3);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -967,12 +967,12 @@ static int ptcache_filename(PTCacheID *pid, char *filename, int cfra, short do_p
|
|||||||
|
|
||||||
if(pid->cache->flag & PTCACHE_EXTERNAL) {
|
if(pid->cache->flag & PTCACHE_EXTERNAL) {
|
||||||
if(pid->cache->index >= 0)
|
if(pid->cache->index >= 0)
|
||||||
snprintf(newname, MAX_PTCACHE_FILE, "_%06d_%02d"PTCACHE_EXT, cfra, pid->stack_index); /* always 6 chars */
|
snprintf(newname, MAX_PTCACHE_FILE, "_%06d_%02u"PTCACHE_EXT, cfra, pid->stack_index); /* always 6 chars */
|
||||||
else
|
else
|
||||||
snprintf(newname, MAX_PTCACHE_FILE, "_%06d"PTCACHE_EXT, cfra); /* always 6 chars */
|
snprintf(newname, MAX_PTCACHE_FILE, "_%06d"PTCACHE_EXT, cfra); /* always 6 chars */
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
snprintf(newname, MAX_PTCACHE_FILE, "_%06d_%02d"PTCACHE_EXT, cfra, pid->stack_index); /* always 6 chars */
|
snprintf(newname, MAX_PTCACHE_FILE, "_%06d_%02u"PTCACHE_EXT, cfra, pid->stack_index); /* always 6 chars */
|
||||||
}
|
}
|
||||||
len += 16;
|
len += 16;
|
||||||
}
|
}
|
||||||
@ -2002,7 +2002,7 @@ void BKE_ptcache_id_clear(PTCacheID *pid, int mode, unsigned int cfra)
|
|||||||
if (dir==NULL)
|
if (dir==NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
snprintf(ext, sizeof(ext), "_%02d"PTCACHE_EXT, pid->stack_index);
|
snprintf(ext, sizeof(ext), "_%02u"PTCACHE_EXT, pid->stack_index);
|
||||||
|
|
||||||
while ((de = readdir(dir)) != NULL) {
|
while ((de = readdir(dir)) != NULL) {
|
||||||
if (strstr(de->d_name, ext)) { /* do we have the right extension?*/
|
if (strstr(de->d_name, ext)) { /* do we have the right extension?*/
|
||||||
@ -2204,7 +2204,7 @@ void BKE_ptcache_id_time(PTCacheID *pid, Scene *scene, float cfra, int *startfra
|
|||||||
if (dir==NULL)
|
if (dir==NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
snprintf(ext, sizeof(ext), "_%02d"PTCACHE_EXT, pid->stack_index);
|
snprintf(ext, sizeof(ext), "_%02u"PTCACHE_EXT, pid->stack_index);
|
||||||
|
|
||||||
while ((de = readdir(dir)) != NULL) {
|
while ((de = readdir(dir)) != NULL) {
|
||||||
if (strstr(de->d_name, ext)) { /* do we have the right extension?*/
|
if (strstr(de->d_name, ext)) { /* do we have the right extension?*/
|
||||||
@ -2904,7 +2904,7 @@ void BKE_ptcache_disk_cache_rename(PTCacheID *pid, char *from, char *to)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
snprintf(ext, sizeof(ext), "_%02d"PTCACHE_EXT, pid->stack_index);
|
snprintf(ext, sizeof(ext), "_%02u"PTCACHE_EXT, pid->stack_index);
|
||||||
|
|
||||||
/* put new name into cache */
|
/* put new name into cache */
|
||||||
strcpy(pid->cache->name, to);
|
strcpy(pid->cache->name, to);
|
||||||
|
@ -115,7 +115,7 @@ void BLO_blendhandle_print_sizes(BlendHandle *bh, void *fp)
|
|||||||
buf[2]= buf[2]?buf[2]:' ';
|
buf[2]= buf[2]?buf[2]:' ';
|
||||||
buf[3]= buf[3]?buf[3]:' ';
|
buf[3]= buf[3]?buf[3]:' ';
|
||||||
|
|
||||||
fprintf(fp, "['%.4s', '%s', %d, %ld ], \n", buf, name, bhead->nr, (long int)bhead->len+sizeof(BHead));
|
fprintf(fp, "['%.4s', '%s', %d, %ld ], \n", buf, name, bhead->nr, (long int)(bhead->len+sizeof(BHead)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fprintf(fp, "]\n");
|
fprintf(fp, "]\n");
|
||||||
|
@ -10063,7 +10063,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
|
|||||||
* to have them show in RNA viewer and accessible otherwise.
|
* to have them show in RNA viewer and accessible otherwise.
|
||||||
*/
|
*/
|
||||||
for(ma= main->mat.first; ma; ma= ma->id.next) {
|
for(ma= main->mat.first; ma; ma= ma->id.next) {
|
||||||
if(ma->nodetree && strlen(ma->nodetree->id.name)==0)
|
if(ma->nodetree && ma->nodetree->id.name[0] == '\0')
|
||||||
strcpy(ma->nodetree->id.name, "NTShader Nodetree");
|
strcpy(ma->nodetree->id.name, "NTShader Nodetree");
|
||||||
|
|
||||||
/* which_output 0 is now "not specified" */
|
/* which_output 0 is now "not specified" */
|
||||||
@ -10077,7 +10077,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
|
|||||||
}
|
}
|
||||||
/* and composit trees */
|
/* and composit trees */
|
||||||
for(sce= main->scene.first; sce; sce= sce->id.next) {
|
for(sce= main->scene.first; sce; sce= sce->id.next) {
|
||||||
if(sce->nodetree && strlen(sce->nodetree->id.name)==0)
|
if(sce->nodetree && sce->nodetree->id.name[0] == '\0')
|
||||||
strcpy(sce->nodetree->id.name, "NTCompositing Nodetree");
|
strcpy(sce->nodetree->id.name, "NTCompositing Nodetree");
|
||||||
|
|
||||||
/* move to cameras */
|
/* move to cameras */
|
||||||
@ -10099,7 +10099,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
|
|||||||
bNode *node;
|
bNode *node;
|
||||||
|
|
||||||
if(tx->nodetree) {
|
if(tx->nodetree) {
|
||||||
if(strlen(tx->nodetree->id.name)==0)
|
if(tx->nodetree->id.name[0] == '\0')
|
||||||
strcpy(tx->nodetree->id.name, "NTTexture Nodetree");
|
strcpy(tx->nodetree->id.name, "NTTexture Nodetree");
|
||||||
|
|
||||||
/* which_output 0 is now "not specified" */
|
/* which_output 0 is now "not specified" */
|
||||||
|
@ -339,7 +339,7 @@ void debug_markers_print_list(ListBase *markers)
|
|||||||
printf("List of markers follows: -----\n");
|
printf("List of markers follows: -----\n");
|
||||||
|
|
||||||
for (marker = markers->first; marker; marker = marker->next) {
|
for (marker = markers->first; marker; marker = marker->next) {
|
||||||
printf("\t'%s' on %d at %p with %d\n", marker->name, marker->frame, (void *)marker, marker->flag);
|
printf("\t'%s' on %d at %p with %u\n", marker->name, marker->frame, (void *)marker, marker->flag);
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("End of list ------------------\n");
|
printf("End of list ------------------\n");
|
||||||
|
@ -162,7 +162,7 @@ static void draw_modifier__generator(uiLayout *layout, ID *id, FModifier *fcm, s
|
|||||||
if (i == 1)
|
if (i == 1)
|
||||||
strcpy(xval, "x");
|
strcpy(xval, "x");
|
||||||
else
|
else
|
||||||
sprintf(xval, "x^%d", i);
|
sprintf(xval, "x^%u", i);
|
||||||
uiDefBut(block, LABEL, 1, xval, 0, 0, 50, 20, NULL, 0.0, 0.0, 0, 0, "Power of x");
|
uiDefBut(block, LABEL, 1, xval, 0, 0, 50, 20, NULL, 0.0, 0.0, 0, 0, "Power of x");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1280,7 +1280,7 @@ static int meshdeform_bind_exec(bContext *C, wmOperator *op)
|
|||||||
return OPERATOR_CANCELLED;
|
return OPERATOR_CANCELLED;
|
||||||
|
|
||||||
if(mmd->bindcagecos) {
|
if(mmd->bindcagecos) {
|
||||||
if(mmd->bindcagecos) MEM_freeN(mmd->bindcagecos);
|
MEM_freeN(mmd->bindcagecos);
|
||||||
if(mmd->dyngrid) MEM_freeN(mmd->dyngrid);
|
if(mmd->dyngrid) MEM_freeN(mmd->dyngrid);
|
||||||
if(mmd->dyninfluences) MEM_freeN(mmd->dyninfluences);
|
if(mmd->dyninfluences) MEM_freeN(mmd->dyninfluences);
|
||||||
if(mmd->bindinfluences) MEM_freeN(mmd->bindinfluences);
|
if(mmd->bindinfluences) MEM_freeN(mmd->bindinfluences);
|
||||||
|
@ -291,7 +291,7 @@ static void gpu_parse_functions_string(GHash *hash, char *code)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(strlen(function->name) == 0 || function->totparam == 0) {
|
if(function->name[0] == '\0' || function->totparam == 0) {
|
||||||
fprintf(stderr, "GPU functions parse error.\n");
|
fprintf(stderr, "GPU functions parse error.\n");
|
||||||
MEM_freeN(function);
|
MEM_freeN(function);
|
||||||
break;
|
break;
|
||||||
|
@ -1426,12 +1426,12 @@ void DirectDrawSurface::printInfo() const
|
|||||||
if (header.flags & DDSD_LINEARSIZE) printf("\tDDSD_LINEARSIZE\n");
|
if (header.flags & DDSD_LINEARSIZE) printf("\tDDSD_LINEARSIZE\n");
|
||||||
if (header.flags & DDSD_MIPMAPCOUNT) printf("\tDDSD_MIPMAPCOUNT\n");
|
if (header.flags & DDSD_MIPMAPCOUNT) printf("\tDDSD_MIPMAPCOUNT\n");
|
||||||
|
|
||||||
printf("Height: %d\n", header.height);
|
printf("Height: %u\n", header.height);
|
||||||
printf("Width: %d\n", header.width);
|
printf("Width: %u\n", header.width);
|
||||||
printf("Depth: %d\n", header.depth);
|
printf("Depth: %u\n", header.depth);
|
||||||
if (header.flags & DDSD_PITCH) printf("Pitch: %d\n", header.pitch);
|
if (header.flags & DDSD_PITCH) printf("Pitch: %u\n", header.pitch);
|
||||||
else if (header.flags & DDSD_LINEARSIZE) printf("Linear size: %d\n", header.pitch);
|
else if (header.flags & DDSD_LINEARSIZE) printf("Linear size: %u\n", header.pitch);
|
||||||
printf("Mipmap count: %d\n", header.mipmapcount);
|
printf("Mipmap count: %u\n", header.mipmapcount);
|
||||||
|
|
||||||
printf("Pixel Format:\n");
|
printf("Pixel Format:\n");
|
||||||
printf("\tFlags: 0x%.8X\n", header.pf.flags);
|
printf("\tFlags: 0x%.8X\n", header.pf.flags);
|
||||||
@ -1468,7 +1468,7 @@ void DirectDrawSurface::printInfo() const
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
printf("\tBit count: %d\n", header.pf.bitcount);
|
printf("\tBit count: %u\n", header.pf.bitcount);
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("\tRed mask: 0x%.8X\n", header.pf.rmask);
|
printf("\tRed mask: 0x%.8X\n", header.pf.rmask);
|
||||||
@ -1522,7 +1522,7 @@ void DirectDrawSurface::printInfo() const
|
|||||||
|
|
||||||
if (header.reserved[7] == FOURCC_UVER)
|
if (header.reserved[7] == FOURCC_UVER)
|
||||||
{
|
{
|
||||||
printf("User Version: %d\n", header.reserved[8]);
|
printf("User Version: %u\n", header.reserved[8]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -646,7 +646,7 @@ void imb_loadtiletiff(ImBuf *ibuf, unsigned char *mem, size_t size, int tx, int
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
printf("imb_loadtiff: mipmap level %d has unexpected size %dx%d instead of %dx%d\n", ibuf->miplevel, width, height, ibuf->x, ibuf->y);
|
printf("imb_loadtiff: mipmap level %d has unexpected size %ux%u instead of %dx%d\n", ibuf->miplevel, width, height, ibuf->x, ibuf->y);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
printf("imb_loadtiff: could not find mipmap level %d\n", ibuf->miplevel);
|
printf("imb_loadtiff: could not find mipmap level %d\n", ibuf->miplevel);
|
||||||
|
@ -569,7 +569,7 @@ static char *rna_def_property_get_func(FILE *f, StructRNA *srna, PropertyRNA *pr
|
|||||||
if(prop->flag & PROP_DYNAMIC)
|
if(prop->flag & PROP_DYNAMIC)
|
||||||
fprintf(f, "void %s(PointerRNA *ptr, %s values[])\n", func, rna_type_type(prop));
|
fprintf(f, "void %s(PointerRNA *ptr, %s values[])\n", func, rna_type_type(prop));
|
||||||
else
|
else
|
||||||
fprintf(f, "void %s(PointerRNA *ptr, %s values[%d])\n", func, rna_type_type(prop), prop->totarraylength);
|
fprintf(f, "void %s(PointerRNA *ptr, %s values[%u])\n", func, rna_type_type(prop), prop->totarraylength);
|
||||||
fprintf(f, "{\n");
|
fprintf(f, "{\n");
|
||||||
|
|
||||||
if(manualfunc) {
|
if(manualfunc) {
|
||||||
@ -587,7 +587,7 @@ static char *rna_def_property_get_func(FILE *f, StructRNA *srna, PropertyRNA *pr
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
fprintf(f, " int i;\n\n");
|
fprintf(f, " int i;\n\n");
|
||||||
fprintf(f, " for(i=0; i<%d; i++) {\n", prop->totarraylength);
|
fprintf(f, " for(i=0; i<%u; i++) {\n", prop->totarraylength);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(dp->dnaarraylength == 1) {
|
if(dp->dnaarraylength == 1) {
|
||||||
@ -783,7 +783,7 @@ static char *rna_def_property_set_func(FILE *f, StructRNA *srna, PropertyRNA *pr
|
|||||||
if(prop->flag & PROP_DYNAMIC)
|
if(prop->flag & PROP_DYNAMIC)
|
||||||
fprintf(f, "void %s(PointerRNA *ptr, const %s values[])\n", func, rna_type_type(prop));
|
fprintf(f, "void %s(PointerRNA *ptr, const %s values[])\n", func, rna_type_type(prop));
|
||||||
else
|
else
|
||||||
fprintf(f, "void %s(PointerRNA *ptr, const %s values[%d])\n", func, rna_type_type(prop), prop->totarraylength);
|
fprintf(f, "void %s(PointerRNA *ptr, const %s values[%u])\n", func, rna_type_type(prop), prop->totarraylength);
|
||||||
fprintf(f, "{\n");
|
fprintf(f, "{\n");
|
||||||
|
|
||||||
if(manualfunc) {
|
if(manualfunc) {
|
||||||
@ -803,7 +803,7 @@ static char *rna_def_property_set_func(FILE *f, StructRNA *srna, PropertyRNA *pr
|
|||||||
else {
|
else {
|
||||||
fprintf(f, " int i;\n\n");
|
fprintf(f, " int i;\n\n");
|
||||||
rna_clamp_value_range(f, prop);
|
rna_clamp_value_range(f, prop);
|
||||||
fprintf(f, " for(i=0; i<%d; i++) {\n", prop->totarraylength);
|
fprintf(f, " for(i=0; i<%u; i++) {\n", prop->totarraylength);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(dp->dnaarraylength == 1) {
|
if(dp->dnaarraylength == 1) {
|
||||||
@ -1324,7 +1324,7 @@ static void rna_def_property_funcs_header(FILE *f, StructRNA *srna, PropertyDefR
|
|||||||
//fprintf(f, "void %sset(PointerRNA *ptr, int value);\n", func);
|
//fprintf(f, "void %sset(PointerRNA *ptr, int value);\n", func);
|
||||||
}
|
}
|
||||||
else if(prop->arraydimension && prop->totarraylength) {
|
else if(prop->arraydimension && prop->totarraylength) {
|
||||||
fprintf(f, "void %sget(PointerRNA *ptr, int values[%d]);\n", func, prop->totarraylength);
|
fprintf(f, "void %sget(PointerRNA *ptr, int values[%u]);\n", func, prop->totarraylength);
|
||||||
//fprintf(f, "void %sset(PointerRNA *ptr, const int values[%d]);\n", func, prop->arraylength);
|
//fprintf(f, "void %sset(PointerRNA *ptr, const int values[%d]);\n", func, prop->arraylength);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -1339,7 +1339,7 @@ static void rna_def_property_funcs_header(FILE *f, StructRNA *srna, PropertyDefR
|
|||||||
//fprintf(f, "void %sset(PointerRNA *ptr, float value);\n", func);
|
//fprintf(f, "void %sset(PointerRNA *ptr, float value);\n", func);
|
||||||
}
|
}
|
||||||
else if(prop->arraydimension && prop->totarraylength) {
|
else if(prop->arraydimension && prop->totarraylength) {
|
||||||
fprintf(f, "void %sget(PointerRNA *ptr, float values[%d]);\n", func, prop->totarraylength);
|
fprintf(f, "void %sget(PointerRNA *ptr, float values[%u]);\n", func, prop->totarraylength);
|
||||||
//fprintf(f, "void %sset(PointerRNA *ptr, const float values[%d]);\n", func, prop->arraylength);
|
//fprintf(f, "void %sset(PointerRNA *ptr, const float values[%d]);\n", func, prop->arraylength);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -1420,21 +1420,21 @@ static void rna_def_property_funcs_header_cpp(FILE *f, StructRNA *srna, Property
|
|||||||
if(!prop->arraydimension)
|
if(!prop->arraydimension)
|
||||||
fprintf(f, "\tinline bool %s(void);", rna_safe_id(prop->identifier));
|
fprintf(f, "\tinline bool %s(void);", rna_safe_id(prop->identifier));
|
||||||
else
|
else
|
||||||
fprintf(f, "\tinline Array<int, %d> %s(void);", prop->totarraylength, rna_safe_id(prop->identifier));
|
fprintf(f, "\tinline Array<int, %u> %s(void);", prop->totarraylength, rna_safe_id(prop->identifier));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case PROP_INT: {
|
case PROP_INT: {
|
||||||
if(!prop->arraydimension)
|
if(!prop->arraydimension)
|
||||||
fprintf(f, "\tinline int %s(void);", rna_safe_id(prop->identifier));
|
fprintf(f, "\tinline int %s(void);", rna_safe_id(prop->identifier));
|
||||||
else
|
else
|
||||||
fprintf(f, "\tinline Array<int, %d> %s(void);", prop->totarraylength, rna_safe_id(prop->identifier));
|
fprintf(f, "\tinline Array<int, %u> %s(void);", prop->totarraylength, rna_safe_id(prop->identifier));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case PROP_FLOAT: {
|
case PROP_FLOAT: {
|
||||||
if(!prop->arraydimension)
|
if(!prop->arraydimension)
|
||||||
fprintf(f, "\tinline float %s(void);", rna_safe_id(prop->identifier));
|
fprintf(f, "\tinline float %s(void);", rna_safe_id(prop->identifier));
|
||||||
else
|
else
|
||||||
fprintf(f, "\tinline Array<float, %d> %s(void);", prop->totarraylength, rna_safe_id(prop->identifier));
|
fprintf(f, "\tinline Array<float, %u> %s(void);", prop->totarraylength, rna_safe_id(prop->identifier));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case PROP_ENUM: {
|
case PROP_ENUM: {
|
||||||
@ -1495,21 +1495,21 @@ static void rna_def_property_funcs_impl_cpp(FILE *f, StructRNA *srna, PropertyDe
|
|||||||
if(!prop->arraydimension)
|
if(!prop->arraydimension)
|
||||||
fprintf(f, "\tBOOLEAN_PROPERTY(%s, %s)", srna->identifier, rna_safe_id(prop->identifier));
|
fprintf(f, "\tBOOLEAN_PROPERTY(%s, %s)", srna->identifier, rna_safe_id(prop->identifier));
|
||||||
else
|
else
|
||||||
fprintf(f, "\tBOOLEAN_ARRAY_PROPERTY(%s, %d, %s)", srna->identifier, prop->totarraylength, rna_safe_id(prop->identifier));
|
fprintf(f, "\tBOOLEAN_ARRAY_PROPERTY(%s, %u, %s)", srna->identifier, prop->totarraylength, rna_safe_id(prop->identifier));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case PROP_INT: {
|
case PROP_INT: {
|
||||||
if(!prop->arraydimension)
|
if(!prop->arraydimension)
|
||||||
fprintf(f, "\tINT_PROPERTY(%s, %s)", srna->identifier, rna_safe_id(prop->identifier));
|
fprintf(f, "\tINT_PROPERTY(%s, %s)", srna->identifier, rna_safe_id(prop->identifier));
|
||||||
else
|
else
|
||||||
fprintf(f, "\tINT_ARRAY_PROPERTY(%s, %d, %s)", srna->identifier, prop->totarraylength, rna_safe_id(prop->identifier));
|
fprintf(f, "\tINT_ARRAY_PROPERTY(%s, %u, %s)", srna->identifier, prop->totarraylength, rna_safe_id(prop->identifier));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case PROP_FLOAT: {
|
case PROP_FLOAT: {
|
||||||
if(!prop->arraydimension)
|
if(!prop->arraydimension)
|
||||||
fprintf(f, "\tFLOAT_PROPERTY(%s, %s)", srna->identifier, rna_safe_id(prop->identifier));
|
fprintf(f, "\tFLOAT_PROPERTY(%s, %s)", srna->identifier, rna_safe_id(prop->identifier));
|
||||||
else
|
else
|
||||||
fprintf(f, "\tFLOAT_ARRAY_PROPERTY(%s, %d, %s)", srna->identifier, prop->totarraylength, rna_safe_id(prop->identifier));
|
fprintf(f, "\tFLOAT_ARRAY_PROPERTY(%s, %u, %s)", srna->identifier, prop->totarraylength, rna_safe_id(prop->identifier));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case PROP_ENUM: {
|
case PROP_ENUM: {
|
||||||
@ -2028,7 +2028,7 @@ static void rna_generate_static_parameter_prototypes(BlenderRNA *brna, StructRNA
|
|||||||
fprintf(f, "int %s%s_len, ", pout ? "*" : "", dparm->prop->identifier);
|
fprintf(f, "int %s%s_len, ", pout ? "*" : "", dparm->prop->identifier);
|
||||||
|
|
||||||
if(!(flag & PROP_DYNAMIC) && dparm->prop->arraydimension)
|
if(!(flag & PROP_DYNAMIC) && dparm->prop->arraydimension)
|
||||||
fprintf(f, "%s%s %s[%d]", rna_type_struct(dparm->prop), rna_parameter_type_name(dparm->prop), dparm->prop->identifier, dparm->prop->totarraylength);
|
fprintf(f, "%s%s %s[%u]", rna_type_struct(dparm->prop), rna_parameter_type_name(dparm->prop), dparm->prop->identifier, dparm->prop->totarraylength);
|
||||||
else
|
else
|
||||||
fprintf(f, "%s%s %s%s", rna_type_struct(dparm->prop), rna_parameter_type_name(dparm->prop), ptrstr, dparm->prop->identifier);
|
fprintf(f, "%s%s %s%s", rna_type_struct(dparm->prop), rna_parameter_type_name(dparm->prop), ptrstr, dparm->prop->identifier);
|
||||||
|
|
||||||
@ -2129,7 +2129,7 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr
|
|||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
if(prop->arraydimension && prop->totarraylength) {
|
if(prop->arraydimension && prop->totarraylength) {
|
||||||
fprintf(f, "static int rna_%s%s_%s_default[%d] = {\n\t", srna->identifier, strnest, prop->identifier, prop->totarraylength);
|
fprintf(f, "static int rna_%s%s_%s_default[%u] = {\n\t", srna->identifier, strnest, prop->identifier, prop->totarraylength);
|
||||||
|
|
||||||
for(i=0; i<prop->totarraylength; i++) {
|
for(i=0; i<prop->totarraylength; i++) {
|
||||||
if(bprop->defaultarray)
|
if(bprop->defaultarray)
|
||||||
@ -2149,7 +2149,7 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr
|
|||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
if(prop->arraydimension && prop->totarraylength) {
|
if(prop->arraydimension && prop->totarraylength) {
|
||||||
fprintf(f, "static int rna_%s%s_%s_default[%d] = {\n\t", srna->identifier, strnest, prop->identifier, prop->totarraylength);
|
fprintf(f, "static int rna_%s%s_%s_default[%u] = {\n\t", srna->identifier, strnest, prop->identifier, prop->totarraylength);
|
||||||
|
|
||||||
for(i=0; i<prop->totarraylength; i++) {
|
for(i=0; i<prop->totarraylength; i++) {
|
||||||
if(iprop->defaultarray)
|
if(iprop->defaultarray)
|
||||||
@ -2169,7 +2169,7 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr
|
|||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
if(prop->arraydimension && prop->totarraylength) {
|
if(prop->arraydimension && prop->totarraylength) {
|
||||||
fprintf(f, "static float rna_%s%s_%s_default[%d] = {\n\t", srna->identifier, strnest, prop->identifier, prop->totarraylength);
|
fprintf(f, "static float rna_%s%s_%s_default[%u] = {\n\t", srna->identifier, strnest, prop->identifier, prop->totarraylength);
|
||||||
|
|
||||||
for(i=0; i<prop->totarraylength; i++) {
|
for(i=0; i<prop->totarraylength; i++) {
|
||||||
if(fprop->defaultarray)
|
if(fprop->defaultarray)
|
||||||
@ -2200,7 +2200,7 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr
|
|||||||
rna_print_c_string(f, prop->name); fprintf(f, ",\n\t");
|
rna_print_c_string(f, prop->name); fprintf(f, ",\n\t");
|
||||||
rna_print_c_string(f, prop->description); fprintf(f, ",\n\t");
|
rna_print_c_string(f, prop->description); fprintf(f, ",\n\t");
|
||||||
fprintf(f, "%d,\n", prop->icon);
|
fprintf(f, "%d,\n", prop->icon);
|
||||||
fprintf(f, "\t%s, %s|%s, %s, %d, {%d, %d, %d}, %d,\n", RNA_property_typename(prop->type), rna_property_subtypename(prop->subtype), rna_property_subtype_unit(prop->subtype), rna_function_string(prop->getlength), prop->arraydimension, prop->arraylength[0], prop->arraylength[1], prop->arraylength[2], prop->totarraylength);
|
fprintf(f, "\t%s, %s|%s, %s, %u, {%u, %u, %u}, %u,\n", RNA_property_typename(prop->type), rna_property_subtypename(prop->subtype), rna_property_subtype_unit(prop->subtype), rna_function_string(prop->getlength), prop->arraydimension, prop->arraylength[0], prop->arraylength[1], prop->arraylength[2], prop->totarraylength);
|
||||||
fprintf(f, "\t%s%s, %d, %s, %s,\n", (prop->flag & PROP_CONTEXT_UPDATE)? "(UpdateFunc)": "", rna_function_string(prop->update), prop->noteflag, rna_function_string(prop->editable), rna_function_string(prop->itemeditable));
|
fprintf(f, "\t%s%s, %d, %s, %s,\n", (prop->flag & PROP_CONTEXT_UPDATE)? "(UpdateFunc)": "", rna_function_string(prop->update), prop->noteflag, rna_function_string(prop->editable), rna_function_string(prop->itemeditable));
|
||||||
|
|
||||||
if(prop->flag & PROP_RAW_ACCESS) rna_set_raw_offset(f, srna, prop);
|
if(prop->flag & PROP_RAW_ACCESS) rna_set_raw_offset(f, srna, prop);
|
||||||
|
@ -1049,7 +1049,7 @@ void RNA_def_property_array(PropertyRNA *prop, int length)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(prop->arraydimension > 1) {
|
if(prop->arraydimension > 1) {
|
||||||
fprintf(stderr, "RNA_def_property_array: \"%s.%s\", array dimensions has been set to %d but would be overwritten as 1.\n", srna->identifier, prop->identifier, prop->arraydimension);
|
fprintf(stderr, "RNA_def_property_array: \"%s.%s\", array dimensions has been set to %u but would be overwritten as 1.\n", srna->identifier, prop->identifier, prop->arraydimension);
|
||||||
DefRNA.error= 1;
|
DefRNA.error= 1;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -152,7 +152,7 @@ bool SCA_RandomActuator::Update()
|
|||||||
/* If x_1, x_2, ... is a sequence of random numbers with uniform */
|
/* If x_1, x_2, ... is a sequence of random numbers with uniform */
|
||||||
/* distribution between zero and one, k is the first integer for */
|
/* distribution between zero and one, k is the first integer for */
|
||||||
/* which the product x_1*x_2*...*x_k < exp(-\lamba). */
|
/* which the product x_1*x_2*...*x_k < exp(-\lamba). */
|
||||||
float a = 0.0, b = 0.0;
|
float a, b;
|
||||||
int res = 0;
|
int res = 0;
|
||||||
/* The - sign is important here! The number to test for, a, must be */
|
/* The - sign is important here! The number to test for, a, must be */
|
||||||
/* between 0 and 1. */
|
/* between 0 and 1. */
|
||||||
|
@ -105,7 +105,7 @@ Exception::Exception (ExceptionID & expID, RESULT rslt, const char * fil, int li
|
|||||||
: m_expID (&expID), m_hRslt (rslt)
|
: m_expID (&expID), m_hRslt (rslt)
|
||||||
{
|
{
|
||||||
// set file and line
|
// set file and line
|
||||||
if (strlen(fil) > 0 || lin > 0)
|
if (fil[0] != '\0' || lin > 0)
|
||||||
setFileLine (fil, lin);
|
setFileLine (fil, lin);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user