diff options
20 files changed, 42 insertions, 36 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index c3ede3cbe03..10ae610b63d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1924,6 +1924,7 @@ if(CMAKE_COMPILER_IS_GNUCC) ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_NO_NULL -Wnonnull) # C only ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_MISSING_INCLUDE_DIRS -Wmissing-include-dirs) ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_NO_DIV_BY_ZERO -Wno-div-by-zero) + ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_REDUNDANT_DECLS -Wredundant-decls) # gcc 4.2 gives annoying warnings on every file with this if (NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "4.3") @@ -1944,6 +1945,7 @@ if(CMAKE_COMPILER_IS_GNUCC) ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_INIT_SELF -Winit-self) # needs -Wuninitialized ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_MISSING_INCLUDE_DIRS -Wmissing-include-dirs) ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_DIV_BY_ZERO -Wno-div-by-zero) + ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_REDUNDANT_DECLS -Wredundant-decls) # gcc 4.2 gives annoying warnings on every file with this if (NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "4.3") diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake index 56ac48bfa61..f3e00be4c53 100644 --- a/build_files/cmake/macros.cmake +++ b/build_files/cmake/macros.cmake @@ -489,6 +489,7 @@ macro(remove_strict_flags) remove_cc_flag("-Wmissing-prototypes") remove_cc_flag("-Wunused-parameter") remove_cc_flag("-Wwrite-strings") + remove_cc_flag("-Wredundant-decls") remove_cc_flag("-Wundef") remove_cc_flag("-Wshadow") remove_cc_flag("-Werror=[^ ]+") diff --git a/source/blender/blenlib/BLI_math_base.h b/source/blender/blenlib/BLI_math_base.h index aa4e697b48b..1f42d94b1dd 100644 --- a/source/blender/blenlib/BLI_math_base.h +++ b/source/blender/blenlib/BLI_math_base.h @@ -179,6 +179,11 @@ #include "intern/math_base_inline.c" #endif +#ifdef __GNUC__ +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wredundant-decls" +#endif + /******************************* Float ******************************/ MINLINE float sqrt3f(float f); @@ -217,6 +222,10 @@ extern double round(double x); double double_round(double x, int ndigits); +#ifdef __GNUC__ +# pragma GCC diagnostic pop +#endif + /* asserts, some math functions expect normalized inputs * check the vector is unit length, or zero length (which can't be helped in some cases). */ diff --git a/source/blender/blenlib/BLI_math_geom.h b/source/blender/blenlib/BLI_math_geom.h index 13f47d94160..593aba75361 100644 --- a/source/blender/blenlib/BLI_math_geom.h +++ b/source/blender/blenlib/BLI_math_geom.h @@ -40,6 +40,11 @@ extern "C" { #include "intern/math_geom_inline.c" #endif +#ifdef __GNUC__ +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wredundant-decls" +#endif + /********************************** Polygons *********************************/ void cent_tri_v3(float r[3], const float a[3], const float b[3], const float c[3]); @@ -281,6 +286,10 @@ MINLINE int min_axis_v3(const float vec[3]); MINLINE int poly_to_tri_count(const int poly_count, const int corner_count); +#ifdef __GNUC__ +# pragma GCC diagnostic pop +#endif + #ifdef __cplusplus } #endif diff --git a/source/blender/blenlib/BLI_math_vector.h b/source/blender/blenlib/BLI_math_vector.h index 5476978513e..a4afb3b5612 100644 --- a/source/blender/blenlib/BLI_math_vector.h +++ b/source/blender/blenlib/BLI_math_vector.h @@ -42,6 +42,11 @@ extern "C" { /************************************* Init ***********************************/ +#ifdef __GNUC__ +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wredundant-decls" +#endif + MINLINE void zero_v2(float r[2]); MINLINE void zero_v3(float r[3]); MINLINE void zero_v4(float r[4]); @@ -261,6 +266,10 @@ void fill_vn_i(int *array_tar, const int size, const int val); void fill_vn_ushort(unsigned short *array_tar, const int size, const unsigned short val); void fill_vn_fl(float *array_tar, const int size, const float val); +#ifdef __GNUC__ +# pragma GCC diagnostic pop +#endif + #ifdef __cplusplus } #endif diff --git a/source/blender/blenlib/intern/math_base.c b/source/blender/blenlib/intern/math_base.c index 6bb238ac612..38d303e667a 100644 --- a/source/blender/blenlib/intern/math_base.c +++ b/source/blender/blenlib/intern/math_base.c @@ -57,7 +57,14 @@ double round(double x) return copysign(y, x); } #else /* OpenSuse 11.1 seems to need this. */ +# ifdef __GNUC__ +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wredundant-decls" +# endif double round(double x); +# ifdef __GNUC__ +# pragma GCC diagnostic pop +# endif #endif /* from python 3.1 floatobject.c diff --git a/source/blender/bmesh/intern/bmesh_operators_private.h b/source/blender/bmesh/intern/bmesh_operators_private.h index ea9ad2ed151..1aa4383d761 100644 --- a/source/blender/bmesh/intern/bmesh_operators_private.h +++ b/source/blender/bmesh/intern/bmesh_operators_private.h @@ -30,9 +30,6 @@ struct BMesh; struct BMOperator; -void BMO_push(BMesh *bm, BMOperator *op); -void BMO_pop(BMesh *bm); - void bmo_automerge_exec(BMesh *bm, BMOperator *op); void bmo_average_vert_facedata_exec(BMesh *bm, BMOperator *op); void bmo_beautify_fill_exec(BMesh *bm, BMOperator *op); diff --git a/source/blender/bmesh/operators/bmo_wireframe.c b/source/blender/bmesh/operators/bmo_wireframe.c index 0d603faf3c4..00838533104 100644 --- a/source/blender/bmesh/operators/bmo_wireframe.c +++ b/source/blender/bmesh/operators/bmo_wireframe.c @@ -151,8 +151,6 @@ static bool bm_loop_is_radial_boundary(BMLoop *l_first) return true; } -extern float BM_vert_calc_mean_tagged_edge_length(BMVert *v); - void bmo_wireframe_exec(BMesh *bm, BMOperator *op) { const bool use_boundary = BMO_slot_bool_get(op->slots_in, "use_boundary"); diff --git a/source/blender/editors/include/ED_curve.h b/source/blender/editors/include/ED_curve.h index d66cc49a5d0..66c1798f507 100644 --- a/source/blender/editors/include/ED_curve.h +++ b/source/blender/editors/include/ED_curve.h @@ -63,8 +63,6 @@ void load_editNurb(struct Object *obedit); void make_editNurb(struct Object *obedit); void free_editNurb(struct Object *obedit); -void BKE_curve_editNurb_free(struct Curve *cu); - int mouse_nurb(struct bContext *C, const int mval[2], int extend, int deselect, int toggle); struct Nurb *add_nurbs_primitive(struct bContext *C, struct Object *obedit, float mat[4][4], int type, int newob); diff --git a/source/blender/editors/include/ED_mesh.h b/source/blender/editors/include/ED_mesh.h index d3de2593b9d..dd5bf45f557 100644 --- a/source/blender/editors/include/ED_mesh.h +++ b/source/blender/editors/include/ED_mesh.h @@ -172,17 +172,10 @@ void em_setup_viewcontext(struct bContext *C, struct ViewContext *vc); /* renam extern unsigned int bm_vertoffs, bm_solidoffs, bm_wireoffs; - /* mesh_ops.c */ void ED_operatortypes_mesh(void); void ED_operatormacros_mesh(void); void ED_keymap_mesh(struct wmKeyConfig *keyconf); -void ED_keymap_mesh(struct wmKeyConfig *keyconf); - - -/* spacetypes.c */ -void ED_spacetypes_init(void); - /* editmesh_tools.c (could be moved) */ void EMBM_project_snap_verts(struct bContext *C, struct ARegion *ar, struct BMEditMesh *em); diff --git a/source/blender/editors/include/ED_screen.h b/source/blender/editors/include/ED_screen.h index 72208a8e93d..d073eaa5607 100644 --- a/source/blender/editors/include/ED_screen.h +++ b/source/blender/editors/include/ED_screen.h @@ -71,7 +71,6 @@ void ED_region_visible_rect(struct ARegion *ar, struct rcti *rect); /* spaces */ -void ED_spacetypes_init(void); void ED_spacetypes_keymap(struct wmKeyConfig *keyconf); int ED_area_header_switchbutton(const struct bContext *C, struct uiBlock *block, int yco); int ED_area_header_standardbuttons(const struct bContext *C, struct uiBlock *block, int yco); diff --git a/source/blender/editors/include/ED_space_api.h b/source/blender/editors/include/ED_space_api.h index c8521cb194a..a40cf90f7ad 100644 --- a/source/blender/editors/include/ED_space_api.h +++ b/source/blender/editors/include/ED_space_api.h @@ -34,6 +34,8 @@ struct ARegionType; struct bContext; +void ED_spacetypes_init(void); + /* the pluginnable API for export to editors */ /* calls for registering default spaces */ diff --git a/source/blender/editors/mesh/mesh_intern.h b/source/blender/editors/mesh/mesh_intern.h index 9ea15f93250..e3d795e88ca 100644 --- a/source/blender/editors/mesh/mesh_intern.h +++ b/source/blender/editors/mesh/mesh_intern.h @@ -77,7 +77,6 @@ int EDBM_op_init(struct BMEditMesh *em, struct BMOperator *bmop, int EDBM_op_finish(struct BMEditMesh *em, struct BMOperator *bmop, struct wmOperator *op, const int report); -void EDBM_flag_disable_all(struct BMEditMesh *em, const char hflag); void EDBM_stats_update(struct BMEditMesh *em); /* ******************** editface.c */ diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index 921c7921dcb..2d6e8d0ada0 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -67,6 +67,8 @@ #include "screen_intern.h" +extern void ui_draw_anti_tria(float x1, float y1, float x2, float y2, float x3, float y3); /* xxx temp */ + /* general area and region code */ static void region_draw_emboss(ARegion *ar, rcti *scirct) @@ -245,8 +247,6 @@ static void draw_azone_plus(float x1, float y1, float x2, float y2) static void region_draw_azone_tab_plus(AZone *az) { - extern void ui_draw_anti_tria(float x1, float y1, float x2, float y2, float x3, float y3); /* xxx temp */ - glEnable(GL_BLEND); /* add code to draw region hidden as 'too small' */ @@ -321,8 +321,6 @@ static void region_draw_azone_tab(AZone *az) static void region_draw_azone_tria(AZone *az) { - extern void ui_draw_anti_tria(float x1, float y1, float x2, float y2, float x3, float y3); /* xxx temp */ - glEnable(GL_BLEND); //UI_GetThemeColor3fv(TH_HEADER, col); glColor4f(0.0f, 0.0f, 0.0f, 0.35f); diff --git a/source/blender/editors/sculpt_paint/paint_intern.h b/source/blender/editors/sculpt_paint/paint_intern.h index fc69e5d8eef..8d1076479cd 100644 --- a/source/blender/editors/sculpt_paint/paint_intern.h +++ b/source/blender/editors/sculpt_paint/paint_intern.h @@ -137,7 +137,6 @@ void paint_proj_stroke_done(void *ps); void paint_brush_init_tex(struct Brush *brush); void paint_brush_exit_tex(struct Brush *brush); -void PAINT_OT_image_paint(struct wmOperatorType *ot); void PAINT_OT_grab_clone(struct wmOperatorType *ot); void PAINT_OT_sample_color(struct wmOperatorType *ot); void PAINT_OT_clone_cursor_set(struct wmOperatorType *ot); diff --git a/source/blender/editors/sculpt_paint/sculpt_intern.h b/source/blender/editors/sculpt_paint/sculpt_intern.h index fa1bdd6ca82..82a07c9e3be 100644 --- a/source/blender/editors/sculpt_paint/sculpt_intern.h +++ b/source/blender/editors/sculpt_paint/sculpt_intern.h @@ -62,9 +62,6 @@ int sculpt_poll(struct bContext *C); void sculpt_update_mesh_elements(struct Scene *scene, struct Sculpt *sd, struct Object *ob, int need_pmap, int need_mask); -/* Deformed mesh sculpt */ -void free_sculptsession_deformMats(struct SculptSession *ss); - /* Stroke */ int sculpt_stroke_get_location(bContext *C, float out[3], const float mouse[2]); diff --git a/source/blender/imbuf/intern/IMB_indexer.h b/source/blender/imbuf/intern/IMB_indexer.h index 9c95531e90d..d114df945ae 100644 --- a/source/blender/imbuf/intern/IMB_indexer.h +++ b/source/blender/imbuf/intern/IMB_indexer.h @@ -116,9 +116,6 @@ void IMB_indexer_close(struct anim_index * idx); void IMB_free_indices(struct anim * anim); -int IMB_anim_index_get_frame_index( - struct anim *anim, IMB_Timecode_Type tc, int position); - struct anim *IMB_anim_open_proxy( struct anim *anim, IMB_Proxy_Size preview_size); struct anim_index * IMB_anim_open_index( diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index 2ceec970cf5..cde104710df 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -353,7 +353,6 @@ extern StructRNA RNA_MouseSensor; extern StructRNA RNA_MovieSequence; extern StructRNA RNA_MovieClipSequence; extern StructRNA RNA_MovieTracking; -extern StructRNA RNA_MovieTrackingTrack; extern StructRNA RNA_MovieTrackingObject; extern StructRNA RNA_MovieTrackingTrack; extern StructRNA RNA_MulticamSequence; diff --git a/source/blender/python/bmesh/bmesh_py_types_meshdata.h b/source/blender/python/bmesh/bmesh_py_types_meshdata.h index c9e8dce97a0..8280e5c3bc5 100644 --- a/source/blender/python/bmesh/bmesh_py_types_meshdata.h +++ b/source/blender/python/bmesh/bmesh_py_types_meshdata.h @@ -51,9 +51,6 @@ PyObject *BPy_BMTexPoly_CreatePyObject(struct MTexPoly *mloopuv); int BPy_BMLoopUV_AssignPyObject(struct MLoopUV *data, PyObject *value); PyObject *BPy_BMLoopUV_CreatePyObject(struct MLoopUV *data); -int BPy_BMLoopUV_AssignPyObject(struct MLoopUV *data, PyObject *value); -PyObject *BPy_BMLoopUV_CreatePyObject(struct MLoopUV *data); - int BPy_BMLoopColor_AssignPyObject(struct MLoopCol *data, PyObject *value); PyObject *BPy_BMLoopColor_CreatePyObject(struct MLoopCol *data); diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c index 1b3d4cd870d..552df561bbd 100644 --- a/source/blender/python/intern/bpy_interface.c +++ b/source/blender/python/intern/bpy_interface.c @@ -931,11 +931,7 @@ static void bpy_module_free(void *UNUSED(mod)) /* EVIL, define text.c functions here... */ -extern int text_check_identifier_unicode(const unsigned int ch); -extern int text_check_identifier_nodigit_unicode(const unsigned int ch); -extern int text_check_identifier(const char ch); -extern int text_check_identifier_nodigit(const char ch); - +/* BKE_text.h */ int text_check_identifier_unicode(const unsigned int ch) { return (ch < 255 && text_check_identifier((char)ch)) || Py_UNICODE_ISALNUM(ch); |