remove unneeded casts from 'unsigned int' to 'int'

This commit is contained in:
Campbell Barton 2011-12-27 03:54:23 +00:00
parent 8d92e14088
commit 397d7d949f
6 changed files with 36 additions and 32 deletions

View File

@ -466,8 +466,8 @@ int test_index_face(MFace *mface, CustomData *fdata, int mfindex, int nr)
if(mface->v3==0) {
static int corner_indices[4] = {1, 2, 0, 3};
SWAP(int, mface->v1, mface->v2);
SWAP(int, mface->v2, mface->v3);
SWAP(unsigned int, mface->v1, mface->v2);
SWAP(unsigned int, mface->v2, mface->v3);
if(fdata)
CustomData_swap(fdata, mfindex, corner_indices);
@ -477,8 +477,8 @@ int test_index_face(MFace *mface, CustomData *fdata, int mfindex, int nr)
if(mface->v3==0 || mface->v4==0) {
static int corner_indices[4] = {2, 3, 0, 1};
SWAP(int, mface->v1, mface->v3);
SWAP(int, mface->v2, mface->v4);
SWAP(unsigned int, mface->v1, mface->v3);
SWAP(unsigned int, mface->v2, mface->v4);
if(fdata)
CustomData_swap(fdata, mfindex, corner_indices);
@ -520,12 +520,14 @@ void set_mesh(Object *ob, Mesh *me)
/* ************** make edges in a Mesh, for outside of editmode */
struct edgesort {
int v1, v2;
unsigned int v1, v2;
short is_loose, is_draw;
};
/* edges have to be added with lowest index first for sorting */
static void to_edgesort(struct edgesort *ed, int v1, int v2, short is_loose, short is_draw)
static void to_edgesort(struct edgesort *ed,
unsigned int v1, unsigned int v2,
short is_loose, short is_draw)
{
if(v1<v2) {
ed->v1= v1; ed->v2= v2;
@ -627,7 +629,7 @@ static void make_edges_mdata(MVert *UNUSED(allvert), MFace *allface, int UNUSED(
/* order is swapped so extruding this edge as a surface wont flip face normals
* with cyclic curves */
if(ed->v1+1 != ed->v2) {
SWAP(int, medge->v1, medge->v2);
SWAP(unsigned int, medge->v1, medge->v2);
}
medge++;
}
@ -1029,17 +1031,17 @@ typedef struct EdgeLink {
typedef struct VertLink {
Link *next, *prev;
int index;
unsigned int index;
} VertLink;
static void prependPolyLineVert(ListBase *lb, int index)
static void prependPolyLineVert(ListBase *lb, unsigned int index)
{
VertLink *vl= MEM_callocN(sizeof(VertLink), "VertLink");
vl->index = index;
BLI_addhead(lb, vl);
}
static void appendPolyLineVert(ListBase *lb, int index)
static void appendPolyLineVert(ListBase *lb, unsigned int index)
{
VertLink *vl= MEM_callocN(sizeof(VertLink), "VertLink");
vl->index = index;
@ -1111,8 +1113,8 @@ void mesh_to_curve(Scene *scene, Object *ob)
int closed = FALSE;
int totpoly= 0;
MEdge *med_current= ((EdgeLink *)edges.last)->edge;
int startVert= med_current->v1;
int endVert= med_current->v2;
unsigned int startVert= med_current->v1;
unsigned int endVert= med_current->v2;
int ok= TRUE;
appendPolyLineVert(&polyline, startVert); totpoly++;

View File

@ -1080,8 +1080,8 @@ int *mesh_get_x_mirror_faces(Object *ob, EditMesh *em)
/* make sure v4 is not 0 if a quad */
if(mf->v4 && mirrormf.v4==0) {
SWAP(int, mirrormf.v1, mirrormf.v3);
SWAP(int, mirrormf.v2, mirrormf.v4);
SWAP(unsigned int, mirrormf.v1, mirrormf.v3);
SWAP(unsigned int, mirrormf.v2, mirrormf.v4);
}
hashmf= BLI_ghash_lookup(fhash, &mirrormf);

View File

@ -266,7 +266,7 @@ static DerivedMesh *doMirrorOnAxis(MirrorModifierData *mmd,
}
/* Flip face normal */
SWAP(int, mf2->v1, mf2->v3);
SWAP(unsigned int, mf2->v1, mf2->v3);
DM_swap_face_data(result, numFaces, corner_indices);
test_index_face(mf2, &result->faceData, numFaces, inMF.v4?4:3);

View File

@ -145,12 +145,12 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
int mface_index=0;
int step;
int i, j;
int i1,i2;
unsigned int i1, i2;
int step_tot= useRenderParams ? ltmd->render_steps : ltmd->steps;
const int do_flip = ltmd->flag & MOD_SCREW_NORMAL_FLIP ? 1 : 0;
int maxVerts=0, maxEdges=0, maxFaces=0;
int totvert= dm->getNumVerts(dm);
int totedge= dm->getNumEdges(dm);
const unsigned int totvert= dm->getNumVerts(dm);
const unsigned int totedge= dm->getNumEdges(dm);
char axis_char= 'X', close;
float angle= ltmd->angle;
@ -571,7 +571,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
if (lt_iter.v == lt_iter.e->v1) {
if (ed_loop_flip == 0) {
/*printf("\t\t\tFlipping 0\n");*/
SWAP(int, lt_iter.e->v1, lt_iter.e->v2);
SWAP(unsigned int, lt_iter.e->v1, lt_iter.e->v2);
}/* else {
printf("\t\t\tFlipping Not 0\n");
}*/
@ -579,7 +579,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
else if (lt_iter.v == lt_iter.e->v2) {
if (ed_loop_flip == 1) {
/*printf("\t\t\tFlipping 1\n");*/
SWAP(int, lt_iter.e->v1, lt_iter.e->v2);
SWAP(unsigned int, lt_iter.e->v1, lt_iter.e->v2);
}/* else {
printf("\t\t\tFlipping Not 1\n");
}*/
@ -771,8 +771,8 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
}
if( !mf_new->v3 || !mf_new->v4 ) {
SWAP(int, mf_new->v1, mf_new->v3);
SWAP(int, mf_new->v2, mf_new->v4);
SWAP(unsigned int, mf_new->v1, mf_new->v3);
SWAP(unsigned int, mf_new->v2, mf_new->v4);
}
mf_new->flag= ME_SMOOTH;
origindex[mface_index]= ORIGINDEX_NONE;
@ -807,8 +807,8 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
}
if( !mf_new->v3 || !mf_new->v4 ) {
SWAP(int, mf_new->v1, mf_new->v3);
SWAP(int, mf_new->v2, mf_new->v4);
SWAP(unsigned int, mf_new->v1, mf_new->v3);
SWAP(unsigned int, mf_new->v2, mf_new->v4);
}
mf_new->flag= ME_SMOOTH;
origindex[mface_index]= ORIGINDEX_NONE;

View File

@ -350,7 +350,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
{
static int corner_indices[4] = {2, 1, 0, 3};
int is_quad;
unsigned int is_quad;
for(i=0, mf=mface+numFaces; i<numFaces; i++, mf++) {
mf->v1 += numVerts;
@ -362,7 +362,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
/* Flip face normal */
{
is_quad = mf->v4;
SWAP(int, mf->v1, mf->v3);
SWAP(unsigned int, mf->v1, mf->v3);
DM_swap_face_data(result, i+numFaces, corner_indices);
test_index_face(mf, &result->faceData, numFaces, is_quad ? 4:3);
}

View File

@ -3056,17 +3056,19 @@ static void init_render_curve(Render *re, ObjectRen *obr, int timeoffset)
/* ------------------------------------------------------------------------- */
struct edgesort {
int v1, v2;
unsigned int v1, v2;
int f;
int i1, i2;
unsigned int i1, i2;
};
/* edges have to be added with lowest index first for sorting */
static void to_edgesort(struct edgesort *ed, int i1, int i2, int v1, int v2, int f)
static void to_edgesort(struct edgesort *ed,
unsigned int i1, unsigned int i2,
unsigned int v1, unsigned int v2, int f)
{
if(v1>v2) {
SWAP(int, v1, v2);
SWAP(int, i1, i2);
if (v1 > v2) {
SWAP(unsigned int, v1, v2);
SWAP(unsigned int, i1, i2);
}
ed->v1= v1;