Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2013-12-10 06:44:46 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-12-10 06:45:17 +0400
commit8dc80e9d736a9262947de8fb80df40dc010e37b4 (patch)
treee95ba44fcbe16fe75b2c858d080979de4bad8341
parent07d09267964b70893d81e2d2fd6958ad6075e16c (diff)
Style Cleanup
-rw-r--r--source/blender/compositor/intern/COM_MemoryBuffer.cpp43
-rw-r--r--source/blender/compositor/operations/COM_DisplaceOperation.cpp4
-rw-r--r--source/blender/editors/interface/interface_handlers.c4
-rw-r--r--source/blender/editors/screen/screen_ops.c4
-rw-r--r--source/blender/editors/space_file/file_ops.c2
-rw-r--r--source/blender/editors/space_image/image_ops.c2
-rw-r--r--source/blender/makesrna/intern/rna_particle.c4
-rw-r--r--source/blender/makesrna/intern/rna_sculpt_paint.c2
-rw-r--r--source/blender/nodes/composite/node_composite_tree.c3
-rw-r--r--source/blender/windowmanager/intern/wm_dragdrop.c4
10 files changed, 37 insertions, 35 deletions
diff --git a/source/blender/compositor/intern/COM_MemoryBuffer.cpp b/source/blender/compositor/intern/COM_MemoryBuffer.cpp
index 8a010561adf..7d8511540f7 100644
--- a/source/blender/compositor/intern/COM_MemoryBuffer.cpp
+++ b/source/blender/compositor/intern/COM_MemoryBuffer.cpp
@@ -216,10 +216,10 @@ static const float EWA_WTS[EWA_MAXIDX + 1] = {
static void ellipse_bounds(float A, float B, float C, float F, float &xmax, float &ymax)
{
- float denom = 4.0f*A*C - B*B;
+ float denom = 4.0f * A * C - B * B;
if (denom > 0.0f && A != 0.0f && C != 0.0f) {
- xmax = sqrt(F)/(2.0f*A) * (sqrt(F*(4.0f*A - B*B/C)) + B*B*sqrt(F/(C*denom)));
- ymax = sqrt(F)/(2.0f*C) * (sqrt(F*(4.0f*C - B*B/A)) + B*B*sqrt(F/(A*denom)));
+ xmax = sqrt(F) / (2.0f * A) * (sqrt(F * (4.0f * A - B * B / C)) + B * B * sqrt(F / (C * denom)));
+ ymax = sqrt(F) / (2.0f * C) * (sqrt(F * (4.0f * C - B * B / A)) + B * B * sqrt(F / (A * denom)));
}
else {
xmax = 0.0f;
@@ -227,18 +227,19 @@ static void ellipse_bounds(float A, float B, float C, float F, float &xmax, floa
}
}
-static void ellipse_params(float Ux, float Uy, float Vx, float Vy, float &A, float &B, float &C, float &F, float &umax, float &vmax)
+static void ellipse_params(float Ux, float Uy, float Vx, float Vy,
+ float &A, float &B, float &C, float &F, float &umax, float &vmax)
{
- A = Vx*Vx + Vy*Vy;
- B = -2.0f * (Ux*Vx + Uy*Vy);
- C = Ux*Ux + Uy*Uy;
- F = A*C - B*B * 0.25f;
+ A = Vx * Vx + Vy * Vy;
+ B = -2.0f * (Ux * Vx + Uy * Vy);
+ C = Ux * Ux + Uy * Uy;
+ F = A * C - B * B * 0.25f;
- float factor = (F != 0.0f ? (float)(EWA_MAXIDX+1) / F : 0.0f);
+ float factor = (F != 0.0f ? (float)(EWA_MAXIDX + 1) / F : 0.0f);
A *= factor;
B *= factor;
C *= factor;
- F = (float)(EWA_MAXIDX+1);
+ F = (float)(EWA_MAXIDX + 1);
ellipse_bounds(A, B, C, sqrtf(F), umax, vmax);
}
@@ -282,31 +283,31 @@ void MemoryBuffer::readEWA(float result[4], const float uv[2], const float deriv
/* note: if eccentricity gets clamped (see above),
* the ue/ve limits can also be lowered accordingly
*/
- if (U0-u1 > EWA_MAXIDX) u1 = U0 - EWA_MAXIDX;
- if (u2-U0 > EWA_MAXIDX) u2 = U0 + EWA_MAXIDX;
- if (V0-v1 > EWA_MAXIDX) v1 = V0 - EWA_MAXIDX;
- if (v2-V0 > EWA_MAXIDX) v2 = V0 + EWA_MAXIDX;
+ if (U0 - u1 > EWA_MAXIDX) u1 = U0 - EWA_MAXIDX;
+ if (u2 - U0 > EWA_MAXIDX) u2 = U0 + EWA_MAXIDX;
+ if (V0 - v1 > EWA_MAXIDX) v1 = V0 - EWA_MAXIDX;
+ if (v2 - V0 > EWA_MAXIDX) v2 = V0 + EWA_MAXIDX;
- float DDQ = 2.f * A;
+ float DDQ = 2.0f * A;
float U = u1 - U0;
- float ac1 = A * (2.f*U + 1.f);
- float ac2 = A * U*U;
+ float ac1 = A * (2.0f * U + 1.0f);
+ float ac2 = A * U * U;
float BU = B * U;
float sum = 0.0f;
for (int v = v1; v <= v2; ++v) {
float V = v - V0;
- float DQ = ac1 + B*V;
- float Q = (C*V + BU)*V + ac2;
+ float DQ = ac1 + B * V;
+ float Q = (C * V + BU) * V + ac2;
for (int u = u1; u <= u2; ++u) {
if (Q < F) {
float tc[4];
const float wt = EWA_WTS[CLAMPIS((int)Q, 0, EWA_MAXIDX)];
switch (sampler) {
case COM_PS_NEAREST: read(tc, u, v); break;
- case COM_PS_BILINEAR: readBilinear(tc, (float)u+ufac, (float)v+vfac); break;
- case COM_PS_BICUBIC: readBilinear(tc, (float)u+ufac, (float)v+vfac); break; /* XXX no readBicubic method yet */
+ case COM_PS_BILINEAR: readBilinear(tc, (float)u + ufac, (float)v + vfac); break;
+ case COM_PS_BICUBIC: readBilinear(tc, (float)u + ufac, (float)v + vfac); break; /* XXX no readBicubic method yet */
default: zero_v4(tc); break;
}
madd_v4_v4fl(result, tc, wt);
diff --git a/source/blender/compositor/operations/COM_DisplaceOperation.cpp b/source/blender/compositor/operations/COM_DisplaceOperation.cpp
index 96031e7acc4..2842b47dd74 100644
--- a/source/blender/compositor/operations/COM_DisplaceOperation.cpp
+++ b/source/blender/compositor/operations/COM_DisplaceOperation.cpp
@@ -72,8 +72,8 @@ bool DisplaceOperation::read_displacement(float x, float y, float xscale, float
else {
float col[4];
m_inputVectorProgram->readSampled(col, x, y, COM_PS_BILINEAR);
- r_u = origin[0] - col[0]*xscale + 0.5f;
- r_v = origin[1] - col[1]*yscale + 0.5f;
+ r_u = origin[0] - col[0] * xscale + 0.5f;
+ r_v = origin[1] - col[1] * yscale + 0.5f;
return true;
}
}
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index 5e17831fc42..f858e58011c 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -2344,7 +2344,7 @@ static void ui_do_but_textedit(bContext *C, uiBlock *block, uiBut *but, uiHandle
int autocomplete = ui_textedit_autocomplete(C, but, data);
changed = autocomplete != AUTOCOMPLETE_NO_MATCH;
- if(autocomplete == AUTOCOMPLETE_FULL_MATCH)
+ if (autocomplete == AUTOCOMPLETE_FULL_MATCH)
button_activate_state(C, but, BUTTON_STATE_EXIT);
update = true; /* do live update for tab key */
@@ -2595,7 +2595,7 @@ int ui_button_open_menu_direction(uiBut *but)
}
/* Hack for uiList LISTROW buttons to "give" events to overlaying TEX buttons (cltr-clic rename feature & co). */
-static uiBut* ui_but_list_row_text_activate(bContext *C, uiBut *but, uiHandleButtonData *data, const wmEvent *event,
+static uiBut *ui_but_list_row_text_activate(bContext *C, uiBut *but, uiHandleButtonData *data, const wmEvent *event,
uiButtonActivateType activate_type)
{
ARegion *ar = CTX_wm_region(C);
diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c
index e4b5883e2a4..1e169180d18 100644
--- a/source/blender/editors/screen/screen_ops.c
+++ b/source/blender/editors/screen/screen_ops.c
@@ -1025,9 +1025,9 @@ static void area_move_set_limits(bScreen *sc, int dir, int winsizex, int winsize
int x1;
areamin = AREAMINX;
- if(sa->v1->vec.x > 0)
+ if (sa->v1->vec.x > 0)
areamin += U.pixelsize;
- if(sa->v4->vec.x < winsizex - 1)
+ if (sa->v4->vec.x < winsizex - 1)
areamin += U.pixelsize;
x1 = sa->v4->vec.x - sa->v1->vec.x + 1 - areamin;
diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c
index f8f647786f9..f4cae0c462f 100644
--- a/source/blender/editors/space_file/file_ops.c
+++ b/source/blender/editors/space_file/file_ops.c
@@ -1253,7 +1253,7 @@ void file_directory_enter_handle(bContext *C, void *UNUSED(arg_unused), void *UN
void file_filename_enter_handle(bContext *C, void *UNUSED(arg_unused), void *arg_but)
{
SpaceFile *sfile = CTX_wm_space_file(C);
- uiBut *but = (uiBut*)arg_but;
+ uiBut *but = arg_but;
char matched_file[FILE_MAX];
char filepath[sizeof(sfile->params->dir)];
diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c
index a37b50172cf..2ea77bba681 100644
--- a/source/blender/editors/space_image/image_ops.c
+++ b/source/blender/editors/space_image/image_ops.c
@@ -1880,7 +1880,7 @@ static int image_invert_exec(bContext *C, wmOperator *op)
if (support_undo) {
ED_undo_paint_push_begin(UNDO_PAINT_IMAGE, op->type->name,
- ED_image_undo_restore, ED_image_undo_free);
+ ED_image_undo_restore, ED_image_undo_free);
/* not strictly needed, because we only imapaint_dirty_region to invalidate all tiles
* but better do this right in case someone copies this for a tool that uses partial redraw better */
ED_imapaint_clear_partial_redraw();
diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c
index 92c567e9a67..01e7b673838 100644
--- a/source/blender/makesrna/intern/rna_particle.c
+++ b/source/blender/makesrna/intern/rna_particle.c
@@ -402,8 +402,8 @@ static EnumPropertyItem *rna_Particule_Material_itemf(bContext *C, PointerRNA *U
int totitem = 0;
int i;
- if (ob->totcol > 0){
- for (i = 1; i<=ob->totcol; i++) {
+ if (ob->totcol > 0) {
+ for (i = 1; i <= ob->totcol; i++) {
ma = give_current_material(ob, i);
tmp.value = i;
tmp.icon = ICON_MATERIAL_DATA;
diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c b/source/blender/makesrna/intern/rna_sculpt_paint.c
index d72fbcc48f3..6280e0833e5 100644
--- a/source/blender/makesrna/intern/rna_sculpt_paint.c
+++ b/source/blender/makesrna/intern/rna_sculpt_paint.c
@@ -352,7 +352,7 @@ static void rna_def_sculpt(BlenderRNA *brna)
"Subdivide Edges", "Subdivide long edges to add mesh detail where needed"},
{SCULPT_DYNTOPO_COLLAPSE, "COLLAPSE", 0,
"Collapse Edges", "Collapse short edges to remove mesh detail where possible"},
- {SCULPT_DYNTOPO_SUBDIVIDE|SCULPT_DYNTOPO_COLLAPSE, "SUBDIVIDE_COLLAPSE", 0,
+ {SCULPT_DYNTOPO_SUBDIVIDE | SCULPT_DYNTOPO_COLLAPSE, "SUBDIVIDE_COLLAPSE", 0,
"Subdivide Collapse", "Both subdivide long edges and collapse short edges to refine mesh detail"},
{0, NULL, 0, NULL, NULL}
};
diff --git a/source/blender/nodes/composite/node_composite_tree.c b/source/blender/nodes/composite/node_composite_tree.c
index 7da3a35dba0..d05a5da5f1c 100644
--- a/source/blender/nodes/composite/node_composite_tree.c
+++ b/source/blender/nodes/composite/node_composite_tree.c
@@ -218,7 +218,8 @@ static void update(bNodeTree *ntree)
}
}
-static void composite_node_add_init(bNodeTree *UNUSED(bnodetree), bNode *bnode) {
+static void composite_node_add_init(bNodeTree *UNUSED(bnodetree), bNode *bnode)
+{
/* Composite node will only show previews for input classes
* by default, other will be hidden
* but can be made visible with the show_preview option */
diff --git a/source/blender/windowmanager/intern/wm_dragdrop.c b/source/blender/windowmanager/intern/wm_dragdrop.c
index 53d846b63c7..819ec365e09 100644
--- a/source/blender/windowmanager/intern/wm_dragdrop.c
+++ b/source/blender/windowmanager/intern/wm_dragdrop.c
@@ -367,7 +367,7 @@ void wm_drags_draw(bContext *C, wmWindow *win, rcti *rect)
x = cursorx - drag->sx / 2;
if (cursory + drag->sy / 2 + padding + iconsize < winsizey)
- y = cursory + drag->sy / 2 + padding;
+ y = cursory + drag->sy / 2 + padding;
else
y = cursory - drag->sy / 2 - padding - iconsize - padding - iconsize;
}
@@ -375,7 +375,7 @@ void wm_drags_draw(bContext *C, wmWindow *win, rcti *rect)
x = cursorx - 2 * padding;
if (cursory + iconsize + iconsize < winsizey)
- y = cursory + iconsize;
+ y = cursory + iconsize;
else
y = cursory - iconsize - 2 * UI_DPI_FAC;
}