quiet various warnings, also disable -Wdouble-promotion with cmake since it gives warnings with variable length args.

This commit is contained in:
Campbell Barton 2011-04-03 10:04:16 +00:00
parent 744a3b9cb2
commit 0298d223cc
39 changed files with 90 additions and 62 deletions

@ -1059,7 +1059,8 @@ if(CMAKE_COMPILER_IS_GNUCC)
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_POINTER_ARITH -Wpointer-arith)
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_UNUSED_PARAMETER -Wunused-parameter)
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_WRITE_STRINGS -Wwrite-strings)
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_DOUBLE_PROMOTION -Wdouble-promotion -Wno-error=double-promotion)
# disable because it gives warnings for printf() & friends.
# ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_DOUBLE_PROMOTION -Wdouble-promotion -Wno-error=double-promotion)
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_NO_ERROR_UNUSED_BUT_SET_VARIABLE -Wno-error=unused-but-set-variable)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_ALL -Wall)

@ -1851,7 +1851,7 @@ void nladata_flush_channels (ListBase *channels)
* ! This is exported so that keyframing code can use this for make use of it for anim layers support
* > echannels: (list<NlaEvalChannels>) evaluation channels with calculated values
*/
void animsys_evaluate_nla (ListBase *echannels, PointerRNA *ptr, AnimData *adt, float ctime)
static void animsys_evaluate_nla (ListBase *echannels, PointerRNA *ptr, AnimData *adt, float ctime)
{
NlaTrack *nlt;
short track_index=0;

@ -206,7 +206,7 @@
# ifdef __GNUC__ /* just want to check if __func__ is available */
# define BLI_assert(a) \
do { \
if (0 == (a)) { \
if (!(a)) { \
fprintf(stderr, \
"BLI_assert failed: %s, %s(), %d at \'%s\'\n", \
__FILE__, __func__, __LINE__, STRINGIFY(a)); \

@ -129,7 +129,7 @@ typedef struct IconTexture {
/* ******************* STATIC LOCAL VARS ******************* */
/* static here to cache results of icon directory scan, so it's not
* scanning the filesystem each time the menu is drawn */
static struct ListBase iconfilelist = {0, 0};
static struct ListBase iconfilelist = {NULL, NULL};
static IconTexture icongltex = {0, 0, 0, 0.0f, 0.0f};
/* **************************************************** */
@ -144,7 +144,7 @@ static void def_internal_icon(ImBuf *bbuf, int icon_id, int xofs, int yofs, int
new_icon = MEM_callocN(sizeof(Icon), "texicon");
new_icon->obj = 0; /* icon is not for library object */
new_icon->obj = NULL; /* icon is not for library object */
new_icon->type = 0;
di = MEM_callocN(sizeof(DrawInfo), "drawinfo");
@ -184,14 +184,14 @@ static void def_internal_vicon( int icon_id, VectorDrawFunc drawFunc)
new_icon = MEM_callocN(sizeof(Icon), "texicon");
new_icon->obj = 0; /* icon is not for library object */
new_icon->obj = NULL; /* icon is not for library object */
new_icon->type = 0;
di = MEM_callocN(sizeof(DrawInfo), "drawinfo");
di->type= ICON_TYPE_VECTOR;
di->data.vector.func =drawFunc;
new_icon->drawinfo_free = 0;
new_icon->drawinfo_free = NULL;
new_icon->drawinfo = di;
BKE_icon_set(icon_id, new_icon);
@ -667,7 +667,7 @@ static void init_iconfile_list(struct ListBase *list)
if (dir[i].string) MEM_freeN(dir[i].string);
}
free(dir);
dir= 0;
dir= NULL;
}
static void free_iconfile_list(struct ListBase *list)

@ -809,7 +809,7 @@ static void fluidbake_free_data(FluidAnimChannels *channels, ListBase *fobjects,
}
}
int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain)
static int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain)
{
Scene *scene= CTX_data_scene(C);
int i;

@ -39,8 +39,7 @@
#include "BLI_blenlib.h"
#include "ED_anim_api.h"
#include "ED_transform.h"
#include "action_intern.h"

@ -45,6 +45,7 @@
#include "UI_view2d.h"
#include "ED_anim_api.h"
#include "ED_screen.h"
#include "ED_transform.h"

@ -337,7 +337,7 @@ Sequence *find_nearest_seq(Scene *scene, View2D *v2d, int *hand, short mval[2])
}
seq= seq->next;
}
return 0;
return NULL;
}
@ -461,12 +461,12 @@ static void reload_image_strip(Scene *scene, char *UNUSED(name))
if(last_seq==0 || last_seq->type!=SEQ_IMAGE) return;
if(last_seq==NULL || last_seq->type!=SEQ_IMAGE) return;
seqact= last_seq; /* last_seq changes in alloc_sequence */
/* search sfile */
// sfile= scrarea_find_space_of_type(curarea, SPACE_FILE);
if(sfile==0) return;
if(sfile == NULL) return;
waitcursor(1);
@ -479,7 +479,7 @@ static void reload_image_strip(Scene *scene, char *UNUSED(name))
seqact->len= seq->len;
calc_sequence(scene, seqact);
seq->strip= 0;
seq->strip= NULL;
seq_free_sequence(scene, seq);
BLI_remlink(ed->seqbasep, seq);
@ -497,7 +497,7 @@ static void change_sequence(Scene *scene)
Scene *sce;
short event;
if(last_seq==0) return;
if(last_seq == NULL) return;
if(last_seq->type & SEQ_EFFECT) {
event = pupmenu("Change Effect%t"
@ -590,7 +590,7 @@ static void change_sequence(Scene *scene)
int seq_effect_find_selected(Scene *scene, Sequence *activeseq, int type, Sequence **selseq1, Sequence **selseq2, Sequence **selseq3, const char **error_str)
{
Editing *ed = seq_give_editing(scene, FALSE);
Sequence *seq1= 0, *seq2= 0, *seq3= 0, *seq;
Sequence *seq1= NULL, *seq2= NULL, *seq3= NULL, *seq;
*error_str= NULL;
@ -604,9 +604,9 @@ int seq_effect_find_selected(Scene *scene, Sequence *activeseq, int type, Sequen
return 0;
}
if((seq != activeseq) && (seq != seq2)) {
if(seq2==0) seq2= seq;
else if(seq1==0) seq1= seq;
else if(seq3==0) seq3= seq;
if(seq2 == NULL) seq2= seq;
else if(seq1 == NULL) seq1= seq;
else if(seq3 == NULL) seq3= seq;
else {
*error_str= "Can't apply effect to more than 3 sequence strips";
return 0;
@ -617,7 +617,7 @@ int seq_effect_find_selected(Scene *scene, Sequence *activeseq, int type, Sequen
/* make sequence selection a little bit more intuitive
for 3 strips: the last-strip should be sequence3 */
if (seq3 != 0 && seq2 != 0) {
if (seq3 != NULL && seq2 != NULL) {
Sequence *tmp = seq2;
seq2 = seq3;
seq3 = tmp;
@ -626,21 +626,21 @@ int seq_effect_find_selected(Scene *scene, Sequence *activeseq, int type, Sequen
switch(get_sequence_effect_num_inputs(type)) {
case 0:
*selseq1 = *selseq2 = *selseq3 = 0;
*selseq1 = *selseq2 = *selseq3 = NULL;
return 1; /* succsess */
case 1:
if(seq2==0) {
if(seq2==NULL) {
*error_str= "Need at least one selected sequence strip";
return 0;
}
if(seq1==0) seq1= seq2;
if(seq3==0) seq3= seq2;
if(seq1==NULL) seq1= seq2;
if(seq3==NULL) seq3= seq2;
case 2:
if(seq1==0 || seq2==0) {
if(seq1==NULL || seq2==NULL) {
*error_str= "Need 2 selected sequence strips";
return 0;
}
if(seq3==0) seq3= seq2;
if(seq3 == NULL) seq3= seq2;
}
if (seq1==NULL && seq2==NULL && seq3==NULL) {
@ -722,7 +722,7 @@ static void recurs_del_seq_flag(Scene *scene, ListBase *lb, short flag, short de
static Sequence *cut_seq_hard(Scene *scene, Sequence * seq, int cutframe)
{
TransSeq ts;
Sequence *seqn = 0;
Sequence *seqn = NULL;
int skip_dup = FALSE;
/* backup values */
@ -816,7 +816,7 @@ static Sequence *cut_seq_hard(Scene *scene, Sequence * seq, int cutframe)
static Sequence *cut_seq_soft(Scene *scene, Sequence * seq, int cutframe)
{
TransSeq ts;
Sequence *seqn = 0;
Sequence *seqn = NULL;
int skip_dup = FALSE;
/* backup values */
@ -2013,8 +2013,8 @@ static int sequencer_meta_separate_exec(bContext *C, wmOperator *UNUSED(op))
BLI_movelisttolist(ed->seqbasep, &last_seq->seqbase);
last_seq->seqbase.first= 0;
last_seq->seqbase.last= 0;
last_seq->seqbase.first= NULL;
last_seq->seqbase.last= NULL;
BLI_remlink(ed->seqbasep, last_seq);
seq_free_sequence(scene, last_seq);

@ -167,7 +167,7 @@ static struct ImBuf *make_waveform_view_from_ibuf_byte(struct ImBuf * ibuf)
}
for (y = 0; y < ibuf->y; y++) {
unsigned char * last_p = 0;
unsigned char * last_p = NULL;
for (x = 0; x < ibuf->x; x++) {
unsigned char * rgb = src + 4 * (ibuf->x * y + x);
@ -182,7 +182,7 @@ static struct ImBuf *make_waveform_view_from_ibuf_byte(struct ImBuf * ibuf)
p += 4 * w;
scope_put_pixel(wtable, p);
if (last_p != 0) {
if (last_p != NULL) {
wform_put_line(w, last_p, p);
}
last_p = p;
@ -213,7 +213,7 @@ static struct ImBuf *make_waveform_view_from_ibuf_float(struct ImBuf * ibuf)
}
for (y = 0; y < ibuf->y; y++) {
unsigned char * last_p = 0;
unsigned char * last_p = NULL;
for (x = 0; x < ibuf->x; x++) {
float * rgb = src + 4 * (ibuf->x * y + x);
@ -231,7 +231,7 @@ static struct ImBuf *make_waveform_view_from_ibuf_float(struct ImBuf * ibuf)
p += 4 * w;
scope_put_pixel(wtable, p);
if (last_p != 0) {
if (last_p != NULL) {
wform_put_line(w, last_p, p);
}
last_p = p;
@ -274,7 +274,7 @@ static struct ImBuf *make_sep_waveform_view_from_ibuf_byte(struct ImBuf * ibuf)
}
for (y = 0; y < ibuf->y; y++) {
unsigned char * last_p[3] = {0,0,0};
unsigned char *last_p[3] = {NULL, NULL, NULL};
for (x = 0; x < ibuf->x; x++) {
int c;
@ -288,7 +288,7 @@ static struct ImBuf *make_sep_waveform_view_from_ibuf_byte(struct ImBuf * ibuf)
p += 4 * w;
scope_put_pixel_single(wtable, p, c);
if (last_p[c] != 0) {
if (last_p[c] != NULL) {
wform_put_line_single(
w, last_p[c], p, c);
}
@ -324,7 +324,7 @@ static struct ImBuf *make_sep_waveform_view_from_ibuf_float(
}
for (y = 0; y < ibuf->y; y++) {
unsigned char * last_p[3] = {0, 0, 0};
unsigned char *last_p[3] = {NULL, NULL, NULL};
for (x = 0; x < ibuf->x; x++) {
int c;
@ -342,7 +342,7 @@ static struct ImBuf *make_sep_waveform_view_from_ibuf_float(
p += 4 * w;
scope_put_pixel_single(wtable, p, c);
if (last_p[c] != 0) {
if (last_p[c] != NULL) {
wform_put_line_single(
w, last_p[c], p, c);
}

@ -1696,7 +1696,7 @@ static void RestoreState(bContext *C, wmWindow *win)
}
/* was space_set_commmandline_options in 2.4x */
void game_set_commmandline_options(GameData *gm)
static void game_set_commmandline_options(GameData *gm)
{
SYS_SystemHandle syshandle;
int test;

@ -106,7 +106,7 @@ void GPU_render_text(MTFace *tface, int mode,
line_height= MAX4(v1[1], v2[1], v3[1], v4[2]) - MIN4(v1[1], v2[1], v3[1], v4[2]);
else
line_height= MAX3(v1[1], v2[1], v3[1]) - MIN3(v1[1], v2[1], v3[1]);
line_height *= 1.2; /* could be an option? */
line_height *= 1.2f; /* could be an option? */
/* end multiline */
@ -358,7 +358,7 @@ static void gpu_set_blend_mode(GPUBlendMode blendmode)
* turn off alpha test in this case */
/* added after 2.45 to clip alpha */
if(U.glalphaclip == 1.0) {
if(U.glalphaclip == 1.0f) {
glDisable(GL_ALPHA_TEST);
}
else {
@ -1288,8 +1288,8 @@ int GPU_scene_object_lights(Scene *scene, Object *ob, int lay, float viewmat[][4
/* spot lamp */
negate_v3_v3(direction, base->object->obmat[2]);
glLightfv(GL_LIGHT0+count, GL_SPOT_DIRECTION, direction);
glLightf(GL_LIGHT0+count, GL_SPOT_CUTOFF, la->spotsize/2.0);
glLightf(GL_LIGHT0+count, GL_SPOT_EXPONENT, 128.0*la->spotblend);
glLightf(GL_LIGHT0+count, GL_SPOT_CUTOFF, la->spotsize/2.0f);
glLightf(GL_LIGHT0+count, GL_SPOT_EXPONENT, 128.0f*la->spotblend);
}
else
glLightf(GL_LIGHT0+count, GL_SPOT_CUTOFF, 180.0);

@ -75,25 +75,25 @@ EnumPropertyItem constraint_type_items[] ={
{CONSTRAINT_TYPE_SHRINKWRAP, "SHRINKWRAP", ICON_CONSTRAINT_DATA, "Shrinkwrap", ""},
{0, NULL, 0, NULL, NULL}};
EnumPropertyItem space_pchan_items[] = {
static EnumPropertyItem space_pchan_items[] = {
{0, "WORLD", 0, "World Space", ""},
{2, "POSE", 0, "Pose Space", ""},
{3, "LOCAL_WITH_PARENT", 0, "Local With Parent", ""},
{1, "LOCAL", 0, "Local Space", ""},
{0, NULL, 0, NULL, NULL}};
EnumPropertyItem space_object_items[] = {
static EnumPropertyItem space_object_items[] = {
{0, "WORLD", 0, "World Space", ""},
{1, "LOCAL", 0, "Local Space", ""},
{0, NULL, 0, NULL, NULL}};
EnumPropertyItem constraint_ik_type_items[] ={
static EnumPropertyItem constraint_ik_type_items[] ={
{CONSTRAINT_IK_COPYPOSE, "COPY_POSE", 0, "Copy Pose", ""},
{CONSTRAINT_IK_DISTANCE, "DISTANCE", 0, "Distance", ""},
{0, NULL, 0, NULL, NULL},
};
EnumPropertyItem constraint_ik_axisref_items[] ={
static EnumPropertyItem constraint_ik_axisref_items[] ={
{0, "BONE", 0, "Bone", ""},
{CONSTRAINT_IK_TARGETAXIS, "TARGET", 0, "Target", ""},
{0, NULL, 0, NULL, NULL},

@ -2855,7 +2855,7 @@ void RNA_def_property_free_pointers(PropertyRNA *prop)
}
}
void RNA_def_property_free(StructOrFunctionRNA *cont_, PropertyRNA *prop)
static void rna_def_property_free(StructOrFunctionRNA *cont_, PropertyRNA *prop)
{
ContainerRNA *cont= cont_;
@ -2880,7 +2880,7 @@ int RNA_def_property_free_identifier(StructOrFunctionRNA *cont_, const char *ide
for(prop= cont->properties.first; prop; prop= prop->next) {
if(strcmp(prop->identifier, identifier)==0) {
if(prop->flag & PROP_RUNTIME) {
RNA_def_property_free(cont_, prop);
rna_def_property_free(cont_, prop);
return 1;
}
else {

@ -272,8 +272,8 @@ static void rna_def_gpencil_layers(BlenderRNA *brna, PropertyRNA *cprop)
StructRNA *srna;
PropertyRNA *prop;
FunctionRNA *func;
PropertyRNA *parm;
// FunctionRNA *func;
// PropertyRNA *parm;
RNA_def_property_srna(cprop, "GreasePencilLayers");
srna= RNA_def_struct(brna, "GreasePencilLayers", NULL);

@ -81,7 +81,7 @@ struct wmTimer *rna_event_timer_add(struct wmWindowManager *wm, float time_step,
void rna_event_timer_remove(struct wmWindowManager *wm, wmTimer *timer)
{
return WM_event_remove_timer(wm, timer->win, timer);
WM_event_remove_timer(wm, timer->win, timer);
}
#else

@ -191,14 +191,14 @@ static int edgecut_get(EdgeHash *edgehash, int v1, int v2)
}
const short add_faces[24] = {
static const short add_faces[24] = {
0,
0, 0, 2, 0, 1, 2, 2, 0, 2, 1,
2, 2, 2, 2, 3, 0, 0, 0, 1, 0,
1, 1, 2
};
MFace *get_dface(DerivedMesh *dm, DerivedMesh *split, int cur, int i, MFace *mf)
static MFace *get_dface(DerivedMesh *dm, DerivedMesh *split, int cur, int i, MFace *mf)
{
MFace *df = CDDM_get_face(split, cur);
DM_copy_face_data(dm, split, i, cur, 1);

@ -31,7 +31,8 @@
*/
#include "../TEX_util.h"
#include "../TEX_util.h"
#include "TEX_node.h"
static bNodeSocketType inputs[]= {
{ SOCK_RGBA, 1, "Texture", 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f },

@ -31,7 +31,9 @@
*/
#include "../TEX_util.h"
#include "../TEX_util.h"
#include "TEX_node.h"
#include <math.h>
static bNodeSocketType inputs[]= {

@ -31,7 +31,8 @@
*/
#include "../TEX_util.h"
#include "../TEX_util.h"
#include "TEX_node.h"
#include <math.h>
static bNodeSocketType inputs[]= {

@ -31,7 +31,8 @@
*/
#include "../TEX_util.h"
#include "../TEX_util.h"
#include "TEX_node.h"
static bNodeSocketType inputs[]= {
{ SOCK_VALUE, 1, "Red", 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f },

@ -32,6 +32,7 @@
#include "../TEX_util.h"
#include "TEX_node.h"
static bNodeSocketType outputs[]= {
{ SOCK_VECTOR, 0, "Coordinates", 0.0f, 0.0f, 0.0f, 0.0f, -1.0f, 1.0f },

@ -32,6 +32,7 @@
#include "../TEX_util.h"
#include "TEX_node.h"
/* **************** CURVE Time ******************** */

@ -31,7 +31,8 @@
*/
#include "../TEX_util.h"
#include "../TEX_util.h"
#include "TEX_node.h"
#include <math.h>
static bNodeSocketType inputs[]= {

@ -34,6 +34,7 @@
#include <math.h>
#include "BLI_math.h"
#include "../TEX_util.h"
#include "TEX_node.h"
static bNodeSocketType inputs[]= {
{ SOCK_VECTOR, 1, "Coordinate 1", 0.0f, 0.0f, 0.0f, 0.0f, -1.0f, 1.0f },

@ -32,6 +32,7 @@
#include "../TEX_util.h"
#include "TEX_node.h"
static bNodeSocketType inputs[]= {

@ -33,6 +33,7 @@
#include "../TEX_util.h"
#include "TEX_node.h"
static bNodeSocketType outputs[]= {
{ SOCK_RGBA, 0, "Image", 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f},

@ -32,6 +32,7 @@
#include "../TEX_util.h"
#include "TEX_node.h"
/* **************** INVERT ******************** */
static bNodeSocketType inputs[]= {

@ -32,7 +32,7 @@
#include "../TEX_util.h"
#include "TEX_node.h"
/* **************** SCALAR MATH ******************** */

@ -32,6 +32,7 @@
#include "../TEX_util.h"
#include "TEX_node.h"
/* **************** MIX RGB ******************** */
static bNodeSocketType inputs[]= {

@ -32,6 +32,7 @@
#include "../TEX_util.h"
#include "TEX_node.h"
/* **************** COMPOSITE ******************** */
static bNodeSocketType inputs[]= {

@ -32,6 +32,8 @@
#include "../TEX_util.h"
#include "TEX_node.h"
#include "RE_shader_ext.h"
/*

@ -34,6 +34,7 @@
#include <math.h>
#include "../TEX_util.h"
#include "TEX_node.h"
static bNodeSocketType inputs[]= {
{ SOCK_RGBA, 1, "Color", 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f},

@ -32,6 +32,8 @@
#include "../TEX_util.h"
#include "TEX_node.h"
#include "RE_shader_ext.h"
static bNodeSocketType inputs[]= {

@ -33,6 +33,7 @@
#include <math.h>
#include "../TEX_util.h"
#include "TEX_node.h"
static bNodeSocketType inputs[]= {
{ SOCK_RGBA, 1, "Color", 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f},

@ -32,6 +32,7 @@
#include "../TEX_util.h"
#include "TEX_node.h"
static bNodeSocketType inputs[]= {
{ SOCK_VALUE, 1, "Val", 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f },

@ -33,6 +33,7 @@
#include "../TEX_util.h"
#include "TEX_node.h"
/* **************** VALTORGB ******************** */
static bNodeSocketType valtorgb_in[]= {

@ -31,7 +31,8 @@
*/
#include "../TEX_util.h"
#include "../TEX_util.h"
#include "TEX_node.h"
#include <math.h>
static bNodeSocketType inputs[]= {

@ -64,6 +64,7 @@
#endif
/* --- end bpy build options --- */
struct ID;
extern PyTypeObject pyrna_struct_meta_idprop_Type;
extern PyTypeObject pyrna_struct_Type;
@ -192,4 +193,6 @@ void BPY_modules_update(struct bContext *C); //XXX temp solution
extern PyMethodDef meth_bpy_register_class;
extern PyMethodDef meth_bpy_unregister_class;
void BPY_id_release(struct ID *id);
#endif

@ -46,6 +46,7 @@
#include "bpy_rna.h"
#include "bpy_util.h"
#include "bpy_rna_anim.h"
#define TRUE 1
#define FALSE 0