diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-01-21 03:03:41 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-01-21 03:03:41 +0400 |
commit | a98a75346c592bc0f44f40d7bb149bd31186b715 (patch) | |
tree | 29b7912beefb29bec03a1a3de0d44c0a4d1d5eb4 | |
parent | f08a8c5b156a5a26c5f7428b77e803edef09cdab (diff) |
quiet warnings and possible NULL checking crash fix for indentation functions.
-rw-r--r-- | build_files/cmake/cmake_static_check_cppcheck.py | 3 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/dynamicpaint.c | 3 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/image.c | 4 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/mesh.c | 4 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/movieclip.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/text.c | 20 | ||||
-rw-r--r-- | source/blender/blenlib/intern/math_rotation.c | 2 | ||||
-rw-r--r-- | source/blender/editors/armature/editarmature_retarget.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_buttons/buttons_context.c | 1 | ||||
-rw-r--r-- | source/blender/editors/space_script/script_edit.c | 2 | ||||
-rw-r--r-- | source/blender/editors/uvedit/uvedit_smart_stitch.c | 5 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_sequence_types.h | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_nodetree.c | 2 |
13 files changed, 29 insertions, 23 deletions
diff --git a/build_files/cmake/cmake_static_check_cppcheck.py b/build_files/cmake/cmake_static_check_cppcheck.py index 8720cb83054..6c13f3a079a 100644 --- a/build_files/cmake/cmake_static_check_cppcheck.py +++ b/build_files/cmake/cmake_static_check_cppcheck.py @@ -37,7 +37,8 @@ CHECKER_BIN = "cppcheck" CHECKER_ARGS = [ # not sure why this is needed, but it is. "-I" + os.path.join(project_source_info.SOURCE_DIR, "extern", "glew", "include"), - + "--suppress=*:%s/extern/glew/include/GL/glew.h:241" % project_source_info.SOURCE_DIR, + # "--max-configs=1", # speeds up execution # "--check-config", # when includes are missing # "--enable=all", # if you want sixty hundred pedantic suggestions ] diff --git a/source/blender/blenkernel/intern/dynamicpaint.c b/source/blender/blenkernel/intern/dynamicpaint.c index 8dc568cd004..6a2207d455c 100644 --- a/source/blender/blenkernel/intern/dynamicpaint.c +++ b/source/blender/blenkernel/intern/dynamicpaint.c @@ -188,11 +188,12 @@ typedef struct ImgSeqFormatData { Vec3f *barycentricWeights; /* b-weights for all pixel samples */ } ImgSeqFormatData; +#if 0 /* UNUSED */ typedef struct EffVelPoint { float previous_pos[3]; float previous_vel[3]; } EffVelPoint; - +#endif /* adjacency data flags */ #define ADJ_ON_MESH_EDGE (1<<0) diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index ce337608cc5..0a80e8a3d56 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -1111,9 +1111,9 @@ int BKE_add_image_extension(char *string, const char imtype) if(BLI_testextensie_array(string, imb_ext_image) || (G.have_quicktime && BLI_testextensie_array(string, imb_ext_image_qt))) { return BLI_replace_extension(string, FILE_MAX, extension); - } else { + } + else { return BLI_ensure_extension(string, FILE_MAX, extension); - return TRUE; } } diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c index f6bd321466c..cba92e7a14c 100644 --- a/source/blender/blenkernel/intern/mesh.c +++ b/source/blender/blenkernel/intern/mesh.c @@ -1292,11 +1292,11 @@ float (*mesh_getVertexCos(Mesh *me, int *numVerts_r))[3] { int i, numVerts = me->totvert; float (*cos)[3] = MEM_mallocN(sizeof(*cos)*numVerts, "vertexcos1"); - + if (numVerts_r) *numVerts_r = numVerts; for (i=0; i<numVerts; i++) copy_v3_v3(cos[i], me->mvert[i].co); - + return cos; } diff --git a/source/blender/blenkernel/intern/movieclip.c b/source/blender/blenkernel/intern/movieclip.c index 3b1dc2973ad..bb8e420451f 100644 --- a/source/blender/blenkernel/intern/movieclip.c +++ b/source/blender/blenkernel/intern/movieclip.c @@ -981,7 +981,7 @@ static void movieclip_build_proxy_ibuf(MovieClip *clip, ImBuf *ibuf, int cfra, i { char name[FILE_MAX]; int quality, rectx, recty; - int size= size= rendersize_to_number(proxy_render_size); + int size= rendersize_to_number(proxy_render_size); ImBuf *scaleibuf; get_proxy_fname(clip, proxy_render_size, undistorted, cfra, name); diff --git a/source/blender/blenkernel/intern/text.c b/source/blender/blenkernel/intern/text.c index b8f37a90a4d..8e5cc8c48e3 100644 --- a/source/blender/blenkernel/intern/text.c +++ b/source/blender/blenkernel/intern/text.c @@ -2751,15 +2751,19 @@ void txt_indent(Text *text) /* hardcoded: TXT_TABSIZE = 4 spaces: */ int spaceslen = TXT_TABSIZE; + if (ELEM3(NULL, text, text->curl, text->sell)) { + return; + } + + if (!text) return; + if (!text->curl) return; + if (!text->sell) return; + /* insert spaces rather than tabs */ if (text->flags & TXT_TABSTOSPACES){ add = tab_to_spaces; indentlen = spaceslen; } - - if (!text) return; - if (!text->curl) return; - if (!text->sell) return; num = 0; while (TRUE) @@ -2812,16 +2816,16 @@ void txt_unindent(Text *text) /* hardcoded: TXT_TABSIZE = 4 spaces: */ int spaceslen = TXT_TABSIZE; + if (!text) return; + if (!text->curl) return; + if (!text->sell) return; + /* insert spaces rather than tabs */ if (text->flags & TXT_TABSTOSPACES){ remove = tab_to_spaces; indent = spaceslen; } - if (!text) return; - if (!text->curl) return; - if (!text->sell) return; - while(TRUE) { int i = 0; diff --git a/source/blender/blenlib/intern/math_rotation.c b/source/blender/blenlib/intern/math_rotation.c index 5596b6f9f22..b0e6fe51810 100644 --- a/source/blender/blenlib/intern/math_rotation.c +++ b/source/blender/blenlib/intern/math_rotation.c @@ -811,7 +811,7 @@ void single_axis_angle_to_mat3(float mat[3][3], const char axis, const float ang mat[2][2] = 1.0f; break; default: - assert("invalid axis"); + assert(0); } } diff --git a/source/blender/editors/armature/editarmature_retarget.c b/source/blender/editors/armature/editarmature_retarget.c index 9ec27b69835..a8978a0bbde 100644 --- a/source/blender/editors/armature/editarmature_retarget.c +++ b/source/blender/editors/armature/editarmature_retarget.c @@ -450,7 +450,7 @@ static void renameTemplateBone(char *name, char *template_name, ListBase *editbo { int i, j; - for (i = 0, j = 0; template_name[i] != '\0' && i < (MAXBONENAME-1) && j < (MAXBONENAME-1); i++) + for (i = 0, j = 0; i < (MAXBONENAME-1) && j < (MAXBONENAME-1) && template_name[i] != '\0'; i++) { if (template_name[i] == '&') { diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c index 4c028612320..57981431492 100644 --- a/source/blender/editors/space_buttons/buttons_context.c +++ b/source/blender/editors/space_buttons/buttons_context.c @@ -1061,7 +1061,6 @@ ID *buttons_context_id_path(const bContext *C) if(ptr->id.data) { return ptr->id.data; - break; } } } diff --git a/source/blender/editors/space_script/script_edit.c b/source/blender/editors/space_script/script_edit.c index b0c2de390a2..7702e952e24 100644 --- a/source/blender/editors/space_script/script_edit.c +++ b/source/blender/editors/space_script/script_edit.c @@ -96,8 +96,8 @@ static int script_reload_exec(bContext *C, wmOperator *UNUSED(op)) return OPERATOR_FINISHED; #else (void)C; /* unused */ -#endif return OPERATOR_CANCELLED; +#endif } void SCRIPT_OT_reload(wmOperatorType *ot) diff --git a/source/blender/editors/uvedit/uvedit_smart_stitch.c b/source/blender/editors/uvedit/uvedit_smart_stitch.c index c4716f2e3ca..3731d348522 100644 --- a/source/blender/editors/uvedit/uvedit_smart_stitch.c +++ b/source/blender/editors/uvedit/uvedit_smart_stitch.c @@ -912,12 +912,13 @@ static void stitch_select_uv(UvElement *element, StitchState *stitch_state, int } } -static void stitch_calculate_edge_normal(EditMesh *em, UvEdge *edge, float *normal){ +static void stitch_calculate_edge_normal(EditMesh *em, UvEdge *edge, float *normal) +{ UvElement *element = edge->element; EditFace *efa = element->face; MTFace *mt = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); int nverts = efa->v4?4 : 3; - int index = index = (element->tfindex + 2)%nverts; + int index = (element->tfindex + 2)%nverts; float tangent[2], internal[2]; sub_v2_v2v2(tangent, mt->uv[(element->tfindex + 1)%nverts], mt->uv[element->tfindex]); diff --git a/source/blender/makesdna/DNA_sequence_types.h b/source/blender/makesdna/DNA_sequence_types.h index fa501de8d6d..748769bd5d8 100644 --- a/source/blender/makesdna/DNA_sequence_types.h +++ b/source/blender/makesdna/DNA_sequence_types.h @@ -353,7 +353,7 @@ typedef struct SpeedControlVars { */ -#define SEQ_HAS_PATH(_seq) (ELEM5((_seq)->type, SEQ_MOVIE, SEQ_IMAGE, SEQ_SOUND, SEQ_RAM_SOUND, SEQ_HD_SOUND)) +#define SEQ_HAS_PATH(_seq) (ELEM4((_seq)->type, SEQ_MOVIE, SEQ_IMAGE, SEQ_RAM_SOUND, SEQ_HD_SOUND)) #endif diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index a04ddec2098..989202f785c 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -3071,7 +3071,7 @@ static void rna_def_node_socket_subtype(BlenderRNA *brna, int type, int subtype, }; #undef SUBTYPE - #define SUBTYPE(socktype, stypename, id, idname) if (subtype==PROP_##id) propsubtype = PROP_##id; + #define SUBTYPE(socktype, stypename, id, idname) if (subtype == (PROP_##id)) propsubtype = PROP_##id; NODE_DEFINE_SUBTYPES #undef SUBTYPE |