style cleanup

This commit is contained in:
Campbell Barton 2013-02-02 04:58:03 +00:00
parent 9da4cab9fd
commit 518bfbb1c9
28 changed files with 43 additions and 44 deletions

@ -96,7 +96,7 @@ typedef struct SPHData {
float *gravity; float *gravity;
float hfac; float hfac;
/* Average distance to neighbours (other particles in the support domain), /* Average distance to neighbours (other particles in the support domain),
for calculating the Courant number (adaptive time step). */ * for calculating the Courant number (adaptive time step). */
int pass; int pass;
float element_size; float element_size;
float flow[3]; float flow[3];

@ -507,7 +507,7 @@ void BKE_displist_fill(ListBase *dispbase, ListBase *to, int flipnormal)
dl = dl->next; dl = dl->next;
} }
/* XXX (obedit && obedit->actcol)?(obedit->actcol-1):0)) { */ /* XXX (obedit && obedit->actcol) ? (obedit->actcol-1) : 0)) { */
if (totvert && (tot = BLI_scanfill_calc(&sf_ctx, BLI_SCANFILL_CALC_REMOVE_DOUBLES | BLI_SCANFILL_CALC_HOLES))) { if (totvert && (tot = BLI_scanfill_calc(&sf_ctx, BLI_SCANFILL_CALC_REMOVE_DOUBLES | BLI_SCANFILL_CALC_HOLES))) {
if (tot) { if (tot) {
dlnew = MEM_callocN(sizeof(DispList), "filldisplist"); dlnew = MEM_callocN(sizeof(DispList), "filldisplist");

@ -1489,7 +1489,7 @@ void BKE_mesh_from_nurbs_displist(Object *ob, ListBase *dispbase, int use_orco_u
if (dm == NULL) { if (dm == NULL) {
if (BKE_mesh_nurbs_displist_to_mdata(ob, dispbase, &allvert, &totvert, if (BKE_mesh_nurbs_displist_to_mdata(ob, dispbase, &allvert, &totvert,
&alledge, &totedge, &allloop, &alledge, &totedge, &allloop,
&allpoly, (use_orco_uv)? &alluv: NULL, &allpoly, (use_orco_uv) ? &alluv : NULL,
&totloop, &totpoly) != 0) &totloop, &totpoly) != 0)
{ {
/* Error initializing */ /* Error initializing */

@ -770,7 +770,7 @@ static void pbvh_bmesh_collapse_edge(PBVH *bvh, BMEdge *e, BMVert *v1,
BM_edge_kill(bvh->bm, e); BM_edge_kill(bvh->bm, e);
/* For all remaining faces of v2, create a new face that is the /* For all remaining faces of v2, create a new face that is the
same except it uses v1 instead of v2 */ * same except it uses v1 instead of v2 */
/* Note: this could be done with BM_vert_splice(), but that /* Note: this could be done with BM_vert_splice(), but that
* requires handling other issues like duplicate edges, so doesn't * requires handling other issues like duplicate edges, so doesn't
* really buy anything. */ * really buy anything. */

@ -1065,7 +1065,7 @@ static void scene_depsgraph_hack(Scene *scene, Scene *scene_parent)
if (ob->depsflag) { if (ob->depsflag) {
int recalc = 0; int recalc = 0;
// printf("depshack %s\n", ob->id.name+2); // printf("depshack %s\n", ob->id.name + 2);
if (ob->depsflag & OB_DEPS_EXTRA_OB_RECALC) if (ob->depsflag & OB_DEPS_EXTRA_OB_RECALC)
recalc |= OB_RECALC_OB; recalc |= OB_RECALC_OB;

@ -2378,7 +2378,7 @@ void interp_weights_poly_v3(float *w, float v[][3], const int n, const float co[
t2 = mean_value_half_tan_v3(co, vmid, vnext); t2 = mean_value_half_tan_v3(co, vmid, vnext);
len = len_v3v3(co, vmid); len = len_v3v3(co, vmid);
w[i] = (len != 0.0f)? (t1 + t2) / len: 0.0f; w[i] = (len != 0.0f) ? (t1 + t2) / len: 0.0f;
totweight += w[i]; totweight += w[i];
} }
@ -2430,7 +2430,7 @@ void interp_weights_poly_v2(float *w, float v[][2], const int n, const float co[
t2 = mean_value_half_tan_v2(co, vmid, vnext); t2 = mean_value_half_tan_v2(co, vmid, vnext);
len = len_v2v2(co, vmid); len = len_v2v2(co, vmid);
w[i] = (len != 0.0f)? (t1 + t2) / len: 0.0f; w[i] = (len != 0.0f) ? (t1 + t2) / len: 0.0f;
totweight += w[i]; totweight += w[i];
} }

@ -518,7 +518,7 @@ static int bev_ccw_test(BMEdge *a, BMEdge *b, BMFace *f)
* We want M to make M*A=B where A has the left side above, as columns * We want M to make M*A=B where A has the left side above, as columns
* and B has the right side as columns - both extended into homogeneous coords. * and B has the right side as columns - both extended into homogeneous coords.
* So M = B*(Ainverse). Doing Ainverse by hand gives the code below. * So M = B*(Ainverse). Doing Ainverse by hand gives the code below.
*/ */
static int make_unit_square_map(const float va[3], const float vmid[3], const float vb[3], static int make_unit_square_map(const float va[3], const float vmid[3], const float vb[3],
float r_mat[4][4]) float r_mat[4][4])
{ {
@ -1304,7 +1304,7 @@ static void fix_vmesh_tangents(VMesh *vm, BevVert *bv)
/* Also want (i, 1, k) snapped to plane of adjacent face for /* Also want (i, 1, k) snapped to plane of adjacent face for
* 1 < k < ns - 1, but current initial cage and subdiv rules * 1 < k < ns - 1, but current initial cage and subdiv rules
* ensure this, so nothing to do */ * ensure this, so nothing to do */
} while ((bndv = bndv->next) != vm->boundstart); } while ((bndv = bndv->next) != vm->boundstart);
} }

@ -184,7 +184,7 @@ void SceneExporter::writeNodes(Object *ob, Scene *sce)
if (ob->constraints.first != NULL ){ if (ob->constraints.first != NULL ){
bConstraint *con = (bConstraint*) ob->constraints.first; bConstraint *con = (bConstraint*) ob->constraints.first;
while(con){ while (con) {
std::string con_name(id_name(con)); std::string con_name(id_name(con));
std::string con_tag = con_name + "_constraint"; std::string con_tag = con_name + "_constraint";
colladaNode.addExtraTechniqueChildParameter("blender",con_tag,"type",con->type); colladaNode.addExtraTechniqueChildParameter("blender",con_tag,"type",con->type);

@ -45,13 +45,13 @@ void TransformReader::get_node_mat(float mat[4][4], COLLADAFW::Node *node, std::
COLLADAFW::Transformation *tm = node->getTransformations()[i]; COLLADAFW::Transformation *tm = node->getTransformations()[i];
COLLADAFW::Transformation::TransformationType type = tm->getTransformationType(); COLLADAFW::Transformation::TransformationType type = tm->getTransformationType();
if(type == COLLADAFW::Transformation::MATRIX){ if (type == COLLADAFW::Transformation::MATRIX){
// XXX why does this return and discard all following transformations? // XXX why does this return and discard all following transformations?
dae_matrix_to_mat4(tm, mat); dae_matrix_to_mat4(tm, mat);
return; return;
} }
else{ else {
switch (type) { switch (type) {
case COLLADAFW::Transformation::TRANSLATE: case COLLADAFW::Transformation::TRANSLATE:
dae_translate_to_mat4(tm, cur); dae_translate_to_mat4(tm, cur);

@ -146,16 +146,15 @@ int ED_markers_post_apply_transform(ListBase *markers, Scene *scene, int mode, f
marker->frame += (int)floorf(value + 0.5f); marker->frame += (int)floorf(value + 0.5f);
changed++; changed++;
} }
break;
} }
break;
case TFM_TIME_SCALE: case TFM_TIME_SCALE:
{ {
/* rescale the distance between the marker and the current frame */ /* rescale the distance between the marker and the current frame */
marker->frame = cfra + (int)floorf(((float)(marker->frame - cfra) * value) + 0.5f); marker->frame = cfra + (int)floorf(((float)(marker->frame - cfra) * value) + 0.5f);
changed++; changed++;
break;
} }
break;
} }
} }
} }

@ -997,7 +997,7 @@ void ui_fontscale(short *points, float aspect)
/* project button or block (but==NULL) to pixels in regionspace */ /* project button or block (but==NULL) to pixels in regionspace */
static void ui_but_to_pixelrect(rcti *rect, const ARegion *ar, uiBlock *block, uiBut *but) static void ui_but_to_pixelrect(rcti *rect, const ARegion *ar, uiBlock *block, uiBut *but)
{ {
rctf rectf = (but)? but->rect: block->rect; rctf rectf = (but) ? but->rect : block->rect;
ui_block_to_window_fl(ar, block, &rectf.xmin, &rectf.ymin); ui_block_to_window_fl(ar, block, &rectf.xmin, &rectf.ymin);
ui_block_to_window_fl(ar, block, &rectf.xmax, &rectf.ymax); ui_block_to_window_fl(ar, block, &rectf.xmax, &rectf.ymax);

@ -59,7 +59,7 @@ static FCurve *ui_but_get_fcurve(uiBut *but, bAction **action, int *driven)
{ {
/* for entire array buttons we check the first component, it's not perfect /* for entire array buttons we check the first component, it's not perfect
* but works well enough in typical cases */ * but works well enough in typical cases */
int rnaindex = (but->rnaindex == -1)? 0: but->rnaindex; int rnaindex = (but->rnaindex == -1) ? 0 : but->rnaindex;
return rna_get_fcurve(&but->rnapoin, but->rnaprop, rnaindex, action, driven); return rna_get_fcurve(&but->rnapoin, but->rnaprop, rnaindex, action, driven);
} }

@ -3598,8 +3598,8 @@ static void SCENE_OT_delete(wmOperatorType *ot)
/* ***************** region alpha blending ***************** */ /* ***************** region alpha blending ***************** */
/* implementation note: a disapplearing region needs at least 1 last draw with 100% backbuffer /* implementation note: a disapplearing region needs at least 1 last draw with 100% backbuffer
texture over it- then triple buffer will clear it entirely. * texture over it- then triple buffer will clear it entirely.
This because flag RGN_HIDDEN is set in end - region doesnt draw at all then */ * This because flag RGN_HIDDEN is set in end - region doesnt draw at all then */
typedef struct RegionAlphaInfo { typedef struct RegionAlphaInfo {
ScrArea *sa; ScrArea *sa;

@ -4347,7 +4347,7 @@ static int project_paint_sub_stroke(ProjPaintState *ps, BrushPainter *painter, c
pos[1] = (float)(mval_i[1]); pos[1] = (float)(mval_i[1]);
// we may want to use this later // we may want to use this later
// BKE_brush_painter_require_imbuf(painter, ((ibuf->rect_float)? 1: 0), 0, 0); // BKE_brush_painter_require_imbuf(painter, ((ibuf->rect_float) ? 1 : 0), 0, 0);
if (BKE_brush_painter_paint(painter, project_paint_op, pos, time, pressure, ps, 0)) { if (BKE_brush_painter_paint(painter, project_paint_op, pos, time, pressure, ps, 0)) {
return 1; return 1;

@ -425,11 +425,11 @@ static void sima_draw_alpha_pixelsf(float x1, float y1, int rectx, int recty, fl
MEM_freeN(trectf); MEM_freeN(trectf);
/* ogl trick below is slower... (on ATI 9600) */ /* ogl trick below is slower... (on ATI 9600) */
// glColorMask(1, 0, 0, 0); // glColorMask(1, 0, 0, 0);
// glaDrawPixelsSafe(x1, y1, rectx, recty, rectx, GL_RGBA, GL_FLOAT, rectf+3); // glaDrawPixelsSafe(x1, y1, rectx, recty, rectx, GL_RGBA, GL_FLOAT, rectf + 3);
// glColorMask(0, 1, 0, 0); // glColorMask(0, 1, 0, 0);
// glaDrawPixelsSafe(x1, y1, rectx, recty, rectx, GL_RGBA, GL_FLOAT, rectf+2); // glaDrawPixelsSafe(x1, y1, rectx, recty, rectx, GL_RGBA, GL_FLOAT, rectf + 2);
// glColorMask(0, 0, 1, 0); // glColorMask(0, 0, 1, 0);
// glaDrawPixelsSafe(x1, y1, rectx, recty, rectx, GL_RGBA, GL_FLOAT, rectf+1); // glaDrawPixelsSafe(x1, y1, rectx, recty, rectx, GL_RGBA, GL_FLOAT, rectf + 1);
// glColorMask(1, 1, 1, 1); // glColorMask(1, 1, 1, 1);
} }

@ -1309,8 +1309,8 @@ static void do_outliner_keyingset_editop(SpaceOops *soops, KeyingSet *ks, ListBa
* for now, we don't supply one, and just let this use the KeyingSet name */ * for now, we don't supply one, and just let this use the KeyingSet name */
BKE_keyingset_add_path(ks, id, NULL, path, array_index, flag, groupmode); BKE_keyingset_add_path(ks, id, NULL, path, array_index, flag, groupmode);
ks->active_path = BLI_countlist(&ks->paths); ks->active_path = BLI_countlist(&ks->paths);
break;
} }
break;
case KEYINGSET_EDITMODE_REMOVE: case KEYINGSET_EDITMODE_REMOVE:
{ {
/* find the relevant path, then remove it from the KeyingSet */ /* find the relevant path, then remove it from the KeyingSet */
@ -1322,8 +1322,8 @@ static void do_outliner_keyingset_editop(SpaceOops *soops, KeyingSet *ks, ListBa
ks->active_path = 0; ks->active_path = 0;
} }
break;
} }
break;
} }
/* free path, since it had to be generated */ /* free path, since it had to be generated */

@ -238,7 +238,7 @@ static void InputAngle(TransInfo *UNUSED(t), MouseInput *mi, const int mval[2],
double deler = (((dx1 * dx1 + dy1 * dy1) + double deler = (((dx1 * dx1 + dy1 * dy1) +
(dx2 * dx2 + dy2 * dy2) - (dx2 * dx2 + dy2 * dy2) -
(dx3 * dx3 + dy3 * dy3)) / (2.0 * ((A * B) ? (A * B) : 1.0))); (dx3 * dx3 + dy3 * dy3)) / (2.0 * ((A * B) ? (A * B) : 1.0)));
/* ((A*B)?(A*B):1.0) this takes care of potential divide by zero errors */ /* ((A * B) ? (A * B) : 1.0) this takes care of potential divide by zero errors */
float dphi; float dphi;

@ -650,7 +650,7 @@ static void stitch_uv_edge_generate_linked_edges(GHash *edge_hash, StitchState *
edge2 = BLI_ghash_lookup(edge_hash, &edgetmp); edge2 = BLI_ghash_lookup(edge_hash, &edgetmp);
/* here I am taking care of non manifold case, assuming more than two matching edges. /* here I am taking care of non manifold case, assuming more than two matching edges.
* I am not too sure we want this though */ * I am not too sure we want this though */
last_set->next = edge2; last_set->next = edge2;
last_set = edge2; last_set = edge2;
/* set first, similarly to uv elements. Now we can iterate among common edges easily */ /* set first, similarly to uv elements. Now we can iterate among common edges easily */

@ -164,7 +164,7 @@ typedef enum BrushSculptTool {
} BrushSculptTool; } BrushSculptTool;
/* ImagePaintSettings.tool */ /* ImagePaintSettings.tool */
typedef enum BrushImagePaintTool{ typedef enum BrushImagePaintTool {
PAINT_TOOL_DRAW = 0, PAINT_TOOL_DRAW = 0,
PAINT_TOOL_SOFTEN = 1, PAINT_TOOL_SOFTEN = 1,
PAINT_TOOL_SMEAR = 2, PAINT_TOOL_SMEAR = 2,

@ -3427,7 +3427,7 @@ static const char *cpp_classes = ""
"namespace BL {\n" "namespace BL {\n"
"\n" "\n"
"#define BOOLEAN_PROPERTY(sname, identifier) \\\n" "#define BOOLEAN_PROPERTY(sname, identifier) \\\n"
" inline bool sname::identifier(void) { return sname##_##identifier##_get(&ptr)? true: false; } \\\n" " inline bool sname::identifier(void) { return sname##_##identifier##_get(&ptr) ? true: false; } \\\n"
" inline void sname::identifier(int value) { sname##_##identifier##_set(&ptr, value); }\n" " inline void sname::identifier(int value) { sname##_##identifier##_set(&ptr, value); }\n"
"\n" "\n"
"#define BOOLEAN_ARRAY_PROPERTY(sname, size, identifier) \\\n" "#define BOOLEAN_ARRAY_PROPERTY(sname, size, identifier) \\\n"
@ -3586,7 +3586,7 @@ static const char *cpp_classes = ""
"public:\n" "public:\n"
" Pointer(const PointerRNA &p) : ptr(p) { }\n" " Pointer(const PointerRNA &p) : ptr(p) { }\n"
" operator const PointerRNA&() { return ptr; }\n" " operator const PointerRNA&() { return ptr; }\n"
" bool is_a(StructRNA *type) { return RNA_struct_is_a(ptr.type, type)? true: false; }\n" " bool is_a(StructRNA *type) { return RNA_struct_is_a(ptr.type, type) ? true: false; }\n"
" operator void*() { return ptr.data; }\n" " operator void*() { return ptr.data; }\n"
" operator bool() { return ptr.data != NULL; }\n" " operator bool() { return ptr.data != NULL; }\n"
"\n" "\n"

@ -460,7 +460,7 @@ static void rna_Curve_body_set(PointerRNA *ptr, const char *value)
/* don't know why this is +4, just duplicating load_editText() */ /* don't know why this is +4, just duplicating load_editText() */
cu->strinfo = MEM_callocN((len + 4) * sizeof(CharInfo), "strinfo"); cu->strinfo = MEM_callocN((len + 4) * sizeof(CharInfo), "strinfo");
/*BLI_strncpy_wchar_as_utf8(cu->str, value, len+1); *//* value is not wchar_t */ /*BLI_strncpy_wchar_as_utf8(cu->str, value, len + 1); *//* value is not wchar_t */
BLI_strncpy(cu->str, value, len + 1); BLI_strncpy(cu->str, value, len + 1);
} }

@ -413,7 +413,7 @@ static void rna_Sequence_name_set(PointerRNA *ptr, const char *value)
/* fix all the animation data which may link to this */ /* fix all the animation data which may link to this */
/* don't rename everywhere because these are per scene */ /* don't rename everywhere because these are per scene */
/* BKE_all_animdata_fix_paths_rename(NULL, "sequence_editor.sequences_all", oldname, seq->name+2); */ /* BKE_all_animdata_fix_paths_rename(NULL, "sequence_editor.sequences_all", oldname, seq->name + 2); */
adt = BKE_animdata_from_id(&scene->id); adt = BKE_animdata_from_id(&scene->id);
if (adt) if (adt)
BKE_animdata_fix_paths_rename(&scene->id, adt, NULL, "sequence_editor.sequences_all", oldname, seq->name + 2, 0, 0, 1); BKE_animdata_fix_paths_rename(&scene->id, adt, NULL, "sequence_editor.sequences_all", oldname, seq->name + 2, 0, 0, 1);

@ -34,12 +34,12 @@
/* ******************* Channel Matte Node ********************************* */ /* ******************* Channel Matte Node ********************************* */
static bNodeSocketTemplate cmp_node_channel_matte_in[] ={ static bNodeSocketTemplate cmp_node_channel_matte_in[] = {
{SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f}, {SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f},
{-1, 0, ""} {-1, 0, ""}
}; };
static bNodeSocketTemplate cmp_node_channel_matte_out[] ={ static bNodeSocketTemplate cmp_node_channel_matte_out[] = {
{SOCK_RGBA, 0, N_("Image")}, {SOCK_RGBA, 0, N_("Image")},
{SOCK_FLOAT, 0, N_("Matte")}, {SOCK_FLOAT, 0, N_("Matte")},
{-1, 0, ""} {-1, 0, ""}

@ -197,7 +197,7 @@ void node_group_remove_socket(bNodeTree *ngroup, bNodeSocket *gsock, int in_out)
/* groups display their internal tree name as label */ /* groups display their internal tree name as label */
const char *node_group_label(bNode *node) const char *node_group_label(bNode *node)
{ {
return (node->id)? node->id->name+2: IFACE_("Missing Datablock"); return (node->id)? node->id->name + 2: IFACE_("Missing Datablock");
} }
int node_group_valid(bNodeTree *ntree, bNodeTemplate *ntemp) int node_group_valid(bNodeTree *ntree, bNodeTemplate *ntemp)

@ -277,7 +277,7 @@ void ntreeExecGPUNodes(bNodeTreeExec *exec, GPUMaterial *mat, int do_outputs)
bNodeStack *stack; bNodeStack *stack;
bNodeStack *nsin[MAX_SOCKET]; /* arbitrary... watch this */ bNodeStack *nsin[MAX_SOCKET]; /* arbitrary... watch this */
bNodeStack *nsout[MAX_SOCKET]; /* arbitrary... watch this */ bNodeStack *nsout[MAX_SOCKET]; /* arbitrary... watch this */
GPUNodeStack gpuin[MAX_SOCKET+1], gpuout[MAX_SOCKET+1]; GPUNodeStack gpuin[MAX_SOCKET + 1], gpuout[MAX_SOCKET + 1];
int do_it; int do_it;
stack= exec->stack; stack= exec->stack;

@ -734,8 +734,8 @@ static void bake_single_vertex(BakeShade *bs, VertRen *vert, float u, float v)
} }
/* Bake all vertices of a face. Actually, this still works on a face-by-face /* Bake all vertices of a face. Actually, this still works on a face-by-face
basis, and each vertex on each face is shaded. Vertex colors are a property * basis, and each vertex on each face is shaded. Vertex colors are a property
of loops, not vertices. */ * of loops, not vertices. */
static void shade_verts(BakeShade *bs) static void shade_verts(BakeShade *bs)
{ {
VlakRen *vlr = bs->vlr; VlakRen *vlr = bs->vlr;
@ -756,7 +756,7 @@ static void shade_verts(BakeShade *bs)
zero_v3(bs->dyco); zero_v3(bs->dyco);
/* Shade each vertex of the face. u and v are barycentric coordinates; since /* Shade each vertex of the face. u and v are barycentric coordinates; since
we're only interested in vertices, these will be 0 or 1. */ * we're only interested in vertices, these will be 0 or 1. */
if ((vlr->flag & R_FACE_SPLIT) == 0) { if ((vlr->flag & R_FACE_SPLIT) == 0) {
/* Processing triangle face, whole quad, or first half of split quad. */ /* Processing triangle face, whole quad, or first half of split quad. */

@ -282,7 +282,7 @@ void wm_event_do_notifiers(bContext *C)
/* XXX context in notifiers? */ /* XXX context in notifiers? */
CTX_wm_window_set(C, win); CTX_wm_window_set(C, win);
/* printf("notifier win %d screen %s cat %x\n", win->winid, win->screen->id.name+2, note->category); */ /* printf("notifier win %d screen %s cat %x\n", win->winid, win->screen->id.name + 2, note->category); */
ED_screen_do_listen(C, note); ED_screen_do_listen(C, note);
for (ar = win->screen->regionbase.first; ar; ar = ar->next) { for (ar = win->screen->regionbase.first; ar; ar = ar->next) {
@ -1383,8 +1383,8 @@ static void wm_event_modalkeymap(const bContext *C, wmOperator *op, wmEvent *eve
} }
else { else {
/* modal keymap checking returns handled events fine, but all hardcoded modal /* modal keymap checking returns handled events fine, but all hardcoded modal
handling typically swallows all events (OPERATOR_RUNNING_MODAL). * handling typically swallows all events (OPERATOR_RUNNING_MODAL).
This bypass just disables support for double clicks in hardcoded modal handlers */ * This bypass just disables support for double clicks in hardcoded modal handlers */
if (event->val == KM_DBL_CLICK) { if (event->val == KM_DBL_CLICK) {
event->prevval = event->val; event->prevval = event->val;
event->val = KM_PRESS; event->val = KM_PRESS;

@ -921,7 +921,7 @@ static int set_ge_parameters(int argc, const char **argv, void *data)
} }
} /* if (*(argv[a+1]) == '=') */ } /* if (*(argv[a + 1]) == '=') */
} }
return a; return a;