/WX enabled for MSVC in CMake too.

Warning fixes.
This commit is contained in:
Nathan Letwory
2010-10-21 08:32:53 +00:00
parent c4ad3cb5c4
commit c9d16d0ddb
13 changed files with 39 additions and 36 deletions

View File

@@ -69,6 +69,7 @@ IF(APPLE)
ADD_DEFINITIONS(-DWITH_QUICKTIME) ADD_DEFINITIONS(-DWITH_QUICKTIME)
ENDIF(WITH_QUICKTIME) ENDIF(WITH_QUICKTIME)
ELSEIF(WIN32) ELSEIF(WIN32)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX")
LIST(APPEND INC ${WINTAB_INC}) LIST(APPEND INC ${WINTAB_INC})
LIST(APPEND SRC LIST(APPEND SRC

View File

@@ -136,7 +136,7 @@ void interpolateOnTriangle ( float to[3], float v1[3], float v2[3], float v3[3],
///////////////////////////////////////////////// /////////////////////////////////////////////////
// used in effect.c // used in effect.c
///////////////////////////////////////////////// /////////////////////////////////////////////////
struct Object **get_collisionobjects(struct Scene *scene, struct Object *self, struct Group *group, int *numcollobj); struct Object **get_collisionobjects(struct Scene *scene, struct Object *self, struct Group *group, unsigned int *numcollobj);
typedef struct ColliderCache { typedef struct ColliderCache {
struct ColliderCache *next, *prev; struct ColliderCache *next, *prev;

View File

@@ -130,6 +130,7 @@ IF(WITH_LZMA)
ENDIF(WITH_LZMA) ENDIF(WITH_LZMA)
IF(WIN32) IF(WIN32)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /WX")
LIST(APPEND INC ${PTHREADS_INC}) LIST(APPEND INC ${PTHREADS_INC})
ENDIF(WIN32) ENDIF(WIN32)

View File

@@ -385,7 +385,8 @@ static int do_step_cloth(Object *ob, ClothModifierData *clmd, DerivedMesh *resul
Cloth *cloth; Cloth *cloth;
ListBase *effectors = NULL; ListBase *effectors = NULL;
MVert *mvert; MVert *mvert;
int i, ret = 0; unsigned int i = 0;
int ret = 0;
/* simulate 1 frame forward */ /* simulate 1 frame forward */
cloth = clmd->clothObject; cloth = clmd->clothObject;
@@ -1044,10 +1045,10 @@ static int cloth_build_springs ( ClothModifierData *clmd, DerivedMesh *dm )
Cloth *cloth = clmd->clothObject; Cloth *cloth = clmd->clothObject;
ClothSpring *spring = NULL, *tspring = NULL, *tspring2 = NULL; ClothSpring *spring = NULL, *tspring = NULL, *tspring2 = NULL;
unsigned int struct_springs = 0, shear_springs=0, bend_springs = 0; unsigned int struct_springs = 0, shear_springs=0, bend_springs = 0;
int i = 0; unsigned int i = 0;
int numverts = dm->getNumVerts ( dm ); unsigned int numverts = (unsigned int)dm->getNumVerts ( dm );
int numedges = dm->getNumEdges ( dm ); unsigned int numedges = (unsigned int)dm->getNumEdges ( dm );
int numfaces = dm->getNumFaces ( dm ); unsigned int numfaces = (unsigned int)dm->getNumFaces ( dm );
MEdge *medge = CDDM_get_edges ( dm ); MEdge *medge = CDDM_get_edges ( dm );
MFace *mface = CDDM_get_faces ( dm ); MFace *mface = CDDM_get_faces ( dm );
int index2 = 0; // our second vertex index int index2 = 0; // our second vertex index

View File

@@ -83,7 +83,7 @@ BVHTree *bvhtree_build_from_mvert ( MFace *mfaces, unsigned int numfaces, MVert
{ {
BVHTree *tree; BVHTree *tree;
float co[12]; float co[12];
int i; unsigned int i;
MFace *tface = mfaces; MFace *tface = mfaces;
tree = BLI_bvhtree_new ( numfaces*2, epsilon, 4, 26 ); tree = BLI_bvhtree_new ( numfaces*2, epsilon, 4, 26 );
@@ -1342,12 +1342,12 @@ static void add_collision_object(Object ***objs, int *numobj, int *maxobj, Objec
// return all collision objects in scene // return all collision objects in scene
// collision object will exclude self // collision object will exclude self
Object **get_collisionobjects(Scene *scene, Object *self, Group *group, int *numcollobj) Object **get_collisionobjects(Scene *scene, Object *self, Group *group, unsigned int *numcollobj)
{ {
Base *base; Base *base;
Object **objs; Object **objs;
GroupObject *go; GroupObject *go;
int numobj= 0, maxobj= 100; unsigned int numobj= 0, maxobj= 100;
objs= MEM_callocN(sizeof(Object *)*maxobj, "CollisionObjectsArray"); objs= MEM_callocN(sizeof(Object *)*maxobj, "CollisionObjectsArray");
@@ -1503,12 +1503,12 @@ int cloth_bvh_objcollision (Object *ob, ClothModifierData * clmd, float step, fl
{ {
Cloth *cloth= clmd->clothObject; Cloth *cloth= clmd->clothObject;
BVHTree *cloth_bvh= cloth->bvhtree; BVHTree *cloth_bvh= cloth->bvhtree;
int i=0, numfaces = 0, numverts = 0, k, l, j; unsigned int i=0, numfaces = 0, numverts = 0, k, l, j;
int rounds = 0; // result counts applied collisions; ic is for debug output; int rounds = 0; // result counts applied collisions; ic is for debug output;
ClothVertex *verts = NULL; ClothVertex *verts = NULL;
int ret = 0, ret2 = 0; int ret = 0, ret2 = 0;
Object **collobjs = NULL; Object **collobjs = NULL;
int numcollobj = 0; unsigned int numcollobj = 0;
if ((clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_COLLOBJ) || cloth_bvh==NULL) if ((clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_COLLOBJ) || cloth_bvh==NULL)
return 0; return 0;
@@ -1605,11 +1605,11 @@ int cloth_bvh_objcollision (Object *ob, ClothModifierData * clmd, float step, fl
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
if ( clmd->coll_parms->flags & CLOTH_COLLSETTINGS_FLAG_SELF ) if ( clmd->coll_parms->flags & CLOTH_COLLSETTINGS_FLAG_SELF )
{ {
for(l = 0; l < clmd->coll_parms->self_loop_count; l++) for(l = 0; l < (unsigned int)clmd->coll_parms->self_loop_count; l++)
{ {
// TODO: add coll quality rounds again // TODO: add coll quality rounds again
BVHTreeOverlap *overlap = NULL; BVHTreeOverlap *overlap = NULL;
int result = 0; unsigned int result = 0;
// collisions = 1; // collisions = 1;
verts = cloth->verts; // needed for openMP verts = cloth->verts; // needed for openMP

View File

@@ -1004,7 +1004,8 @@ DO_INLINE void save_sample_line(Scopes *scopes, const int idx, const float fx, f
void scopes_update(Scopes *scopes, ImBuf *ibuf, int use_color_management) void scopes_update(Scopes *scopes, ImBuf *ibuf, int use_color_management)
{ {
int x, y, c, n, nl; int x, y, c;
unsigned int n, nl;
double div, divl; double div, divl;
float *rf=NULL; float *rf=NULL;
unsigned char *rc=NULL; unsigned char *rc=NULL;

View File

@@ -146,7 +146,7 @@ static void fcm_generator_verify (FModifier *fcm)
nc= MEM_callocN(sizeof(float)*(data->poly_order+1), "FMod_Generator_Coefs"); nc= MEM_callocN(sizeof(float)*(data->poly_order+1), "FMod_Generator_Coefs");
if (data->coefficients) { if (data->coefficients) {
if (data->arraysize > (data->poly_order+1)) if ((int)data->arraysize > (data->poly_order+1))
memcpy(nc, data->coefficients, sizeof(float)*(data->poly_order+1)); memcpy(nc, data->coefficients, sizeof(float)*(data->poly_order+1));
else else
memcpy(nc, data->coefficients, sizeof(float)*data->arraysize); memcpy(nc, data->coefficients, sizeof(float)*data->arraysize);
@@ -172,7 +172,7 @@ static void fcm_generator_verify (FModifier *fcm)
nc= MEM_callocN(sizeof(float)*(data->poly_order*2), "FMod_Generator_Coefs"); nc= MEM_callocN(sizeof(float)*(data->poly_order*2), "FMod_Generator_Coefs");
if (data->coefficients) { if (data->coefficients) {
if (data->arraysize > (data->poly_order * 2)) if (data->arraysize > (unsigned int)(data->poly_order * 2))
memcpy(nc, data->coefficients, sizeof(float)*(data->poly_order * 2)); memcpy(nc, data->coefficients, sizeof(float)*(data->poly_order * 2));
else else
memcpy(nc, data->coefficients, sizeof(float)*data->arraysize); memcpy(nc, data->coefficients, sizeof(float)*data->arraysize);
@@ -240,7 +240,7 @@ static void fcm_generator_evaluate (FCurve *UNUSED(fcu), FModifier *fcm, float *
unsigned int i; unsigned int i;
/* for each coefficient pair, solve for that bracket before accumulating in value by multiplying */ /* for each coefficient pair, solve for that bracket before accumulating in value by multiplying */
for (cp=data->coefficients, i=0; (cp) && (i < data->poly_order); cp+=2, i++) for (cp=data->coefficients, i=0; (cp) && (i < (unsigned int)data->poly_order); cp+=2, i++)
value *= (cp[0]*evaltime + cp[1]); value *= (cp[0]*evaltime + cp[1]);
/* only if something changed, write *cvalue in one go */ /* only if something changed, write *cvalue in one go */

View File

@@ -1425,7 +1425,7 @@ typedef struct HairGridVert {
by Lena Petrovic, Mark Henne and John Anderson by Lena Petrovic, Mark Henne and John Anderson
* Pixar Technical Memo #06-08, Pixar Animation Studios * Pixar Technical Memo #06-08, Pixar Animation Studios
*/ */
static void hair_velocity_smoothing(ClothModifierData *clmd, lfVector *lF, lfVector *lX, lfVector *lV, int numverts) static void hair_velocity_smoothing(ClothModifierData *clmd, lfVector *lF, lfVector *lX, lfVector *lV, unsigned int numverts)
{ {
/* TODO: This is an initial implementation and should be made much better in due time. /* TODO: This is an initial implementation and should be made much better in due time.
* What should at least be implemented is a grid size parameter and a smoothing kernel * What should at least be implemented is a grid size parameter and a smoothing kernel
@@ -1441,10 +1441,10 @@ static void hair_velocity_smoothing(ClothModifierData *clmd, lfVector *lF, lfVec
/* 2.0f is an experimental value that seems to give good results */ /* 2.0f is an experimental value that seems to give good results */
float smoothfac = 2.0f * clmd->sim_parms->velocity_smooth; float smoothfac = 2.0f * clmd->sim_parms->velocity_smooth;
float collfac = 2.0f * clmd->sim_parms->collider_friction; float collfac = 2.0f * clmd->sim_parms->collider_friction;
int v = 0; unsigned int v = 0;
int i = 0; unsigned int i = 0;
int j = 0; int j = 0;
int k = 0; int k = 0;
INIT_MINMAX(gmin, gmax); INIT_MINMAX(gmin, gmax);
@@ -1559,7 +1559,7 @@ static void cloth_calc_force(ClothModifierData *clmd, float UNUSED(frame), lfVec
{ {
/* Collect forces and derivatives: F,dFdX,dFdV */ /* Collect forces and derivatives: F,dFdX,dFdV */
Cloth *cloth = clmd->clothObject; Cloth *cloth = clmd->clothObject;
int i = 0; unsigned int i = 0;
float spring_air = clmd->sim_parms->Cvi * 0.01f; /* viscosity of air scaled in percent */ float spring_air = clmd->sim_parms->Cvi * 0.01f; /* viscosity of air scaled in percent */
float gravity[3] = {0.0f, 0.0f, 0.0f}; float gravity[3] = {0.0f, 0.0f, 0.0f};
float tm2[3][3] = {{-spring_air,0,0}, {0,-spring_air,0},{0,0,-spring_air}}; float tm2[3][3] = {{-spring_air,0,0}, {0,-spring_air,0},{0,0,-spring_air}};

View File

@@ -1123,7 +1123,7 @@ static void icu_to_fcurves (ID *id, ListBase *groups, ListBase *list, IpoCurve *
{ {
AdrBit2Path *abp; AdrBit2Path *abp;
FCurve *fcu; FCurve *fcu;
int i=0, totbits; unsigned int i=0, totbits;
/* allocate memory for a new F-Curve */ /* allocate memory for a new F-Curve */
fcu= MEM_callocN(sizeof(FCurve), "FCurve"); fcu= MEM_callocN(sizeof(FCurve), "FCurve");
@@ -1174,7 +1174,7 @@ static void icu_to_fcurves (ID *id, ListBase *groups, ListBase *list, IpoCurve *
abp= adrcode_bitmaps_to_paths(icu->blocktype, icu->adrcode, &totbits); abp= adrcode_bitmaps_to_paths(icu->blocktype, icu->adrcode, &totbits);
if (abp && totbits) { if (abp && totbits) {
FCurve *fcurve; FCurve *fcurve;
int b; unsigned int b;
if (G.f & G_DEBUG) printf("\tconvert bitflag ipocurve, totbits = %d \n", totbits); if (G.f & G_DEBUG) printf("\tconvert bitflag ipocurve, totbits = %d \n", totbits);

View File

@@ -1158,18 +1158,19 @@ static void multires_load_old_dm(DerivedMesh *dm, Mesh *me, int totlvl)
MultiresLevel *lvl, *lvl1; MultiresLevel *lvl, *lvl1;
Multires *mr= me->mr; Multires *mr= me->mr;
MVert *vsrc, *vdst; MVert *vsrc, *vdst;
int src, dst; unsigned int src, dst;
int st = multires_side_tot[totlvl - 1] - 1; int st = multires_side_tot[totlvl - 1] - 1;
int extedgelen = multires_side_tot[totlvl] - 2; int extedgelen = multires_side_tot[totlvl] - 2;
int *vvmap; // inorder for dst, map to src int *vvmap; // inorder for dst, map to src
int crossedgelen; int crossedgelen;
int i, j, s, x, totvert, tottri, totquad; int s, x, tottri, totquad;
unsigned int i, j, totvert;
src = 0; src = 0;
dst = 0; dst = 0;
vsrc = mr->verts; vsrc = mr->verts;
vdst = dm->getVertArray(dm); vdst = dm->getVertArray(dm);
totvert = dm->getNumVerts(dm); totvert = (unsigned int)dm->getNumVerts(dm);
vvmap = MEM_callocN(sizeof(int) * totvert, "multires vvmap"); vvmap = MEM_callocN(sizeof(int) * totvert, "multires vvmap");
lvl1 = mr->levels.first; lvl1 = mr->levels.first;
@@ -1260,7 +1261,7 @@ static void multires_load_old_dm(DerivedMesh *dm, Mesh *me, int totlvl)
fmem = MEM_callocN(sizeof(IndexNode*) * (mr->level_count-1), "multires fmem"); fmem = MEM_callocN(sizeof(IndexNode*) * (mr->level_count-1), "multires fmem");
emem = MEM_callocN(sizeof(IndexNode*) * (mr->level_count-1), "multires emem"); emem = MEM_callocN(sizeof(IndexNode*) * (mr->level_count-1), "multires emem");
lvl = lvl1; lvl = lvl1;
for(i = 0; i < mr->level_count - 1; ++i) { for(i = 0; i < (unsigned int)mr->level_count - 1; ++i) {
create_old_vert_face_map(fmap + i, fmem + i, lvl->faces, lvl->totvert, lvl->totface); create_old_vert_face_map(fmap + i, fmem + i, lvl->faces, lvl->totvert, lvl->totface);
create_old_vert_edge_map(emap + i, emem + i, lvl->edges, lvl->totvert, lvl->totedge); create_old_vert_edge_map(emap + i, emem + i, lvl->edges, lvl->totvert, lvl->totedge);
lvl = lvl->next; lvl = lvl->next;
@@ -1297,7 +1298,7 @@ static void multires_load_old_dm(DerivedMesh *dm, Mesh *me, int totlvl)
lvl = lvl->next; lvl = lvl->next;
for(i = 0; i < mr->level_count - 1; ++i) { for(i = 0; i < (unsigned int)(mr->level_count - 1); ++i) {
MEM_freeN(fmap[i]); MEM_freeN(fmap[i]);
MEM_freeN(fmem[i]); MEM_freeN(fmem[i]);
MEM_freeN(emap[i]); MEM_freeN(emap[i]);

View File

@@ -62,8 +62,6 @@
#include "IMB_imbuf.h" #include "IMB_imbuf.h"
#include "IMB_imbuf_types.h" #include "IMB_imbuf_types.h"
#include "BKE_context.h" #include "BKE_context.h"
#include "BKE_sound.h" #include "BKE_sound.h"
#include "AUD_C-API.h" #include "AUD_C-API.h"
@@ -3219,7 +3217,7 @@ void seq_offset_animdata(Scene *scene, Sequence *seq, int ofs)
for (fcu= scene->adt->action->curves.first; fcu; fcu= fcu->next) { for (fcu= scene->adt->action->curves.first; fcu; fcu= fcu->next) {
if(strstr(fcu->rna_path, "sequence_editor.sequences_all[") && strstr(fcu->rna_path, str)) { if(strstr(fcu->rna_path, "sequence_editor.sequences_all[") && strstr(fcu->rna_path, str)) {
int i; unsigned int i;
for (i = 0; i < fcu->totvert; i++) { for (i = 0; i < fcu->totvert; i++) {
BezTriple *bezt= &fcu->bezt[i]; BezTriple *bezt= &fcu->bezt[i];
bezt->vec[0][0] += ofs; bezt->vec[0][0] += ofs;

View File

@@ -991,8 +991,8 @@ void txt_move_to (Text *text, unsigned int line, unsigned int ch, short sel)
if ((*linep)->next) *linep= (*linep)->next; if ((*linep)->next) *linep= (*linep)->next;
else break; else break;
} }
if (ch>(*linep)->len) if (ch>(unsigned int)((*linep)->len))
ch= (*linep)->len; ch= (unsigned int)((*linep)->len);
*charp= ch; *charp= ch;
if(!sel) txt_pop_sel(text); if(!sel) txt_pop_sel(text);

View File

@@ -955,7 +955,7 @@ int append_ffmpeg(RenderData *rd, int frame, int *pixels, int rectx, int recty,
void end_ffmpeg(void) void end_ffmpeg(void)
{ {
int i; unsigned int i;
fprintf(stderr, "Closing ffmpeg...\n"); fprintf(stderr, "Closing ffmpeg...\n");