style cleanup: 'sizeof foo' --> 'sizeof(foo)', add check in style checking script.

This commit is contained in:
Campbell Barton
2013-02-21 17:18:27 +00:00
parent c84e4da7dd
commit 091d86b9cb
5 changed files with 15 additions and 15 deletions

View File

@@ -39,7 +39,7 @@ GHOST_DisplayManagerSDL::GHOST_DisplayManagerSDL(GHOST_SystemSDL *system)
GHOST_DisplayManager(),
m_system(system)
{
memset(&m_mode, 0, sizeof m_mode);
memset(&m_mode, 0, sizeof(m_mode));
}
GHOST_TSuccess

View File

@@ -167,7 +167,7 @@ HeapNode *BLI_heap_insert(Heap *heap, float value, void *ptr)
heap->freenodes = (HeapNode *)(((HeapNode *)heap->freenodes)->ptr);
}
else {
node = (HeapNode *)BLI_memarena_alloc(heap->arena, sizeof *node);
node = (HeapNode *)BLI_memarena_alloc(heap->arena, sizeof(*node));
}
node->value = value;

View File

@@ -5035,7 +5035,7 @@ static void project_state_init(bContext *C, Object *ob, ProjPaintState *ps)
ps->is_texbrush = false;
}
/* sizeof ProjPixel, since we alloc this a _lot_ */
/* sizeof(ProjPixel), since we alloc this a _lot_ */
ps->pixel_sizeof = project_paint_pixel_sizeof(ps->tool);
BLI_assert(ps->pixel_sizeof >= sizeof(ProjPixel));

View File

@@ -709,7 +709,7 @@ static void p_face_restore_uvs(PFace *f)
static PVert *p_vert_add(PHandle *handle, PHashKey key, const float co[3], PEdge *e)
{
PVert *v = (PVert *)BLI_memarena_alloc(handle->arena, sizeof *v);
PVert *v = (PVert *)BLI_memarena_alloc(handle->arena, sizeof(*v));
copy_v3_v3(v->co, co);
v->u.key = key;
v->edge = e;
@@ -732,7 +732,7 @@ static PVert *p_vert_lookup(PHandle *handle, PHashKey key, const float co[3], PE
static PVert *p_vert_copy(PChart *chart, PVert *v)
{
PVert *nv = (PVert *)BLI_memarena_alloc(chart->handle->arena, sizeof *nv);
PVert *nv = (PVert *)BLI_memarena_alloc(chart->handle->arena, sizeof(*nv));
copy_v3_v3(nv->co, v->co);
nv->uv[0] = v->uv[0];
@@ -786,7 +786,7 @@ static int p_face_exists(ParamHandle *phandle, ParamKey *pvkeys, int i1, int i2,
static PChart *p_chart_new(PHandle *handle)
{
PChart *chart = (PChart *)MEM_callocN(sizeof *chart, "PChart");
PChart *chart = (PChart *)MEM_callocN(sizeof(*chart), "PChart");
chart->handle = handle;
return chart;
@@ -904,7 +904,7 @@ static PBool p_edge_connect_pair(PHandle *handle, PEdge *e, PEdge ***stack, PBoo
static int p_connect_pairs(PHandle *handle, PBool impl)
{
PEdge **stackbase = MEM_mallocN(sizeof *stackbase * phash_size(handle->hash_faces), "Pstackbase");
PEdge **stackbase = MEM_mallocN(sizeof(*stackbase) * phash_size(handle->hash_faces), "Pstackbase");
PEdge **stack = stackbase;
PFace *f, *first;
PEdge *e, *e1, *e2;
@@ -999,7 +999,7 @@ static void p_split_vert(PChart *chart, PEdge *e)
static PChart **p_split_charts(PHandle *handle, PChart *chart, int ncharts)
{
PChart **charts = MEM_mallocN(sizeof *charts * ncharts, "PCharts"), *nchart;
PChart **charts = MEM_mallocN(sizeof(*charts) * ncharts, "PCharts"), *nchart;
PFace *f, *nextf;
int i;
@@ -1041,12 +1041,12 @@ static PFace *p_face_add(PHandle *handle)
PEdge *e1, *e2, *e3;
/* allocate */
f = (PFace *)BLI_memarena_alloc(handle->arena, sizeof *f);
f = (PFace *)BLI_memarena_alloc(handle->arena, sizeof(*f));
f->flag = 0; /* init ! */
e1 = (PEdge *)BLI_memarena_alloc(handle->arena, sizeof *e1);
e2 = (PEdge *)BLI_memarena_alloc(handle->arena, sizeof *e2);
e3 = (PEdge *)BLI_memarena_alloc(handle->arena, sizeof *e3);
e1 = (PEdge *)BLI_memarena_alloc(handle->arena, sizeof(*e1));
e2 = (PEdge *)BLI_memarena_alloc(handle->arena, sizeof(*e2));
e3 = (PEdge *)BLI_memarena_alloc(handle->arena, sizeof(*e3));
/* set up edges */
f->edge = e1;
@@ -3674,7 +3674,7 @@ static PBool p_triangle_inside(SmoothTriangle *t, float co[2])
static SmoothNode *p_node_new(MemArena *arena, SmoothTriangle **tri, int ntri, float *bmin, float *bmax, int depth)
{
SmoothNode *node = BLI_memarena_alloc(arena, sizeof *node);
SmoothNode *node = BLI_memarena_alloc(arena, sizeof(*node));
int axis, i, t1size = 0, t2size = 0;
float split, /* mi, */ /* UNUSED */ mx;
SmoothTriangle **t1, **t2, *t;
@@ -4114,7 +4114,7 @@ static void p_smooth(PChart *chart)
ParamHandle *param_construct_begin(void)
{
PHandle *handle = MEM_callocN(sizeof *handle, "PHandle");
PHandle *handle = MEM_callocN(sizeof(*handle), "PHandle");
handle->construction_chart = p_chart_new(handle);
handle->state = PHANDLE_STATE_ALLOCATED;
handle->arena = BLI_memarena_new((1 << 16), "param construct arena");

View File

@@ -1308,7 +1308,7 @@ static void reg_node(int ID, int category, const char *enum_name, const char *st
static void init(void)
{
memset(nodes, 0, sizeof nodes);
memset(nodes, 0, sizeof(nodes));
#define DefNode(Category, ID, DefFunc, EnumName, StructName, UIName, UIDesc) \
reg_node(ID, Category_##Category, EnumName, STRINGIFY_ARG(Category##StructName), #Category, UIName, UIDesc);