use gcc warning -Wredundant-decls, exposes some odd/duplicate declarations which have been removed.

This commit is contained in:
Campbell Barton
2013-03-11 20:27:38 +00:00
parent 8560b141eb
commit 660be3da39
20 changed files with 42 additions and 36 deletions

View File

@@ -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_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_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_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 # gcc 4.2 gives annoying warnings on every file with this
if (NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "4.3") 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_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_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_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 # gcc 4.2 gives annoying warnings on every file with this
if (NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "4.3") if (NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "4.3")

View File

@@ -489,6 +489,7 @@ macro(remove_strict_flags)
remove_cc_flag("-Wmissing-prototypes") remove_cc_flag("-Wmissing-prototypes")
remove_cc_flag("-Wunused-parameter") remove_cc_flag("-Wunused-parameter")
remove_cc_flag("-Wwrite-strings") remove_cc_flag("-Wwrite-strings")
remove_cc_flag("-Wredundant-decls")
remove_cc_flag("-Wundef") remove_cc_flag("-Wundef")
remove_cc_flag("-Wshadow") remove_cc_flag("-Wshadow")
remove_cc_flag("-Werror=[^ ]+") remove_cc_flag("-Werror=[^ ]+")

View File

@@ -179,6 +179,11 @@
#include "intern/math_base_inline.c" #include "intern/math_base_inline.c"
#endif #endif
#ifdef __GNUC__
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wredundant-decls"
#endif
/******************************* Float ******************************/ /******************************* Float ******************************/
MINLINE float sqrt3f(float f); MINLINE float sqrt3f(float f);
@@ -217,6 +222,10 @@ extern double round(double x);
double double_round(double x, int ndigits); double double_round(double x, int ndigits);
#ifdef __GNUC__
# pragma GCC diagnostic pop
#endif
/* asserts, some math functions expect normalized inputs /* asserts, some math functions expect normalized inputs
* check the vector is unit length, or zero length (which can't be helped in some cases). * check the vector is unit length, or zero length (which can't be helped in some cases).
*/ */

View File

