fixes for errors/warnings found with cppcheck
This commit is contained in:
@@ -182,11 +182,11 @@ AviError AVI_print_error (AviError in_error) {
|
||||
|
||||
return in_error;
|
||||
}
|
||||
|
||||
/*
|
||||
void AVI_set_debug (int mode) {
|
||||
AVI_DEBUG= mode;
|
||||
}
|
||||
|
||||
*/
|
||||
/*
|
||||
int AVI_is_avi (char *name) {
|
||||
FILE *fp;
|
||||
|
@@ -352,7 +352,8 @@ int cdf_write_open(CDataFile *cdf, char *filename)
|
||||
|
||||
/* fill header */
|
||||
header= &cdf->header;
|
||||
strcpy(header->ID, "BCDF");
|
||||
/* strcpy(, "BCDF"); // terminator out of range */
|
||||
header->ID[0]= 'B'; header->ID[1]= 'C'; header->ID[2]= 'D'; header->ID[3]= 'F';
|
||||
header->endian= cdf_endian();
|
||||
header->version= CDF_VERSION;
|
||||
header->subversion= CDF_SUBVERSION;
|
||||
|
@@ -52,13 +52,3 @@
|
||||
* since we have to force clearing all Python related data before freeing
|
||||
* Blender's library. Still testing, will decide later (Willian). */
|
||||
|
||||
//XXX
|
||||
#if 0
|
||||
void free_script (Script *script)
|
||||
{
|
||||
if (!script) return;
|
||||
#ifndef DISABLE_PYTHON
|
||||
BPY_clear_script(script);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
@@ -159,7 +159,7 @@ int BLI_gzip(char *from, char *to) {
|
||||
|
||||
file = open(from,O_BINARY|O_RDONLY);
|
||||
|
||||
if ( -1 == file ) return -2;
|
||||
if (file < 0) return -2;
|
||||
|
||||
while ( 1 )
|
||||
{
|
||||
|
@@ -440,7 +440,7 @@ int BLI_filepathsize(const char *path)
|
||||
{
|
||||
int size, file = open(path, O_BINARY|O_RDONLY);
|
||||
|
||||
if (file <= 0)
|
||||
if (file < 0)
|
||||
return -1;
|
||||
|
||||
size = BLI_filesize(file);
|
||||
|
@@ -230,12 +230,8 @@ void CutEdgeloop(Object *obedit, wmOperator *op, EditMesh *em, int numcuts)
|
||||
nearest = findnearestedge(&vc, &dist); // returns actual distance in dist
|
||||
// scrarea_do_windraw(curarea); // after findnearestedge, backbuf!
|
||||
|
||||
sprintf(msg,"Number of Cuts: %d",numcuts);
|
||||
if(smooth){
|
||||
sprintf(msg,"%s (S)mooth: on",msg);
|
||||
} else {
|
||||
sprintf(msg,"%s (S)mooth: off",msg);
|
||||
}
|
||||
sprintf(msg,"Number of Cuts: %d (S)mooth: ",numcuts);
|
||||
strcat(msg, smooth ? "on":"off");
|
||||
|
||||
// headerprint(msg);
|
||||
/* Need to figure preview */
|
||||
|
@@ -3803,7 +3803,7 @@ int PE_minmax(Scene *scene, float *min, float *max)
|
||||
{
|
||||
Object *ob= OBACT;
|
||||
PTCacheEdit *edit= PE_get_current(scene, ob);
|
||||
ParticleSystem *psys = edit->psys;
|
||||
ParticleSystem *psys;
|
||||
ParticleSystemModifierData *psmd = NULL;
|
||||
POINT_P; KEY_K;
|
||||
float co[3], mat[4][4];
|
||||
@@ -3811,7 +3811,7 @@ int PE_minmax(Scene *scene, float *min, float *max)
|
||||
|
||||
if(!edit) return ok;
|
||||
|
||||
if(psys)
|
||||
if((psys = edit->psys))
|
||||
psmd= psys_get_modifier(ob, psys);
|
||||
else
|
||||
unit_m4(mat);
|
||||
|
@@ -298,7 +298,6 @@ static int buttons_context_path_particle(ButsContextPath *path)
|
||||
static int buttons_context_path_brush(const bContext *C, ButsContextPath *path)
|
||||
{
|
||||
Scene *scene;
|
||||
ToolSettings *ts;
|
||||
Brush *br= NULL;
|
||||
PointerRNA *ptr= &path->ptr[path->len-1];
|
||||
|
||||
@@ -309,7 +308,6 @@ static int buttons_context_path_brush(const bContext *C, ButsContextPath *path)
|
||||
/* if we have a scene, use the toolsettings brushes */
|
||||
else if(buttons_context_path_scene(path)) {
|
||||
scene= path->ptr[path->len-1].data;
|
||||
ts= scene->toolsettings;
|
||||
|
||||
if(scene)
|
||||
br= paint_brush(paint_get_active(scene));
|
||||
|
@@ -4003,11 +4003,13 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv
|
||||
sprintf(val, " %i", a);
|
||||
|
||||
if(part->draw&PART_DRAW_NUM && part->draw&PART_DRAW_HEALTH)
|
||||
sprintf(val, "%s:", val);
|
||||
|
||||
if(part->draw&PART_DRAW_HEALTH && a < totpart && part->phystype==PART_PHYS_BOIDS)
|
||||
sprintf(val, "%s %.2f", val, pa_health);
|
||||
strcat(val, ":");
|
||||
|
||||
if(part->draw&PART_DRAW_HEALTH && a < totpart && part->phystype==PART_PHYS_BOIDS) {
|
||||
char tval[8];
|
||||
sprintf(tval, " %.2f", pa_health);
|
||||
strcat(val, tval);
|
||||
}
|
||||
/* in path drawing state.co is the end point */
|
||||
view3d_cached_text_draw_add(state.co[0], state.co[1], state.co[2], val, 0);
|
||||
}
|
||||
|
@@ -829,7 +829,7 @@ static void draw_selected_name(Scene *scene, Object *ob, View3D *v3d)
|
||||
if(kb){
|
||||
sprintf(shapes, ": %s ", kb->name);
|
||||
if(ob->shapeflag == OB_SHAPE_LOCK){
|
||||
sprintf(shapes, "%s (Pinned)",shapes);
|
||||
strcat(shapes, " (Pinned)");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -279,7 +279,7 @@ struct ImBuf *IMB_loadiffname(const char *naam, int flags) {
|
||||
|
||||
file = open(naam, O_BINARY|O_RDONLY);
|
||||
|
||||
if (file == -1) return (0);
|
||||
if (file < 0) return (0);
|
||||
|
||||
ibuf= IMB_loadifffile(file, flags);
|
||||
|
||||
@@ -304,7 +304,7 @@ struct ImBuf *IMB_testiffname(char *naam,int flags) {
|
||||
flags |= IB_test;
|
||||
file = open(naam,O_BINARY|O_RDONLY);
|
||||
|
||||
if (file<=0) return (0);
|
||||
if (file < 0) return (0);
|
||||
|
||||
ibuf=IMB_loadifffile(file,flags);
|
||||
if (ibuf) {
|
||||
|
@@ -296,7 +296,10 @@ short imb_savetarga(struct ImBuf * ibuf, char *name, int flags)
|
||||
|
||||
if (ibuf->cmap){
|
||||
for (i = 0 ; i<ibuf->maxcol ; i++){
|
||||
if (fwrite(((uchar *)(ibuf->cmap + i)) + 1,1,3,fildes) != 3) return (0);
|
||||
if (fwrite(((uchar *)(ibuf->cmap + i)) + 1,1,3,fildes) != 3) {
|
||||
fclose(fildes);
|
||||
return (0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -129,7 +129,6 @@ extern "C" {
|
||||
// void BPY_spacescript_do_pywin_draw( struct SpaceScript *sc );
|
||||
// void BPY_spacescript_do_pywin_event( struct SpaceScript *sc,
|
||||
// unsigned short event, short val, char ascii );
|
||||
// void BPY_clear_script( struct Script *script );
|
||||
// void BPY_free_finished_script( struct Script *script );
|
||||
// void BPY_scripts_clear_pyobjects( void );
|
||||
//
|
||||
|
@@ -30,7 +30,6 @@
|
||||
//void BPY_run_python_script() {}
|
||||
//void BPY_start_python() {}
|
||||
void BPY_call_importloader() {}
|
||||
void BPY_clear_script() {}
|
||||
//void BPY_free_compiled_text() {}
|
||||
void BPY_pyconstraint_eval() {}
|
||||
void BPY_pyconstraint_target() {}
|
||||
|
@@ -5200,7 +5200,7 @@ static int load_fluidsimspeedvectors(Render *re, ObjectInstanceRen *obi, float *
|
||||
float mat[4][4], winmat[4][4];
|
||||
float imat[4][4];
|
||||
FluidsimModifierData *fluidmd = (FluidsimModifierData *)modifiers_findByType(fsob, eModifierType_Fluidsim);
|
||||
FluidsimSettings *fss = fluidmd->fss;
|
||||
FluidsimSettings *fss;
|
||||
float *velarray = NULL;
|
||||
|
||||
/* only one step needed */
|
||||
|
Reference in New Issue
Block a user