Cleanup: style

This commit is contained in:
Campbell Barton 2017-04-24 21:58:28 +10:00
parent 50bfaffc6b
commit aff30aaf2d
15 changed files with 37 additions and 34 deletions

@ -3053,7 +3053,7 @@ void DAG_id_type_tag(Main *bmain, short idtype)
DAG_id_type_tag(bmain, ID_SCE);
}
atomic_fetch_and_or_uint8((uint8_t*)&bmain->id_tag_update[BKE_idcode_to_index(idtype)], 1);
atomic_fetch_and_or_uint8((uint8_t *)&bmain->id_tag_update[BKE_idcode_to_index(idtype)], 1);
}
int DAG_id_type_tagged(Main *bmain, short idtype)

@ -953,7 +953,7 @@ IDProperty *IDP_New(const char type, const IDPropertyTemplate *val, const char *
prop->len = prop->totallen = val->array.len;
break;
}
printf("%s: bad array type.\n",__func__);
printf("%s: bad array type.\n", __func__);
return NULL;
}
case IDP_STRING:

@ -978,6 +978,7 @@ void BKE_library_foreach_ID_link(Main *bmain, ID *id, LibraryIDLinkCallback call
for (bGPDlayer *gp_layer = gpencil->layers.first; gp_layer; gp_layer = gp_layer->next) {
CALLBACK_INVOKE(gp_layer->parent, IDWALK_CB_NOP);
}
break;
}
/* Nothing needed for those... */

