code cleanup: more zero as NULL pointers.

This commit is contained in:
Campbell Barton
2013-08-07 03:36:05 +00:00
parent c2ad963e28
commit f97a4bd254
12 changed files with 25 additions and 25 deletions

View File

@@ -149,11 +149,11 @@ void BLF_shadow_offset(int fontid, int x, int y);
/* Set the buffer, size and number of channels to draw, one thing to take care is call
* this function with NULL pointer when we finish, for example:
*
* BLF_buffer(my_fbuf, my_cbuf, 100, 100, 4, TRUE);
* BLF_buffer(my_fbuf, my_cbuf, 100, 100, 4, TRUE, NULL);
*
* ... set color, position and draw ...
*
* BLF_buffer(NULL, NULL, 0, 0, 0, FALSE);
* BLF_buffer(NULL, NULL, NULL, 0, 0, FALSE, NULL);
*/
void BLF_buffer(int fontid, float *fbuf, unsigned char *cbuf, int w, int h, int nch, struct ColorManagedDisplay *display);

View File

@@ -3290,7 +3290,7 @@ static int dynamicPaint_paintMesh(DynamicPaintSurface *surface,
if (!brush->dm) return 0;
{
BVHTreeFromMesh treeData = {0};
BVHTreeFromMesh treeData = {NULL};
float avg_brushNor[3] = {0.0f};
float brush_radius = brush->paint_distance * surface->radius_scale;
int numOfVerts;
@@ -4977,7 +4977,7 @@ static int dynamicPaint_doStep(Scene *scene, Object *ob, DynamicPaintSurface *su
/* make sure we're dealing with a brush */
if (pmd2->brush) {
DynamicPaintBrushSettings *brush = pmd2->brush;
BrushMaterials bMats = {0};
BrushMaterials bMats = {NULL};
/* calculate brush speed vectors if required */
if (surface->type == MOD_DPAINT_SURFACE_T_PAINT && brush->flags & MOD_DPAINT_DO_SMUDGE) {

View File

@@ -336,7 +336,7 @@ static void checker_board_text(unsigned char *rect, float *rect_float, int width
}
/* cleanup the buffer. */
BLF_buffer(mono, NULL, NULL, 0, 0, 0, FALSE);
BLF_buffer(mono, NULL, NULL, 0, 0, 0, NULL);
}
void BKE_image_buf_fill_checker_color(unsigned char *rect, float *rect_float, int width, int height)

View File

@@ -722,7 +722,7 @@ static void obstacles_from_derivedmesh(Object *coll_ob, SmokeDomainSettings *sds
DerivedMesh *dm = NULL;
MVert *mvert = NULL;
MFace *mface = NULL;
BVHTreeFromMesh treeData = {0};
BVHTreeFromMesh treeData = {NULL};
int numverts, i, z;
float surface_distance = 0.6;
@@ -1573,7 +1573,7 @@ static void emit_from_derivedmesh(Object *flow_ob, SmokeDomainSettings *sds, Smo
MVert *mvert_orig = NULL;
MFace *mface = NULL;
MTFace *tface = NULL;
BVHTreeFromMesh treeData = {0};
BVHTreeFromMesh treeData = {NULL};
int numOfVerts, i, z;
float flow_center[3] = {0};
@@ -2108,7 +2108,7 @@ static void update_flowsfluids(Scene *scene, Object *ob, SmokeDomainSettings *sd
// float scene_subframe = scene->r.subframe; // UNUSED
int subframe;
for (subframe = 0; subframe <= subframes; subframe++) {
EmissionMap em_temp = {0};
EmissionMap em_temp = {NULL};
float sample_size = 1.0f / (float)(subframes+1);
float prev_frame_pos = sample_size * (float)(subframe+1);
float sdt = dt * sample_size;

View File

@@ -654,7 +654,7 @@ void BKE_tracking_track_flag_clear(MovieTrackingTrack *track, int area, int flag
*/
int BKE_tracking_track_has_marker_at_frame(MovieTrackingTrack *track, int framenr)
{
return BKE_tracking_marker_get_exact(track, framenr) != 0;
return BKE_tracking_marker_get_exact(track, framenr) != NULL;
}
/* Check whether track has got enabled marker at specified frame.

View File

@@ -379,10 +379,10 @@ static ScanFillVertLink *addedgetoscanlist(ScanFillContext *sf_ctx, ScanFillEdge
sc = (ScanFillVertLink *)bsearch(&scsearch, sf_ctx->_scdata, len,
sizeof(ScanFillVertLink), vergscdata);
if (sc == 0) printf("Error in search edge: %p\n", (void *)eed);
if (sc == NULL) printf("Error in search edge: %p\n", (void *)eed);
else if (addedgetoscanvert(sc, eed) == 0) return sc;
return 0;
return NULL;
}
static short boundinsideEV(ScanFillEdge *eed, ScanFillVert *eve)
@@ -669,7 +669,7 @@ static int scanfill(ScanFillContext *sf_ctx, PolyFill *pf, const int flag)
a = verts;
break;
}
if (ed2 == 0) {
if (ed2 == NULL) {
sc->edge_first = sc->edge_last = NULL;
/* printf("just 1 edge to vert\n"); */
BLI_addtail(&sf_ctx->filledgebase, ed1);
@@ -1051,7 +1051,7 @@ int BLI_scanfill_calc_ex(ScanFillContext *sf_ctx, const int flag, const float no
eed = nexted;
}
}
if (sf_ctx->filledgebase.first == 0) {
if (sf_ctx->filledgebase.first == NULL) {
/* printf("All edges removed\n"); */
return 0;
}

View File

@@ -121,7 +121,7 @@ static VoronoiParabola *voronoiParabola_new(void)
parabola->is_leaf = FALSE;
parabola->event = NULL;
parabola->edge = NULL;
parabola->parent = 0;
parabola->parent = NULL;
return parabola;
}
@@ -134,7 +134,7 @@ static VoronoiParabola *voronoiParabola_newSite(float site[2])
parabola->is_leaf = TRUE;
parabola->event = NULL;
parabola->edge = NULL;
parabola->parent = 0;
parabola->parent = NULL;
return parabola;
}

View File

@@ -793,7 +793,7 @@ void draw_action_channel(View2D *v2d, AnimData *adt, bAction *act, float ypos)
{
DLRBT_Tree keys, blocks;
short locked = (act && act->id.lib != 0);
short locked = (act && act->id.lib != NULL);
BLI_dlrbTree_init(&keys);
BLI_dlrbTree_init(&blocks);
@@ -887,7 +887,7 @@ void scene_to_keylist(bDopeSheet *ads, Scene *sce, DLRBT_Tree *keys, DLRBT_Tree
bAnimListElem *ale;
int filter;
bAnimListElem dummychan = {0};
bAnimListElem dummychan = {NULL};
if (sce == NULL)
return;
@@ -920,8 +920,8 @@ void ob_to_keylist(bDopeSheet *ads, Object *ob, DLRBT_Tree *keys, DLRBT_Tree *bl
bAnimListElem *ale;
int filter;
bAnimListElem dummychan = {0};
Base dummybase = {0};
bAnimListElem dummychan = {NULL};
Base dummybase = {NULL};
if (ob == NULL)
return;

View File

@@ -815,7 +815,7 @@ static int pose_clear_user_transforms_exec(bContext *C, wmOperator *op)
* just pose values should change, so this should be fine
*/
bPose *dummyPose = NULL;
Object workob = {{0}};
Object workob = {{NULL}};
bPoseChannel *pchan;
/* execute animation step for current frame using a dummy copy of the pose */

View File

@@ -3364,7 +3364,7 @@ static int paint_weight_gradient_exec(bContext *C, wmOperator *op)
const bool is_interactive = (gesture != NULL);
DerivedMesh *dm = mesh_get_derived_final(scene, ob, scene->customdata_mask);
DMGradient_userData data = {0};
DMGradient_userData data = {NULL};
if (is_interactive) {
if (gesture->userdata == NULL) {

View File

@@ -519,8 +519,8 @@ static DerivedMesh *NewBooleanDerivedMesh_intern(
DerivedMesh *result = NULL;
if (dm == NULL || dm_select == NULL) return 0;
if (!dm->getNumTessFaces(dm) || !dm_select->getNumTessFaces(dm_select)) return 0;
if (dm == NULL || dm_select == NULL) return NULL;
if (!dm->getNumTessFaces(dm) || !dm_select->getNumTessFaces(dm_select)) return NULL;
/* we map the final object back into ob's local coordinate space. For this
* we need to compute the inverse transform from global to ob (inv_mat),

View File

@@ -368,8 +368,8 @@ ModifierTypeInfo modifierType_Warp = {
/* deformMatrices */ NULL,
/* deformVertsEM */ deformVertsEM,
/* deformMatricesEM */ NULL,
/* applyModifier */ 0,
/* applyModifierEM */ 0,
/* applyModifier */ NULL,
/* applyModifierEM */ NULL,
/* initData */ initData,
/* requiredDataMask */ requiredDataMask,
/* freeData */ freeData,