diff --git a/source/blender/blenkernel/intern/deform.c b/source/blender/blenkernel/intern/deform.c index 37c551a05b7..97780a30a5c 100644 --- a/source/blender/blenkernel/intern/deform.c +++ b/source/blender/blenkernel/intern/deform.c @@ -262,23 +262,24 @@ void defvert_flip(MDeformVert *dvert, const int *flip_map, const int flip_map_le void defvert_flip_merged(MDeformVert *dvert, const int *flip_map, const int flip_map_len) { - MDeformWeight *dw, *copydw; + MDeformWeight *dw, *dw_cpy; float weight; int i, totweight = dvert->totweight; /* copy weights */ - for (dw= dvert->dw, i=0; idw, i=0; i < totweight; dw++, i++) { if (dw->def_nr < flip_map_len) { if (flip_map[dw->def_nr] >= 0) { - copydw= defvert_verify_index(dvert, flip_map[dw->def_nr]); - dw= &dvert->dw[i]; /* in case array got realloced */ + /* error checkers complain of this but we'll never get NULL return */ + dw_cpy = defvert_verify_index(dvert, flip_map[dw->def_nr]); + dw = &dvert->dw[i]; /* in case array got realloced */ /* distribute weights: if only one of the vertex groups was - assigned this will halve the weights, otherwise it gets - evened out. this keeps it proportional to other groups */ - weight = 0.5f*(copydw->weight + dw->weight); - copydw->weight= weight; - dw->weight= weight; + * assigned this will halve the weights, otherwise it gets + * evened out. this keeps it proportional to other groups */ + weight = 0.5f * (dw_cpy->weight + dw->weight); + dw_cpy->weight = weight; + dw->weight = weight; } } } diff --git a/source/blender/blenlib/BLI_fileops.h b/source/blender/blenlib/BLI_fileops.h index fa1a61998d7..73220cbd739 100644 --- a/source/blender/blenlib/BLI_fileops.h +++ b/source/blender/blenlib/BLI_fileops.h @@ -45,6 +45,8 @@ extern "C" { /* for size_t (needed on windows) */ #include +struct gzFile; + /* Common */ int BLI_exists(const char *path); @@ -68,8 +70,8 @@ unsigned int BLI_dir_contents(const char *dir, struct direntry **filelist); /* Files */ -FILE * BLI_fopen(const char * filename, const char * mode); -void* BLI_gzopen(const char * filename, const char * mode); +FILE *BLI_fopen(const char *filename, const char *mode); +void *BLI_gzopen(const char *filename, const char *mode); int BLI_open(const char *filename, int oflag, int pmode); int BLI_file_is_writable(const char *file); diff --git a/source/blender/blenlib/intern/fileops.c b/source/blender/blenlib/intern/fileops.c index 9527ec9466b..9c53048dc5b 100644 --- a/source/blender/blenlib/intern/fileops.c +++ b/source/blender/blenlib/intern/fileops.c @@ -202,12 +202,12 @@ int BLI_file_touch(const char *file) static char str[MAXPATHLEN+12]; -FILE * BLI_fopen(const char * filename, const char * mode) +FILE *BLI_fopen(const char *filename, const char *mode) { return ufopen(filename, mode); } -gzFile BLI_gzopen(const char * filename, const char * mode) +gzFile BLI_gzopen(const char *filename, const char *mode) { gzFile gzfile; int fi; @@ -550,12 +550,12 @@ static int delete_single_file(const char *from, const char *UNUSED(to)) return recursiveOp_Callback_OK; } -FILE * BLI_fopen(const char * filename, const char * mode) +FILE *BLI_fopen(const char *filename, const char *mode) { return fopen(filename, mode); } -gzFile BLI_gzopen(const char * filename, const char * mode) +void *BLI_gzopen(const char *filename, const char *mode) { return gzopen(filename, mode); }