code cleanup: favor braces when blocks have mixed brace use.

This commit is contained in:
Campbell Barton 2013-03-09 03:46:30 +00:00
parent 9e1ead1940
commit ddddb7bab1
84 changed files with 689 additions and 322 deletions

@ -404,7 +404,9 @@ int AVI_is_avi(const char *name)
}
if (j > 0) fseek(movie.fp, j, SEEK_CUR);
}
else fseek(movie.fp, movie.streams[temp].sf_size, SEEK_CUR);
else {
fseek(movie.fp, movie.streams[temp].sf_size, SEEK_CUR);
}
/* Walk to the next LIST */
while (GET_FCC(movie.fp) != FCC("LIST")) {
@ -595,8 +597,10 @@ AviError AVI_open_movie(const char *name, AviMovie *movie)
}
if (j > 0) fseek(movie->fp, j, SEEK_CUR);
}
else fseek(movie->fp, movie->streams[temp].sf_size, SEEK_CUR);
else {
fseek(movie->fp, movie->streams[temp].sf_size, SEEK_CUR);
}
/* Walk to the next LIST */
while (GET_FCC(movie->fp) != FCC("LIST")) {
temp = GET_FCC(movie->fp);

@ -199,7 +199,9 @@ int curvemap_remove_point(CurveMap *cuma, CurveMapPoint *point)
cmp[b] = cuma->curve[a];
b++;
}
else removed++;
else {
removed++;
}
}
MEM_freeN(cuma->curve);
@ -221,7 +223,9 @@ void curvemap_remove(CurveMap *cuma, const short flag)
cmp[b] = cuma->curve[a];
b++;
}
else removed++;
else {
removed++;
}
}
cmp[b] = cuma->curve[a];

@ -793,7 +793,9 @@ static void makeknots(Nurb *nu, short uv)
calcknots(nu->knotsv, nu->pntsv, nu->orderv, nu->flagv);
}
}
else nu->knotsv = NULL;
else {
nu->knotsv = NULL;
}
}
}
}

@ -1555,7 +1555,9 @@ static unsigned int flush_layer_node(Scene *sce, DagNode *node, int curtime)
if (itA->node->lasttime != curtime) {
itA->lay = flush_layer_node(sce, itA->node, curtime); /* lay is only set once for each relation */
}
else itA->lay = itA->node->lay;
else {
itA->lay = itA->node->lay;
}
node->lay |= itA->lay;
}

@ -473,7 +473,9 @@ static float mixColors(float a_color[3], float a_weight, float b_color[3], float
}
weight_ratio = b_weight / (a_weight + b_weight);
}
else return a_weight * (1.0f - ratio);
else {
return a_weight * (1.0f - ratio);
}
/* calculate final interpolation factor */
if (ratio <= 0.5f) {
@ -2606,7 +2608,9 @@ int dynamicPaint_createUVSurface(DynamicPaintSurface *surface)
if (!f_data->uv_p || !f_data->barycentricWeights) error = 1;
}
else error = 1;
else {
error = 1;
}
sData->total_points = active_points;
@ -2859,7 +2863,9 @@ static void dynamicPaint_doMaterialTex(BrushMaterials *bMats, float color[3], fl
mat = bMats->ob_mats[mat_nr];
if (mat == NULL) return; /* No material assigned */
}
else return;
else {
return;
}
}
RE_sample_material_color(mat, color, alpha, volume_co, surface_co, faceIndex, isQuad, orcoDm, brushOb);
@ -3924,7 +3930,9 @@ static int dynamicPaint_paintSinglePoint(DynamicPaintSurface *surface, float *po
strength = 1.0f - distance / brush_radius;
CLAMP(strength, 0.0f, 1.0f);
}
else strength = 1.0f;
else {
strength = 1.0f;
}
if (strength >= 0.001f) {
float paintColor[3] = {0.0f};

@ -943,10 +943,13 @@ makebreak:
ct = chartransdata;
for (i = 0; i < slen; i++) {
if (ct->linenr == lnr) {
if (ct->charnr == cnr) break;
if ( (ct + 1)->charnr == 0) break;
if ((ct->charnr == cnr) || ((ct + 1)->charnr == 0)) {
break;
}
}
else if (ct->linenr > lnr) {
break;
}
else if (ct->linenr > lnr) break;
cu->pos++;
ct++;
}

@ -1567,7 +1567,9 @@ static void stampdata(Scene *scene, Object *camera, StampData *stamp_data, int d
if (camera && camera->type == OB_CAMERA) {
BLI_snprintf(text, sizeof(text), "%.2f", ((Camera *)camera->data)->lens);
}
else BLI_strncpy(text, "<none>", sizeof(text));
else {
BLI_strncpy(text, "<none>", sizeof(text));
}
BLI_snprintf(stamp_data->cameralens, sizeof(stamp_data->cameralens), do_prefix ? "Lens %s" : "%s", text);
}

@ -405,9 +405,13 @@ static int setkeys(float fac, ListBase *lb, KeyBlock *k[], float t[4], int cycl)
k1 = firstkey;
ofs += dpos;
}
else if (t[2] == t[3]) break;
else if (t[2] == t[3]) {
break;
}
}
else {
k1 = k1->next;
}
else k1 = k1->next;
t[0] = t[1];
k[0] = k[1];
@ -595,7 +599,9 @@ static void cp_key(const int start, int end, const int tot, char *poin, Key *key
k1 += a * key->elemsize;
}
}
else k1 += start * key->elemsize;
else {
k1 += start * key->elemsize;
}
}
if (mode == KEY_MODE_BEZTRIPLE) {
@ -828,7 +834,9 @@ static void do_key(const int start, int end, const int tot, char *poin, Key *key
if (k[0]->totelem) {
k1d = k[0]->totelem / (float)tot;
}
else flagdo -= 1;
else {
flagdo -= 1;
}
}
if (tot != k[1]->totelem) {
k2tot = 0.0;
@ -836,7 +844,9 @@ static void do_key(const int start, int end, const int tot, char *poin, Key *key
if (k[0]->totelem) {
k2d = k[1]->totelem / (float)tot;
}
else flagdo -= 2;
else {
flagdo -= 2;
}
}
if (tot != k[2]->totelem) {
k3tot = 0.0;
@ -844,7 +854,9 @@ static void do_key(const int start, int end, const int tot, char *poin, Key *key
if (k[0]->totelem) {
k3d = k[2]->totelem / (float)tot;
}
else flagdo -= 4;
else {
flagdo -= 4;
}
}
if (tot != k[3]->totelem) {
k4tot = 0.0;
@ -852,7 +864,9 @@ static void do_key(const int start, int end, const int tot, char *poin, Key *key
if (k[0]->totelem) {
k4d = k[3]->totelem / (float)tot;
}
else flagdo -= 8;
else {
flagdo -= 8;
}
}
/* this exception needed for slurphing */
@ -869,7 +883,9 @@ static void do_key(const int start, int end, const int tot, char *poin, Key *key
k1 += a * key->elemsize;
}
}
else k1 += start * key->elemsize;
else {
k1 += start * key->elemsize;
}
}
if (flagdo & 2) {
if (flagflo & 2) {
@ -880,7 +896,9 @@ static void do_key(const int start, int end, const int tot, char *poin, Key *key
k2 += a * key->elemsize;
}
}
else k2 += start * key->elemsize;
else {
k2 += start * key->elemsize;
}
}
if (flagdo & 4) {
if (flagflo & 4) {
@ -891,7 +909,9 @@ static void do_key(const int start, int end, const int tot, char *poin, Key *key
k3 += a * key->elemsize;
}
}
else k3 += start * key->elemsize;
else {
k3 += start * key->elemsize;
}
}
if (flagdo & 8) {
if (flagflo & 8) {
@ -902,7 +922,9 @@ static void do_key(const int start, int end, const int tot, char *poin, Key *key
k4 += a * key->elemsize;
}
}
else k4 += start * key->elemsize;
else {
k4 += start * key->elemsize;
}
}
}
@ -968,7 +990,9 @@ static void do_key(const int start, int end, const int tot, char *poin, Key *key
k2 += elemsize;
}
}
else k2 += elemsize;
else {
k2 += elemsize;
}
}
if (flagdo & 4) {
if (flagflo & 4) {
@ -978,7 +1002,9 @@ static void do_key(const int start, int end, const int tot, char *poin, Key *key
k3 += elemsize;
}
}
else k3 += elemsize;
else {
k3 += elemsize;
}
}
if (flagdo & 8) {
if (flagflo & 8) {
@ -988,7 +1014,9 @@ static void do_key(const int start, int end, const int tot, char *poin, Key *key
k4 += elemsize;
}
}
else k4 += elemsize;
else {
k4 += elemsize;
}
}
if (mode == KEY_MODE_BEZTRIPLE) a += 2;

