fix for bad NULL check in bmo_connect_pair, also remove duplicate checks in if statements and redundant initialization vars.

This commit is contained in:
Campbell Barton 2013-07-13 16:25:47 +00:00
parent 4a39a4a92a
commit b7396654e1
9 changed files with 16 additions and 12 deletions

@ -87,7 +87,7 @@ void blf_font_size(FontBLF *font, unsigned int size, unsigned int dpi)
err = FT_Set_Char_Size(font->face, 0, (FT_F26Dot6)(size * 64), dpi, dpi);
if (err) {
/* FIXME: here we can go through the fixed size and choice a close one */
printf("The current font don't support the size, %d and dpi, %d\n", size, dpi);
printf("The current font don't support the size, %u and dpi, %u\n", size, dpi);
return;
}

@ -539,7 +539,7 @@ float BKE_brush_sample_tex_3D(const Scene *scene, Brush *br,
else if (mtex->brush_map_mode == MTEX_MAP_MODE_STENCIL) {
float rotation = -mtex->rot;
float point_2d[2] = {point[0], point[1]};
float x = 0.0f, y = 0.0f; /* Quite warnings */
float x, y;
float co[3];
x = point_2d[0] - br->stencil_pos[0];
@ -658,7 +658,7 @@ float BKE_brush_sample_masktex(const Scene *scene, Brush *br,
if (mtex->brush_map_mode == MTEX_MAP_MODE_STENCIL) {
float rotation = -mtex->rot;
float point_2d[2] = {point[0], point[1]};
float x = 0.0f, y = 0.0f; /* Quite warnings */
float x, y;
float co[3];
x = point_2d[0] - br->mask_stencil_pos[0];

@ -2519,7 +2519,7 @@ static void distlimit_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *t
/* only evaluate if there is a target */
if (VALID_CONS_TARGET(ct)) {
float dvec[3], dist = 0.0f, sfac = 1.0f;
float dvec[3], dist, sfac = 1.0f;
short clamp_surf = 0;
/* calculate our current distance from the target */

@ -3455,7 +3455,7 @@ static bool check_point_in_stroke(bGPDstroke *stroke, float x, float y)
prev = i;
}
return count % 2 ? true : false;
return (count % 2) ? true : false;
}
/* Check whether point is inside any stroke of grease pencil layer. */

@ -381,7 +381,7 @@ void bmo_connect_vert_pair_exec(BMesh *bm, BMOperator *op)
pc.v_b = ((BMVert **)op_verts_slot->data.p)[1];
/* fail! */
if (!(pc.v_a && pc.v_a)) {
if (!(pc.v_a && pc.v_b)) {
return;
}

@ -174,7 +174,6 @@ void EDBM_stats_update(BMEditMesh *em)
DerivedMesh *EDBM_mesh_deform_dm_get(BMEditMesh *em)
{
return ((em->derivedFinal != NULL) &&
(em->derivedFinal) &&
(em->derivedFinal->type == DM_TYPE_EDITBMESH) &&
(em->derivedFinal->deformedOnly != false)) ? em->derivedFinal : NULL;
}

@ -1682,7 +1682,7 @@ static int manipulator_selectbuf(ScrArea *sa, ARegion *ar, const int mval[2], fl
rctf rect;
GLuint buffer[64]; // max 4 items per select, so large enuf
short hits;
extern void setwinmatrixview3d(ARegion *ar, View3D *v3d, rctf *rect); // XXX check a bit later on this... (ton)
extern void setwinmatrixview3d(ARegion *, View3D *, rctf *); // XXX check a bit later on this... (ton)
/* when looking through a selected camera, the manipulator can be at the
* exact same position as the view, skip so we don't break selection */

@ -3478,9 +3478,14 @@ static void init_render_mesh(Render *re, ObjectRen *obr, int timeoffset)
ma= give_render_material(re, ob, a1+1);
/* test for 100% transparent */
ok= 1;
if (ma->alpha==0.0f && ma->spectra==0.0f && ma->spectra==0.0f && ma->filter==0.0f && (ma->mode & MA_TRANSP) && (ma->mode & (MA_RAYTRANSP | MA_RAYMIRROR))==0 ) {
ok= 0;
ok = 1;
if ((ma->alpha == 0.0f) &&
(ma->spectra == 0.0f) &&
(ma->filter == 0.0f) &&
(ma->mode & MA_TRANSP) &&
(ma->mode & (MA_RAYTRANSP | MA_RAYMIRROR)) == 0)
{
ok = 0;
/* texture on transparency? */
for (a=0; a<MAX_MTEX; a++) {
if (ma->mtex[a] && ma->mtex[a]->tex) {

@ -409,7 +409,7 @@ static int marble(Tex *tex, const float texvec[3], TexResult *texres)
static int magic(Tex *tex, const float texvec[3], TexResult *texres)
{
float x, y, z, turb=1.0;
float x, y, z, turb;
int n;
n= tex->noisedepth;