@@ -40,6 +40,11 @@ extern "C" {
#include "intern/math_geom_inline.c" #include "intern/math_geom_inline.c"
#endif #endif
#ifdef __GNUC__
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wredundant-decls"
#endif
/********************************** Polygons *********************************/ /********************************** Polygons *********************************/
void cent_tri_v3(float r[3], const float a[3], const float b[3], const float c[3]); 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); MINLINE int poly_to_tri_count(const int poly_count, const int corner_count);
#ifdef __GNUC__
# pragma GCC diagnostic pop
#endif
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@@ -42,6 +42,11 @@ extern "C" {
/************************************* Init ***********************************/ /************************************* Init ***********************************/
#ifdef __GNUC__
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wredundant-decls"
#endif
MINLINE void zero_v2(float r[2]); MINLINE void zero_v2(float r[2]);
MINLINE void zero_v3(float r[3]); MINLINE void zero_v3(float r[3]);
MINLINE void zero_v4(float r[4]); 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_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); void fill_vn_fl(float *array_tar, const int size, const float val);
#ifdef __GNUC__
# pragma GCC diagnostic pop
#endif
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@@ -57,7 +57,14 @@ double round(double x)
return copysign(y, x); return copysign(y, x);
} }
#else /* OpenSuse 11.1 seems to need this. */ #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); double round(double x);
# ifdef __GNUC__
# pragma GCC diagnostic pop
# endif
#endif #endif
/* from python 3.1 floatobject.c /* from python 3.1 floatobject.c

View File

@@ -30,9 +30,6 @@
struct BMesh; struct BMesh;
struct BMOperator; struct BMOperator;
void BMO_push(BMesh *bm, BMOperator *op);
void BMO_pop(BMesh *bm);
void bmo_automerge_exec(BMesh *bm, BMOperator *op); void bmo_automerge_exec(BMesh *bm, BMOperator *op);
void bmo_average_vert_facedata_exec(BMesh *bm, BMOperator *op); void bmo_average_vert_facedata_exec(BMesh *bm, BMOperator *op);
void bmo_beautify_fill_exec(BMesh *bm, BMOperator *op); void bmo_beautify_fill_exec(BMesh *bm, BMOperator *op);

View File

@@ -151,8 +151,6 @@ static bool bm_loop_is_radial_boundary(BMLoop *l_first)
return true; return true;
} }
extern float BM_vert_calc_mean_tagged_edge_length(BMVert *v);
void bmo_wireframe_exec(BMesh *bm, BMOperator *op) void bmo_wireframe_exec(BMesh *bm, BMOperator *op)
{ {
const bool use_boundary = BMO_slot_bool_get(op->slots_in, "use_boundary"); const bool use_boundary = BMO_slot_bool_get(op->slots_in, "use_boundary");

View File

@@ -63,8 +63,6 @@ void load_editNurb(struct Object *obedit);
void make_editNurb(struct Object *obedit); void make_editNurb(struct Object *obedit);
void free_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); 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); struct Nurb *add_nurbs_primitive(struct bContext *C, struct Object *obedit, float mat[4][4], int type, int newob);

View File

@@ -172,17 +172,10 @@ void em_setup_viewcontext(struct bContext *C, struct ViewContext *vc); /* renam
extern unsigned int bm_vertoffs, bm_solidoffs, bm_wireoffs; extern unsigned int bm_vertoffs, bm_solidoffs, bm_wireoffs;
/* mesh_ops.c */ /* mesh_ops.c */
void ED_operatortypes_mesh(void); void ED_operatortypes_mesh(void);
void ED_operatormacros_mesh(void); void ED_operatormacros_mesh(void);
void ED_keymap_mesh(struct wmKeyConfig *keyconf); 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) */ /* editmesh_tools.c (could be moved) */
void EMBM_project_snap_verts(struct bContext *C, struct ARegion *ar, struct BMEditMesh *em); void EMBM_project_snap_verts(struct bContext *C, struct ARegion *ar, struct BMEditMesh *em);

View File

@@ -71,7 +71,6 @@ void ED_region_visible_rect(struct ARegion *ar, struct rcti *rect);
/* spaces */ /* spaces */
void ED_spacetypes_init(void);
void ED_spacetypes_keymap(struct wmKeyConfig *keyconf); 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_switchbutton(const struct bContext *C, struct uiBlock *block, int yco);
int ED_area_header_standardbuttons(const struct bContext *C, struct uiBlock *block, int yco); int ED_area_header_standardbuttons(const struct bContext *C, struct uiBlock *block, int yco);

View File

@@ -34,6 +34,8 @@
struct ARegionType; struct ARegionType;
struct bContext; struct bContext;
void ED_spacetypes_init(void);
/* the pluginnable API for export to editors */ /* the pluginnable API for export to editors */
/* calls for registering default spaces */ /* calls for registering default spaces */

View File