@ -404,9 +404,11 @@ void calc_latt_deform(Object *ob, float co[3], float weight)
if (w != 0.0f) {
if (ww > 0) {
if (ww < lt->pntsw) idx_w = ww * lt->pntsu * lt->pntsv;
else idx_w = (lt->pntsw - 1) * lt->pntsu * lt->pntsv;
else idx_w = (lt->pntsw - 1) * lt->pntsu * lt->pntsv;
}
else {
idx_w = 0;
}
else idx_w = 0;
for (vv = vi - 1; vv <= vi + 2; vv++) {
v = w * tv[vv - vi + 1];
@ -414,9 +416,11 @@ void calc_latt_deform(Object *ob, float co[3], float weight)
if (v != 0.0f) {
if (vv > 0) {
if (vv < lt->pntsv) idx_v = idx_w + vv * lt->pntsu;
else idx_v = idx_w + (lt->pntsv - 1) * lt->pntsu;
else idx_v = idx_w + (lt->pntsv - 1) * lt->pntsu;
}
else {
idx_v = idx_w;
}
else idx_v = idx_w;
for (uu = ui - 1; uu <= ui + 2; uu++) {
u = weight * v * tu[uu - ui + 1];
@ -424,9 +428,11 @@ void calc_latt_deform(Object *ob, float co[3], float weight)
if (u != 0.0f) {
if (uu > 0) {
if (uu < lt->pntsu) idx_u = idx_v + uu;
else idx_u = idx_v + (lt->pntsu - 1);
else idx_u = idx_v + (lt->pntsu - 1);
}
else {
idx_u = idx_v;
}
else idx_u = idx_v;
madd_v3_v3fl(co, &lt->latticedata[idx_u * 3], u);
@ -492,7 +498,9 @@ static int where_on_path_deform(Object *ob, float ctime, float vec[4], float dir
if (cycl == 0) {
ctime1 = CLAMPIS(ctime, 0.0f, 1.0f);
}
else ctime1 = ctime;
else {
ctime1 = ctime;
}
/* vec needs 4 items */
if (where_on_path(ob, ctime1, vec, dir, quat, radius, NULL)) {

@ -1794,7 +1794,9 @@ static short convert_tfacenomaterial(Main *main, Mesh *me, MTFace *tf, int flag)
ma->game.flag = -flag;
id_us_min((ID *)ma);
}
else printf("Error: Unable to create Material \"%s\" for Mesh \"%s\".", idname + 2, me->id.name + 2);
else {
printf("Error: Unable to create Material \"%s\" for Mesh \"%s\".", idname + 2, me->id.name + 2);
}
}
/* set as converted, no need to go bad to this face */

@ -2293,7 +2293,9 @@ void BKE_mball_polygonize(Scene *scene, Object *ob, ListBase *dispbase)
}
/* width is size per polygonize cube */
if (G.is_rendering) width = mb->rendersize;
if (G.is_rendering) {
width = mb->rendersize;
}
else {
width = mb->wiresize;
if (G.moving && mb->flag == MB_UPDATE_HALFRES) width *= 2;

@ -74,8 +74,10 @@ bProperty *BKE_bproperty_copy(bProperty *prop)
if (prop->poin && prop->poin != &prop->data) {
propn->poin = MEM_dupallocN(prop->poin);
}
else propn->poin = &propn->data;
else {
propn->poin = &propn->data;
}
return propn;
}

@ -760,7 +760,9 @@ int BKE_scene_base_iter_next(Scene **scene, int val, Base **base, Object **ob)
else {
if (*base && fase != F_DUPLI) {
*base = (*base)->next;
if (*base) *ob = (*base)->object;
if (*base) {
*ob = (*base)->object;
}
else {
if (fase == F_SCENE) {
/* (*scene) is finished, now do the set */
@ -777,7 +779,9 @@ int BKE_scene_base_iter_next(Scene **scene, int val, Base **base, Object **ob)
}
}
if (*base == NULL) fase = F_START;
if (*base == NULL) {
fase = F_START;
}
else {
if (fase != F_DUPLI) {
if ( (*base)->object->transflag & OB_DUPLI) {

@ -182,8 +182,8 @@ static void do_alphaover_effect_byte(float facf0, float facf1, int x, int y, un
fac = fac2;
mfac = 1.0f - fac2 * rt1[3];
if (fac <= 0.0f) *( (unsigned int *) rt) = *( (unsigned int *) cp2);
else if (mfac <= 0.0f) *( (unsigned int *) rt) = *( (unsigned int *) cp1);
if (fac <= 0.0f) *((unsigned int *) rt) = *((unsigned int *) cp2);
else if (mfac <= 0.0f) *((unsigned int *) rt) = *((unsigned int *) cp1);
else {
tempc[0] = fac * rt1[0] + mfac * rt2[0];
tempc[1] = fac * rt1[1] + mfac * rt2[1];
@ -206,8 +206,8 @@ static void do_alphaover_effect_byte(float facf0, float facf1, int x, int y, un
fac = fac4;
mfac = 1.0f - (fac4 * rt1[3]);
if (fac <= 0.0f) *( (unsigned int *) rt) = *( (unsigned int *) cp2);
else if (mfac <= 0.0f) *( (unsigned int *) rt) = *( (unsigned int *) cp1);
if (fac <= 0.0f) *((unsigned int *) rt) = *((unsigned int *) cp2);
else if (mfac <= 0.0f) *((unsigned int *) rt) = *((unsigned int *) cp1);
else {
tempc[0] = fac * rt1[0] + mfac * rt2[0];
tempc[1] = fac * rt1[1] + mfac * rt2[1];
@ -328,13 +328,13 @@ static void do_alphaunder_effect_byte(float facf0, float facf1, int x, int y, un
/* this complex optimization is because the
* 'skybuf' can be crossed in
*/
if (rt2[3] == 0 && fac2 == 256) *( (unsigned int *) rt) = *( (unsigned int *) rt1);
else if (rt2[3] == 255) *( (unsigned int *) rt) = *( (unsigned int *) rt2);
if (rt2[3] == 0 && fac2 == 256) *((unsigned int *) rt) = *((unsigned int *) rt1);
else if (rt2[3] == 255) *((unsigned int *) rt) = *((unsigned int *) rt2);
else {
mfac = rt2[3];
fac = (fac2 * (256 - mfac)) >> 8;
if (fac == 0) *( (unsigned int *) rt) = *( (unsigned int *) rt2);
if (fac == 0) *((unsigned int *) rt) = *((unsigned int *) rt2);
else {
rt[0] = (fac * rt1[0] + mfac * rt2[0]) >> 8;
rt[1] = (fac * rt1[1] + mfac * rt2[1]) >> 8;
@ -351,13 +351,13 @@ static void do_alphaunder_effect_byte(float facf0, float facf1, int x, int y, un
x = xo;
while (x--) {
if (rt2[3] == 0 && fac4 == 256) *( (unsigned int *) rt) = *( (unsigned int *) rt1);
else if (rt2[3] == 255) *( (unsigned int *) rt) = *( (unsigned int *) rt2);
if (rt2[3] == 0 && fac4 == 256) *((unsigned int *) rt) = *((unsigned int *) rt1);
else if (rt2[3] == 255) *((unsigned int *) rt) = *((unsigned int *) rt2);
else {
mfac = rt2[3];
fac = (fac4 * (256 - mfac)) >> 8;
if (fac == 0) *( (unsigned int *)rt) = *( (unsigned int *)rt2);
if (fac == 0) *((unsigned int *)rt) = *((unsigned int *)rt2);
else {
rt[0] = (fac * rt1[0] + mfac * rt2[0]) >> 8;
rt[1] = (fac * rt1[1] + mfac * rt2[1]) >> 8;
@ -682,7 +682,7 @@ static void gamtabs(float gamma)
}
/* inverse gamtab1 : in byte, out short */
for (a = 1; a <= 256; a++) {
if (gamma == 2.0f) igamtab1[a - 1] = a * a - 1;
if (gamma == 2.0f) igamtab1[a - 1] = a * a - 1;
else if (gamma == 1.0f) igamtab1[a - 1] = 256 * a - 1;
else {
val = a / 256.0f;

@ -2284,7 +2284,9 @@ struct DerivedMesh *smokeModifier_do(SmokeModifierData *smd, Scene *scene, Objec
{
return createDomainGeometry(smd->domain, ob);
}
else return CDDM_copy(dm);
else {
return CDDM_copy(dm);
}
}
static float calc_voxel_transp(float *result, float *input, int res[3], int *pixel, float *tRay, float correct)

@ -930,7 +930,9 @@ void txt_move_right(Text *text, short sel)
tabsize++;
(*charp) = i;
}
else (*charp) += BLI_str_utf8_size((*linep)->line + *charp);
else {
(*charp) += BLI_str_utf8_size((*linep)->line + *charp);
}
}
if (!sel) txt_pop_sel(text);

@ -256,7 +256,9 @@ int do_colorband(const ColorBand *coba, float in, float out[4])
left.pos = 0.0f;
cbd2 = &left;
}
else cbd2 = cbd1 - 1;
else {
cbd2 = cbd1 - 1;
}
if (in >= cbd1->pos && coba->ipotype < 2) {
out[0] = cbd1->r;
@ -916,9 +918,13 @@ void autotexname(Tex *tex)
strcat(di, fi);
new_id(&bmain->tex, (ID *)tex, di);
}
else new_id(&bmain->tex, (ID *)tex, texstr[tex->type]);
else {
new_id(&bmain->tex, (ID *)tex, texstr[tex->type]);
}
}
else {
new_id(&bmain->tex, (ID *)tex, texstr[tex->type]);
}
else new_id(&bmain->tex, (ID *)tex, texstr[tex->type]);
}
}
#endif

@ -261,7 +261,9 @@ void BKE_tracking_get_projection_matrix(MovieTracking *tracking, MovieTrackingOb
invert_m4_m4(imat, camera->mat);
mult_m4_m4m4(mat, winmat, imat);
}
else copy_m4_m4(mat, winmat);
else {
copy_m4_m4(mat, winmat);
}
}
/* **** space transformation functions **** */

@ -138,7 +138,9 @@ char *BLI_file_ungzip_to_mem(const char *from_file, int *size_r)
if (readsize > 0) {
size += readsize;
}
else break;
else {
break;
}
}
gzclose(gzfile);

@ -449,7 +449,9 @@ static int check_freetypefont(PackedFile *pf)
glyph_index = FT_Get_Char_Index(face, 'A');
err = FT_Load_Glyph(face, glyph_index, FT_LOAD_NO_SCALE | FT_LOAD_NO_BITMAP);
if (err) success = 0;
if (err) {
success = 0;
}
else {
glyph = face->glyph;
if (glyph->format == ft_glyph_format_outline) {

@ -2563,7 +2563,9 @@ void resolve_tri_uv(float r_uv[2], const float st[2], const float st0[2], const
r_uv[0] = (float)((d * x[0] - b * x[1]) / det);
r_uv[1] = (float)(((-c) * x[0] + a * x[1]) / det);
}
else zero_v2(r_uv);
else {
zero_v2(r_uv);
}
}
/* bilinear reverse */
@ -3062,7 +3064,9 @@ void vcloud_estimate_transform(int list_size, float (*pos)[3], float *weight, fl
add_v3_v3(accu_com, v);
accu_weight += weight[a];
}
else add_v3_v3(accu_com, pos[a]);
else {
add_v3_v3(accu_com, pos[a]);
}
if (rweight) {
float v[3];
@ -3071,8 +3075,9 @@ void vcloud_estimate_transform(int list_size, float (*pos)[3], float *weight, fl
add_v3_v3(accu_rcom, v);
accu_rweight += rweight[a];
}
else add_v3_v3(accu_rcom, rpos[a]);
else {
add_v3_v3(accu_rcom, rpos[a]);
}
}
if (!weight || !rweight) {
accu_weight = accu_rweight = list_size;

@ -191,7 +191,9 @@ double BLI_dir_free_space(const char *dir)
slash = strrchr(name, '/');
if (slash) slash[1] = 0;
}
else strcpy(name, "/");
else {
strcpy(name, "/");
}
#if defined(__FreeBSD__) || defined(linux) || defined(__OpenBSD__) || defined(__APPLE__) || defined(__GNU__) || defined(__GLIBC__)
if (statfs(name, &disk)) return(-1);

@ -3246,7 +3246,9 @@ static void direct_link_curve(FileData *fd, Curve *cu)
cu->strinfo= newdataadr(fd, cu->strinfo);
cu->tb = newdataadr(fd, cu->tb);
if (cu->vfont == NULL) link_list(fd, &(cu->nurb));
if (cu->vfont == NULL) {
link_list(fd, &(cu->nurb));
}
else {
cu->nurb.first=cu->nurb.last= NULL;
@ -3826,8 +3828,10 @@ static void lib_link_mesh(FileData *fd, Main *main)
me->mat[i] = newlibadr_us(fd, me->id.lib, me->mat[i]);
}
}
else me->totcol = 0;
else {
me->totcol = 0;
}
me->ipo = newlibadr_us(fd, me->id.lib, me->ipo); // XXX: deprecated: old anim sys
me->key = newlibadr_us(fd, me->id.lib, me->key);
me->texcomesh = newlibadr_us(fd, me->id.lib, me->texcomesh);
@ -5715,7 +5719,9 @@ void blo_lib_link_screen_restore(Main *newmain, bScreen *curscreen, Scene *cursc
}
#endif
}
else if (v3d->scenelock) v3d->lay = sc->scene->lay;
else if (v3d->scenelock) {
v3d->lay = sc->scene->lay;
}
/* not very nice, but could help */
if ((v3d->layact & v3d->lay) == 0) v3d->layact = v3d->lay;
@ -10463,7 +10469,9 @@ static void read_libraries(FileData *basefd, ListBase *mainlist)
/* subversion */
read_file_version(fd, mainptr);
}
else mainptr->curlib->filedata = NULL;
else {
mainptr->curlib->filedata = NULL;
}
if (fd == NULL) {
BKE_reportf_wrap(basefd->reports, RPT_WARNING, TIP_("Cannot find lib '%s'"),

@ -1547,7 +1547,9 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
else if (sbuts->mainb == BUTS_EDIT) {
sbuts->mainb = CONTEXT_EDITING;
}
else sbuts->mainb = CONTEXT_SCENE;
else {
sbuts->mainb = CONTEXT_SCENE;
}
}
}
}

@ -750,7 +750,9 @@ void BM_mesh_bm_to_me(BMesh *bm, Mesh *me, bool do_tessface)
hmd->indexar[j++] = BM_elem_index_get(eve);
}
}
else j++;
else {
j++;
}
}
hmd->totindex = j;

@ -276,7 +276,9 @@ static void add_marker_to_cfra_elem(ListBase *lb, TimeMarker *marker, short only
ce->sel = marker->flag;
return;
}
else if (ce->cfra > marker->frame) break;
else if (ce->cfra > marker->frame) {
break;
}
}
cen = MEM_callocN(sizeof(CfraElem), "add_to_cfra_elem");

@ -320,8 +320,8 @@ void updateDuplicateSubtargetObjects(EditBone *dupBone, ListBase *editbones, Obj
bConstraint *curcon;
ListBase *conlist;
if ( (pchan = BKE_pose_channel_verify(dst_ob->pose, dupBone->name)) ) {
if ( (conlist = &pchan->constraints) ) {
if ((pchan = BKE_pose_channel_verify(dst_ob->pose, dupBone->name))) {
if ((conlist = &pchan->constraints)) {
for (curcon = conlist->first; curcon; curcon = curcon->next) {
/* does this constraint have a subtarget in
* this armature?

@ -152,7 +152,9 @@ void ED_armature_bone_rename(bArmature *arm, const char *oldnamep, const char *n
unique_editbone_name(arm->edbo, newname, NULL);
BLI_strncpy(eBone->name, newname, MAXBONENAME);
}
else return;
else {
return;
}
}
else {
Bone *bone = BKE_armature_find_bone_name(arm, oldname);
@ -161,7 +163,9 @@ void ED_armature_bone_rename(bArmature *arm, const char *oldnamep, const char *n
unique_bone_name(arm, newname);
BLI_strncpy(bone->name, newname, MAXBONENAME);
}
else return;
else {
return;
}
}
/* do entire dbase - objects */

@ -323,7 +323,9 @@ static EditBone *get_nearest_editbonepoint(ViewContext *vc, const int mval[2],
else
dep = 2;
}
else dep = 2;
else {
dep = 2;
}
}
else {
/* bone found */
@ -333,7 +335,9 @@ static EditBone *get_nearest_editbonepoint(ViewContext *vc, const int mval[2],
else
dep = 3;
}
else dep = 3;
else {
dep = 3;
}
}
if (ebone == ebone_next_act) {
@ -390,8 +394,10 @@ void ED_armature_deselect_all(Object *obedit, int toggle)
// }
}
}
else sel = toggle;
else {
sel = toggle;
}
/* Set the flags */
for (eBone = arm->edbo->first; eBone; eBone = eBone->next) {
if (sel == 2) {

@ -626,7 +626,9 @@ static void switch_keys_direction(Curve *cu, Nurb *actnu)
bezt++;
}
}
else fp += a * 12;
else {
fp += a * 12;
}
}
else {
BPoint *bp = nu->bp;
@ -640,7 +642,9 @@ static void switch_keys_direction(Curve *cu, Nurb *actnu)
bp++;
}
}
else fp += a * 4;
else {
fp += a * 4;
}
}
nu = nu->next;
@ -1473,7 +1477,9 @@ static short isNurbselUV(Nurb *nu, int *u, int *v, int flag)
if (*u == -1) *u = b;
else return 0;
}
else if (sel > 1) return 0; /* because sel == 1 is still ok */
else if (sel > 1) {
return 0; /* because sel == 1 is still ok */
}
}
for (a = 0; a < nu->pntsu; a++) {
@ -1486,7 +1492,9 @@ static short isNurbselUV(Nurb *nu, int *u, int *v, int flag)
if (*v == -1) *v = a;
else return 0;
}
else if (sel > 1) return 0;
else if (sel > 1) {
return 0;
}
}
if (*u == -1 && *v > -1) return 1;
@ -1781,7 +1789,7 @@ static short extrudeflagNurb(EditNurb *editnurb, int flag)
else {
/* which row or column is selected */
if (isNurbselUV(nu, &u, &v, flag) ) {
if (isNurbselUV(nu, &u, &v, flag)) {
/* deselect all */
bp = nu->bp;
@ -1872,7 +1880,7 @@ static void adduplicateflagNurb(Object *obedit, short flag)
for (a = 0; a < nu->pntsu; a++) {
enda = -1;
starta = a;
while ( (bezt->f1 & flag) || (bezt->f2 & flag) || (bezt->f3 & flag) ) {
while ((bezt->f1 & flag) || (bezt->f2 & flag) || (bezt->f3 & flag)) {
select_beztriple(bezt, DESELECT, flag, HIDDEN);
enda = a;
if (a >= nu->pntsu - 1) break;
@ -2431,12 +2439,12 @@ static void select_adjacent_cp(ListBase *editnurb, short next, short cont, short
BezTriple *bezt;
BPoint *bp;
int a;
short lastsel = 0;
short lastsel = false;
if (next == 0) return;
for (nu = editnurb->first; nu; nu = nu->next) {
lastsel = 0;
lastsel = false;
if (nu->type == CU_BEZIER) {
a = nu->pntsu;
bezt = nu->bezt;
@ -2447,12 +2455,12 @@ static void select_adjacent_cp(ListBase *editnurb, short next, short cont, short
bezt += next;
if (!(bezt->f2 & SELECT) || (selstatus == 0)) {
short sel = select_beztriple(bezt, selstatus, 1, VISIBLE);
if ((sel == 1) && (cont == 0)) lastsel = 1;
if ((sel == 1) && (cont == 0)) lastsel = true;
}
}
else {
bezt += next;
lastsel = 0;
lastsel = false;
}
/* move around in zigzag way so that we go through each */
bezt -= (next - next / abs(next));
@ -2468,12 +2476,12 @@ static void select_adjacent_cp(ListBase *editnurb, short next, short cont, short
bp += next;
if (!(bp->f1 & SELECT) || (selstatus == 0)) {
short sel = select_bpoint(bp, selstatus, 1, VISIBLE);
if ((sel == 1) && (cont == 0)) lastsel = 1;
if ((sel == 1) && (cont == 0)) lastsel = true;
}
}
else {
bp += next;
lastsel = 0;
lastsel = false;
}
/* move around in zigzag way so that we go through each */
bp -= (next - next / abs(next));
@ -2878,7 +2886,7 @@ static void subdividenurb(Object *obedit, int number_cuts)
keyIndex_updateBezt(editnurb, prevbezt, beztn, 1);
beztn++;
if (BEZSELECTED_HIDDENHANDLES(cu, prevbezt) && BEZSELECTED_HIDDENHANDLES(cu, bezt) ) {
if (BEZSELECTED_HIDDENHANDLES(cu, prevbezt) && BEZSELECTED_HIDDENHANDLES(cu, bezt)) {
float prevvec[3][3];
memcpy(prevvec, prevbezt->vec, sizeof(float) * 9);
@ -3062,7 +3070,7 @@ static void subdividenurb(Object *obedit, int number_cuts)
bp++;
}
}
if (sel == (nu->pntsu * nu->pntsv) ) { /* subdivide entire nurb */
if (sel == (nu->pntsu * nu->pntsv)) { /* subdivide entire nurb */
/* Global subdivision is a special case of partial
* subdivision. Strange it is considered separately... */
@ -3332,7 +3340,7 @@ static void findselectedNurbvert(ListBase *editnurb, Nurb **nu, BezTriple **bezt
bezt1 = nu1->bezt;
a = nu1->pntsu;
while (a--) {
if ( (bezt1->f1 & SELECT) || (bezt1->f2 & SELECT) || (bezt1->f3 & SELECT) ) {
if ((bezt1->f1 & SELECT) || (bezt1->f2 & SELECT) || (bezt1->f3 & SELECT)) {
if (*nu != NULL && *nu != nu1) {
*nu = NULL;
*bp = NULL;
@ -3803,7 +3811,7 @@ static void merge_2_nurb(wmOperator *op, ListBase *editnurb, Nurb *nu1, Nurb *nu
/* first nurbs: u = resolu-1 selected */
if (is_u_selected(nu1, nu1->pntsu - 1) ) {
if (is_u_selected(nu1, nu1->pntsu - 1)) {
/* pass */
}
else {
@ -3835,7 +3843,7 @@ static void merge_2_nurb(wmOperator *op, ListBase *editnurb, Nurb *nu1, Nurb *nu
}
/* 2nd nurbs: u = 0 selected */
if (is_u_selected(nu2, 0) ) {
if (is_u_selected(nu2, 0)) {
/* pass */
}
else {
@ -4041,9 +4049,11 @@ static int make_segment_exec(bContext *C, wmOperator *op)
if ((nu->flagu & CU_NURB_CYCLIC) == 0) { /* not cyclic */
if (nu->type == CU_BEZIER) {
if (nu1 == NULL) {
if (BEZSELECTED_HIDDENHANDLES(cu, nu->bezt) ) nu1 = nu;
if (BEZSELECTED_HIDDENHANDLES(cu, nu->bezt)) {
nu1 = nu;
}
else {
if (BEZSELECTED_HIDDENHANDLES(cu, &(nu->bezt[nu->pntsu - 1])) ) {
if (BEZSELECTED_HIDDENHANDLES(cu, &(nu->bezt[nu->pntsu - 1]))) {
nu1 = nu;
BKE_nurb_direction_switch(nu);
keyData_switchDirectionNurb(cu, nu);
@ -4051,23 +4061,27 @@ static int make_segment_exec(bContext *C, wmOperator *op)
}
}
else if (nu2 == NULL) {
if (BEZSELECTED_HIDDENHANDLES(cu, nu->bezt) ) {
if (BEZSELECTED_HIDDENHANDLES(cu, nu->bezt)) {
nu2 = nu;
BKE_nurb_direction_switch(nu);
keyData_switchDirectionNurb(cu, nu);
}
else {
if (BEZSELECTED_HIDDENHANDLES(cu, &(nu->bezt[nu->pntsu - 1])) ) {
if (BEZSELECTED_HIDDENHANDLES(cu, &(nu->bezt[nu->pntsu - 1]))) {
nu2 = nu;
}
}
}
else break;
else {
break;
}
}
else if (nu->pntsv == 1) {
bp = nu->bp;
if (nu1 == NULL) {
if (bp->f1 & SELECT) nu1 = nu;
if (bp->f1 & SELECT) {
nu1 = nu;
}
else {
bp = bp + (nu->pntsu - 1);
if (bp->f1 & SELECT) {
@ -4090,7 +4104,9 @@ static int make_segment_exec(bContext *C, wmOperator *op)
}
}
}
else break;
else {
break;
}
}
}
}
@ -4495,7 +4511,9 @@ static int addvert_Nurb(bContext *C, short mode, float location[3])
newnu->resolu = cu->resolu;
newnu->flag |= CU_SMOOTH;
}
else memcpy(newnu, nu, sizeof(Nurb));
else {
memcpy(newnu, nu, sizeof(Nurb));
}
BLI_addtail(&editnurb->nurbs, newnu);
set_actNurb(obedit, newnu);
@ -4609,7 +4627,9 @@ static int addvert_Nurb(bContext *C, short mode, float location[3])
bezt = newbezt;
ok = 1;
}
else bezt = NULL;
else {
bezt = NULL;
}
if (bezt) {
if (!newnu) nu->pntsu++;
@ -4687,7 +4707,9 @@ static int addvert_Nurb(bContext *C, short mode, float location[3])
bp = newbp;
ok = 1;
}
else bp = NULL;
else {
bp = NULL;
}
if (bp) {
if (mode == 'e') {
@ -4705,7 +4727,9 @@ static int addvert_Nurb(bContext *C, short mode, float location[3])
nu->pntsu++;
BKE_nurb_knot_calc_u(nu);
}
else BKE_nurb_knot_calc_u(newnu);
else {
BKE_nurb_knot_calc_u(newnu);
}
}
}
@ -4864,7 +4888,7 @@ static int toggle_cyclic_exec(bContext *C, wmOperator *op)
a = nu->pntsu;
bezt = nu->bezt;
while (a--) {
if (BEZSELECTED_HIDDENHANDLES(cu, bezt) ) {
if (BEZSELECTED_HIDDENHANDLES(cu, bezt)) {
nu->flagu ^= CU_NURB_CYCLIC;
break;
}
@ -4983,7 +5007,7 @@ static int select_linked_exec(bContext *C, wmOperator *UNUSED(op))
bezt = nu->bezt;
a = nu->pntsu;
while (a--) {
if ( (bezt->f1 & SELECT) || (bezt->f2 & SELECT) || (bezt->f3 & SELECT) ) {
if ((bezt->f1 & SELECT) || (bezt->f2 & SELECT) || (bezt->f3 & SELECT)) {
a = nu->pntsu;
bezt = nu->bezt;
while (a--) {
@ -5333,7 +5357,7 @@ static int select_less_exec(bContext *C, wmOperator *UNUSED(op))
BPoint *bp;
BezTriple *bezt;
int a;
short sel = 0, lastsel = 0;
short sel = 0, lastsel = false;
short *selbpoints;
if (obedit->type == OB_SURF) {
@ -5344,44 +5368,54 @@ static int select_less_exec(bContext *C, wmOperator *UNUSED(op))
while (a--) {
if ((bp->hide == 0) && (bp->f1 & SELECT)) {
sel = 0;
/* check if neighbors have been selected */
/* edges of surface are an exception */
if ((a + 1) % nu->pntsu == 0) sel++;
if ((a + 1) % nu->pntsu == 0) {
sel++;
}
else {
bp--;
if ((selbpoints[a + 1] == 1) || ((bp->hide == 0) && (bp->f1 & SELECT))) sel++;
bp++;
}
if ((a + 1) % nu->pntsu == 1) sel++;
if ((a + 1) % nu->pntsu == 1) {
sel++;
}
else {
bp++;
if ((bp->hide == 0) && (bp->f1 & SELECT)) sel++;
bp--;
}
if (a + 1 > nu->pntsu * nu->pntsv - nu->pntsu) sel++;
if (a + 1 > nu->pntsu * nu->pntsv - nu->pntsu) {
sel++;
}
else {
bp -= nu->pntsu;
if ((selbpoints[a + nu->pntsu] == 1) || ((bp->hide == 0) && (bp->f1 & SELECT))) sel++;
bp += nu->pntsu;
}
if (a < nu->pntsu) sel++;
if (a < nu->pntsu) {
sel++;
}
else {
bp += nu->pntsu;
if ((bp->hide == 0) && (bp->f1 & SELECT)) sel++;
bp -= nu->pntsu;
}
if (sel != 4) {
select_bpoint(bp, DESELECT, 1, VISIBLE);
selbpoints[a] = 1;
}
}
else lastsel = 0;
else {
lastsel = false;
}
bp++;
}
@ -5390,26 +5424,29 @@ static int select_less_exec(bContext *C, wmOperator *UNUSED(op))
}
else {
for (nu = editnurb->first; nu; nu = nu->next) {
lastsel = 0;
lastsel = false;
/* check what type of curve/nurb it is */
if (nu->type == CU_BEZIER) {
a = nu->pntsu;
bezt = nu->bezt;
while (a--) {
if ((bezt->hide == 0) && (bezt->f2 & SELECT)) {
if (lastsel == 1) sel = 1;
else sel = 0;
sel = (lastsel == 1);
/* check if neighbors have been selected */
/* first and last are exceptions */
if (a == nu->pntsu - 1) sel++;
if (a == nu->pntsu - 1) {
sel++;
}
else {
bezt--;
if ((bezt->hide == 0) && (bezt->f2 & SELECT)) sel++;
bezt++;
}
if (a == 0) sel++;
if (a == 0) {
sel++;
}
else {
bezt++;
if ((bezt->hide == 0) && (bezt->f2 & SELECT)) sel++;
@ -5418,12 +5455,16 @@ static int select_less_exec(bContext *C, wmOperator *UNUSED(op))
if (sel != 2) {
select_beztriple(bezt, DESELECT, 1, VISIBLE);
lastsel = 1;
lastsel = true;
}
else {
lastsel = false;
}
else lastsel = 0;
}
else lastsel = 0;
else {
lastsel = false;
}
bezt++;
}
}
@ -5436,28 +5477,36 @@ static int select_less_exec(bContext *C, wmOperator *UNUSED(op))
else sel = 0;
/* first and last are exceptions */
if (a == nu->pntsu * nu->pntsv - 1) sel++;
if (a == nu->pntsu * nu->pntsv - 1) {
sel++;
}
else {
bp--;
if ((bp->hide == 0) && (bp->f1 & SELECT)) sel++;
bp++;
}
if (a == 0) sel++;
if (a == 0) {
sel++;
}
else {
bp++;
if ((bp->hide == 0) && (bp->f1 & SELECT)) sel++;
bp--;
}
if (sel != 2) {
select_bpoint(bp, DESELECT, 1, VISIBLE);
lastsel = 1;
lastsel = true;
}
else {
lastsel = false;
}
else lastsel = 0;
}
else lastsel = 0;
else {
lastsel = false;
}
bp++;
}
}
@ -5820,7 +5869,7 @@ static int delete_exec(bContext *C, wmOperator *op)
int delta = 0;
bezt = nu->bezt;
for (a = 0; a < nu->pntsu; a++) {
if (BEZSELECTED_HIDDENHANDLES(cu, bezt) ) {
if (BEZSELECTED_HIDDENHANDLES(cu, bezt)) {
memmove(bezt, bezt + 1, (nu->pntsu - a - 1) * sizeof(BezTriple));
keyIndex_delBezt(editnurb, bezt + delta);
keyIndex_updateBezt(editnurb, bezt + 1, bezt, nu->pntsu - a - 1);
@ -5829,7 +5878,9 @@ static int delete_exec(bContext *C, wmOperator *op)
type = 1;
delta++;
}
else bezt++;
else {
bezt++;
}
}
if (type) {
bezt1 = (BezTriple *)MEM_mallocN((nu->pntsu) * sizeof(BezTriple), "delNurb");
@ -5889,16 +5940,16 @@ static int delete_exec(bContext *C, wmOperator *op)
if (nu->type == CU_BEZIER) {
bezt = nu->bezt;
for (a = 0; a < nu->pntsu - 1; a++) {
if (BEZSELECTED_HIDDENHANDLES(cu, bezt) ) {
if (BEZSELECTED_HIDDENHANDLES(cu, bezt)) {
bezt1 = bezt;
bezt2 = bezt + 1;
if ((bezt2->f1 & SELECT) || (bezt2->f2 & SELECT) || (bezt2->f3 & SELECT)) {
/* pass */
}
else { /* maybe do not make cyclic */
if (a == 0 && (nu->flagu & CU_NURB_CYCLIC) ) {
if (a == 0 && (nu->flagu & CU_NURB_CYCLIC)) {
bezt2 = bezt + (nu->pntsu - 1);
if ( (bezt2->f1 & SELECT) || (bezt2->f2 & SELECT) || (bezt2->f3 & SELECT) ) {
if ((bezt2->f1 & SELECT) || (bezt2->f2 & SELECT) || (bezt2->f3 & SELECT)) {
nu->flagu &= ~CU_NURB_CYCLIC;
BKE_nurb_handles_calc(nu);
WM_event_add_notifier(C, NC_GEOM | ND_DATA, obedit->data);
@ -5925,7 +5976,7 @@ static int delete_exec(bContext *C, wmOperator *op)
/* pass */
}
else { /* maybe do not make cyclic */
if (a == 0 && (nu->flagu & CU_NURB_CYCLIC) ) {
if (a == 0 && (nu->flagu & CU_NURB_CYCLIC)) {
bp2 = bp + (nu->pntsu - 1);
if (bp2->f1 & SELECT) {
nu->flagu &= ~CU_NURB_CYCLIC;
@ -6187,10 +6238,12 @@ int join_curve_exec(bContext *C, wmOperator *UNUSED(op))
if (ob->totcol) { /* TODO, merge material lists */
CLAMP(newnu->mat_nr, 0, ob->totcol - 1);
}
else newnu->mat_nr = 0;
else {
newnu->mat_nr = 0;
}
BLI_addtail(&tempbase, newnu);
if ( (bezt = newnu->bezt) ) {
if ((bezt = newnu->bezt)) {
a = newnu->pntsu;
while (a--) {
mul_m4_v3(cmat, bezt->vec[0]);
@ -6200,7 +6253,7 @@ int join_curve_exec(bContext *C, wmOperator *UNUSED(op))
}
BKE_nurb_handles_calc(newnu);
}
if ( (bp = newnu->bp) ) {
if ((bp = newnu->bp)) {
a = newnu->pntsu * nu->pntsv;
while (a--) {
mul_m4_v3(cmat, bp->vec);
@ -6653,14 +6706,18 @@ static int curvesurf_prim_add(bContext *C, wmOperator *op, int type, int isSurf)
if (type & CU_PRIM_PATH)
cu->flag |= CU_PATH | CU_3D;
}
else DAG_id_tag_update(&obedit->id, OB_RECALC_DATA);
else {
DAG_id_tag_update(&obedit->id, OB_RECALC_DATA);
}
}
else { /* adding surface */
if (obedit == NULL || obedit->type != OB_SURF) {
obedit = ED_object_add_type(C, OB_SURF, loc, rot, TRUE, layer);
newob = 1;
}
else DAG_id_tag_update(&obedit->id, OB_RECALC_DATA);
else {
DAG_id_tag_update(&obedit->id, OB_RECALC_DATA);
}
}
/* rename here, the undo stack checks name for valid undo pushes */

@ -285,7 +285,7 @@ void ED_view3d_offscreen_sky_color_get(struct Scene *scene, float sky_color[3]);
struct Base *ED_view3d_give_base_under_cursor(struct bContext *C, const int mval[2]);
void ED_view3d_quadview_update(struct ScrArea *sa, struct ARegion *ar, short do_clip);
void ED_view3d_update_viewmat(struct Scene *scene, struct View3D *v3d, struct ARegion *ar, float viewmat[4][4], float winmat[4][4]);
int ED_view3d_lock(struct RegionView3D *rv3d);
bool ED_view3d_lock(struct RegionView3D *rv3d);
uint64_t ED_view3d_datamask(struct Scene *scene, struct View3D *v3d);
uint64_t ED_view3d_screen_datamask(struct bScreen *screen);

@ -231,7 +231,9 @@ static void ui_text_bounds_block(uiBlock *block, float offset)
nextcol = 1;
col++;
}
else nextcol = 0;
else {
nextcol = 0;
}
bt->rect.xmin = x1addval;
bt->rect.xmax = bt->rect.xmin + i + block->bounds;
@ -2555,7 +2557,9 @@ static void ui_block_do_align_but(uiBut *first, short nr)
else
flag = UI_BUT_ALIGN_TOP | UI_BUT_ALIGN_LEFT;
}
else flag = UI_BUT_ALIGN_TOP;
else {
flag = UI_BUT_ALIGN_TOP;
}
}
}
else if (buts_are_horiz(but, next)) {
@ -2575,7 +2579,9 @@ static void ui_block_do_align_but(uiBut *first, short nr)
if (bt == NULL || bt->alignnr != nr) flag = UI_BUT_ALIGN_TOP | UI_BUT_ALIGN_RIGHT;
}
}
else flag |= UI_BUT_ALIGN_LEFT;
else {
flag |= UI_BUT_ALIGN_LEFT;
}
}
else {
if (cols == 0) {

@ -97,7 +97,9 @@ void uiDrawBox(int mode, float minx, float miny, float maxx, float maxy, float r
}
glVertex2f(maxx, miny + rad);
}
else glVertex2f(maxx, miny);
else {
glVertex2f(maxx, miny);
}
/* corner right-top */
if (roundboxtype & UI_CNR_TOP_RIGHT) {
@ -107,7 +109,9 @@ void uiDrawBox(int mode, float minx, float miny, float maxx, float maxy, float r
}
glVertex2f(maxx - rad, maxy);
}
else glVertex2f(maxx, maxy);
else {
glVertex2f(maxx, maxy);
}
/* corner left-top */
if (roundboxtype & UI_CNR_TOP_LEFT) {
@ -117,7 +121,9 @@ void uiDrawBox(int mode, float minx, float miny, float maxx, float maxy, float r
}
glVertex2f(minx, maxy - rad);
}
else glVertex2f(minx, maxy);
else {
glVertex2f(minx, maxy);
}
/* corner left-bottom */
if (roundboxtype & UI_CNR_BOTTOM_LEFT) {
@ -127,7 +133,9 @@ void uiDrawBox(int mode, float minx, float miny, float maxx, float maxy, float r
}
glVertex2f(minx + rad, miny);
}
else glVertex2f(minx, miny);
else {
glVertex2f(minx, miny);
}
glEnd();
}
@ -1292,8 +1300,10 @@ void ui_draw_but_NORMAL(uiBut *but, uiWidgetColors *wcol, rcti *rect)
glEndList();
}
else glCallList(displist);
else {
glCallList(displist);
}
/* restore */
glDisable(GL_LIGHTING);
glDisable(GL_CULL_FACE);

@ -216,7 +216,7 @@ void uiStyleFontDrawRotated(uiFontStyle *fs, rcti *rect, const char *str)
/* rotate counter-clockwise for now (assumes left-to-right language)*/
xofs += height;
yofs = BLF_width(fs->uifont_id, str) + 5;
angle = M_PI / 2.0f;
angle = (float)M_PI / 2.0f;
/* translate rect to vertical */
txtrect.xmin = rect->xmin - BLI_rcti_size_y(rect);

@ -281,7 +281,9 @@ static void template_id_cb(bContext *C, void *arg_litem, void *arg_event)
if (id->flag & LIB_FAKEUSER) id_us_plus(id);
else id_us_min(id);
}
else return;
else {
return;
}
break;
case UI_ID_LOCAL:
if (id) {

@ -1292,7 +1292,9 @@ static void widget_draw_text_icon(uiFontStyle *fstyle, uiWidgetColors *wcol, uiB
else if ((but->block->flag & UI_BLOCK_LOOP) && (but->type == BUT)) {
ui_text_clip_left(fstyle, but, rect);
}
else but->ofs = 0;
else {
but->ofs = 0;
}
/* check for button text label */
if (but->type == ICONTEXTROW) {

@ -457,8 +457,12 @@ static void ui_view2d_curRect_validate_resize(View2D *v2d, int resize, int mask_
if (ABS(winx - v2d->oldwinx) > ABS(winy - v2d->oldwiny)) do_y = FALSE;
else do_x = FALSE;
}
else if (winRatio > 1.0f) do_x = FALSE;
else do_x = TRUE;
else if (winRatio > 1.0f) {
do_x = FALSE;
}
else {
do_x = TRUE;
}
}
do_cur = do_x;
/* do_win = do_y; */ /* UNUSED */

@ -525,7 +525,9 @@ int paintface_mouse_select(struct bContext *C, Object *ob, const int mval[2], in
else
mpoly_sel->flag |= ME_FACE_SEL;
}
else mpoly_sel->flag |= ME_FACE_SEL;
else {
mpoly_sel->flag |= ME_FACE_SEL;
}
/* image window redraw */

@ -307,8 +307,10 @@ int EDBM_backbuf_circle_init(ViewContext *vc, short xs, short ys, short rads)
return 0;
}
}
else if (vc->v3d->drawtype < OB_SOLID || (vc->v3d->flag & V3D_ZBUF_SELECT) == 0) return 0;
else if (vc->v3d->drawtype < OB_SOLID || (vc->v3d->flag & V3D_ZBUF_SELECT) == 0) {
return 0;
}
xmin = xs - rads; xmax = xs + rads;
ymin = ys - rads; ymax = ys + rads;
buf = view3d_read_backbuf(vc, xmin, ymin, xmax, ymax);

@ -2292,8 +2292,12 @@ static int edbm_select_vertex_path_exec(bContext *C, wmOperator *op)
if (!BM_elem_flag_test(eve, BM_ELEM_SELECT) || BM_elem_flag_test(eve, BM_ELEM_HIDDEN))
continue;
if (svert == NULL) svert = eve;
else if (evert == NULL) evert = eve;
if (svert == NULL) {
svert = eve;
}
else if (evert == NULL) {
evert = eve;
}
else {
/* more than two vertices are selected,
* show warning message and cancel operator */

@ -789,7 +789,9 @@ static intptr_t mesh_octree_find_index(MocNode **bt, MVert *mvert, const float c
return (*bt)->index[a];
}
}
else return -1;
else {
return -1;
}
}
if ( (*bt)->next)
return mesh_octree_find_index(&(*bt)->next, mvert, co);

@ -662,7 +662,9 @@ static int object_armature_add_exec(bContext *C, wmOperator *op)
ED_object_enter_editmode(C, 0);
newob = 1;
}
else DAG_id_tag_update(&obedit->id, OB_RECALC_DATA);
else {
DAG_id_tag_update(&obedit->id, OB_RECALC_DATA);
}
if (obedit == NULL) {
BKE_report(op->reports, RPT_ERROR, "Cannot create editmode armature");

@ -138,7 +138,9 @@ static int multiresbake_check(bContext *C, wmOperator *op)
}
}
}
else ok = 0;
else {
ok = 0;
}
if (!ok) {
BKE_report(op->reports, RPT_ERROR, "Multires data baking requires multi-resolution object");

@ -435,7 +435,9 @@ static void test_constraints(Object *owner, bPoseChannel *pchan)
curcon->flag |= CONSTRAINT_DISABLE;
}
}
else curcon->flag |= CONSTRAINT_DISABLE;
else {
curcon->flag |= CONSTRAINT_DISABLE;
}
}
}
else if (curcon->type == CONSTRAINT_TYPE_CAMERASOLVER) {

@ -215,7 +215,7 @@ static int vertex_parent_set_exec(bContext *C, wmOperator *op)
}
}
if (v4 || !((v1 && v2 == 0 && v3 == 0) || (v1 && v2 && v3)) ) {
if (v4 || !((v1 && v2 == 0 && v3 == 0) || (v1 && v2 && v3))) {
BKE_report(op->reports, RPT_ERROR, "Select either 1 or 3 vertices to parent to");
return OPERATOR_CANCELLED;
}
@ -608,8 +608,10 @@ int ED_object_parent_set(ReportList *reports, Main *bmain, Scene *scene, Object
cu->flag |= CU_PATH | CU_FOLLOW;
BKE_displist_make_curveTypes(scene, par, 0); /* force creation of path data */
}
else cu->flag |= CU_FOLLOW;
else {
cu->flag |= CU_FOLLOW;
}
/* if follow, add F-Curve for ctime (i.e. "eval_time") so that path-follow works */
if (partype == PAR_FOLLOW) {
/* get or create F-Curve */

@ -795,8 +795,8 @@ static int object_origin_set_exec(bContext *C, wmOperator *op)
if (centermode == ORIGIN_TO_CURSOR) { /* done */ }
else if (centermode == ORIGIN_TO_CENTER_OF_MASS) { BKE_mesh_center_centroid(me, cent); }
else if (around == V3D_CENTROID) { BKE_mesh_center_median(me, cent); }
else { BKE_mesh_center_bounds(me, cent); }
else if (around == V3D_CENTROID) { BKE_mesh_center_median(me, cent); }
else { BKE_mesh_center_bounds(me, cent); }
negate_v3_v3(cent_neg, cent);
BKE_mesh_translate(me, cent_neg, 1);
@ -808,9 +808,9 @@ static int object_origin_set_exec(bContext *C, wmOperator *op)
else if (ELEM(ob->type, OB_CURVE, OB_SURF)) {
Curve *cu = ob->data;
if (centermode == ORIGIN_TO_CURSOR) { /* done */ }
if (centermode == ORIGIN_TO_CURSOR) { /* done */ }
else if (around == V3D_CENTROID) { BKE_curve_center_median(cu, cent); }
else { BKE_curve_center_bounds(cu, cent); }
else { BKE_curve_center_bounds(cu, cent); }
/* don't allow Z change if curve is 2D */
if ((ob->type == OB_CURVE) && !(cu->flag & CU_3D))
@ -889,9 +889,9 @@ static int object_origin_set_exec(bContext *C, wmOperator *op)
else if (ob->type == OB_MBALL) {
MetaBall *mb = ob->data;
if (centermode == ORIGIN_TO_CURSOR) { /* done */ }
if (centermode == ORIGIN_TO_CURSOR) { /* done */ }
else if (around == V3D_CENTROID) { BKE_mball_center_median(mb, cent); }
else { BKE_mball_center_bounds(mb, cent); }
else { BKE_mball_center_bounds(mb, cent); }
negate_v3_v3(cent_neg, cent);
BKE_mball_translate(mb, cent_neg);
@ -910,9 +910,9 @@ static int object_origin_set_exec(bContext *C, wmOperator *op)
else if (ob->type == OB_LATTICE) {
Lattice *lt = ob->data;
if (centermode == ORIGIN_TO_CURSOR) { /* done */ }
if (centermode == ORIGIN_TO_CURSOR) { /* done */ }
else if (around == V3D_CENTROID) { BKE_lattice_center_median(lt, cent); }
else { BKE_lattice_center_bounds(lt, cent); }
else { BKE_lattice_center_bounds(lt, cent); }
negate_v3_v3(cent_neg, cent);
BKE_lattice_translate(lt, cent_neg, 1);

@ -671,8 +671,10 @@ static void shader_preview_render(ShaderPreview *sp, ID *id, int split, int firs
if (first) sizex = sp->sizex / 2;
else sizex = sp->sizex - sp->sizex / 2;
}
else sizex = sp->sizex;
else {
sizex = sp->sizex;
}
/* we have to set preview variables first */
sce = preview_get_scene(pr_main);
if (sce) {

@ -1071,7 +1071,9 @@ static void region_rect_recursive(wmWindow *win, ScrArea *sa, ARegion *ar, rcti
if (G.debug & G_DEBUG)
printf("region quadsplit failed\n");
}
else quad = 1;
else {
quad = 1;
}
}
if (quad) {
if (quad == 1) { /* left bottom */
@ -1746,7 +1748,9 @@ void ED_region_panels(const bContext *C, ARegion *ar, int vertical, const char *
/* uiScalePanels(ar, BLI_rctf_size_x(&v2d->cur));
break; */
}
else break;
else {
break;
}
}

@ -807,7 +807,9 @@ void bglBegin(int mode)
pointhack = floor(value[0] + 0.5f);
if (pointhack > 4) pointhack = 4;
}
else glBegin(mode);
else {
glBegin(mode);
}
}
}
@ -835,7 +837,9 @@ void bglVertex3fv(const float vec[3])
glRasterPos3fv(vec);
glBitmap(pointhack, pointhack, (float)pointhack / 2.0f, (float)pointhack / 2.0f, 0.0, 0.0, Squaredot);
}
else glVertex3fv(vec);
else {
glVertex3fv(vec);
}
break;
}
}
@ -848,7 +852,9 @@ void bglVertex3f(float x, float y, float z)
glRasterPos3f(x, y, z);
glBitmap(pointhack, pointhack, (float)pointhack / 2.0f, (float)pointhack / 2.0f, 0.0, 0.0, Squaredot);
}
else glVertex3f(x, y, z);
else {
glVertex3f(x, y, z);
}
break;
}
}
@ -861,7 +867,9 @@ void bglVertex2fv(const float vec[2])
glRasterPos2fv(vec);
glBitmap(pointhack, pointhack, (float)pointhack / 2, pointhack / 2, 0.0, 0.0, Squaredot);
}
else glVertex2fv(vec);
else {
glVertex2fv(vec);
}
break;
}
}

@ -194,7 +194,9 @@ void removenotused_scrverts(bScreen *sc)
BLI_remlink(&sc->vertbase, sv);
MEM_freeN(sv);
}
else sv->flag = 0;
else {
sv->flag = 0;
}
sv = svn;
}
}
@ -250,7 +252,9 @@ void removenotused_scredges(bScreen *sc)
BLI_remlink(&sc->edgebase, se);
MEM_freeN(se);
}
else se->flag = 0;
else {
se->flag = 0;
}
se = sen;
}
}

@ -4357,7 +4357,9 @@ static int project_paint_sub_stroke(ProjPaintState *ps, BrushPainter *painter, c
if (brush_painter_2d_paint(painter, project_paint_op, pos, time, pressure, ps, 0)) {
return 1;
}
else return 0;
else {
return 0;
}
}

@ -3512,7 +3512,9 @@ void sculpt_update_mesh_elements(Scene *scene, Sculpt *sd, Object *ob,
}
}
}
else free_sculptsession_deformMats(ss);
else {
free_sculptsession_deformMats(ss);
}
/* if pbvh is deformed, key block is already applied to it */
if (ss->kb && !BKE_pbvh_isDeformed(ss->pbvh)) {
@ -3780,7 +3782,9 @@ static void sculpt_update_cache_invariants(bContext *C, Sculpt *sd, SculptSessio
ss->layer_co = MEM_mallocN(sizeof(float) * 3 * ss->totvert,
"sculpt mesh vertices copy");
if (ss->deform_cos) memcpy(ss->layer_co, ss->deform_cos, ss->totvert);
if (ss->deform_cos) {
memcpy(ss->layer_co, ss->deform_cos, ss->totvert);
}
else {
for (i = 0; i < ss->totvert; ++i) {
copy_v3_v3(ss->layer_co[i], ss->mvert[i].co);

@ -131,7 +131,9 @@ static int sculpt_undo_restore_coords(bContext *C, DerivedMesh *dm, SculptUndoNo
vertCos = BKE_key_convert_to_vertcos(ob, ss->kb);
for (i = 0; i < unode->totvert; i++) {
if (ss->modifiers_active) sculpt_undo_restore_deformed(ss, unode, i, index[i], vertCos[index[i]]);
if (ss->modifiers_active) {
sculpt_undo_restore_deformed(ss, unode, i, index[i], vertCos[index[i]]);
}
else {
if (unode->orig_co) swap_v3_v3(vertCos[index[i]], unode->orig_co[i]);
else swap_v3_v3(vertCos[index[i]], unode->co[i]);
@ -149,7 +151,9 @@ static int sculpt_undo_restore_coords(bContext *C, DerivedMesh *dm, SculptUndoNo
}
else {
for (i = 0; i < unode->totvert; i++) {
if (ss->modifiers_active) sculpt_undo_restore_deformed(ss, unode, i, index[i], mvert[index[i]].co);
if (ss->modifiers_active) {
sculpt_undo_restore_deformed(ss, unode, i, index[i], mvert[index[i]].co);
}
else {
if (unode->orig_co) swap_v3_v3(mvert[index[i]].co, unode->orig_co[i]);
else swap_v3_v3(mvert[index[i]].co, unode->co[i]);

@ -2196,8 +2196,9 @@ static int graph_fmodifier_add_exec(bContext *C, wmOperator *op)
/* add F-Modifier of specified type to active F-Curve, and make it the active one */
fcm = add_fmodifier(&fcu->modifiers, type);
if (fcm)
if (fcm) {
set_active_fmodifier(&fcu->modifiers, fcm);
}
else {
BKE_report(op->reports, RPT_ERROR, "Modifier could not be added (see console for details)");
break;

@ -2021,8 +2021,9 @@ static int nla_fmodifier_add_exec(bContext *C, wmOperator *op)
/* add F-Modifier of specified type to selected, and make it the active one */
fcm = add_fmodifier(&strip->modifiers, type);
if (fcm)
if (fcm) {
set_active_fmodifier(&strip->modifiers, fcm);
}
else {
BKE_reportf(op->reports, RPT_ERROR,
"Modifier could not be added to (%s : %s) (see console for details)",

@ -1236,12 +1236,20 @@ static void outliner_draw_iconrow(bContext *C, uiBlock *block, Scene *scene, Spa
/* active blocks get white circle */
if (tselem->type == 0) {
if (te->idcode == ID_OB) active = (OBACT == (Object *)tselem->id);
else if (scene->obedit && scene->obedit->data == tselem->id) active = 1; // XXX use context?
else active = tree_element_active(C, scene, soops, te, 0);
if (te->idcode == ID_OB) {
active = (OBACT == (Object *)tselem->id);
}
else if (scene->obedit && scene->obedit->data == tselem->id) {
active = 1; // XXX use context?
}
else {
active = tree_element_active(C, scene, soops, te, 0);
}
}
else active = tree_element_type_active(NULL, scene, soops, te, tselem, 0);
else {
active = tree_element_type_active(NULL, scene, soops, te, tselem, 0);
}
if (active) {
float ufac = UI_UNIT_X / 20.0f;

@ -890,9 +890,13 @@ static void tree_element_show_hierarchy(Scene *scene, SpaceOops *soops, ListBase
else tselem->flag |= TSE_CLOSED;
}
}
else tselem->flag |= TSE_CLOSED;
if (TSELEM_OPEN(tselem, soops)) tree_element_show_hierarchy(scene, soops, &te->subtree);
else {
tselem->flag |= TSE_CLOSED;
}
if (TSELEM_OPEN(tselem, soops)) {
tree_element_show_hierarchy(scene, soops, &te->subtree);
}
}
}

@ -148,7 +148,9 @@ static int tree_element_set_active_object(bContext *C, Scene *scene, SpaceOops
Object *ob = NULL;
/* if id is not object, we search back */
if (te->idcode == ID_OB) ob = (Object *)tselem->id;
if (te->idcode == ID_OB) {
ob = (Object *)tselem->id;
}
else {
ob = (Object *)outliner_search_back(soops, te, ID_OB);
if (ob == OBACT) return 0;
@ -312,7 +314,9 @@ static int tree_element_active_lamp(bContext *UNUSED(C), Scene *scene, SpaceOops
if (set) {
// XXX extern_set_butspace(F5KEY, 0);
}
else return 1;
else {
return 1;
}
return 0;
}
@ -791,9 +795,11 @@ static int do_outliner_item_activate(bContext *C, Scene *scene, ARegion *ar, Spa
else { // rest of types
tree_element_active(C, scene, soops, te, 1);
}
}
else {
tree_element_type_active(C, scene, soops, te, tselem, 1 + (extend != 0));
}
else tree_element_type_active(C, scene, soops, te, tselem, 1 + (extend != 0));
return 1;
}

@ -190,8 +190,10 @@ static void unlink_texture_cb(bContext *UNUSED(C), Scene *UNUSED(scene), TreeEle
World *wrld = (World *)tsep->id;
mtex = wrld->mtex;
}
else return;
else {
return;
}
for (a = 0; a < MAX_MTEX; a++) {
if (a == te->index && mtex[a]) {
if (mtex[a]->tex) {
@ -1259,7 +1261,9 @@ static int do_outliner_operation_event(bContext *C, Scene *scene, ARegion *ar, S
WM_operator_name_call(C, "OUTLINER_OT_object_operation", WM_OP_INVOKE_REGION_WIN, NULL);
}
else if (idlevel) {
if (idlevel == -1 || datalevel) BKE_report(reports, RPT_WARNING, "Mixed selection");
if (idlevel == -1 || datalevel) {
BKE_report(reports, RPT_WARNING, "Mixed selection");
}
else {
if (idlevel == ID_GR)
WM_operator_name_call(C, "OUTLINER_OT_group_operation", WM_OP_INVOKE_REGION_WIN, NULL);
@ -1268,7 +1272,9 @@ static int do_outliner_operation_event(bContext *C, Scene *scene, ARegion *ar, S
}
}
else if (datalevel) {
if (datalevel == -1) BKE_report(reports, RPT_WARNING, "Mixed selection");
if (datalevel == -1) {
BKE_report(reports, RPT_WARNING, "Mixed selection");
}
else {
if (datalevel == TSE_ANIM_DATA)
WM_operator_name_call(C, "OUTLINER_OT_animdata_operation", WM_OP_INVOKE_REGION_WIN, NULL);

@ -1257,19 +1257,23 @@ static int treesort_obtype_alpha(const void *v1, const void *v2)
const tTreeSort *x1 = v1, *x2 = v2;
/* first put objects last (hierarchy) */
if (x1->idcode == ID_OB && x2->idcode != ID_OB) return 1;
else if (x2->idcode == ID_OB && x1->idcode != ID_OB) return -1;
if (x1->idcode == ID_OB && x2->idcode != ID_OB) {
return 1;
}
else if (x2->idcode == ID_OB && x1->idcode != ID_OB) {
return -1;
}
else {
/* 2nd we check ob type */
if (x1->idcode == ID_OB && x2->idcode == ID_OB) {
if (((Object *)x1->id)->type > ((Object *)x2->id)->type) return 1;
if (((Object *)x1->id)->type > ((Object *)x2->id)->type) return 1;
else if (((Object *)x1->id)->type > ((Object *)x2->id)->type) return -1;
else return 0;
}
else {
int comp = strcmp(x1->name, x2->name);
if (comp > 0) return 1;
if (comp > 0) return 1;
else if (comp < 0) return -1;
return 0;
}

@ -813,7 +813,9 @@ static void UNUSED_FUNCTION(set_special_seq_update) (int val)
if (val) {
// XXX special_seq_update = find_nearest_seq(&x);
}
else special_seq_update = NULL;
else {
special_seq_update = NULL;
}
}
ImBuf *sequencer_ibuf_get(struct Main *bmain, Scene *scene, SpaceSeq *sseq, int cfra, int frame_ofs)

@ -520,7 +520,7 @@ int seq_effect_find_selected(Scene *scene, Sequence *activeseq, int type, Sequen
return 0;
}
if ((seq != activeseq) && (seq != seq2)) {
if (seq2 == NULL) seq2 = seq;
if (seq2 == NULL) seq2 = seq;
else if (seq1 == NULL) seq1 = seq;
else if (seq3 == NULL) seq3 = seq;
else {

@ -552,8 +552,6 @@ void SEQUENCER_OT_select(wmOperatorType *ot)
}
/* run recursively to select linked */
static int select_more_less_seq__internal(Scene *scene, int sel, int linked)
{

@ -678,7 +678,9 @@ int text_get_visible_lines(SpaceText *st, ARegion *ar, const char *str)
chars = st->tabnumber - i % st->tabnumber;
ch = ' ';
}
else chars = 1;
else {
chars = 1;
}
while (chars--) {
if (i - start >= max) {
@ -712,7 +714,9 @@ int text_get_span_wrap(SpaceText *st, ARegion *ar, TextLine *from, TextLine *to)
return ret;
}
else return txt_get_span(from, to);
else {
return txt_get_span(from, to);
}
}
int text_get_total_lines(SpaceText *st, ARegion *ar)

@ -1413,7 +1413,9 @@ static int text_get_cursor_rel(SpaceText *st, ARegion *ar, TextLine *linein, int
chars = st->tabnumber - i % st->tabnumber;
ch = ' ';
}
else chars = 1;
else {
chars = 1;
}
while (chars--) {
if (rell == 0 && i - start == relc) {
@ -1591,7 +1593,9 @@ static void txt_wrap_move_bol(SpaceText *st, ARegion *ar, short sel)
chars = st->tabnumber - i % st->tabnumber;
ch = ' ';
}
else chars = 1;
else {
chars = 1;
}
while (chars--) {
if (i - start >= max) {
@ -1657,7 +1661,9 @@ static void txt_wrap_move_eol(SpaceText *st, ARegion *ar, short sel)
chars = st->tabnumber - i % st->tabnumber;
ch = ' ';
}
else chars = 1;
else {
chars = 1;
}
while (chars--) {
if (i - start >= max) {
@ -1716,7 +1722,9 @@ static void txt_wrap_move_up(SpaceText *st, ARegion *ar, short sel)
visible_lines = text_get_visible_lines(st, ar, (*linep)->line);
*charp = text_get_cursor_rel(st, ar, *linep, visible_lines - 1, col);
}
else *charp = 0;
else {
*charp = 0;
}
}
if (!sel) txt_pop_sel(text);
@ -1745,7 +1753,9 @@ static void txt_wrap_move_down(SpaceText *st, ARegion *ar, short sel)
*linep = (*linep)->next;
*charp = text_get_cursor_rel(st, ar, *linep, 0, col);
}
else *charp = (*linep)->len;
else {
*charp = (*linep)->len;
}
}
if (!sel) txt_pop_sel(text);
@ -2350,7 +2360,9 @@ static int flatten_len(SpaceText *st, const char *str)
if (str[i] == '\t') {
total += st->tabnumber - total % st->tabnumber;
}
else total++;
else {
total++;
}
}
return total;
@ -2412,7 +2424,9 @@ static void text_cursor_set_to_pos_wrapped(SpaceText *st, ARegion *ar, int x, in
chars = st->tabnumber - i % st->tabnumber;
ch = ' ';
}
else chars = 1;
else {
chars = 1;
}
while (chars--) {
/* Gone too far, go back to last wrap point */

@ -428,7 +428,9 @@ static DMDrawOption draw_tface__set_draw_legacy(MTFace *tface, int has_mcol, int
return DM_DRAW_OPTION_NO_MCOL; /* Don't set color */
}
else if (!has_mcol) {
if (tface) glColor3f(1.0, 1.0, 1.0);
if (tface) {
glColor3f(1.0, 1.0, 1.0);
}
else {
if (ma) {
float col[3];
@ -437,7 +439,9 @@ static DMDrawOption draw_tface__set_draw_legacy(MTFace *tface, int has_mcol, int
glColor3fv(col);
}
else glColor3f(1.0, 1.0, 1.0);
else {
glColor3f(1.0, 1.0, 1.0);
}
}
return DM_DRAW_OPTION_NO_MCOL; /* Don't set color */
}

@ -3879,7 +3879,9 @@ static void draw_particle(ParticleKey *state, int draw_as, short draw, float pix
if (draw_as == PART_DRAW_AXIS) {
copy_v3_v3(vec2, state->co);
}
else sub_v3_v3v3(vec2, state->co, vec);
else {
sub_v3_v3v3(vec2, state->co, vec);
}
add_v3_v3(vec, state->co);
copy_v3_v3(pdd->vd, vec); pdd->vd += 3;
@ -3891,7 +3893,9 @@ static void draw_particle(ParticleKey *state, int draw_as, short draw, float pix
if (draw_as == PART_DRAW_AXIS) {
copy_v3_v3(vec2, state->co);
}
else sub_v3_v3v3(vec2, state->co, vec);
else {
sub_v3_v3v3(vec2, state->co, vec);
}
add_v3_v3(vec, state->co);
@ -5966,8 +5970,10 @@ static void drawtexspace(Object *ob)
copy_v3_v3(size, mb->size);
copy_v3_v3(loc, mb->loc);
}
else return;
else {
return;
}
vec[0][0] = vec[1][0] = vec[2][0] = vec[3][0] = loc[0] - size[0];
vec[4][0] = vec[5][0] = vec[6][0] = vec[7][0] = loc[0] + size[0];

@ -1600,7 +1600,9 @@ static void view3d_draw_bgpic(Scene *scene, ARegion *ar, View3D *v3d,
if (scene->camera)
clip = BKE_object_movieclip_get(scene, scene->camera, 1);
}
else clip = bgpic->clip;
else {
clip = bgpic->clip;
}
if (clip == NULL)
continue;

@ -791,7 +791,7 @@ static void obmat_to_viewmat(View3D *v3d, RegionView3D *rv3d, Object *ob, short
#define QUATSET(a, b, c, d, e) { a[0] = b; a[1] = c; a[2] = d; a[3] = e; } (void)0
int ED_view3d_lock(RegionView3D *rv3d)
bool ED_view3d_lock(RegionView3D *rv3d)
{
switch (rv3d->view) {
case RV3D_VIEW_BOTTOM:
@ -818,10 +818,10 @@ int ED_view3d_lock(RegionView3D *rv3d)
QUATSET(rv3d->viewquat, 0.5, -0.5, -0.5, -0.5);
break;
default:
return FALSE;
return false;
}
return TRUE;
return true;
}
/* don't set windows active in here, is used by renderwin too */
@ -863,7 +863,9 @@ void setviewmatrixview3d(Scene *scene, View3D *v3d, RegionView3D *rv3d)
copy_v3_v3(vec, give_cursor(scene, v3d));
translate_m4(rv3d->viewmat, -vec[0], -vec[1], -vec[2]);
}
else translate_m4(rv3d->viewmat, rv3d->ofs[0], rv3d->ofs[1], rv3d->ofs[2]);
else {
translate_m4(rv3d->viewmat, rv3d->ofs[0], rv3d->ofs[1], rv3d->ofs[2]);
}
}
}

@ -1298,7 +1298,9 @@ int transformEvent(TransInfo *t, wmEvent *event)
if (t->flag & T_AUTOIK) {
transform_autoik_update(t, 1);
}
else view_editmove(event->type);
else {
view_editmove(event->type);
}
t->redraw = 1;
break;
case PADMINUS:
@ -1313,7 +1315,9 @@ int transformEvent(TransInfo *t, wmEvent *event)
if (t->flag & T_AUTOIK) {
transform_autoik_update(t, -1);
}
else view_editmove(event->type);
else {
view_editmove(event->type);
}
t->redraw = 1;
break;
case LEFTALTKEY:

@ -223,7 +223,9 @@ static void set_prop_dist(TransInfo *t, short with_dist)
tob->rdist = dist;
}
}
else break; // by definition transdata has selected items in beginning
else {
break; /* by definition transdata has selected items in beginning */
}
}
if (with_dist) {
tob->dist = tob->rdist;
@ -2048,7 +2050,9 @@ static void createTransEditVerts(TransInfo *t)
if (propmode & T_PROP_CONNECTED)
dists = MEM_mallocN(em->bm->totvert * sizeof(float), "scratch nears");
}
else t->total = countsel;
else {
t->total = countsel;
}
tob = t->data = MEM_callocN(t->total * sizeof(TransData), "TransObData(Mesh EditMode)");
if (ELEM(t->mode, TFM_SKIN_RESIZE, TFM_SHRINKFATTEN)) {
@ -3584,7 +3588,9 @@ static void createTransGraphEditData(bContext *C, TransInfo *t)
if (ELEM3(t->mode, TFM_TRANSLATION, TFM_TIME_TRANSLATE, TFM_TIME_SLIDE)) {
/* for 'normal' pivots - just include anything that is selected.
* this works a bit differently in translation modes */
if (sel2) count++;
if (sel2) {
count++;
}
else {
if (sel1) count++;
if (sel3) count++;

@ -856,7 +856,7 @@ static void axis_sort_v3(const float axis_values[3], int r_axis_order[3])
}
else {
if (v[1] < v[2]) { SWAP_AXIS(0, 1); }
else { SWAP_AXIS(0, 2); }
else { SWAP_AXIS(0, 2); }
}
if (v[2] < v[1]) { SWAP_AXIS(1, 2); }
@ -1293,7 +1293,9 @@ static void draw_manipulator_scale(View3D *v3d, RegionView3D *rv3d, int moving,
dz = 1.0;
}
else dz = 1.0f - 4.0f * cusize;
else {
dz = 1.0f - 4.0f * cusize;
}
if (moving) {
float matt[4][4];
@ -1739,8 +1741,12 @@ static int manipulator_selectbuf(ScrArea *sa, ARegion *ar, const int mval[2], fl
dep = buffer[4 * a + 1];
val = buffer[4 * a + 3];
if (val == MAN_TRANS_C) return MAN_TRANS_C;
else if (val == MAN_SCALE_C) return MAN_SCALE_C;
if (val == MAN_TRANS_C) {
return MAN_TRANS_C;
}
else if (val == MAN_SCALE_C) {
return MAN_SCALE_C;
}
else {
if (val & MAN_ROT_C) {
if (minvalrot == 0 || dep < mindeprot) {

@ -246,7 +246,9 @@ void undo_editmode_step(bContext *C, int step)
}
else if (step == 1) {
if (curundo == NULL || curundo->prev == NULL) error("No more steps to undo");
if (curundo == NULL || curundo->prev == NULL) {
error("No more steps to undo");
}
else {
if (G.debug & G_DEBUG) printf("undo %s\n", curundo->name);
curundo = curundo->prev;
@ -256,7 +258,9 @@ void undo_editmode_step(bContext *C, int step)
else {
/* curundo has to remain current situation! */
if (curundo == NULL || curundo->next == NULL) error("No more steps to redo");
if (curundo == NULL || curundo->next == NULL) {
error("No more steps to redo");
}
else {
undo_restore(curundo->next, curundo->getdata(C), obedit->data);
curundo = curundo->next;

@ -200,7 +200,9 @@ static void make_dmats(bPoseChannel *pchan)
invert_m4_m4(iR_parmat, pchan->parent->pose_mat);
mult_m4_m4m4(pchan->chan_mat, iR_parmat, pchan->pose_mat); // delta mat
}
else copy_m4_m4(pchan->chan_mat, pchan->pose_mat);
else {
copy_m4_m4(pchan->chan_mat, pchan->pose_mat);
}
}
/* applies IK matrix to pchan, IK is done separated */

@ -319,7 +319,9 @@ static int fwritecolrs(FILE *file, int width, int channels, unsigned char *ibufs
putc((unsigned char)(128 + cnt), file);
putc(rgbe_scan[beg][i], file);
}
else cnt = 0;
else {
cnt = 0;
}
}
}
MEM_freeN(rgbe_scan);

@ -77,8 +77,8 @@ static int tga_out1(unsigned int data, FILE *file)
uchar *p;
p = (uchar *) &data;
if (putc(p[0], file) == EOF) return(EOF);
return (~EOF);
if (putc(p[0], file) == EOF) return EOF;
return ~EOF;
}
static int tga_out2(unsigned int data, FILE *file)
@ -86,9 +86,9 @@ static int tga_out2(unsigned int data, FILE *file)
uchar *p;
p = (uchar *) &data;
if (putc(p[0], file) == EOF) return(EOF);
if (putc(p[1], file) == EOF) return(EOF);
return (~EOF);
if (putc(p[0], file) == EOF) return EOF;
if (putc(p[1], file) == EOF) return EOF;
return ~EOF;
}
@ -97,10 +97,10 @@ static int tga_out3(unsigned int data, FILE *file)
uchar *p;
p = (uchar *) &data;
if (putc(p[2], file) == EOF) return(EOF);
if (putc(p[1], file) == EOF) return(EOF);
if (putc(p[0], file) == EOF) return(EOF);
return (~EOF);
if (putc(p[2], file) == EOF) return EOF;
if (putc(p[1], file) == EOF) return EOF;
if (putc(p[0], file) == EOF) return EOF;
return ~EOF;
}
@ -110,11 +110,11 @@ static int tga_out4(unsigned int data, FILE *file)
p = (uchar *) &data;
/* order = bgra */
if (putc(p[2], file) == EOF) return(EOF);
if (putc(p[1], file) == EOF) return(EOF);
if (putc(p[0], file) == EOF) return(EOF);
if (putc(p[3], file) == EOF) return(EOF);
return (~EOF);
if (putc(p[2], file) == EOF) return EOF;
if (putc(p[1], file) == EOF) return EOF;
if (putc(p[0], file) == EOF) return EOF;
if (putc(p[3], file) == EOF) return EOF;
return ~EOF;
}
static short makebody_tga(ImBuf *ibuf, FILE *file, int (*out)(unsigned int, FILE *))
@ -154,9 +154,9 @@ static short makebody_tga(ImBuf *ibuf, FILE *file, int (*out)(unsigned int, FILE
last = copy;
if (copy >= 128) last = 128;
copy -= last;
if (fputc(last - 1, file) == EOF) return(0);
if (fputc(last - 1, file) == EOF) return 0;
do {
if (out(*rect++, file) == EOF) return(0);
if (out(*rect++, file) == EOF) return 0;
} while (--last != 0);
}
rectstart = rect;
@ -177,23 +177,23 @@ static short makebody_tga(ImBuf *ibuf, FILE *file, int (*out)(unsigned int, FILE
while (copy) {
if (copy > 128) {
if (fputc(255, file) == EOF) return(0);
if (fputc(255, file) == EOF) return 0;
copy -= 128;
}
else {
if (copy == 1) {
if (fputc(0, file) == EOF) return(0);
if (fputc(0, file) == EOF) return 0;
}
else if (fputc(127 + copy, file) == EOF) return(0);
else if (fputc(127 + copy, file) == EOF) return 0;
copy = 0;
}
if (out(last, file) == EOF) return(0);
if (out(last, file) == EOF) return 0;
}
copy = TRUE;
}
}
}
return (1);
return 1;
}
static int dumptarga(struct ImBuf *ibuf, FILE *file)
@ -201,15 +201,15 @@ static int dumptarga(struct ImBuf *ibuf, FILE *file)
int size;
uchar *rect;
if (ibuf == NULL) return (0);
if (ibuf->rect == NULL) return (0);
if (ibuf == NULL) return 0;
if (ibuf->rect == NULL) return 0;
size = ibuf->x * ibuf->y;
rect = (uchar *) ibuf->rect;
if (ibuf->planes <= 8) {
while (size > 0) {
if (putc(*rect, file) == EOF) return (0);
if (putc(*rect, file) == EOF) return 0;
size--;
rect += 4;
}
@ -217,7 +217,7 @@ static int dumptarga(struct ImBuf *ibuf, FILE *file)
else if (ibuf->planes <= 16) {
while (size > 0) {
putc(rect[0], file);
if (putc(rect[1], file) == EOF) return (0);
if (putc(rect[1], file) == EOF) return 0;
size--;
rect += 4;
}
@ -226,7 +226,7 @@ static int dumptarga(struct ImBuf *ibuf, FILE *file)
while (size > 0) {
putc(rect[2], file);
putc(rect[1], file);
if (putc(rect[0], file) == EOF) return (0);
if (putc(rect[0], file) == EOF) return 0;
size--;
rect += 4;
}
@ -236,14 +236,16 @@ static int dumptarga(struct ImBuf *ibuf, FILE *file)
putc(rect[2], file);
putc(rect[1], file);
putc(rect[0], file);
if (putc(rect[3], file) == EOF) return (0);
if (putc(rect[3], file) == EOF) return 0;
size--;
rect += 4;
}
}
else return (0);
return (1);
else {
return 0;
}
return 1;
}
@ -285,7 +287,7 @@ int imb_savetarga(struct ImBuf *ibuf, const char *name, int flags)
if (fwrite(buf, 1, 18, fildes) != 18) {
fclose(fildes);
return (0);
return 0;
}
if (ibuf->ftype == RAWTGA) {
@ -309,7 +311,7 @@ int imb_savetarga(struct ImBuf *ibuf, const char *name, int flags)
}
fclose(fildes);
return (ok);
return ok;
}
@ -329,7 +331,7 @@ static int checktarga(TARGA *tga, unsigned char *mem)
tga->pixsize = mem[16];
tga->imgdes = mem[17];
if (tga->maptyp > 1) return(0);
if (tga->maptyp > 1) return 0;
switch (tga->imgtyp) {
case 1: /* raw cmap */
case 2: /* raw rgb */
@ -339,14 +341,14 @@ static int checktarga(TARGA *tga, unsigned char *mem)
case 11: /* b&w */
break;
default:
return(0);
return 0;
}
if (tga->mapsize && tga->mapbits > 32) return(0);
if (tga->xsize <= 0 || tga->xsize >= 8192) return(0);
if (tga->ysize <= 0 || tga->ysize >= 8192) return(0);
if (tga->pixsize > 32) return(0);
if (tga->pixsize == 0) return(0);
return(1);
if (tga->mapsize && tga->mapbits > 32) return 0;
if (tga->xsize <= 0 || tga->xsize >= 8192) return 0;
if (tga->ysize <= 0 || tga->ysize >= 8192) return 0;
if (tga->pixsize > 32) return 0;
if (tga->pixsize == 0) return 0;
return 1;
}
int imb_is_a_targa(unsigned char *buf)
@ -557,14 +559,16 @@ ImBuf *imb_loadtarga(unsigned char *mem, size_t mem_size, int flags, char colors
unsigned int *rect, *cmap = NULL /*, mincol = 0*/, maxcol = 0;
uchar *cp = (uchar *) &col;
if (checktarga(&tga, mem) == 0) return(NULL);
if (checktarga(&tga, mem) == 0) {
return NULL;
}
colorspace_set_default_role(colorspace, IM_MAX_SPACE, COLOR_ROLE_DEFAULT_BYTE);
if (flags & IB_test) ibuf = IMB_allocImBuf(tga.xsize, tga.ysize, tga.pixsize, 0);
else ibuf = IMB_allocImBuf(tga.xsize, tga.ysize, (tga.pixsize + 0x7) & ~0x7, IB_rect);
if (ibuf == NULL) return(NULL);
if (ibuf == NULL) return NULL;
ibuf->ftype = TGA;
mem = mem + 18 + tga.numid;
@ -613,7 +617,9 @@ ImBuf *imb_loadtarga(unsigned char *mem, size_t mem_size, int flags, char colors
}
}
if (flags & IB_test) return (ibuf);
if (flags & IB_test) {
return ibuf;
}
if (tga.imgtyp != 1 && tga.imgtyp != 9) { /* happens sometimes (beuh) */
if (cmap) {
@ -693,5 +699,5 @@ ImBuf *imb_loadtarga(unsigned char *mem, size_t mem_size, int flags, char colors
if (ibuf->rect)
IMB_convert_rgba_to_abgr(ibuf);
return(ibuf);
return ibuf;
}

@ -251,7 +251,9 @@ static int add_type(const char *str, int len)
}
/* append new type */
if (nr_types == 0) cp = typedata;
if (nr_types == 0) {
cp = typedata;
}
else {
cp = types[nr_types - 1] + strlen(types[nr_types - 1]) + 1;
}
@ -397,7 +399,9 @@ static int add_name(const char *str)
}
/* append new type */
if (nr_names == 0) cp = namedata;
if (nr_names == 0) {
cp = namedata;
}
else {
cp = names[nr_names - 1] + strlen(names[nr_names - 1]) + 1;
}

@ -3173,7 +3173,9 @@ static void rna_generate_struct(BlenderRNA *UNUSED(brna), StructRNA *srna, FILE
fprintf(f, "\t(PropertyRNA *)&rna_%s_%s, ", base->identifier, prop->identifier);
}
else fprintf(f, "\tNULL, ");
else {
fprintf(f, "\tNULL, ");
}
prop = srna->iteratorproperty;
base = srna;

@ -209,7 +209,9 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
if (psys == NULL || psys->totpart == 0)
return derivedData;
}
else return derivedData;
else {
return derivedData;
}
if (pimd->flag & eParticleInstanceFlag_Parents)
totpart += psys->totpart;

@ -470,7 +470,9 @@ const char *BPy_IDProperty_Map_ValidateAndCreate(PyObject *name_obj, IDProperty
Py_XDECREF(keys);
Py_XDECREF(vals);
}
else return "invalid property value";
else {
return "invalid property value";
}
if (group->type == IDP_IDPARRAY) {
IDP_AppendArray(group, prop);

@ -274,14 +274,18 @@ int imagewrap(Tex *tex, Image *ima, ImBuf *ibuf, const float texvec[3], TexResul
ibuf_get_color(col, ibuf, x+1, y);
val2= (col[0]+col[1]+col[2]);
}
else val2= val1;
else {
val2= val1;
}
if (y<ibuf->y-1) {
float col[4];
ibuf_get_color(col, ibuf, x, y+1);
val3= (col[0]+col[1]+col[2]);
val3 = (col[0]+col[1]+col[2]);
}
else {
val3 = val1;
}
else val3= val1;
/* do not mix up x and y here! */
texres->nor[0]= (val1-val2);
@ -289,13 +293,19 @@ int imagewrap(Tex *tex, Image *ima, ImBuf *ibuf, const float texvec[3], TexResul
}
}
if (texres->talpha) texres->tin= texres->ta;
if (texres->talpha) {
texres->tin = texres->ta;
}
else if (tex->imaflag & TEX_CALCALPHA) {
texres->ta = texres->tin = max_fff(texres->tr, texres->tg, texres->tb);
}
else texres->ta= texres->tin= 1.0;
else {
texres->ta = texres->tin = 1.0;
}
if (tex->flag & TEX_NEGALPHA) texres->ta= 1.0f-texres->ta;
if (tex->flag & TEX_NEGALPHA) {
texres->ta = 1.0f - texres->ta;
}
/* de-premul, this is being premulled in shade_input_do_shade() */
if (texres->ta!=1.0f && texres->ta>1e-4f) {
@ -1838,7 +1848,9 @@ int imagewraposa(Tex *tex, Image *ima, ImBuf *ibuf, const float texvec[3], const
if (tex->imaflag & TEX_CALCALPHA) {
texres->ta = texres->tin = texres->ta * max_fff(texres->tr, texres->tg, texres->tb);
}
else texres->tin= texres->ta;
else {
texres->tin = texres->ta;
}
if (tex->flag & TEX_NEGALPHA) texres->ta= 1.0f-texres->ta;

@ -363,7 +363,9 @@ void WM_jobs_start(wmWindowManager *wm, wmJob *wm_job)
if (G.debug & G_DEBUG_JOBS)
wm_job->start_time = PIL_check_seconds_timer();
}
else printf("job fails, not initialized\n");
else {
printf("job fails, not initialized\n");
}
}
}

@ -590,7 +590,9 @@ static int ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr ps_void)
case GHOST_kKeyPeriod:
case GHOST_kKeyNumpadPeriod:
if (val) {
if (ps->sstep) ps->wait2 = FALSE;
if (ps->sstep) {
ps->wait2 = FALSE;
}
else {
ps->sstep = TRUE;
ps->wait2 = !ps->wait2;
@ -1192,16 +1194,18 @@ static char *wm_main_playanim_intern(int argc, const char **argv)
void WM_main_playanim(int argc, const char **argv)
{
int looping = TRUE;
bool looping = true;
while (looping) {
char *filepath = wm_main_playanim_intern(argc, argv);
if (filepath) { /* use simple args */
argv[1] = "-a";
argv[2] = filepath;
argc = 3;
}
else looping = 0;
else {
looping = false;
}
}
}

@ -1252,7 +1252,9 @@ void WM_clipboard_text_set(char *buf, int selection)
if (*p == '\n') {
*(p2++) = '\r'; *p2 = '\n';
}
else *p2 = *p;
else {
*p2 = *p;
}
}
*p2 = '\0';