@ -1026,7 +1026,7 @@ static bool loop_split_generator_check_cyclic_smooth_fan(
BLI_assert(!BLI_BITMAP_TEST(skip_loops, mlfan_vert_index));
BLI_BITMAP_ENABLE(skip_loops, mlfan_vert_index);
while(true) {
while (true) {
/* Find next loop of the smooth fan. */
loop_manifold_fan_around_vert_next(
mloops, mpolys, loop_to_poly, e2lfan_curr, mv_pivot_index,

@ -186,8 +186,9 @@ static DupliObject *make_dupli(const DupliContext *ctx,
dob->random_id = BLI_hash_string(dob->ob->id.name + 2);
if (dob->persistent_id[0] != INT_MAX) {
for(i = 0; i < MAX_DUPLI_RECUR*2; i++)
for (i = 0; i < MAX_DUPLI_RECUR * 2; i++) {
dob->random_id = BLI_hash_int_2d(dob->random_id, (unsigned int)dob->persistent_id[i]);
}
}
else {
dob->random_id = BLI_hash_int_2d(dob->random_id, 0);

@ -27,7 +27,7 @@
BLI_INLINE unsigned int BLI_hash_int_2d(unsigned int kx, unsigned int ky)
{
#define rot(x,k) (((x)<<(k)) | ((x)>>(32-(k))))
#define rot(x, k) (((x) << (k)) | ((x) >> (32 - (k))))
unsigned int a, b, c;
@ -35,13 +35,13 @@ BLI_INLINE unsigned int BLI_hash_int_2d(unsigned int kx, unsigned int ky)
a += kx;
b += ky;
c ^= b; c -= rot(b,14);
a ^= c; a -= rot(c,11);
b ^= a; b -= rot(a,25);
c ^= b; c -= rot(b,16);
a ^= c; a -= rot(c,4);
b ^= a; b -= rot(a,14);
c ^= b; c -= rot(b,24);
c ^= b; c -= rot(b, 14);
a ^= c; a -= rot(c, 11);
b ^= a; b -= rot(a, 25);
c ^= b; c -= rot(b, 16);
a ^= c; a -= rot(c, 4);
b ^= a; b -= rot(a, 14);
c ^= b; c -= rot(b, 24);
return c;
@ -52,9 +52,9 @@ BLI_INLINE unsigned int BLI_hash_string(const char *str)
{
unsigned int i = 0, c;
while((c = *str++))
while ((c = *str++)) {
i = i * 37 + c;
}
return i;
}

@ -1259,7 +1259,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
for (Camera *camera = main->camera.first; camera != NULL; camera = camera->id.next) {
if (camera->stereo.pole_merge_angle_from == 0.0f &&
camera->stereo.pole_merge_angle_to == 0.0f)
camera->stereo.pole_merge_angle_to == 0.0f)
{
camera->stereo.pole_merge_angle_from = DEG2RADF(60.0f);
camera->stereo.pole_merge_angle_to = DEG2RADF(75.0f);

@ -1317,8 +1317,8 @@ static void write_particlesettings(WriteData *wd, ParticleSettings *part)
dw->index = 0;
if (part->dup_group) { /* can be NULL if lining fails or set to None */
for (GroupObject *go = part->dup_group->gobject.first;
go && go->ob != dw->ob;
go = go->next, dw->index++);
go && go->ob != dw->ob;
go = go->next, dw->index++);
}
}
writestruct(wd, DATA, ParticleDupliWeight, 1, dw);
@ -2654,8 +2654,8 @@ static void write_scene(WriteData *wd, Scene *sce)
}
if (seq->type == SEQ_TYPE_IMAGE) {
writestruct(wd, DATA, StripElem,
MEM_allocN_len(strip->stripdata) / sizeof(struct StripElem),
strip->stripdata);
MEM_allocN_len(strip->stripdata) / sizeof(struct StripElem),
strip->stripdata);
}
else if (ELEM(seq->type, SEQ_TYPE_MOVIE, SEQ_TYPE_SOUND_RAM, SEQ_TYPE_SOUND_HD)) {
writestruct(wd, DATA, StripElem, 1, strip->stripdata);
@ -3362,13 +3362,13 @@ static void write_mask(WriteData *wd, Mask *mask)
}
for (masklay_shape = masklay->splines_shapes.first;
masklay_shape;
masklay_shape = masklay_shape->next)
masklay_shape;
masklay_shape = masklay_shape->next)
{
writestruct(wd, DATA, MaskLayerShape, 1, masklay_shape);
writedata(wd, DATA,
masklay_shape->tot_vert * sizeof(float) * MASK_OBJECT_SHAPE_ELEM_SIZE,
masklay_shape->data);
masklay_shape->tot_vert * sizeof(float) * MASK_OBJECT_SHAPE_ELEM_SIZE,
masklay_shape->data);
}
}
}
@ -3854,7 +3854,7 @@ static bool write_file_handle(
write_scene(wd, (Scene *)id);
break;
case ID_CU:
write_curve(wd,(Curve *)id);
write_curve(wd, (Curve *)id);
break;
case ID_MB:
write_mball(wd, (MetaBall *)id);

@ -77,7 +77,6 @@
#include "ED_object.h"
#include "ED_screen.h"
#include "ED_view3d.h"
#include "ED_screen.h"
#include "ED_space_api.h"
#include "gpencil_intern.h"

@ -1012,7 +1012,7 @@ static int gpencil_lasso_select_exec(bContext *C, wmOperator *op)
}
/* test if in lasso boundbox + within the lasso noose */
if ((!ELEM(V2D_IS_CLIPPED, x0, y0)) && BLI_rcti_isect_pt(&rect, x0, y0) &&
BLI_lasso_is_point_inside(mcords, mcords_tot, x0, y0, INT_MAX))
BLI_lasso_is_point_inside(mcords, mcords_tot, x0, y0, INT_MAX))
{
if (select) {
pt->flag |= GP_SPOINT_SELECT;

@ -2109,7 +2109,7 @@ void ED_object_single_users(Main *bmain, Scene *scene, const bool full, const bo
for (Base *base = scene->base.first; base; base = base->next) {
Object *ob = base->object;
if (!ID_IS_LINKED_DATABLOCK(ob)) {
IDP_RelinkProperty(ob->id.properties);
IDP_RelinkProperty(ob->id.properties);
}
}

@ -1912,7 +1912,7 @@ static void GPU_get_object_info(float oi[3], Material *mat)
else {
random = BLI_hash_int_2d(BLI_hash_string(GMS.gob->id.name + 2), 0);
}
oi[2] = random * (1.0f/(float)0xFFFFFFFF);
oi[2] = random * (1.0f / (float)0xFFFFFFFF);
}
int GPU_object_material_bind(int nr, void *attribs)

@ -1152,9 +1152,11 @@ static void surfacedeformModifier_do(ModifierData *md, float (*vertexCos)[3], un
}
/* Actual vertex location update starts here */
SDefDeformData data = {.bind_verts = smd->verts,
.targetCos = MEM_mallocN(sizeof(float[3]) * tnumverts, "SDefTargetVertArray"),
.vertexCos = vertexCos};
SDefDeformData data = {
.bind_verts = smd->verts,
.targetCos = MEM_mallocN(sizeof(float[3]) * tnumverts, "SDefTargetVertArray"),
.vertexCos = vertexCos,
};
if (data.targetCos != NULL) {
bool tdm_vert_alloc;

@ -48,7 +48,7 @@ static void node_shader_exec_object_info(void *data, int UNUSED(thread), bNode *
copy_v4_v4(out[0]->vec, RE_object_instance_get_matrix(scd->shi->obi, RE_OBJECT_INSTANCE_MATRIX_OB)[3]);
out[1]->vec[0] = RE_object_instance_get_object_pass_index(scd->shi->obi);
out[2]->vec[0] = scd->shi->mat->index;
out[3]->vec[0] = RE_object_instance_get_random_id(scd->shi->obi) * (1.0f/(float)0xFFFFFFFF);;
out[3]->vec[0] = RE_object_instance_get_random_id(scd->shi->obi) * (1.0f / (float)0xFFFFFFFF);
}
/* node type definition */

@ -7107,8 +7107,8 @@ static int deferred_register_prop(StructRNA *srna, PyObject *key, PyObject *item
RNA_struct_idprops_contains_datablock(type_srna))
{
PyErr_Format(PyExc_ValueError,
"bpy_struct \"%.200s\" doesn't support datablock properties \n",
RNA_struct_identifier(srna));
"bpy_struct \"%.200s\" doesn't support datablock properties \n",
RNA_struct_identifier(srna));
return -1;
}
}