@@ -77,7 +77,6 @@ int EDBM_op_init(struct BMEditMesh *em, struct BMOperator *bmop,
int EDBM_op_finish(struct BMEditMesh *em, struct BMOperator *bmop, int EDBM_op_finish(struct BMEditMesh *em, struct BMOperator *bmop,
struct wmOperator *op, const int report); struct wmOperator *op, const int report);
void EDBM_flag_disable_all(struct BMEditMesh *em, const char hflag);
void EDBM_stats_update(struct BMEditMesh *em); void EDBM_stats_update(struct BMEditMesh *em);
/* ******************** editface.c */ /* ******************** editface.c */

View File

@@ -67,6 +67,8 @@
#include "screen_intern.h" #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 */ /* general area and region code */
static void region_draw_emboss(ARegion *ar, rcti *scirct) 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) 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); glEnable(GL_BLEND);
/* add code to draw region hidden as 'too small' */ /* 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) 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); glEnable(GL_BLEND);
//UI_GetThemeColor3fv(TH_HEADER, col); //UI_GetThemeColor3fv(TH_HEADER, col);
glColor4f(0.0f, 0.0f, 0.0f, 0.35f); glColor4f(0.0f, 0.0f, 0.0f, 0.35f);

View File

@@ -137,7 +137,6 @@ void paint_proj_stroke_done(void *ps);
void paint_brush_init_tex(struct Brush *brush); void paint_brush_init_tex(struct Brush *brush);
void paint_brush_exit_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_grab_clone(struct wmOperatorType *ot);
void PAINT_OT_sample_color(struct wmOperatorType *ot); void PAINT_OT_sample_color(struct wmOperatorType *ot);
void PAINT_OT_clone_cursor_set(struct wmOperatorType *ot); void PAINT_OT_clone_cursor_set(struct wmOperatorType *ot);

View File

@@ -62,9 +62,6 @@ int sculpt_poll(struct bContext *C);
void sculpt_update_mesh_elements(struct Scene *scene, struct Sculpt *sd, struct Object *ob, void sculpt_update_mesh_elements(struct Scene *scene, struct Sculpt *sd, struct Object *ob,
int need_pmap, int need_mask); int need_pmap, int need_mask);
/* Deformed mesh sculpt */
void free_sculptsession_deformMats(struct SculptSession *ss);
/* Stroke */ /* Stroke */
int sculpt_stroke_get_location(bContext *C, float out[3], const float mouse[2]); int sculpt_stroke_get_location(bContext *C, float out[3], const float mouse[2]);

View File

@@ -116,9 +116,6 @@ void IMB_indexer_close(struct anim_index * idx);
void IMB_free_indices(struct anim * anim); 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 *IMB_anim_open_proxy(
struct anim *anim, IMB_Proxy_Size preview_size); struct anim *anim, IMB_Proxy_Size preview_size);
struct anim_index * IMB_anim_open_index( struct anim_index * IMB_anim_open_index(

View File

@@ -353,7 +353,6 @@ extern StructRNA RNA_MouseSensor;
extern StructRNA RNA_MovieSequence; extern StructRNA RNA_MovieSequence;
extern StructRNA RNA_MovieClipSequence; extern StructRNA RNA_MovieClipSequence;
extern StructRNA RNA_MovieTracking; extern StructRNA RNA_MovieTracking;
extern StructRNA RNA_MovieTrackingTrack;
extern StructRNA RNA_MovieTrackingObject; extern StructRNA RNA_MovieTrackingObject;
extern StructRNA RNA_MovieTrackingTrack; extern StructRNA RNA_MovieTrackingTrack;
extern StructRNA RNA_MulticamSequence; extern StructRNA RNA_MulticamSequence;

View File

@@ -51,9 +51,6 @@ PyObject *BPy_BMTexPoly_CreatePyObject(struct MTexPoly *mloopuv);
int BPy_BMLoopUV_AssignPyObject(struct MLoopUV *data, PyObject *value); int BPy_BMLoopUV_AssignPyObject(struct MLoopUV *data, PyObject *value);
PyObject *BPy_BMLoopUV_CreatePyObject(struct MLoopUV *data); 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); int BPy_BMLoopColor_AssignPyObject(struct MLoopCol *data, PyObject *value);
PyObject *BPy_BMLoopColor_CreatePyObject(struct MLoopCol *data); PyObject *BPy_BMLoopColor_CreatePyObject(struct MLoopCol *data);

View File

@@ -931,11 +931,7 @@ static void bpy_module_free(void *UNUSED(mod))
/* EVIL, define text.c functions here... */ /* EVIL, define text.c functions here... */
extern int text_check_identifier_unicode(const unsigned int ch); /* BKE_text.h */
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);
int text_check_identifier_unicode(const unsigned int ch) int text_check_identifier_unicode(const unsigned int ch)
{ {
return (ch < 255 && text_check_identifier((char)ch)) || Py_UNICODE_ISALNUM(ch); return (ch < 255 && text_check_identifier((char)ch)) || Py_UNICODE_ISALNUM(ch);