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>2014-03-15 20:24:05 +0400
committerCampbell Barton <ideasman42@gmail.com>2014-03-15 20:26:23 +0400
commit2097e621edcf7658895b9f6ba9cc4e51f5538369 (patch)
tree9f112e8a2b35fed01734ed355d3832cd857de826 /source/blender/editors
parent38244166b03bc4a01d8c0b99e2fd2cb2c9b60012 (diff)
Code cleanup: use r_ prefix for return args
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/curve/editcurve.c4
-rw-r--r--source/blender/editors/include/ED_object.h2
-rw-r--r--source/blender/editors/include/ED_uvedit.h3
-rw-r--r--source/blender/editors/interface/interface_widgets.c10
-rw-r--r--source/blender/editors/object/object_constraint.c10
-rw-r--r--source/blender/editors/object/object_hook.c75
-rw-r--r--source/blender/editors/screen/glutil.c12
-rw-r--r--source/blender/editors/uvedit/uvedit_ops.c15
8 files changed, 70 insertions, 61 deletions
diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c
index 6ea7cbd87fa..31c91ad01eb 100644
--- a/source/blender/editors/curve/editcurve.c
+++ b/source/blender/editors/curve/editcurve.c
@@ -1165,7 +1165,7 @@ int ED_curve_updateAnimPaths(Curve *cu)
/* ********************* LOAD and MAKE *************** */
-static int *initialize_index_map(Object *obedit, int *old_totvert_r)
+static int *initialize_index_map(Object *obedit, int *r_old_totvert)
{
Curve *curve = (Curve *) obedit->data;
EditNurb *editnurb = curve->editnurb;
@@ -1230,7 +1230,7 @@ static int *initialize_index_map(Object *obedit, int *old_totvert_r)
}
}
- *old_totvert_r = old_totvert;
+ *r_old_totvert = old_totvert;
return old_to_new_map;
}
diff --git a/source/blender/editors/include/ED_object.h b/source/blender/editors/include/ED_object.h
index dae53213afb..4e3526fac7d 100644
--- a/source/blender/editors/include/ED_object.h
+++ b/source/blender/editors/include/ED_object.h
@@ -162,7 +162,7 @@ void ED_objects_recalculate_paths(struct bContext *C, struct Scene *scene);
/* constraints */
struct ListBase *get_active_constraints(struct Object *ob);
-struct ListBase *get_constraint_lb(struct Object *ob, struct bConstraint *con, struct bPoseChannel **pchan_r);
+struct ListBase *get_constraint_lb(struct Object *ob, struct bConstraint *con, struct bPoseChannel **r_pchan);
struct bConstraint *get_active_constraint(struct Object *ob);
void object_test_constraints(struct Object *ob);
diff --git a/source/blender/editors/include/ED_uvedit.h b/source/blender/editors/include/ED_uvedit.h
index 572042a0150..04eb829979f 100644
--- a/source/blender/editors/include/ED_uvedit.h
+++ b/source/blender/editors/include/ED_uvedit.h
@@ -53,7 +53,8 @@ void ED_keymap_uvedit(struct wmKeyConfig *keyconf);
void ED_uvedit_assign_image(struct Main *bmain, struct Scene *scene, struct Object *obedit, struct Image *ima, struct Image *previma);
bool ED_uvedit_minmax(struct Scene *scene, struct Image *ima, struct Object *obedit, float min[2], float max[2]);
-bool ED_object_get_active_image(struct Object *ob, int mat_nr, struct Image **ima, struct ImageUser **iuser, struct bNode **node);
+bool ED_object_get_active_image(struct Object *ob, int mat_nr,
+ struct Image **r_ima, struct ImageUser **r_iuser, struct bNode **r_node);
void ED_object_assign_active_image(struct Main *bmain, struct Object *ob, int mat_nr, struct Image *ima);
bool ED_uvedit_test(struct Object *obedit);
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c
index f2afe356ed9..179ec578b1d 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -610,15 +610,15 @@ static void shadecolors4(char coltop[4], char coldown[4], const char *color, sho
coldown[3] = color[3];
}
-static void round_box_shade_col4_r(unsigned char col_r[4], const char col1[4], const char col2[4], const float fac)
+static void round_box_shade_col4_r(unsigned char r_col[4], const char col1[4], const char col2[4], const float fac)
{
const int faci = FTOCHAR(fac);
const int facm = 255 - faci;
- col_r[0] = (faci * col1[0] + facm * col2[0]) >> 8;
- col_r[1] = (faci * col1[1] + facm * col2[1]) >> 8;
- col_r[2] = (faci * col1[2] + facm * col2[2]) >> 8;
- col_r[3] = (faci * col1[3] + facm * col2[3]) >> 8;
+ r_col[0] = (faci * col1[0] + facm * col2[0]) >> 8;
+ r_col[1] = (faci * col1[1] + facm * col2[1]) >> 8;
+ r_col[2] = (faci * col1[2] + facm * col2[2]) >> 8;
+ r_col[3] = (faci * col1[3] + facm * col2[3]) >> 8;
}
static void widget_verts_to_quad_strip(uiWidgetBase *wtb, const int totvert, float quad_strip[WIDGET_SIZE_MAX * 2 + 2][2])
diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c
index 9f77d3ee12c..1e7e543ccb8 100644
--- a/source/blender/editors/object/object_constraint.c
+++ b/source/blender/editors/object/object_constraint.c
@@ -105,10 +105,10 @@ ListBase *get_active_constraints(Object *ob)
}
/* Find the list that a given constraint belongs to, and/or also get the posechannel this is from (if applicable) */
-ListBase *get_constraint_lb(Object *ob, bConstraint *con, bPoseChannel **pchan_r)
+ListBase *get_constraint_lb(Object *ob, bConstraint *con, bPoseChannel **r_pchan)
{
- if (pchan_r)
- *pchan_r = NULL;
+ if (r_pchan)
+ *r_pchan = NULL;
if (ELEM(NULL, ob, con))
return NULL;
@@ -128,8 +128,8 @@ ListBase *get_constraint_lb(Object *ob, bConstraint *con, bPoseChannel **pchan_r
for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) {
if ((BLI_findindex(&pchan->constraints, con) != -1)) {
- if (pchan_r)
- *pchan_r = pchan;
+ if (r_pchan)
+ *r_pchan = pchan;
return &pchan->constraints;
}
diff --git a/source/blender/editors/object/object_hook.c b/source/blender/editors/object/object_hook.c
index fe27060e5ae..5e7572e3681 100644
--- a/source/blender/editors/object/object_hook.c
+++ b/source/blender/editors/object/object_hook.c
@@ -74,7 +74,9 @@
#include "object_intern.h"
-static int return_editmesh_indexar(BMEditMesh *em, int *tot, int **indexar, float *cent)
+static int return_editmesh_indexar(
+ BMEditMesh *em,
+ int *r_tot, int **r_indexar, float r_cent[3])
{
BMVert *eve;
BMIter iter;
@@ -85,29 +87,29 @@ static int return_editmesh_indexar(BMEditMesh *em, int *tot, int **indexar, floa
}
if (totvert == 0) return 0;
- *indexar = index = MEM_mallocN(4 * totvert, "hook indexar");
- *tot = totvert;
+ *r_indexar = index = MEM_mallocN(4 * totvert, "hook indexar");
+ *r_tot = totvert;
nr = 0;
- zero_v3(cent);
+ zero_v3(r_cent);
BM_ITER_MESH (eve, &iter, em->bm, BM_VERTS_OF_MESH) {
if (BM_elem_flag_test(eve, BM_ELEM_SELECT)) {
*index = nr; index++;
- add_v3_v3(cent, eve->co);
+ add_v3_v3(r_cent, eve->co);
}
nr++;
}
- mul_v3_fl(cent, 1.0f / (float)totvert);
+ mul_v3_fl(r_cent, 1.0f / (float)totvert);
return totvert;
}
-static bool return_editmesh_vgroup(Object *obedit, BMEditMesh *em, char *name, float *cent)
+static bool return_editmesh_vgroup(Object *obedit, BMEditMesh *em, char *r_name, float r_cent[3])
{
const int cd_dvert_offset = obedit->actdef ? CustomData_get_offset(&em->bm->vdata, CD_MDEFORMVERT) : -1;
- zero_v3(cent);
+ zero_v3(r_cent);
if (cd_dvert_offset != -1) {
const int defgrp_index = obedit->actdef - 1;
@@ -122,14 +124,14 @@ static bool return_editmesh_vgroup(Object *obedit, BMEditMesh *em, char *name, f
dvert = BM_ELEM_CD_GET_VOID_P(eve, cd_dvert_offset);
if (defvert_find_weight(dvert, defgrp_index) > 0.0f) {
- add_v3_v3(cent, eve->co);
+ add_v3_v3(r_cent, eve->co);
totvert++;
}
}
if (totvert) {
bDeformGroup *dg = BLI_findlink(&obedit->defbase, defgrp_index);
- BLI_strncpy(name, dg->name, sizeof(dg->name));
- mul_v3_fl(cent, 1.0f / (float)totvert);
+ BLI_strncpy(r_name, dg->name, sizeof(dg->name));
+ mul_v3_fl(r_cent, 1.0f / (float)totvert);
return true;
}
}
@@ -160,7 +162,9 @@ static void select_editbmesh_hook(Object *ob, HookModifierData *hmd)
EDBM_select_flush(em);
}
-static int return_editlattice_indexar(Lattice *editlatt, int *tot, int **indexar, float *cent)
+static int return_editlattice_indexar(
+ Lattice *editlatt,
+ int *r_tot, int **r_indexar, float r_cent[3])
{
BPoint *bp;
int *index, nr, totvert = 0, a;
@@ -177,10 +181,10 @@ static int return_editlattice_indexar(Lattice *editlatt, int *tot, int **indexar
if (totvert == 0) return 0;
- *indexar = index = MEM_mallocN(4 * totvert, "hook indexar");
- *tot = totvert;
+ *r_indexar = index = MEM_mallocN(4 * totvert, "hook indexar");
+ *r_tot = totvert;
nr = 0;
- zero_v3(cent);
+ zero_v3(r_cent);
a = editlatt->pntsu * editlatt->pntsv * editlatt->pntsw;
bp = editlatt->def;
@@ -188,14 +192,14 @@ static int return_editlattice_indexar(Lattice *editlatt, int *tot, int **indexar
if (bp->f1 & SELECT) {
if (bp->hide == 0) {
*index = nr; index++;
- add_v3_v3(cent, bp->vec);
+ add_v3_v3(r_cent, bp->vec);
}
}
bp++;
nr++;
}
- mul_v3_fl(cent, 1.0f / (float)totvert);
+ mul_v3_fl(r_cent, 1.0f / (float)totvert);
return totvert;
}
@@ -220,7 +224,9 @@ static void select_editlattice_hook(Object *obedit, HookModifierData *hmd)
}
}
-static int return_editcurve_indexar(Object *obedit, int *tot, int **indexar, float *cent)
+static int return_editcurve_indexar(
+ Object *obedit,
+ int *r_tot, int **r_indexar, float r_cent[3])
{
ListBase *editnurb = object_editcurve_get(obedit);
Nurb *nu;
@@ -250,10 +256,10 @@ static int return_editcurve_indexar(Object *obedit, int *tot, int **indexar, flo
}
if (totvert == 0) return 0;
- *indexar = index = MEM_mallocN(4 * totvert, "hook indexar");
- *tot = totvert;
+ *r_indexar = index = MEM_mallocN(4 * totvert, "hook indexar");
+ *r_tot = totvert;
nr = 0;
- zero_v3(cent);
+ zero_v3(r_cent);
for (nu = editnurb->first; nu; nu = nu->next) {
if (nu->type == CU_BEZIER) {
@@ -262,17 +268,17 @@ static int return_editcurve_indexar(Object *obedit, int *tot, int **indexar, flo
while (a--) {
if (bezt->f1 & SELECT) {
*index = nr; index++;
- add_v3_v3(cent, bezt->vec[0]);
+ add_v3_v3(r_cent, bezt->vec[0]);
}
nr++;
if (bezt->f2 & SELECT) {
*index = nr; index++;
- add_v3_v3(cent, bezt->vec[1]);
+ add_v3_v3(r_cent, bezt->vec[1]);
}
nr++;
if (bezt->f3 & SELECT) {
*index = nr; index++;
- add_v3_v3(cent, bezt->vec[2]);
+ add_v3_v3(r_cent, bezt->vec[2]);
}
nr++;
bezt++;
@@ -284,7 +290,7 @@ static int return_editcurve_indexar(Object *obedit, int *tot, int **indexar, flo
while (a--) {
if (bp->f1 & SELECT) {
*index = nr; index++;
- add_v3_v3(cent, bp->vec);
+ add_v3_v3(r_cent, bp->vec);
}
nr++;
bp++;
@@ -292,16 +298,17 @@ static int return_editcurve_indexar(Object *obedit, int *tot, int **indexar, flo
}
}
- mul_v3_fl(cent, 1.0f / (float)totvert);
+ mul_v3_fl(r_cent, 1.0f / (float)totvert);
return totvert;
}
-static bool object_hook_index_array(Scene *scene, Object *obedit, int *tot, int **indexar, char *name, float *cent_r)
+static bool object_hook_index_array(Scene *scene, Object *obedit,
+ int *r_tot, int **r_indexar, char *r_name, float r_cent[3])
{
- *indexar = NULL;
- *tot = 0;
- name[0] = 0;
+ *r_indexar = NULL;
+ *r_tot = 0;
+ r_name[0] = 0;
switch (obedit->type) {
case OB_MESH:
@@ -319,18 +326,18 @@ static bool object_hook_index_array(Scene *scene, Object *obedit, int *tot, int
BKE_editmesh_tessface_calc(em);
/* check selected vertices first */
- if (return_editmesh_indexar(em, tot, indexar, cent_r) == 0) {
- return return_editmesh_vgroup(obedit, em, name, cent_r);
+ if (return_editmesh_indexar(em, r_tot, r_indexar, r_cent) == 0) {
+ return return_editmesh_vgroup(obedit, em, r_name, r_cent);
}
return true;
}
case OB_CURVE:
case OB_SURF:
- return return_editcurve_indexar(obedit, tot, indexar, cent_r);
+ return return_editcurve_indexar(obedit, r_tot, r_indexar, r_cent);
case OB_LATTICE:
{
Lattice *lt = obedit->data;
- return return_editlattice_indexar(lt->editlatt->latt, tot, indexar, cent_r);
+ return return_editlattice_indexar(lt->editlatt->latt, r_tot, r_indexar, r_cent);
}
default:
return false;
diff --git a/source/blender/editors/screen/glutil.c b/source/blender/editors/screen/glutil.c
index 123ca68992a..73953b8f228 100644
--- a/source/blender/editors/screen/glutil.c
+++ b/source/blender/editors/screen/glutil.c
@@ -460,7 +460,7 @@ void glaRasterPosSafe2f(float x, float y, float known_good_x, float known_good_y
glBitmap(0, 0, 0, 0, x - known_good_x, y - known_good_y, &dummy);
}
-static int get_cached_work_texture(int *w_r, int *h_r)
+static int get_cached_work_texture(int *r_w, int *r_h)
{
static GLint texid = -1;
static int tex_w = 256;
@@ -484,8 +484,8 @@ static int get_cached_work_texture(int *w_r, int *h_r)
glBindTexture(GL_TEXTURE_2D, ltexid);
}
- *w_r = tex_w;
- *h_r = tex_h;
+ *r_w = tex_w;
+ *r_h = tex_h;
return texid;
}
@@ -825,10 +825,10 @@ gla2DDrawInfo *glaBegin2DDraw(rcti *screen_rect, rctf *world_rect)
/**
* Translate the (\a wo_x, \a wo_y) point from world coordinates into screen space.
*/
-void gla2DDrawTranslatePt(gla2DDrawInfo *di, float wo_x, float wo_y, int *sc_x_r, int *sc_y_r)
+void gla2DDrawTranslatePt(gla2DDrawInfo *di, float wo_x, float wo_y, int *r_sc_x, int *r_sc_y)
{
- *sc_x_r = (wo_x - di->world_rect.xmin) * di->wo_to_sc[0];
- *sc_y_r = (wo_y - di->world_rect.ymin) * di->wo_to_sc[1];
+ *r_sc_x = (wo_x - di->world_rect.xmin) * di->wo_to_sc[0];
+ *r_sc_y = (wo_y - di->world_rect.ymin) * di->wo_to_sc[1];
}
/**
diff --git a/source/blender/editors/uvedit/uvedit_ops.c b/source/blender/editors/uvedit/uvedit_ops.c
index ff2a2fcc156..fe398c00b6a 100644
--- a/source/blender/editors/uvedit/uvedit_ops.c
+++ b/source/blender/editors/uvedit/uvedit_ops.c
@@ -137,21 +137,22 @@ static bool is_image_texture_node(bNode *node)
return ELEM(node->type, SH_NODE_TEX_IMAGE, SH_NODE_TEX_ENVIRONMENT);
}
-bool ED_object_get_active_image(Object *ob, int mat_nr, Image **ima, ImageUser **iuser, bNode **node_r)
+bool ED_object_get_active_image(Object *ob, int mat_nr,
+ Image **r_ima, ImageUser **r_iuser, bNode **r_node)
{
Material *ma = give_current_material(ob, mat_nr);
bNode *node = (ma && ma->use_nodes) ? nodeGetActiveTexture(ma->nodetree) : NULL;
if (node && is_image_texture_node(node)) {
- if (ima) *ima = (Image *)node->id;
- if (iuser) *iuser = NULL;
- if (node_r) *node_r = node;
+ if (r_ima) *r_ima = (Image *)node->id;
+ if (r_iuser) *r_iuser = NULL;
+ if (r_node) *r_node = node;
return TRUE;
}
- if (ima) *ima = NULL;
- if (iuser) *iuser = NULL;
- if (node_r) *node_r = node;
+ if (r_ima) *r_ima = NULL;
+ if (r_iuser) *r_iuser = NULL;
+ if (r_node) *r_node = node;
return FALSE;
}