style cleanup

This commit is contained in:
Campbell Barton 2012-10-14 13:08:19 +00:00
parent 3a947cf537
commit 8e01b8959e
23 changed files with 116 additions and 68 deletions

@ -193,8 +193,8 @@ set(SRC
BKE_lamp.h BKE_lamp.h
BKE_lattice.h BKE_lattice.h
BKE_library.h BKE_library.h
BKE_mask.h
BKE_main.h BKE_main.h
BKE_mask.h
BKE_material.h BKE_material.h
BKE_mball.h BKE_mball.h
BKE_mesh.h BKE_mesh.h

@ -534,10 +534,12 @@ Mat4 *b_bone_spline_setup(bPoseChannel *pchan, int rest)
mul_m4_v3(imat, h2); mul_m4_v3(imat, h2);
/* if next bone is B-bone too, use average handle direction */ /* if next bone is B-bone too, use average handle direction */
if (next->bone->segments > 1) if (next->bone->segments > 1) {
; /* pass */
else }
else {
h2[1] -= length; h2[1] -= length;
}
normalize_v3(h2); normalize_v3(h2);
/* find the next roll to interpolate as well */ /* find the next roll to interpolate as well */

@ -101,13 +101,15 @@ static int rule_goal_avoid(BoidRule *rule, BoidBrainData *bbd, BoidValues *val,
break; break;
} }
} }
else if (rule->type == eBoidRuleType_Goal && eob == bpa->ground) else if (rule->type == eBoidRuleType_Goal && eob == bpa->ground) {
; /* skip current object */ /* skip current object */
}
else if (pd->forcefield == PFIELD_BOID && mul * pd->f_strength > 0.0f && get_effector_data(cur, &cur_efd, &epoint, 0)) { else if (pd->forcefield == PFIELD_BOID && mul * pd->f_strength > 0.0f && get_effector_data(cur, &cur_efd, &epoint, 0)) {
float temp = mul * pd->f_strength * effector_falloff(cur, &cur_efd, &epoint, bbd->part->effector_weights); float temp = mul * pd->f_strength * effector_falloff(cur, &cur_efd, &epoint, bbd->part->effector_weights);
if (temp == 0.0f) if (temp == 0.0f) {
; /* do nothing */ /* do nothing */
}
else if (temp > priority) { else if (temp > priority) {
priority = temp; priority = temp;
eff = cur; eff = cur;

@ -1013,10 +1013,12 @@ void pdDoEffectors(ListBase *effectors, ListBase *colliders, EffectorWeights *we
if (efd.falloff > 0.0f) if (efd.falloff > 0.0f)
efd.falloff *= eff_calc_visibility(colliders, eff, &efd, point); efd.falloff *= eff_calc_visibility(colliders, eff, &efd, point);
if (efd.falloff <= 0.0f) if (efd.falloff <= 0.0f) {
; /* don't do anything */ /* don't do anything */
else if (eff->pd->forcefield == PFIELD_TEXTURE) }
else if (eff->pd->forcefield == PFIELD_TEXTURE) {
do_texture_effector(eff, &efd, point, force); do_texture_effector(eff, &efd, point, force);
}
else { else {
float temp1[3]={0, 0, 0}, temp2[3]; float temp1[3]={0, 0, 0}, temp2[3];
copy_v3_v3(temp1, force); copy_v3_v3(temp1, force);

@ -3328,8 +3328,9 @@ void BKE_ptcache_load_external(PTCacheID *pid)
cache->endframe = end; cache->endframe = end;
cache->totpoint = 0; cache->totpoint = 0;
if (pid->type == PTCACHE_TYPE_SMOKE_DOMAIN) if (pid->type == PTCACHE_TYPE_SMOKE_DOMAIN) {
; /*necessary info in every file*/ /* necessary info in every file */
}
/* read totpoint from info file (frame 0) */ /* read totpoint from info file (frame 0) */
else if (info) { else if (info) {
pf= ptcache_file_open(pid, PTCACHE_FILE_READ, 0); pf= ptcache_file_open(pid, PTCACHE_FILE_READ, 0);

@ -4319,10 +4319,12 @@ static void direct_link_modifiers(FileData *fd, ListBase *lb)
if (smd->domain->ptcaches[1].first || smd->domain->point_cache[1]) { if (smd->domain->ptcaches[1].first || smd->domain->point_cache[1]) {
if (smd->domain->point_cache[1]) { if (smd->domain->point_cache[1]) {
PointCache *cache = newdataadr(fd, smd->domain->point_cache[1]); PointCache *cache = newdataadr(fd, smd->domain->point_cache[1]);
if (cache->flag & PTCACHE_FAKE_SMOKE) if (cache->flag & PTCACHE_FAKE_SMOKE) {
; /* Smoke was already saved in "new format" and this cache is a fake one. */ /* Smoke was already saved in "new format" and this cache is a fake one. */
else }
else {
printf("High resolution smoke cache not available due to pointcache update. Please reset the simulation.\n"); printf("High resolution smoke cache not available due to pointcache update. Please reset the simulation.\n");
}
BKE_ptcache_free(cache); BKE_ptcache_free(cache);
} }
smd->domain->ptcaches[1].first = NULL; smd->domain->ptcaches[1].first = NULL;

@ -730,8 +730,9 @@ static void write_nodetree(WriteData *wd, bNodeTree *ntree)
write_curvemapping(wd, node->storage); write_curvemapping(wd, node->storage);
else if (ntree->type==NTREE_TEXTURE && (node->type==TEX_NODE_CURVE_RGB || node->type==TEX_NODE_CURVE_TIME) ) else if (ntree->type==NTREE_TEXTURE && (node->type==TEX_NODE_CURVE_RGB || node->type==TEX_NODE_CURVE_TIME) )
write_curvemapping(wd, node->storage); write_curvemapping(wd, node->storage);
else if (ntree->type==NTREE_COMPOSIT && node->type==CMP_NODE_MOVIEDISTORTION) else if (ntree->type==NTREE_COMPOSIT && node->type==CMP_NODE_MOVIEDISTORTION) {
/* pass */; /* pass */
}
else else
writestruct(wd, DATA, node->typeinfo->storagename, 1, node->storage); writestruct(wd, DATA, node->typeinfo->storagename, 1, node->storage);
} }

@ -1528,7 +1528,9 @@ void ui_set_but_val(uiBut *but, double value)
* so leave this unset */ * so leave this unset */
value = UI_BUT_VALUE_UNSET; value = UI_BUT_VALUE_UNSET;
} }
else if (but->pointype == 0) ; else if (but->pointype == 0) {
/* pass */
}
else if (but->type == HSVSLI) { else if (but->type == HSVSLI) {
float *fp, hsv[3]; float *fp, hsv[3];
@ -1721,8 +1723,9 @@ void ui_get_but_string(uiBut *but, char *str, size_t maxlen)
BLI_strncpy(str, but->poin, maxlen); BLI_strncpy(str, but->poin, maxlen);
return; return;
} }
else if (ui_but_anim_expression_get(but, str, maxlen)) else if (ui_but_anim_expression_get(but, str, maxlen)) {
; /* driver expression */ /* driver expression */
}
else { else {
/* number editing */ /* number editing */
double value; double value;
@ -2480,7 +2483,9 @@ static void ui_block_do_align_but(uiBut *first, short nr)
if (rows > 0) { if (rows > 0) {
uiBut *bt = but; uiBut *bt = but;
while (bt && bt->alignnr == nr) { while (bt && bt->alignnr == nr) {
if (bt->next && bt->next->alignnr == nr && buts_are_horiz(bt, bt->next) == 0) break; if (bt->next && bt->next->alignnr == nr && buts_are_horiz(bt, bt->next) == 0) {
break;
}
bt = bt->next; bt = bt->next;
} }
if (bt == NULL || bt->alignnr != nr) flag = UI_BUT_ALIGN_TOP | UI_BUT_ALIGN_RIGHT; if (bt == NULL || bt->alignnr != nr) flag = UI_BUT_ALIGN_TOP | UI_BUT_ALIGN_RIGHT;
@ -2714,9 +2719,8 @@ static uiBut *ui_def_but(uiBlock *block, int type, int retval, const char *str,
} }
/* keep track of UI_interface.h */ /* keep track of UI_interface.h */
if (ELEM7(but->type, BLOCK, BUT, LABEL, PULLDOWN, ROUNDBOX, LISTBOX, BUTM)) ; if (ELEM9(but->type, BLOCK, BUT, LABEL, PULLDOWN, ROUNDBOX, LISTBOX, BUTM, SCROLL, SEPR /* , FTPREVIEW */)) {}
else if (ELEM(but->type, SCROLL, SEPR /* , FTPREVIEW */ )) ; else if (but->type >= SEARCH_MENU) {}
else if (but->type >= SEARCH_MENU) ;
else but->flag |= UI_BUT_UNDO; else but->flag |= UI_BUT_UNDO;
BLI_addtail(&block->buttons, but); BLI_addtail(&block->buttons, but);
@ -2750,7 +2754,7 @@ static uiBut *ui_def_but(uiBlock *block, int type, int retval, const char *str,
static uiBut *ui_def_but_rna(uiBlock *block, int type, int retval, const char *str, static uiBut *ui_def_but_rna(uiBlock *block, int type, int retval, const char *str,
int x, int y, short width, short height, int x, int y, short width, short height,
PointerRNA *ptr, PropertyRNA *prop, int index, PointerRNA *ptr, PropertyRNA *prop, int index,
float min, float max, float a1, float a2, const char *tip) float min, float max, float a1, float a2, const char *tip)
{ {

@ -6621,7 +6621,9 @@ static int ui_handle_menu_event(bContext *C, wmEvent *event, uiPopupBlockHandle
} }
} }
if (menu->menuretval) ; if (menu->menuretval) {
/* pass */
}
else if (event->type == ESCKEY && event->val == KM_PRESS) { else if (event->type == ESCKEY && event->val == KM_PRESS) {
/* esc cancels this and all preceding menus */ /* esc cancels this and all preceding menus */
menu->menuretval = UI_RETURN_CANCEL; menu->menuretval = UI_RETURN_CANCEL;

@ -2674,14 +2674,18 @@ void uiPupMenuReports(bContext *C, ReportList *reports)
ds = BLI_dynstr_new(); ds = BLI_dynstr_new();
for (report = reports->list.first; report; report = report->next) { for (report = reports->list.first; report; report = report->next) {
if (report->type < reports->printlevel) if (report->type < reports->printlevel) {
; /* pass */ /* pass */
else if (report->type >= RPT_ERROR) }
else if (report->type >= RPT_ERROR) {
BLI_dynstr_appendf(ds, "Error %%i%d%%t|%s", ICON_ERROR, report->message); BLI_dynstr_appendf(ds, "Error %%i%d%%t|%s", ICON_ERROR, report->message);
else if (report->type >= RPT_WARNING) }
else if (report->type >= RPT_WARNING) {
BLI_dynstr_appendf(ds, "Warning %%i%d%%t|%s", ICON_ERROR, report->message); BLI_dynstr_appendf(ds, "Warning %%i%d%%t|%s", ICON_ERROR, report->message);
else if (report->type >= RPT_INFO) }
else if (report->type >= RPT_INFO) {
BLI_dynstr_appendf(ds, "Info %%i%d%%t|%s", ICON_INFO, report->message); BLI_dynstr_appendf(ds, "Info %%i%d%%t|%s", ICON_INFO, report->message);
}
} }
str = BLI_dynstr_get_cstring(ds); str = BLI_dynstr_get_cstring(ds);

@ -207,7 +207,7 @@ static int file_browse_invoke(bContext *C, wmOperator *op, wmEvent *event)
* user-prefs exception - campbell */ * user-prefs exception - campbell */
if (RNA_struct_find_property(op->ptr, "relative_path")) { if (RNA_struct_find_property(op->ptr, "relative_path")) {
if (!RNA_struct_property_is_set(op->ptr, "relative_path")) { if (!RNA_struct_property_is_set(op->ptr, "relative_path")) {
/* annoying exception!, if were dealign with the user prefs, default relative to be off */ /* annoying exception!, if were dealing with the user prefs, default relative to be off */
RNA_boolean_set(op->ptr, "relative_path", U.flag & USER_RELPATHS && (ptr.data != &U)); RNA_boolean_set(op->ptr, "relative_path", U.flag & USER_RELPATHS && (ptr.data != &U));
} }
} }

@ -1274,12 +1274,15 @@ static int do_outliner_operation_event(bContext *C, Scene *scene, ARegion *ar, S
else { else {
if (datalevel == TSE_ANIM_DATA) if (datalevel == TSE_ANIM_DATA)
WM_operator_name_call(C, "OUTLINER_OT_animdata_operation", WM_OP_INVOKE_REGION_WIN, NULL); WM_operator_name_call(C, "OUTLINER_OT_animdata_operation", WM_OP_INVOKE_REGION_WIN, NULL);
else if (datalevel == TSE_DRIVER_BASE) else if (datalevel == TSE_DRIVER_BASE) {
/* do nothing... no special ops needed yet */; /* do nothing... no special ops needed yet */
else if (ELEM3(datalevel, TSE_R_LAYER_BASE, TSE_R_LAYER, TSE_R_PASS)) }
/*WM_operator_name_call(C, "OUTLINER_OT_renderdata_operation", WM_OP_INVOKE_REGION_WIN, NULL)*/; else if (ELEM3(datalevel, TSE_R_LAYER_BASE, TSE_R_LAYER, TSE_R_PASS)) {
else /*WM_operator_name_call(C, "OUTLINER_OT_renderdata_operation", WM_OP_INVOKE_REGION_WIN, NULL)*/
}
else {
WM_operator_name_call(C, "OUTLINER_OT_data_operation", WM_OP_INVOKE_REGION_WIN, NULL); WM_operator_name_call(C, "OUTLINER_OT_data_operation", WM_OP_INVOKE_REGION_WIN, NULL);
}
} }
} }
@ -1305,7 +1308,9 @@ static int outliner_operation(bContext *C, wmOperator *UNUSED(op), wmEvent *even
UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1], fmval, fmval + 1); UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1], fmval, fmval + 1);
for (te = soops->tree.first; te; te = te->next) { for (te = soops->tree.first; te; te = te->next) {
if (do_outliner_operation_event(C, scene, ar, soops, te, event, fmval)) break; if (do_outliner_operation_event(C, scene, ar, soops, te, event, fmval)) {
break;
}
} }
return OPERATOR_FINISHED; return OPERATOR_FINISHED;

@ -888,9 +888,10 @@ static void view3d_lasso_select(bContext *C, ViewContext *vc,
do_lasso_select_paintface(vc, mcords, moves, extend, select); do_lasso_select_paintface(vc, mcords, moves, extend, select);
else if (paint_vertsel_test(ob)) else if (paint_vertsel_test(ob))
do_lasso_select_paintvert(vc, mcords, moves, extend, select); do_lasso_select_paintvert(vc, mcords, moves, extend, select);
else if (ob && ob->mode & (OB_MODE_VERTEX_PAINT | OB_MODE_WEIGHT_PAINT | OB_MODE_TEXTURE_PAINT)) else if (ob && (ob->mode & (OB_MODE_VERTEX_PAINT | OB_MODE_WEIGHT_PAINT | OB_MODE_TEXTURE_PAINT))) {
; /* pass */
else if (ob && ob->mode & OB_MODE_PARTICLE_EDIT) }
else if (ob && (ob->mode & OB_MODE_PARTICLE_EDIT))
PE_lasso_select(C, mcords, moves, extend, select); PE_lasso_select(C, mcords, moves, extend, select);
else { else {
do_lasso_select_objects(vc, mcords, moves, extend, select); do_lasso_select_objects(vc, mcords, moves, extend, select);

@ -772,13 +772,15 @@ static int nearest_uv_between(BMEditMesh *em, BMFace *efa, int UNUSED(nverts), i
BM_ITER_ELEM (l, &iter, efa, BM_LOOPS_OF_FACE) { BM_ITER_ELEM (l, &iter, efa, BM_LOOPS_OF_FACE) {
luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV); luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
if (i == id1) if (i == id1) {
uv1 = luv->uv; uv1 = luv->uv;
else if (i == id) }
; /* uv2 = luv->uv; */ /* UNUSED */ else if (i == id) {
else if (i == id2) /* uv2 = luv->uv; */ /* UNUSED */
}
else if (i == id2) {
uv3 = luv->uv; uv3 = luv->uv;
}
i++; i++;
} }

@ -780,7 +780,9 @@ static void shade_one_light(GPUShadeInput *shi, GPUShadeResult *shr, GPULamp *la
} }
} }
if (mat->scene->gm.flag & GAME_GLSL_NO_SHADERS); if (mat->scene->gm.flag & GAME_GLSL_NO_SHADERS) {
/* pass */
}
else if (!(lamp->mode & LA_NO_SPEC) && !(lamp->mode & LA_ONLYSHADOW) && else if (!(lamp->mode & LA_NO_SPEC) && !(lamp->mode & LA_ONLYSHADOW) &&
(GPU_link_changed(shi->spec) || ma->spec != 0.0f)) (GPU_link_changed(shi->spec) || ma->spec != 0.0f))
{ {

@ -1094,7 +1094,9 @@ static int make_structDNA(char *baseDirectory, FILE *file)
int a; int a;
fp = fopen("padding.c", "w"); fp = fopen("padding.c", "w");
if (fp == NULL) ; if (fp == NULL) {
/* pass */
}
else { else {
/* add all include files defined in the global array */ /* add all include files defined in the global array */

@ -1102,8 +1102,8 @@ static char *rna_def_property_lookup_int_func(FILE *f, StructRNA *srna, Property
return NULL; return NULL;
/* only supported in case of standard next functions */ /* only supported in case of standard next functions */
if (strcmp(nextfunc, "rna_iterator_array_next") == 0) ; if (strcmp(nextfunc, "rna_iterator_array_next") == 0) {}
else if (strcmp(nextfunc, "rna_iterator_listbase_next") == 0) ; else if (strcmp(nextfunc, "rna_iterator_listbase_next") == 0) {}
else return NULL; else return NULL;
} }
@ -1372,9 +1372,12 @@ static void rna_def_property_funcs(FILE *f, StructRNA *srna, PropertyDefRNA *dp)
CollectionPropertyRNA *cprop = (CollectionPropertyRNA *)prop; CollectionPropertyRNA *cprop = (CollectionPropertyRNA *)prop;
const char *nextfunc = (const char *)cprop->next; const char *nextfunc = (const char *)cprop->next;
if (dp->dnatype && strcmp(dp->dnatype, "ListBase") == 0) ; if (dp->dnatype && strcmp(dp->dnatype, "ListBase") == 0) {
else if (dp->dnalengthname || dp->dnalengthfixed) /* pass */
}
else if (dp->dnalengthname || dp->dnalengthfixed) {
cprop->length = (void *)rna_def_property_length_func(f, srna, prop, dp, (const char *)cprop->length); cprop->length = (void *)rna_def_property_length_func(f, srna, prop, dp, (const char *)cprop->length);
}
/* test if we can allow raw array access, if it is using our standard /* test if we can allow raw array access, if it is using our standard
* array get/next function, we can be sure it is an actual array */ * array get/next function, we can be sure it is an actual array */

@ -3606,7 +3606,7 @@ static char *rna_path_token(const char **path, char *fixedbuf, int fixedlen, int
/* copy string, taking into account escaped ] */ /* copy string, taking into account escaped ] */
if (bracket) { if (bracket) {
for (p = *path, i = 0, j = 0; i < len; i++, p++) { for (p = *path, i = 0, j = 0; i < len; i++, p++) {
if (*p == '\\' && *(p + 1) == quote) ; if (*p == '\\' && *(p + 1) == quote) {}
else buf[j++] = *p; else buf[j++] = *p;
} }

@ -186,7 +186,7 @@ static void waveModifier_do(WaveModifierData *md,
const float falloff = wmd->falloff; const float falloff = wmd->falloff;
float falloff_fac = 1.0f; /* when falloff == 0.0f this stays at 1.0f */ float falloff_fac = 1.0f; /* when falloff == 0.0f this stays at 1.0f */
if (wmd->flag & MOD_WAVE_NORM && ob->type == OB_MESH) if ((wmd->flag & MOD_WAVE_NORM) && (ob->type == OB_MESH))
mvert = dm->getVertArray(dm); mvert = dm->getVertArray(dm);
if (wmd->objectcenter) { if (wmd->objectcenter) {

@ -382,8 +382,12 @@ static void d2dda(Octree *oc, short b1, short b2, short c1, short c2, char *ocfa
while (TRUE) { while (TRUE) {
if (x < 0 || y < 0 || x >= oc->ocres || y >= oc->ocres) ; if (x < 0 || y < 0 || x >= oc->ocres || y >= oc->ocres) {
else ocface[oc->ocres * x + y] = 1; /* pass*/
}
else {
ocface[oc->ocres * x + y] = 1;
}
labdao = labda; labdao = labda;
if (labdax == labday) { if (labdax == labday) {

@ -4712,10 +4712,12 @@ void RE_Database_Free(Render *re)
static int allow_render_object(Render *re, Object *ob, int nolamps, int onlyselected, Object *actob) static int allow_render_object(Render *re, Object *ob, int nolamps, int onlyselected, Object *actob)
{ {
/* override not showing object when duplis are used with particles */ /* override not showing object when duplis are used with particles */
if (ob->transflag & OB_DUPLIPARTS) if (ob->transflag & OB_DUPLIPARTS) {
; /* let particle system(s) handle showing vs. not showing */ /* pass */ /* let particle system(s) handle showing vs. not showing */
else if ((ob->transflag & OB_DUPLI) && !(ob->transflag & OB_DUPLIFRAMES)) }
else if ((ob->transflag & OB_DUPLI) && !(ob->transflag & OB_DUPLIFRAMES)) {
return 0; return 0;
}
/* don't add non-basic meta objects, ends up having renderobjects with no geometry */ /* don't add non-basic meta objects, ends up having renderobjects with no geometry */
if (ob->type == OB_MBALL && ob!=BKE_mball_basis_find(re->scene, ob)) if (ob->type == OB_MBALL && ob!=BKE_mball_basis_find(re->scene, ob))

@ -887,8 +887,9 @@ static int wm_operator_invoke(bContext *C, wmOperatorType *ot, wmEvent *event,
wm_operator_reports(C, op, retval, (reports != NULL)); wm_operator_reports(C, op, retval, (reports != NULL));
} }
if (retval & OPERATOR_HANDLED) if (retval & OPERATOR_HANDLED) {
; /* do nothing, wm_operator_exec() has been called somewhere */ /* do nothing, wm_operator_exec() has been called somewhere */
}
else if (retval & OPERATOR_FINISHED) { else if (retval & OPERATOR_FINISHED) {
if (!is_nested_call) { /* not called by py script */ if (!is_nested_call) { /* not called by py script */
WM_operator_last_properties_store(op); WM_operator_last_properties_store(op);

@ -254,12 +254,18 @@ bool RAS_IPolyMaterial::UsesLighting(RAS_IRasterizer *rasty) const
{ {
bool dolights = false; bool dolights = false;
if (m_flag & RAS_BLENDERMAT) if (m_flag & RAS_BLENDERMAT) {
dolights = (m_flag &RAS_MULTILIGHT)!=0; dolights = (m_flag & RAS_MULTILIGHT) != 0;
else if (rasty->GetDrawingMode() < RAS_IRasterizer::KX_SOLID); }
else if (rasty->GetDrawingMode() == RAS_IRasterizer::KX_SHADOW); else if (rasty->GetDrawingMode() < RAS_IRasterizer::KX_SOLID) {
else /* pass */
}
else if (rasty->GetDrawingMode() == RAS_IRasterizer::KX_SHADOW) {
/* pass */
}
else {
dolights = m_light; dolights = m_light;
}
return dolights; return dolights;
} }