From 2097e621edcf7658895b9f6ba9cc4e51f5538369 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 16 Mar 2014 03:24:05 +1100 Subject: Code cleanup: use r_ prefix for return args --- source/blender/blenfont/intern/blf_translation.c | 12 ++-- source/blender/blenkernel/BKE_DerivedMesh.h | 32 ++++----- source/blender/blenkernel/BKE_curve.h | 2 +- source/blender/blenkernel/BKE_lattice.h | 2 +- source/blender/blenkernel/BKE_mesh.h | 18 +++--- source/blender/blenkernel/BKE_modifier.h | 2 +- source/blender/blenkernel/BKE_subsurf.h | 2 +- source/blender/blenkernel/intern/DerivedMesh.c | 8 +-- source/blender/blenkernel/intern/cdderivedmesh.c | 52 +++++++-------- source/blender/blenkernel/intern/curve.c | 4 +- source/blender/blenkernel/intern/displist.c | 6 +- source/blender/blenkernel/intern/image.c | 16 ++--- source/blender/blenkernel/intern/lattice.c | 10 +-- source/blender/blenkernel/intern/mask_evaluate.c | 47 +++++++------- source/blender/blenkernel/intern/mesh.c | 12 ++-- source/blender/blenkernel/intern/mesh_evaluate.c | 42 ++++++------ source/blender/blenkernel/intern/modifier.c | 12 ++-- source/blender/blenkernel/intern/subsurf_ccg.c | 26 ++++---- source/blender/blenlib/BLI_edgehash.h | 4 +- source/blender/blenlib/BLI_fileops.h | 2 +- source/blender/blenlib/BLI_math_color.h | 8 +-- source/blender/blenlib/BLI_math_geom.h | 6 +- source/blender/blenlib/intern/edgehash.c | 6 +- source/blender/blenlib/intern/fileops.c | 4 +- source/blender/blenlib/intern/math_color.c | 26 ++++---- source/blender/blenlib/intern/math_geom.c | 22 +++---- source/blender/blenlib/intern/string_utf8.c | 4 +- source/blender/blenloader/intern/readfile.c | 10 +-- source/blender/editors/curve/editcurve.c | 4 +- source/blender/editors/include/ED_object.h | 2 +- source/blender/editors/include/ED_uvedit.h | 3 +- .../blender/editors/interface/interface_widgets.c | 10 +-- source/blender/editors/object/object_constraint.c | 10 +-- source/blender/editors/object/object_hook.c | 75 ++++++++++++---------- source/blender/editors/screen/glutil.c | 12 ++-- source/blender/editors/uvedit/uvedit_ops.c | 15 +++-- source/blender/makesdna/intern/makesdna.c | 14 ++-- source/blender/makesrna/intern/rna_camera_api.c | 10 +-- source/blender/makesrna/intern/rna_texture_api.c | 10 +-- .../modifiers/intern/MOD_particleinstance.c | 10 +-- .../blender/python/bmesh/bmesh_py_types_meshdata.c | 4 +- source/blenderplayer/bad_level_call_stubs/stubs.c | 2 +- .../gameengine/Converter/BL_ModifierDeformer.cpp | 8 +-- 43 files changed, 297 insertions(+), 289 deletions(-) diff --git a/source/blender/blenfont/intern/blf_translation.c b/source/blender/blenfont/intern/blf_translation.c index dc9baf804b3..150ff1b2107 100644 --- a/source/blender/blenfont/intern/blf_translation.c +++ b/source/blender/blenfont/intern/blf_translation.c @@ -58,7 +58,7 @@ static unsigned char *unifont_mono_ttf = NULL; static int unifont_mono_size = 0; #endif /* WITH_INTERNATIONAL */ -unsigned char *BLF_get_unifont(int *unifont_size_r) +unsigned char *BLF_get_unifont(int *r_unifont_size) { #ifdef WITH_INTERNATIONAL if (unifont_ttf == NULL) { @@ -75,11 +75,11 @@ unsigned char *BLF_get_unifont(int *unifont_size_r) } } - *unifont_size_r = unifont_size; + *r_unifont_size = unifont_size; return unifont_ttf; #else - (void)unifont_size_r; + (void)r_unifont_size; return NULL; #endif } @@ -93,7 +93,7 @@ void BLF_free_unifont(void) #endif } -unsigned char *BLF_get_unifont_mono(int *unifont_size_r) +unsigned char *BLF_get_unifont_mono(int *r_unifont_size) { #ifdef WITH_INTERNATIONAL if (unifont_mono_ttf == NULL) { @@ -110,11 +110,11 @@ unsigned char *BLF_get_unifont_mono(int *unifont_size_r) } } - *unifont_size_r = unifont_mono_size; + *r_unifont_size = unifont_mono_size; return unifont_mono_ttf; #else - (void)unifont_size_r; + (void)r_unifont_size; return NULL; #endif } diff --git a/source/blender/blenkernel/BKE_DerivedMesh.h b/source/blender/blenkernel/BKE_DerivedMesh.h index 353b1c5d597..ff1c04fd00d 100644 --- a/source/blender/blenkernel/BKE_DerivedMesh.h +++ b/source/blender/blenkernel/BKE_DerivedMesh.h @@ -208,9 +208,9 @@ struct DerivedMesh { * of this function can be quite slow, iterating over all * elements (editmesh) */ - void (*getVert)(DerivedMesh *dm, int index, struct MVert *vert_r); - void (*getEdge)(DerivedMesh *dm, int index, struct MEdge *edge_r); - void (*getTessFace)(DerivedMesh *dm, int index, struct MFace *face_r); + void (*getVert)(DerivedMesh *dm, int index, struct MVert *r_vert); + void (*getEdge)(DerivedMesh *dm, int index, struct MEdge *r_edge); + void (*getTessFace)(DerivedMesh *dm, int index, struct MFace *r_face); /** Return a pointer to the entire array of verts/edges/face from the * derived mesh. if such an array does not exist yet, it will be created, @@ -226,11 +226,11 @@ struct DerivedMesh { /** Copy all verts/edges/faces from the derived mesh into * *{vert/edge/face}_r (must point to a buffer large enough) */ - void (*copyVertArray)(DerivedMesh *dm, struct MVert *vert_r); - void (*copyEdgeArray)(DerivedMesh *dm, struct MEdge *edge_r); - void (*copyTessFaceArray)(DerivedMesh *dm, struct MFace *face_r); - void (*copyLoopArray)(DerivedMesh *dm, struct MLoop *loop_r); - void (*copyPolyArray)(DerivedMesh *dm, struct MPoly *poly_r); + void (*copyVertArray)(DerivedMesh *dm, struct MVert *r_vert); + void (*copyEdgeArray)(DerivedMesh *dm, struct MEdge *r_edge); + void (*copyTessFaceArray)(DerivedMesh *dm, struct MFace *r_face); + void (*copyLoopArray)(DerivedMesh *dm, struct MLoop *r_loop); + void (*copyPolyArray)(DerivedMesh *dm, struct MPoly *r_poly); /** Return a copy of all verts/edges/faces from the derived mesh * it is the caller's responsibility to free the returned pointer @@ -318,21 +318,21 @@ struct DerivedMesh { * * Also called in Editmode */ - void (*getMinMax)(DerivedMesh *dm, float min_r[3], float max_r[3]); + void (*getMinMax)(DerivedMesh *dm, float r_min[3], float r_max[3]); /** Direct Access Operations * - Can be undefined * - Must be defined for modifiers that only deform however */ /** Get vertex location, undefined if index is not valid */ - void (*getVertCo)(DerivedMesh *dm, int index, float co_r[3]); + void (*getVertCo)(DerivedMesh *dm, int index, float r_co[3]); /** Fill the array (of length .getNumVerts()) with all vertex locations */ - void (*getVertCos)(DerivedMesh *dm, float (*cos_r)[3]); + void (*getVertCos)(DerivedMesh *dm, float (*r_cos)[3]); /** Get smooth vertex normal, undefined if index is not valid */ - void (*getVertNo)(DerivedMesh *dm, int index, float no_r[3]); - void (*getPolyNo)(DerivedMesh *dm, int index, float no_r[3]); + void (*getVertNo)(DerivedMesh *dm, int index, float r_no[3]); + void (*getPolyNo)(DerivedMesh *dm, int index, float r_no[3]); /** Get a map of vertices to faces */ @@ -385,7 +385,7 @@ struct DerivedMesh { /** Draw mapped faces (no color, or texture) * - Only if !setDrawOptions or - * setDrawOptions(userData, mapped-face-index, drawSmooth_r) + * setDrawOptions(userData, mapped-face-index, r_drawSmooth) * returns true * * If drawSmooth is set to true then vertex normals should be set and @@ -670,9 +670,9 @@ DerivedMesh *editbmesh_get_derived_base(struct Object *, struct BMEditMesh *em); DerivedMesh *editbmesh_get_derived_cage(struct Scene *scene, struct Object *, struct BMEditMesh *em, CustomDataMask dataMask); DerivedMesh *editbmesh_get_derived_cage_and_final(struct Scene *scene, struct Object *, - struct BMEditMesh *em, DerivedMesh **final_r, + struct BMEditMesh *em, DerivedMesh **r_final, CustomDataMask dataMask); -float (*editbmesh_get_vertex_cos(struct BMEditMesh *em, int *numVerts_r))[3]; +float (*editbmesh_get_vertex_cos(struct BMEditMesh *em, int *r_numVerts))[3]; bool editbmesh_modifier_is_enabled(struct Scene *scene, struct ModifierData *md, DerivedMesh *dm); void makeDerivedMesh(struct Scene *scene, struct Object *ob, struct BMEditMesh *em, CustomDataMask dataMask, int build_shapekey_layers); diff --git a/source/blender/blenkernel/BKE_curve.h b/source/blender/blenkernel/BKE_curve.h index 4b8c557f0dd..1ea2cb06bc0 100644 --- a/source/blender/blenkernel/BKE_curve.h +++ b/source/blender/blenkernel/BKE_curve.h @@ -97,7 +97,7 @@ void BKE_curve_nurb_vert_active_set(struct Curve *cu, struct Nurb *nu, bool BKE_curve_nurb_vert_active_get(struct Curve *cu, struct Nurb **r_nu, void **r_vert); void BKE_curve_nurb_vert_active_validate(struct Curve *cu); -float (*BKE_curve_nurbs_vertexCos_get(struct ListBase *lb, int *numVerts_r))[3]; +float (*BKE_curve_nurbs_vertexCos_get(struct ListBase *lb, int *r_numVerts))[3]; void BK_curve_nurbs_vertexCos_apply(struct ListBase *lb, float (*vertexCos)[3]); float (*BKE_curve_nurbs_keyVertexCos_get(struct ListBase *lb, float *key))[3]; diff --git a/source/blender/blenkernel/BKE_lattice.h b/source/blender/blenkernel/BKE_lattice.h index fc84ef1f0bd..8d8d3702634 100644 --- a/source/blender/blenkernel/BKE_lattice.h +++ b/source/blender/blenkernel/BKE_lattice.h @@ -73,7 +73,7 @@ void armature_deform_verts(struct Object *armOb, struct Object *target, float (*defMats)[3][3], int numVerts, int deformflag, float (*prevCos)[3], const char *defgrp_name); -float (*BKE_lattice_vertexcos_get(struct Object *ob, int *numVerts_r))[3]; +float (*BKE_lattice_vertexcos_get(struct Object *ob, int *r_numVerts))[3]; void BKE_lattice_vertexcos_apply(struct Object *ob, float (*vertexCos)[3]); void BKE_lattice_modifiers_calc(struct Scene *scene, struct Object *ob); diff --git a/source/blender/blenkernel/BKE_mesh.h b/source/blender/blenkernel/BKE_mesh.h index 7b1f39ab643..25fd95176b2 100644 --- a/source/blender/blenkernel/BKE_mesh.h +++ b/source/blender/blenkernel/BKE_mesh.h @@ -79,7 +79,7 @@ int poly_find_loop_from_vert(const struct MPoly *poly, const struct MLoop *loopstart, unsigned vert); -int poly_get_adj_loops_from_vert(unsigned adj_r[3], const struct MPoly *poly, +int poly_get_adj_loops_from_vert(unsigned r_adj[3], const struct MPoly *poly, const struct MLoop *mloop, unsigned vert); int BKE_mesh_edge_other_vert(const struct MEdge *e, int v); @@ -152,23 +152,23 @@ void BKE_mesh_mselect_active_set(struct Mesh *me, int index, int type); void BKE_mesh_calc_normals_mapping( struct MVert *mverts, int numVerts, - struct MLoop *mloop, struct MPoly *mpolys, int numLoops, int numPolys, float (*polyNors_r)[3], - struct MFace *mfaces, int numFaces, int *origIndexFace, float (*faceNors_r)[3]); + struct MLoop *mloop, struct MPoly *mpolys, int numLoops, int numPolys, float (*r_polyNors)[3], + struct MFace *mfaces, int numFaces, const int *origIndexFace, float (*r_faceNors)[3]); void BKE_mesh_calc_normals_mapping_ex( struct MVert *mverts, int numVerts, - struct MLoop *mloop, struct MPoly *mpolys, int numLoops, int numPolys, float (*polyNors_r)[3], - struct MFace *mfaces, int numFaces, int *origIndexFace, float (*faceNors_r)[3], + struct MLoop *mloop, struct MPoly *mpolys, int numLoops, int numPolys, float (*r_polyNors)[3], + struct MFace *mfaces, int numFaces, const int *origIndexFace, float (*r_faceNors)[3], const bool only_face_normals); void BKE_mesh_calc_normals_poly( struct MVert *mverts, int numVerts, struct MLoop *mloop, struct MPoly *mpolys, - int numLoops, int numPolys, float (*polyNors_r)[3], + int numLoops, int numPolys, float (*r_polyNors)[3], const bool only_face_normals); void BKE_mesh_calc_normals(struct Mesh *me); void BKE_mesh_calc_normals_tessface( struct MVert *mverts, int numVerts, struct MFace *mfaces, int numFaces, - float (*faceNors_r)[3]); + float (*r_faceNors)[3]); void BKE_mesh_normals_loop_split( struct MVert *mverts, const int numVerts, struct MEdge *medges, const int numEdges, struct MLoop *mloops, float (*r_loopnors)[3], const int numLoops, @@ -233,8 +233,8 @@ void BKE_mesh_convert_mfaces_to_mpolys_ex( struct CustomData *fdata, struct CustomData *ldata, struct CustomData *pdata, int totedge_i, int totface_i, int totloop_i, int totpoly_i, struct MEdge *medge, struct MFace *mface, - int *totloop_r, int *totpoly_r, - struct MLoop **mloop_r, struct MPoly **mpoly_r); + int *r_totloop, int *r_totpoly, + struct MLoop **r_mloop, struct MPoly **r_mpoly); /* flush flags */ void BKE_mesh_flush_hidden_from_verts_ex( diff --git a/source/blender/blenkernel/BKE_modifier.h b/source/blender/blenkernel/BKE_modifier.h index 25dee613d20..2d47cf307f7 100644 --- a/source/blender/blenkernel/BKE_modifier.h +++ b/source/blender/blenkernel/BKE_modifier.h @@ -345,7 +345,7 @@ struct ModifierData *modifiers_findByType(struct Object *ob, ModifierType type) struct ModifierData *modifiers_findByName(struct Object *ob, const char *name); void modifiers_clearErrors(struct Object *ob); int modifiers_getCageIndex(struct Scene *scene, struct Object *ob, - int *lastPossibleCageIndex_r, int virtual_); + int *r_lastPossibleCageIndex, bool is_virtual); bool modifiers_isModifierEnabled(struct Object *ob, int modifierType); bool modifiers_isSoftbodyEnabled(struct Object *ob); diff --git a/source/blender/blenkernel/BKE_subsurf.h b/source/blender/blenkernel/BKE_subsurf.h index ab8b8b29915..3dae4087866 100644 --- a/source/blender/blenkernel/BKE_subsurf.h +++ b/source/blender/blenkernel/BKE_subsurf.h @@ -69,7 +69,7 @@ struct DerivedMesh *subsurf_make_derived_from_derived( float (*vertCos)[3], SubsurfFlags flags); -void subsurf_calculate_limit_positions(struct Mesh *me, float (*positions_r)[3]); +void subsurf_calculate_limit_positions(struct Mesh *me, float (*r_positions)[3]); /* get gridsize from 'level', level must be greater than zero */ int BKE_ccg_gridsize(int level); diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c index 4223e903113..b4a2dab8b1e 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.c +++ b/source/blender/blenkernel/intern/DerivedMesh.c @@ -1919,14 +1919,14 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos BLI_linklist_free((LinkNode *)datamasks, NULL); } -float (*editbmesh_get_vertex_cos(BMEditMesh *em, int *numVerts_r))[3] +float (*editbmesh_get_vertex_cos(BMEditMesh *em, int *r_numVerts))[3] { BMIter iter; BMVert *eve; float (*cos)[3]; int i; - *numVerts_r = em->bm->totvert; + *r_numVerts = em->bm->totvert; cos = MEM_mallocN(sizeof(float) * 3 * em->bm->totvert, "vertexcos"); @@ -2415,7 +2415,7 @@ DerivedMesh *mesh_create_derived_no_deform_render(Scene *scene, Object *ob, /***/ -DerivedMesh *editbmesh_get_derived_cage_and_final(Scene *scene, Object *obedit, BMEditMesh *em, DerivedMesh **final_r, +DerivedMesh *editbmesh_get_derived_cage_and_final(Scene *scene, Object *obedit, BMEditMesh *em, DerivedMesh **r_final, CustomDataMask dataMask) { /* if there's no derived mesh or the last data mask used doesn't include @@ -2429,7 +2429,7 @@ DerivedMesh *editbmesh_get_derived_cage_and_final(Scene *scene, Object *obedit, editbmesh_build_data(scene, obedit, em, dataMask); } - *final_r = em->derivedFinal; + *r_final = em->derivedFinal; if (em->derivedFinal) { BLI_assert(!(em->derivedFinal->dirty & DM_DIRTY_NORMALS)); } return em->derivedCage; } diff --git a/source/blender/blenkernel/intern/cdderivedmesh.c b/source/blender/blenkernel/intern/cdderivedmesh.c index b40e04d29d3..a7940eb8f9c 100644 --- a/source/blender/blenkernel/intern/cdderivedmesh.c +++ b/source/blender/blenkernel/intern/cdderivedmesh.c @@ -122,90 +122,90 @@ static int cdDM_getNumPolys(DerivedMesh *dm) return dm->numPolyData; } -static void cdDM_getVert(DerivedMesh *dm, int index, MVert *vert_r) +static void cdDM_getVert(DerivedMesh *dm, int index, MVert *r_vert) { CDDerivedMesh *cddm = (CDDerivedMesh *)dm; - *vert_r = cddm->mvert[index]; + *r_vert = cddm->mvert[index]; } -static void cdDM_getEdge(DerivedMesh *dm, int index, MEdge *edge_r) +static void cdDM_getEdge(DerivedMesh *dm, int index, MEdge *r_edge) { CDDerivedMesh *cddm = (CDDerivedMesh *)dm; - *edge_r = cddm->medge[index]; + *r_edge = cddm->medge[index]; } -static void cdDM_getTessFace(DerivedMesh *dm, int index, MFace *face_r) +static void cdDM_getTessFace(DerivedMesh *dm, int index, MFace *r_face) { CDDerivedMesh *cddm = (CDDerivedMesh *)dm; - *face_r = cddm->mface[index]; + *r_face = cddm->mface[index]; } -static void cdDM_copyVertArray(DerivedMesh *dm, MVert *vert_r) +static void cdDM_copyVertArray(DerivedMesh *dm, MVert *r_vert) { CDDerivedMesh *cddm = (CDDerivedMesh *)dm; - memcpy(vert_r, cddm->mvert, sizeof(*vert_r) * dm->numVertData); + memcpy(r_vert, cddm->mvert, sizeof(*r_vert) * dm->numVertData); } -static void cdDM_copyEdgeArray(DerivedMesh *dm, MEdge *edge_r) +static void cdDM_copyEdgeArray(DerivedMesh *dm, MEdge *r_edge) { CDDerivedMesh *cddm = (CDDerivedMesh *)dm; - memcpy(edge_r, cddm->medge, sizeof(*edge_r) * dm->numEdgeData); + memcpy(r_edge, cddm->medge, sizeof(*r_edge) * dm->numEdgeData); } -static void cdDM_copyTessFaceArray(DerivedMesh *dm, MFace *face_r) +static void cdDM_copyTessFaceArray(DerivedMesh *dm, MFace *r_face) { CDDerivedMesh *cddm = (CDDerivedMesh *)dm; - memcpy(face_r, cddm->mface, sizeof(*face_r) * dm->numTessFaceData); + memcpy(r_face, cddm->mface, sizeof(*r_face) * dm->numTessFaceData); } -static void cdDM_copyLoopArray(DerivedMesh *dm, MLoop *loop_r) +static void cdDM_copyLoopArray(DerivedMesh *dm, MLoop *r_loop) { CDDerivedMesh *cddm = (CDDerivedMesh *)dm; - memcpy(loop_r, cddm->mloop, sizeof(*loop_r) * dm->numLoopData); + memcpy(r_loop, cddm->mloop, sizeof(*r_loop) * dm->numLoopData); } -static void cdDM_copyPolyArray(DerivedMesh *dm, MPoly *poly_r) +static void cdDM_copyPolyArray(DerivedMesh *dm, MPoly *r_poly) { CDDerivedMesh *cddm = (CDDerivedMesh *)dm; - memcpy(poly_r, cddm->mpoly, sizeof(*poly_r) * dm->numPolyData); + memcpy(r_poly, cddm->mpoly, sizeof(*r_poly) * dm->numPolyData); } -static void cdDM_getMinMax(DerivedMesh *dm, float min_r[3], float max_r[3]) +static void cdDM_getMinMax(DerivedMesh *dm, float r_min[3], float r_max[3]) { CDDerivedMesh *cddm = (CDDerivedMesh *) dm; int i; if (dm->numVertData) { for (i = 0; i < dm->numVertData; i++) { - minmax_v3v3_v3(min_r, max_r, cddm->mvert[i].co); + minmax_v3v3_v3(r_min, r_max, cddm->mvert[i].co); } } else { - zero_v3(min_r); - zero_v3(max_r); + zero_v3(r_min); + zero_v3(r_max); } } -static void cdDM_getVertCo(DerivedMesh *dm, int index, float co_r[3]) +static void cdDM_getVertCo(DerivedMesh *dm, int index, float r_co[3]) { CDDerivedMesh *cddm = (CDDerivedMesh *) dm; - copy_v3_v3(co_r, cddm->mvert[index].co); + copy_v3_v3(r_co, cddm->mvert[index].co); } -static void cdDM_getVertCos(DerivedMesh *dm, float (*cos_r)[3]) +static void cdDM_getVertCos(DerivedMesh *dm, float (*r_cos)[3]) { MVert *mv = CDDM_get_verts(dm); int i; for (i = 0; i < dm->numVertData; i++, mv++) - copy_v3_v3(cos_r[i], mv->co); + copy_v3_v3(r_cos[i], mv->co); } -static void cdDM_getVertNo(DerivedMesh *dm, int index, float no_r[3]) +static void cdDM_getVertNo(DerivedMesh *dm, int index, float r_no[3]) { CDDerivedMesh *cddm = (CDDerivedMesh *) dm; - normal_short_to_float_v3(no_r, cddm->mvert[index].no); + normal_short_to_float_v3(r_no, cddm->mvert[index].no); } static const MeshElemMap *cdDM_getPolyMap(Object *ob, DerivedMesh *dm) diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c index c3046804e59..4fc80f30e97 100644 --- a/source/blender/blenkernel/intern/curve.c +++ b/source/blender/blenkernel/intern/curve.c @@ -3637,9 +3637,9 @@ void BKE_nurb_direction_switch(Nurb *nu) } -float (*BKE_curve_nurbs_vertexCos_get(ListBase *lb, int *numVerts_r))[3] +float (*BKE_curve_nurbs_vertexCos_get(ListBase *lb, int *r_numVerts))[3] { - int i, numVerts = *numVerts_r = BKE_nurbList_verts_count(lb); + int i, numVerts = *r_numVerts = BKE_nurbList_verts_count(lb); float *co, (*cos)[3] = MEM_mallocN(sizeof(*cos) * numVerts, "cu_vcos"); Nurb *nu; diff --git a/source/blender/blenkernel/intern/displist.c b/source/blender/blenkernel/intern/displist.c index 9582d87c540..f3fa5f75dbb 100644 --- a/source/blender/blenkernel/intern/displist.c +++ b/source/blender/blenkernel/intern/displist.c @@ -1282,9 +1282,9 @@ void BKE_displist_make_surf(Scene *scene, Object *ob, ListBase *dispbase, BKE_nurbList_free(&nubase); } -static void rotateBevelPiece(Curve *cu, BevPoint *bevp, BevPoint *nbevp, DispList *dlb, float bev_blend, float widfac, float fac, float **data_r) +static void rotateBevelPiece(Curve *cu, BevPoint *bevp, BevPoint *nbevp, DispList *dlb, float bev_blend, float widfac, float fac, float **r_data) { - float *fp, *data = *data_r; + float *fp, *data = *r_data; int b; fp = dlb->verts; @@ -1335,7 +1335,7 @@ static void rotateBevelPiece(Curve *cu, BevPoint *bevp, BevPoint *nbevp, DispLis } } - *data_r = data; + *r_data = data; } static void fillBevelCap(Nurb *nu, DispList *dlb, float *prev_fp, ListBase *dispbase) diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index b8b126c4c8e..aaeead431b9 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -2916,7 +2916,7 @@ static ImBuf *image_get_render_result(Image *ima, ImageUser *iuser, void **lock_ return ibuf; } -static void image_get_frame_and_index(Image *ima, ImageUser *iuser, int *frame_r, int *index_r) +static void image_get_frame_and_index(Image *ima, ImageUser *iuser, int *r_frame, int *r_index) { int frame = 0, index = 0; @@ -2934,8 +2934,8 @@ static void image_get_frame_and_index(Image *ima, ImageUser *iuser, int *frame_r } } - *frame_r = frame; - *index_r = index; + *r_frame = frame; + *r_index = index; } /* Get the ibuf from an image cache for a given image user. @@ -2944,7 +2944,7 @@ static void image_get_frame_and_index(Image *ima, ImageUser *iuser, int *frame_r * call IMB_freeImBuf to de-reference the image buffer after * it's done handling it. */ -static ImBuf *image_get_cached_ibuf(Image *ima, ImageUser *iuser, int *frame_r, int *index_r) +static ImBuf *image_get_cached_ibuf(Image *ima, ImageUser *iuser, int *r_frame, int *r_index) { ImBuf *ibuf = NULL; int frame = 0, index = 0; @@ -2990,11 +2990,11 @@ static ImBuf *image_get_cached_ibuf(Image *ima, ImageUser *iuser, int *frame_r, * a big bottleneck */ } - if (frame_r) - *frame_r = frame; + if (r_frame) + *r_frame = frame; - if (index_r) - *index_r = index; + if (r_index) + *r_index = index; return ibuf; } diff --git a/source/blender/blenkernel/intern/lattice.c b/source/blender/blenkernel/intern/lattice.c index 72462eed30c..f647926fc0f 100644 --- a/source/blender/blenkernel/intern/lattice.c +++ b/source/blender/blenkernel/intern/lattice.c @@ -620,7 +620,7 @@ static bool where_on_path_deform(Object *ob, float ctime, float vec[4], float di /* returns quaternion for rotation, using cd->no_rot_axis */ /* axis is using another define!!! */ static bool calc_curve_deform(Scene *scene, Object *par, float co[3], - const short axis, CurveDeform *cd, float quat_r[4]) + const short axis, CurveDeform *cd, float r_quat[4]) { Curve *cu = par->data; float fac, loc[4], dir[3], new_quat[4], radius; @@ -706,8 +706,8 @@ static bool calc_curve_deform(Scene *scene, Object *par, float co[3], /* translation */ add_v3_v3v3(co, cent, loc); - if (quat_r) - copy_qt_qt(quat_r, quat); + if (r_quat) + copy_qt_qt(r_quat, quat); return 1; } @@ -1024,14 +1024,14 @@ void outside_lattice(Lattice *lt) } } -float (*BKE_lattice_vertexcos_get(struct Object *ob, int *numVerts_r))[3] +float (*BKE_lattice_vertexcos_get(struct Object *ob, int *r_numVerts))[3] { Lattice *lt = ob->data; int i, numVerts; float (*vertexCos)[3]; if (lt->editlatt) lt = lt->editlatt->latt; - numVerts = *numVerts_r = lt->pntsu * lt->pntsv * lt->pntsw; + numVerts = *r_numVerts = lt->pntsu * lt->pntsv * lt->pntsw; vertexCos = MEM_mallocN(sizeof(*vertexCos) * numVerts, "lt_vcos"); diff --git a/source/blender/blenkernel/intern/mask_evaluate.c b/source/blender/blenkernel/intern/mask_evaluate.c index c6cc4a412b8..4d9791a077c 100644 --- a/source/blender/blenkernel/intern/mask_evaluate.c +++ b/source/blender/blenkernel/intern/mask_evaluate.c @@ -252,8 +252,9 @@ static void feather_bucket_add_edge(FeatherEdgesBucket *bucket, int start, int e bucket->tot_segment++; } -static void feather_bucket_check_intersect(float (*feather_points)[2], int tot_feather_point, FeatherEdgesBucket *bucket, - int cur_a, int cur_b) +static void feather_bucket_check_intersect( + float (*feather_points)[2], int tot_feather_point, FeatherEdgesBucket *bucket, + int cur_a, int cur_b) { int i; @@ -313,8 +314,9 @@ static void feather_bucket_check_intersect(float (*feather_points)[2], int tot_f } } -static int feather_bucket_index_from_coord(const float co[2], const float min[2], const float bucket_scale[2], - const int buckets_per_side) +static int feather_bucket_index_from_coord( + const float co[2], const float min[2], const float bucket_scale[2], + const int buckets_per_side) { int x = (int) ((co[0] - min[0]) * bucket_scale[0]); int y = (int) ((co[1] - min[1]) * bucket_scale[1]); @@ -328,9 +330,9 @@ static int feather_bucket_index_from_coord(const float co[2], const float min[2] return y * buckets_per_side + x; } -static void feather_bucket_get_diagonal(FeatherEdgesBucket *buckets, int start_bucket_index, int end_bucket_index, - int buckets_per_side, FeatherEdgesBucket **diagonal_bucket_a_r, - FeatherEdgesBucket **diagonal_bucket_b_r) +static void feather_bucket_get_diagonal( + FeatherEdgesBucket *buckets, int start_bucket_index, int end_bucket_index, int buckets_per_side, + FeatherEdgesBucket **r_diagonal_bucket_a, FeatherEdgesBucket **r_diagonal_bucket_b) { int start_bucket_x = start_bucket_index % buckets_per_side; int start_bucket_y = start_bucket_index / buckets_per_side; @@ -341,11 +343,12 @@ static void feather_bucket_get_diagonal(FeatherEdgesBucket *buckets, int start_b int diagonal_bucket_a_index = start_bucket_y * buckets_per_side + end_bucket_x; int diagonal_bucket_b_index = end_bucket_y * buckets_per_side + start_bucket_x; - *diagonal_bucket_a_r = &buckets[diagonal_bucket_a_index]; - *diagonal_bucket_b_r = &buckets[diagonal_bucket_b_index]; + *r_diagonal_bucket_a = &buckets[diagonal_bucket_a_index]; + *r_diagonal_bucket_b = &buckets[diagonal_bucket_b_index]; } -void BKE_mask_spline_feather_collapse_inner_loops(MaskSpline *spline, float (*feather_points)[2], const unsigned int tot_feather_point) +void BKE_mask_spline_feather_collapse_inner_loops( + MaskSpline *spline, float (*feather_points)[2], const unsigned int tot_feather_point) { #define BUCKET_INDEX(co) \ feather_bucket_index_from_coord(co, min, bucket_scale, buckets_per_side) @@ -502,11 +505,9 @@ void BKE_mask_spline_feather_collapse_inner_loops(MaskSpline *spline, float (*fe } /** only called from #BKE_mask_spline_feather_differentiated_points_with_resolution() ! */ -static float (*mask_spline_feather_differentiated_points_with_resolution__even(MaskSpline *spline, - unsigned int *tot_feather_point, - const unsigned int resol, - const bool do_feather_isect - ))[2] +static float (*mask_spline_feather_differentiated_points_with_resolution__even( + MaskSpline *spline, unsigned int *tot_feather_point, + const unsigned int resol, const bool do_feather_isect))[2] { MaskSplinePoint *points_array = BKE_mask_spline_point_array(spline); MaskSplinePoint *point_curr, *point_prev; @@ -575,11 +576,9 @@ static float (*mask_spline_feather_differentiated_points_with_resolution__even(M } /** only called from #BKE_mask_spline_feather_differentiated_points_with_resolution() ! */ -static float (*mask_spline_feather_differentiated_points_with_resolution__double(MaskSpline *spline, - unsigned int *tot_feather_point, - const unsigned int resol, - const bool do_feather_isect - ))[2] +static float (*mask_spline_feather_differentiated_points_with_resolution__double( + MaskSpline *spline, unsigned int *tot_feather_point, + const unsigned int resol, const bool do_feather_isect))[2] { MaskSplinePoint *points_array = BKE_mask_spline_point_array(spline); @@ -712,11 +711,9 @@ static float (*mask_spline_feather_differentiated_points_with_resolution__double * values align with #BKE_mask_spline_differentiate_with_resolution * when \a resol arguments match. */ -float (*BKE_mask_spline_feather_differentiated_points_with_resolution(MaskSpline *spline, - unsigned int *tot_feather_point, - const unsigned int resol, - const bool do_feather_isect - ))[2] +float (*BKE_mask_spline_feather_differentiated_points_with_resolution( + MaskSpline *spline, unsigned int *tot_feather_point, + const unsigned int resol, const bool do_feather_isect))[2] { switch (spline->offset_mode) { case MASK_SPLINE_OFFSET_EVEN: diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c index 7a81aedb60b..838f93e5222 100644 --- a/source/blender/blenkernel/intern/mesh.c +++ b/source/blender/blenkernel/intern/mesh.c @@ -1750,7 +1750,7 @@ void BKE_mesh_smooth_flag_set(Object *meshOb, int enableSmooth) /** * Return a newly MEM_malloc'd array of all the mesh vertex locations - * \note \a numVerts_r may be NULL + * \note \a r_numVerts may be NULL */ float (*BKE_mesh_vertexCos_get(Mesh *me, int *r_numVerts))[3] { @@ -1781,11 +1781,11 @@ int poly_find_loop_from_vert(const MPoly *poly, const MLoop *loopstart, } /** - * Fill \a adj_r with the loop indices in \a poly adjacent to the + * Fill \a r_adj with the loop indices in \a poly adjacent to the * vertex. Returns the index of the loop matching vertex, or -1 if the * vertex is not in \a poly */ -int poly_get_adj_loops_from_vert(unsigned adj_r[3], const MPoly *poly, +int poly_get_adj_loops_from_vert(unsigned r_adj[3], const MPoly *poly, const MLoop *mloop, unsigned vert) { int corner = poly_find_loop_from_vert(poly, @@ -1796,9 +1796,9 @@ int poly_get_adj_loops_from_vert(unsigned adj_r[3], const MPoly *poly, const MLoop *ml = &mloop[poly->loopstart + corner]; /* vertex was found */ - adj_r[0] = ME_POLY_LOOP_PREV(mloop, poly, corner)->v; - adj_r[1] = ml->v; - adj_r[2] = ME_POLY_LOOP_NEXT(mloop, poly, corner)->v; + r_adj[0] = ME_POLY_LOOP_PREV(mloop, poly, corner)->v; + r_adj[1] = ml->v; + r_adj[2] = ME_POLY_LOOP_NEXT(mloop, poly, corner)->v; } return corner; diff --git a/source/blender/blenkernel/intern/mesh_evaluate.c b/source/blender/blenkernel/intern/mesh_evaluate.c index be24fa8fc46..aa1f9e563db 100644 --- a/source/blender/blenkernel/intern/mesh_evaluate.c +++ b/source/blender/blenkernel/intern/mesh_evaluate.c @@ -83,26 +83,26 @@ static void mesh_calc_normals_vert_fallback(MVert *mverts, int numVerts) } } -/* Calculate vertex and face normals, face normals are returned in *faceNors_r if non-NULL +/* Calculate vertex and face normals, face normals are returned in *r_faceNors if non-NULL * and vertex normals are stored in actual mverts. */ void BKE_mesh_calc_normals_mapping(MVert *mverts, int numVerts, - MLoop *mloop, MPoly *mpolys, int numLoops, int numPolys, float (*polyNors_r)[3], - MFace *mfaces, int numFaces, int *origIndexFace, float (*faceNors_r)[3]) + MLoop *mloop, MPoly *mpolys, int numLoops, int numPolys, float (*r_polyNors)[3], + MFace *mfaces, int numFaces, const int *origIndexFace, float (*r_faceNors)[3]) { BKE_mesh_calc_normals_mapping_ex(mverts, numVerts, mloop, mpolys, - numLoops, numPolys, polyNors_r, mfaces, numFaces, - origIndexFace, faceNors_r, FALSE); + numLoops, numPolys, r_polyNors, mfaces, numFaces, + origIndexFace, r_faceNors, FALSE); } /* extended version of 'BKE_mesh_calc_normals_poly' with option not to calc vertex normals */ void BKE_mesh_calc_normals_mapping_ex( MVert *mverts, int numVerts, MLoop *mloop, MPoly *mpolys, - int numLoops, int numPolys, float (*polyNors_r)[3], - MFace *mfaces, int numFaces, int *origIndexFace, float (*faceNors_r)[3], + int numLoops, int numPolys, float (*r_polyNors)[3], + MFace *mfaces, int numFaces, const int *origIndexFace, float (*r_faceNors)[3], const bool only_face_normals) { - float (*pnors)[3] = polyNors_r, (*fnors)[3] = faceNors_r; + float (*pnors)[3] = r_polyNors, (*fnors)[3] = r_faceNors; int i; MFace *mf; MPoly *mp; @@ -115,7 +115,7 @@ void BKE_mesh_calc_normals_mapping_ex( } /* if we are not calculating verts and no verts were passes then we have nothing to do */ - if ((only_face_normals == TRUE) && (polyNors_r == NULL) && (faceNors_r == NULL)) { + if ((only_face_normals == TRUE) && (r_polyNors == NULL) && (r_faceNors == NULL)) { printf("%s: called with nothing to do\n", __func__); return; } @@ -138,7 +138,7 @@ void BKE_mesh_calc_normals_mapping_ex( } if (origIndexFace && - /* fnors == faceNors_r */ /* NO NEED TO ALLOC YET */ + /* fnors == r_faceNors */ /* NO NEED TO ALLOC YET */ fnors != NULL && numFaces) { @@ -154,8 +154,8 @@ void BKE_mesh_calc_normals_mapping_ex( } } - if (pnors != polyNors_r) MEM_freeN(pnors); - /* if (fnors != faceNors_r) MEM_freeN(fnors); */ /* NO NEED TO ALLOC YET */ + if (pnors != r_polyNors) MEM_freeN(pnors); + /* if (fnors != r_faceNors) MEM_freeN(fnors); */ /* NO NEED TO ALLOC YET */ fnors = pnors = NULL; @@ -277,10 +277,10 @@ void BKE_mesh_calc_normals(Mesh *mesh) #endif } -void BKE_mesh_calc_normals_tessface(MVert *mverts, int numVerts, MFace *mfaces, int numFaces, float (*faceNors_r)[3]) +void BKE_mesh_calc_normals_tessface(MVert *mverts, int numVerts, MFace *mfaces, int numFaces, float (*r_faceNors)[3]) { float (*tnorms)[3] = MEM_callocN(sizeof(*tnorms) * (size_t)numVerts, "tnorms"); - float (*fnors)[3] = (faceNors_r) ? faceNors_r : MEM_callocN(sizeof(*fnors) * (size_t)numFaces, "meshnormals"); + float (*fnors)[3] = (r_faceNors) ? r_faceNors : MEM_callocN(sizeof(*fnors) * (size_t)numFaces, "meshnormals"); int i; for (i = 0; i < numFaces; i++) { @@ -312,7 +312,7 @@ void BKE_mesh_calc_normals_tessface(MVert *mverts, int numVerts, MFace *mfaces, MEM_freeN(tnorms); - if (fnors != faceNors_r) + if (fnors != r_faceNors) MEM_freeN(fnors); } @@ -1733,8 +1733,8 @@ void BKE_mesh_do_versions_convert_mfaces_to_mpolys(Mesh *mesh) void BKE_mesh_convert_mfaces_to_mpolys_ex(ID *id, CustomData *fdata, CustomData *ldata, CustomData *pdata, int totedge_i, int totface_i, int totloop_i, int totpoly_i, MEdge *medge, MFace *mface, - int *totloop_r, int *totpoly_r, - MLoop **mloop_r, MPoly **mpoly_r) + int *r_totloop, int *r_totpoly, + MLoop **r_mloop, MPoly **r_mpoly) { MFace *mf; MLoop *ml, *mloop; @@ -1828,10 +1828,10 @@ void BKE_mesh_convert_mfaces_to_mpolys_ex(ID *id, CustomData *fdata, CustomData BLI_edgehash_free(eh, NULL); - *totpoly_r = totpoly; - *totloop_r = totloop; - *mpoly_r = mpoly; - *mloop_r = mloop; + *r_totpoly = totpoly; + *r_totloop = totloop; + *r_mpoly = mpoly; + *r_mloop = mloop; } /** \} */ diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c index 2d6888244d0..054d09e8b70 100644 --- a/source/blender/blenkernel/intern/modifier.c +++ b/source/blender/blenkernel/intern/modifier.c @@ -337,15 +337,15 @@ void modifier_setError(ModifierData *md, const char *_format, ...) * then is NULL) * also used for some mesh tools to give warnings */ -int modifiers_getCageIndex(struct Scene *scene, Object *ob, int *lastPossibleCageIndex_r, int virtual_) +int modifiers_getCageIndex(struct Scene *scene, Object *ob, int *r_lastPossibleCageIndex, bool is_virtual) { VirtualModifierData virtualModifierData; - ModifierData *md = (virtual_) ? modifiers_getVirtualModifierList(ob, &virtualModifierData) : ob->modifiers.first; + ModifierData *md = (is_virtual) ? modifiers_getVirtualModifierList(ob, &virtualModifierData) : ob->modifiers.first; int i, cageIndex = -1; - if (lastPossibleCageIndex_r) { + if (r_lastPossibleCageIndex) { /* ensure the value is initialized */ - *lastPossibleCageIndex_r = -1; + *r_lastPossibleCageIndex = -1; } /* Find the last modifier acting on the cage. */ @@ -361,7 +361,9 @@ int modifiers_getCageIndex(struct Scene *scene, Object *ob, int *lastPossibleCag if (!modifier_supportsMapping(md)) break; - if (lastPossibleCageIndex_r) *lastPossibleCageIndex_r = i; + if (r_lastPossibleCageIndex) { + *r_lastPossibleCageIndex = i; + } if (!(md->mode & eModifierMode_Realtime)) continue; if (!(md->mode & eModifierMode_Editmode)) continue; diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c index 2d23c32720b..4fc241b8ea5 100644 --- a/source/blender/blenkernel/intern/subsurf_ccg.c +++ b/source/blender/blenkernel/intern/subsurf_ccg.c @@ -694,7 +694,7 @@ static void minmax_v3_v3v3(const float vec[3], float min[3], float max[3]) if (max[2] < vec[2]) max[2] = vec[2]; } -static void ccgDM_getMinMax(DerivedMesh *dm, float min_r[3], float max_r[3]) +static void ccgDM_getMinMax(DerivedMesh *dm, float r_min[3], float r_max[3]) { CCGDerivedMesh *ccgdm = (CCGDerivedMesh *) dm; CCGSubSurf *ss = ccgdm->ss; @@ -708,13 +708,13 @@ static void ccgDM_getMinMax(DerivedMesh *dm, float min_r[3], float max_r[3]) CCG_key_top_level(&key, ss); if (!ccgSubSurf_getNumVerts(ss)) - min_r[0] = min_r[1] = min_r[2] = max_r[0] = max_r[1] = max_r[2] = 0.0; + r_min[0] = r_min[1] = r_min[2] = r_max[0] = r_max[1] = r_max[2] = 0.0; for (vi = ccgSubSurf_getVertIterator(ss); !ccgVertIterator_isStopped(vi); ccgVertIterator_next(vi)) { CCGVert *v = ccgVertIterator_getCurrent(vi); float *co = ccgSubSurf_getVertData(ss, v); - minmax_v3_v3v3(co, min_r, max_r); + minmax_v3_v3v3(co, r_min, r_max); } ccgVertIterator_free(vi); @@ -723,7 +723,7 @@ static void ccgDM_getMinMax(DerivedMesh *dm, float min_r[3], float max_r[3]) CCGElem *edgeData = ccgSubSurf_getEdgeDataArray(ss, e); for (i = 0; i < edgeSize; i++) - minmax_v3_v3v3(CCG_elem_offset_co(&key, edgeData, i), min_r, max_r); + minmax_v3_v3v3(CCG_elem_offset_co(&key, edgeData, i), r_min, r_max); } ccgEdgeIterator_free(ei); @@ -736,7 +736,7 @@ static void ccgDM_getMinMax(DerivedMesh *dm, float min_r[3], float max_r[3]) for (y = 0; y < gridSize; y++) for (x = 0; x < gridSize; x++) - minmax_v3_v3v3(CCG_grid_elem_co(&key, faceGridData, x, y), min_r, max_r); + minmax_v3_v3v3(CCG_grid_elem_co(&key, faceGridData, x, y), r_min, r_max); } } ccgFaceIterator_free(fi); @@ -863,20 +863,20 @@ static void ccgDM_getFinalVert(DerivedMesh *dm, int vertNum, MVert *mv) } } -static void ccgDM_getFinalVertCo(DerivedMesh *dm, int vertNum, float co_r[3]) +static void ccgDM_getFinalVertCo(DerivedMesh *dm, int vertNum, float r_co[3]) { MVert mvert; ccgDM_getFinalVert(dm, vertNum, &mvert); - copy_v3_v3(co_r, mvert.co); + copy_v3_v3(r_co, mvert.co); } -static void ccgDM_getFinalVertNo(DerivedMesh *dm, int vertNum, float no_r[3]) +static void ccgDM_getFinalVertNo(DerivedMesh *dm, int vertNum, float r_no[3]) { MVert mvert; ccgDM_getFinalVert(dm, vertNum, &mvert); - normal_short_to_float_v3(no_r, mvert.no); + normal_short_to_float_v3(r_no, mvert.no); } static void ccgDM_getFinalEdge(DerivedMesh *dm, int edgeNum, MEdge *med) @@ -3682,7 +3682,7 @@ struct DerivedMesh *subsurf_make_derived_from_derived( return (DerivedMesh *)result; } -void subsurf_calculate_limit_positions(Mesh *me, float (*positions_r)[3]) +void subsurf_calculate_limit_positions(Mesh *me, float (*r_positions)[3]) { /* Finds the subsurf limit positions for the verts in a mesh * and puts them in an array of floats. Please note that the @@ -3722,9 +3722,9 @@ void subsurf_calculate_limit_positions(Mesh *me, float (*positions_r)[3]) mul_v3_fl(face_sum, (float)N / (float)numFaces); co = ccgSubSurf_getVertData(ss, v); - positions_r[idx][0] = (co[0] * N * N + edge_sum[0] * 4 + face_sum[0]) / (N * (N + 5)); - positions_r[idx][1] = (co[1] * N * N + edge_sum[1] * 4 + face_sum[1]) / (N * (N + 5)); - positions_r[idx][2] = (co[2] * N * N + edge_sum[2] * 4 + face_sum[2]) / (N * (N + 5)); + r_positions[idx][0] = (co[0] * N * N + edge_sum[0] * 4 + face_sum[0]) / (N * (N + 5)); + r_positions[idx][1] = (co[1] * N * N + edge_sum[1] * 4 + face_sum[1]) / (N * (N + 5)); + r_positions[idx][2] = (co[2] * N * N + edge_sum[2] * 4 + face_sum[2]) / (N * (N + 5)); } ccgVertIterator_free(vi); diff --git a/source/blender/blenlib/BLI_edgehash.h b/source/blender/blenlib/BLI_edgehash.h index 2ca011871d8..fccbda4b4db 100644 --- a/source/blender/blenlib/BLI_edgehash.h +++ b/source/blender/blenlib/BLI_edgehash.h @@ -60,7 +60,7 @@ void BLI_edgehash_flag_clear(EdgeHash *eh, unsigned int flag); EdgeHashIterator *BLI_edgehashIterator_new(EdgeHash *eh) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT; void BLI_edgehashIterator_free(EdgeHashIterator *ehi); -void BLI_edgehashIterator_getKey(EdgeHashIterator *ehi, unsigned int *v0_r, unsigned int *v1_r); +void BLI_edgehashIterator_getKey(EdgeHashIterator *ehi, unsigned int *r_v0, unsigned int *r_v1); void *BLI_edgehashIterator_getValue(EdgeHashIterator *ehi) ATTR_WARN_UNUSED_RESULT; void **BLI_edgehashIterator_getValue_p(EdgeHashIterator *ehi) ATTR_WARN_UNUSED_RESULT; void BLI_edgehashIterator_setValue(EdgeHashIterator *ehi, void *val); @@ -89,7 +89,7 @@ void BLI_edgeset_free(EdgeSet *es); /* rely on inline api for now */ BLI_INLINE EdgeSetIterator *BLI_edgesetIterator_new(EdgeSet *gs) { return (EdgeSetIterator *)BLI_edgehashIterator_new((EdgeHash *)gs); } BLI_INLINE void BLI_edgesetIterator_free(EdgeSetIterator *esi) { BLI_edgehashIterator_free((EdgeHashIterator *)esi); } -BLI_INLINE void BLI_edgesetIterator_getKey(EdgeSetIterator *esi, unsigned int *v0_r, unsigned int *v1_r) { BLI_edgehashIterator_getKey((EdgeHashIterator *)esi, v0_r, v1_r); } +BLI_INLINE void BLI_edgesetIterator_getKey(EdgeSetIterator *esi, unsigned int *r_v0, unsigned int *r_v1) { BLI_edgehashIterator_getKey((EdgeHashIterator *)esi, r_v0, r_v1); } BLI_INLINE void BLI_edgesetIterator_step(EdgeSetIterator *esi) { BLI_edgehashIterator_step((EdgeHashIterator *)esi); } BLI_INLINE bool BLI_edgesetIterator_isDone(EdgeSetIterator *esi) { return BLI_edgehashIterator_isDone((EdgeHashIterator *)esi); } diff --git a/source/blender/blenlib/BLI_fileops.h b/source/blender/blenlib/BLI_fileops.h index ca82086b529..7c10e50acc4 100644 --- a/source/blender/blenlib/BLI_fileops.h +++ b/source/blender/blenlib/BLI_fileops.h @@ -85,7 +85,7 @@ bool BLI_file_is_writable(const char *file); bool BLI_file_touch(const char *file); int BLI_file_gzip(const char *from, const char *to); -char *BLI_file_ungzip_to_mem(const char *from_file, int *size_r); +char *BLI_file_ungzip_to_mem(const char *from_file, int *r_size); size_t BLI_file_descriptor_size(int file); size_t BLI_file_size(const char *file); diff --git a/source/blender/blenlib/BLI_math_color.h b/source/blender/blenlib/BLI_math_color.h index 8a6bc35141c..5c14ac55492 100644 --- a/source/blender/blenlib/BLI_math_color.h +++ b/source/blender/blenlib/BLI_math_color.h @@ -132,10 +132,10 @@ void hsv_clamp_v(float hsv[3], float v_max); void rgb_float_set_hue_float_offset(float *rgb, float hue_offset); void rgb_byte_set_hue_float_offset(unsigned char *rgb, float hue_offset); -void rgb_uchar_to_float(float col_r[3], const unsigned char col_ub[3]); -void rgba_uchar_to_float(float col_r[4], const unsigned char col_ub[4]); -void rgb_float_to_uchar(unsigned char col_r[3], const float col_f[3]); -void rgba_float_to_uchar(unsigned char col_r[4], const float col_f[4]); +void rgb_uchar_to_float(float r_col[3], const unsigned char col_ub[3]); +void rgba_uchar_to_float(float r_col[4], const unsigned char col_ub[4]); +void rgb_float_to_uchar(unsigned char r_col[3], const float col_f[3]); +void rgba_float_to_uchar(unsigned char r_col[4], const float col_f[4]); void xyz_to_lab(float x, float y, float z, float *l, float *a, float *b); diff --git a/source/blender/blenlib/BLI_math_geom.h b/source/blender/blenlib/BLI_math_geom.h index e800369a682..09ff3585312 100644 --- a/source/blender/blenlib/BLI_math_geom.h +++ b/source/blender/blenlib/BLI_math_geom.h @@ -84,7 +84,7 @@ float dist_squared_to_line_v2(const float p[2], const float l1[2], const float l float dist_to_line_v2(const float p[2], const float l1[2], const float l2[2]); float dist_squared_to_line_segment_v2(const float p[2], const float l1[2], const float l2[2]); float dist_to_line_segment_v2(const float p[2], const float l1[2], const float l2[2]); -void closest_to_line_segment_v2(float closest[2], const float p[2], const float l1[2], const float l2[2]); +void closest_to_line_segment_v2(float r_close[2], const float p[2], const float l1[2], const float l2[2]); float dist_squared_to_plane_v3(const float p[3], const float plane[4]); float dist_to_plane_v3(const float p[3], const float plane[4]); @@ -94,8 +94,8 @@ float dist_squared_to_line_v3(const float p[3], const float l1[3], const float l float dist_to_line_v3(const float p[3], const float l1[3], const float l2[3]); float closest_to_line_v3(float r[3], const float p[3], const float l1[3], const float l2[3]); float closest_to_line_v2(float r[2], const float p[2], const float l1[2], const float l2[2]); -void closest_to_line_segment_v3(float r[3], const float p[3], const float l1[3], const float l2[3]); -void closest_to_plane_v3(float close_r[3], const float plane[4], const float pt[3]); +void closest_to_line_segment_v3(float r_close[3], const float p[3], const float l1[3], const float l2[3]); +void closest_to_plane_v3(float r_close[3], const float plane[4], const float pt[3]); /* Set 'r' to the point in triangle (t1, t2, t3) closest to point 'p' */ void closest_on_tri_to_point_v3(float r[3], const float p[3], const float t1[3], const float t2[3], const float t3[3]); diff --git a/source/blender/blenlib/intern/edgehash.c b/source/blender/blenlib/intern/edgehash.c index 1d0c9b20550..c12efbd80f6 100644 --- a/source/blender/blenlib/intern/edgehash.c +++ b/source/blender/blenlib/intern/edgehash.c @@ -465,11 +465,11 @@ void BLI_edgehashIterator_free(EdgeHashIterator *ehi) /** * Retrieve the key from an iterator. */ -void BLI_edgehashIterator_getKey(EdgeHashIterator *ehi, unsigned int *v0_r, unsigned int *v1_r) +void BLI_edgehashIterator_getKey(EdgeHashIterator *ehi, unsigned int *r_v0, unsigned int *r_v1) { if (ehi->curEntry) { - *v0_r = ehi->curEntry->v0; - *v1_r = ehi->curEntry->v1; + *r_v0 = ehi->curEntry->v0; + *r_v1 = ehi->curEntry->v1; } } diff --git a/source/blender/blenlib/intern/fileops.c b/source/blender/blenlib/intern/fileops.c index 55726565f59..4702b384211 100644 --- a/source/blender/blenlib/intern/fileops.c +++ b/source/blender/blenlib/intern/fileops.c @@ -116,7 +116,7 @@ int BLI_file_gzip(const char *from, const char *to) /* gzip the file in from_file and write it to memory to_mem, at most size bytes. * return the unziped size */ -char *BLI_file_ungzip_to_mem(const char *from_file, int *size_r) +char *BLI_file_ungzip_to_mem(const char *from_file, int *r_size) { gzFile gzfile; int readsize, size, alloc_size = 0; @@ -154,7 +154,7 @@ char *BLI_file_ungzip_to_mem(const char *from_file, int *size_r) else if (alloc_size != size) mem = MEM_reallocN(mem, size); - *size_r = size; + *r_size = size; return mem; } diff --git a/source/blender/blenlib/intern/math_color.c b/source/blender/blenlib/intern/math_color.c index 43f6d4c29ae..093b82e9126 100644 --- a/source/blender/blenlib/intern/math_color.c +++ b/source/blender/blenlib/intern/math_color.c @@ -508,29 +508,29 @@ void cpack_to_rgb(unsigned int col, float *r, float *g, float *b) *b = ((float)(((col) >> 16) & 0xFF)) * (1.0f / 255.0f); } -void rgb_uchar_to_float(float col_r[3], const unsigned char col_ub[3]) +void rgb_uchar_to_float(float r_col[3], const unsigned char col_ub[3]) { - col_r[0] = ((float)col_ub[0]) * (1.0f / 255.0f); - col_r[1] = ((float)col_ub[1]) * (1.0f / 255.0f); - col_r[2] = ((float)col_ub[2]) * (1.0f / 255.0f); + r_col[0] = ((float)col_ub[0]) * (1.0f / 255.0f); + r_col[1] = ((float)col_ub[1]) * (1.0f / 255.0f); + r_col[2] = ((float)col_ub[2]) * (1.0f / 255.0f); } -void rgba_uchar_to_float(float col_r[4], const unsigned char col_ub[4]) +void rgba_uchar_to_float(float r_col[4], const unsigned char col_ub[4]) { - col_r[0] = ((float)col_ub[0]) * (1.0f / 255.0f); - col_r[1] = ((float)col_ub[1]) * (1.0f / 255.0f); - col_r[2] = ((float)col_ub[2]) * (1.0f / 255.0f); - col_r[3] = ((float)col_ub[3]) * (1.0f / 255.0f); + r_col[0] = ((float)col_ub[0]) * (1.0f / 255.0f); + r_col[1] = ((float)col_ub[1]) * (1.0f / 255.0f); + r_col[2] = ((float)col_ub[2]) * (1.0f / 255.0f); + r_col[3] = ((float)col_ub[3]) * (1.0f / 255.0f); } -void rgb_float_to_uchar(unsigned char col_r[3], const float col_f[3]) +void rgb_float_to_uchar(unsigned char r_col[3], const float col_f[3]) { - F3TOCHAR3(col_f, col_r); + F3TOCHAR3(col_f, r_col); } -void rgba_float_to_uchar(unsigned char col_r[4], const float col_f[4]) +void rgba_float_to_uchar(unsigned char r_col[4], const float col_f[4]) { - F4TOCHAR4(col_f, col_r); + F4TOCHAR4(col_f, r_col); } /* ********************************* color transforms ********************************* */ diff --git a/source/blender/blenlib/intern/math_geom.c b/source/blender/blenlib/intern/math_geom.c index 3b49ad5db8d..2a19584cdb3 100644 --- a/source/blender/blenlib/intern/math_geom.c +++ b/source/blender/blenlib/intern/math_geom.c @@ -295,49 +295,49 @@ float dist_to_line_segment_v2(const float p[2], const float l1[2], const float l } /* point closest to v1 on line v2-v3 in 2D */ -void closest_to_line_segment_v2(float close_r[2], const float p[2], const float l1[2], const float l2[2]) +void closest_to_line_segment_v2(float r_close[2], const float p[2], const float l1[2], const float l2[2]) { float lambda, cp[2]; lambda = closest_to_line_v2(cp, p, l1, l2); if (lambda <= 0.0f) - copy_v2_v2(close_r, l1); + copy_v2_v2(r_close, l1); else if (lambda >= 1.0f) - copy_v2_v2(close_r, l2); + copy_v2_v2(r_close, l2); else - copy_v2_v2(close_r, cp); + copy_v2_v2(r_close, cp); } /* point closest to v1 on line v2-v3 in 3D */ -void closest_to_line_segment_v3(float close_r[3], const float v1[3], const float v2[3], const float v3[3]) +void closest_to_line_segment_v3(float r_close[3], const float v1[3], const float v2[3], const float v3[3]) { float lambda, cp[3]; lambda = closest_to_line_v3(cp, v1, v2, v3); if (lambda <= 0.0f) - copy_v3_v3(close_r, v2); + copy_v3_v3(r_close, v2); else if (lambda >= 1.0f) - copy_v3_v3(close_r, v3); + copy_v3_v3(r_close, v3); else - copy_v3_v3(close_r, cp); + copy_v3_v3(r_close, cp); } /** * Find the closest point on a plane. * - * \param close_r Return coordinate + * \param r_close Return coordinate * \param plane The plane to test against. * \param pt The point to find the nearest of * * \note non-unit-length planes are supported. */ -void closest_to_plane_v3(float close_r[3], const float plane[4], const float pt[3]) +void closest_to_plane_v3(float r_close[3], const float plane[4], const float pt[3]) { const float len_sq = len_squared_v3(plane); const float side = plane_point_side_v3(plane, pt); - madd_v3_v3v3fl(close_r, pt, plane, -side / len_sq); + madd_v3_v3v3fl(r_close, pt, plane, -side / len_sq); } float dist_squared_to_plane_v3(const float pt[3], const float plane[4]) diff --git a/source/blender/blenlib/intern/string_utf8.c b/source/blender/blenlib/intern/string_utf8.c index e7beaaa33a0..e97f0d8bdaf 100644 --- a/source/blender/blenlib/intern/string_utf8.c +++ b/source/blender/blenlib/intern/string_utf8.c @@ -195,7 +195,7 @@ static const size_t utf8_skip_data[256] = { char *BLI_strncpy_utf8(char *__restrict dst, const char *__restrict src, size_t maxncpy) { - char *dst_r = dst; + char *r_dst = dst; BLI_assert(maxncpy != 0); @@ -206,7 +206,7 @@ char *BLI_strncpy_utf8(char *__restrict dst, const char *__restrict src, size_t /* note: currently we don't attempt to deal with invalid utf8 chars */ BLI_STR_UTF8_CPY(dst, src, maxncpy); - return dst_r; + return r_dst; } char *BLI_strncat_utf8(char *__restrict dst, const char *__restrict src, size_t maxncpy) diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index bf81e0b4e21..4ab3afcaa0c 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -7156,7 +7156,7 @@ static BHead *read_data_into_oldnewmap(FileData *fd, BHead *bhead, const char *a return bhead; } -static BHead *read_libblock(FileData *fd, Main *main, BHead *bhead, int flag, ID **id_r) +static BHead *read_libblock(FileData *fd, Main *main, BHead *bhead, int flag, ID **r_id) { /* this routine reads a libblock and its direct data. Use link functions * to connect it all @@ -7168,8 +7168,8 @@ static BHead *read_libblock(FileData *fd, Main *main, BHead *bhead, int flag, ID /* read libblock */ id = read_struct(fd, bhead, "lib block"); - if (id_r) - *id_r = id; + if (r_id) + *r_id = id; if (!id) return blo_nextbhead(fd, bhead); @@ -8928,7 +8928,7 @@ ID *BLO_library_append_named_part_ex(const bContext *C, Main *mainl, BlendHandle return append_named_part_ex(C, mainl, fd, idname, idcode, flag); } -static void append_id_part(FileData *fd, Main *mainvar, ID *id, ID **id_r) +static void append_id_part(FileData *fd, Main *mainvar, ID *id, ID **r_id) { BHead *bhead; @@ -8939,7 +8939,7 @@ static void append_id_part(FileData *fd, Main *mainvar, ID *id, ID **id_r) id->flag &= ~LIB_READ; id->flag |= LIB_NEED_EXPAND; // printf("read lib block %s\n", id->name); - read_libblock(fd, mainvar, bhead, id->flag, id_r); + read_libblock(fd, mainvar, bhead, id->flag, r_id); break; } 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; } diff --git a/source/blender/makesdna/intern/makesdna.c b/source/blender/makesdna/intern/makesdna.c index d95c394b60f..3845e7cde2c 100644 --- a/source/blender/makesdna/intern/makesdna.c +++ b/source/blender/makesdna/intern/makesdna.c @@ -520,7 +520,7 @@ static int preprocess_include(char *maindata, int len) return newlen; } -static void *read_file_data(char *filename, int *len_r) +static void *read_file_data(char *filename, int *r_len) { #ifdef WIN32 FILE *fp = fopen(filename, "rb"); @@ -530,23 +530,23 @@ static void *read_file_data(char *filename, int *len_r) void *data; if (!fp) { - *len_r = -1; + *r_len = -1; return NULL; } fseek(fp, 0L, SEEK_END); - *len_r = ftell(fp); + *r_len = ftell(fp); fseek(fp, 0L, SEEK_SET); - data = MEM_mallocN(*len_r, "read_file_data"); + data = MEM_mallocN(*r_len, "read_file_data"); if (!data) { - *len_r = -1; + *r_len = -1; fclose(fp); return NULL; } - if (fread(data, *len_r, 1, fp) != 1) { - *len_r = -1; + if (fread(data, *r_len, 1, fp) != 1) { + *r_len = -1; MEM_freeN(data); fclose(fp); return NULL; diff --git a/source/blender/makesrna/intern/rna_camera_api.c b/source/blender/makesrna/intern/rna_camera_api.c index bf916806e40..ae15c58dd29 100644 --- a/source/blender/makesrna/intern/rna_camera_api.c +++ b/source/blender/makesrna/intern/rna_camera_api.c @@ -42,16 +42,16 @@ #include "BKE_object.h" static void rna_camera_view_frame(struct Camera *camera, struct Scene *scene, - float vec1_r[3], float vec2_r[3], float vec3_r[3], float vec4_r[3]) + float r_vec1[3], float r_vec2[3], float r_vec3[3], float r_vec4[3]) { float vec[4][3]; BKE_camera_view_frame(scene, camera, vec); - copy_v3_v3(vec1_r, vec[0]); - copy_v3_v3(vec2_r, vec[1]); - copy_v3_v3(vec3_r, vec[2]); - copy_v3_v3(vec4_r, vec[3]); + copy_v3_v3(r_vec1, vec[0]); + copy_v3_v3(r_vec2, vec[1]); + copy_v3_v3(r_vec3, vec[2]); + copy_v3_v3(r_vec4, vec[3]); } #else diff --git a/source/blender/makesrna/intern/rna_texture_api.c b/source/blender/makesrna/intern/rna_texture_api.c index 3a91796a727..695a3e0548e 100644 --- a/source/blender/makesrna/intern/rna_texture_api.c +++ b/source/blender/makesrna/intern/rna_texture_api.c @@ -69,17 +69,17 @@ static void clear_envmap(struct EnvMap *env, bContext *C) } } -static void texture_evaluate(struct Tex *tex, float value[3], float color_r[4]) +static void texture_evaluate(struct Tex *tex, float value[3], float r_color[4]) { TexResult texres = {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0, NULL}; /* TODO(sergey): always use color management now. */ multitex_ext(tex, value, NULL, NULL, 1, &texres, NULL, true); - color_r[0] = texres.tr; - color_r[1] = texres.tg; - color_r[2] = texres.tb; - color_r[3] = texres.tin; + r_color[0] = texres.tr; + r_color[1] = texres.tg; + r_color[2] = texres.tb; + r_color[3] = texres.tin; } #else diff --git a/source/blender/modifiers/intern/MOD_particleinstance.c b/source/blender/modifiers/intern/MOD_particleinstance.c index b8f590c0e96..3928687c006 100644 --- a/source/blender/modifiers/intern/MOD_particleinstance.c +++ b/source/blender/modifiers/intern/MOD_particleinstance.c @@ -260,11 +260,11 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, psys->lattice_deform_data = psys_create_lattice_deform_data(&sim); if (psys->flag & (PSYS_HAIR_DONE | PSYS_KEYED) || psys->pointcache->flag & PTCACHE_BAKED) { - float min_r[3], max_r[3]; - INIT_MINMAX(min_r, max_r); - dm->getMinMax(dm, min_r, max_r); - min_co = min_r[track]; - max_co = max_r[track]; + float min[3], max[3]; + INIT_MINMAX(min, max); + dm->getMinMax(dm, min, max); + min_co = min[track]; + max_co = max[track]; } result = CDDM_from_template(dm, maxvert, 0, 0, maxloop, maxpoly); diff --git a/source/blender/python/bmesh/bmesh_py_types_meshdata.c b/source/blender/python/bmesh/bmesh_py_types_meshdata.c index 7edbf724ed7..3512dc76cef 100644 --- a/source/blender/python/bmesh/bmesh_py_types_meshdata.c +++ b/source/blender/python/bmesh/bmesh_py_types_meshdata.c @@ -367,9 +367,9 @@ PyObject *BPy_BMVertSkin_CreatePyObject(struct MVertSkin *mvertskin) #define MLOOPCOL_FROM_CAPSULE(color_capsule) \ ((MLoopCol *)PyCapsule_GetPointer(color_capsule, NULL)) -static void mloopcol_to_float(const MLoopCol *mloopcol, float col_r[3]) +static void mloopcol_to_float(const MLoopCol *mloopcol, float r_col[3]) { - rgb_uchar_to_float(col_r, (unsigned char *)&mloopcol->r); + rgb_uchar_to_float(r_col, (unsigned char *)&mloopcol->r); } static void mloopcol_from_float(MLoopCol *mloopcol, const float col[3]) diff --git a/source/blenderplayer/bad_level_call_stubs/stubs.c b/source/blenderplayer/bad_level_call_stubs/stubs.c index bbece2a33d0..055036158d6 100644 --- a/source/blenderplayer/bad_level_call_stubs/stubs.c +++ b/source/blenderplayer/bad_level_call_stubs/stubs.c @@ -317,7 +317,7 @@ void UI_view2d_to_region_no_clip(struct View2D *v2d, float x, float y, int *regi struct EditBone *ED_armature_bone_get_mirrored(const struct ListBase *edbo, EditBone *ebo) RET_NULL struct EditBone *ED_armature_edit_bone_add(struct bArmature *arm, const char *name) RET_NULL struct ListBase *get_active_constraints (struct Object *ob) RET_NULL -struct ListBase *get_constraint_lb(struct Object *ob, struct bConstraint *con, struct bPoseChannel **pchan_r) RET_NULL +struct ListBase *get_constraint_lb(struct Object *ob, struct bConstraint *con, struct bPoseChannel **r_pchan) RET_NULL bool ED_space_image_show_uvedit(struct SpaceImage *sima, struct Object *obedit) RET_ZERO bool ED_space_image_show_render(struct SpaceImage *sima) RET_ZERO diff --git a/source/gameengine/Converter/BL_ModifierDeformer.cpp b/source/gameengine/Converter/BL_ModifierDeformer.cpp index 82f49ad5227..7e64d16d012 100644 --- a/source/gameengine/Converter/BL_ModifierDeformer.cpp +++ b/source/gameengine/Converter/BL_ModifierDeformer.cpp @@ -189,10 +189,10 @@ bool BL_ModifierDeformer::Update(void) /* update the graphic controller */ PHY_IGraphicController *ctrl = m_gameobj->GetGraphicController(); if (ctrl) { - float min_r[3], max_r[3]; - INIT_MINMAX(min_r, max_r); - m_dm->getMinMax(m_dm, min_r, max_r); - ctrl->SetLocalAabb(min_r, max_r); + float min[3], max[3]; + INIT_MINMAX(min, max); + m_dm->getMinMax(m_dm, min, max); + ctrl->SetLocalAabb(min, max); } } m_lastModifierUpdate=m_gameobj->GetLastFrame(); -- cgit v1.2.3