Code Cleanup: remove redundant/misleading NULL checks

This commit is contained in:
Campbell Barton 2013-12-03 09:22:29 +11:00
parent 1cee3e53fc
commit 4fcd8b64da
5 changed files with 8 additions and 16 deletions

View File

@ -158,7 +158,7 @@ struct MaskLayerShape *BKE_mask_layer_shape_alloc(struct MaskLayer *masklay, con
void BKE_mask_layer_shape_free(struct MaskLayerShape *masklay_shape);
struct MaskLayerShape *BKE_mask_layer_shape_verify_frame(struct MaskLayer *masklay, const int frame);
struct MaskLayerShape *BKE_mask_layer_shape_duplicate(struct MaskLayerShape *masklay_shape);
bool BKE_mask_layer_shape_unlink(struct MaskLayer *masklay, struct MaskLayerShape *masklay_shape);
void BKE_mask_layer_shape_unlink(struct MaskLayer *masklay, struct MaskLayerShape *masklay_shape);
void BKE_mask_layer_shape_sort(struct MaskLayer *masklay);
bool BKE_mask_layer_shape_spline_from_index(struct MaskLayer *masklay, int index,

View File

@ -1179,8 +1179,7 @@ static void curve_calc_orcodm(Scene *scene, Object *ob, DerivedMesh *derivedFina
/* add an orco layer if needed */
add_orco_dm(ob, derivedFinal, orcodm);
if (orcodm)
orcodm->release(orcodm);
orcodm->release(orcodm);
}
void BKE_displist_make_surf(Scene *scene, Object *ob, ListBase *dispbase,

View File

@ -62,11 +62,7 @@ bool free_gpencil_strokes(bGPDframe *gpf)
{
bGPDstroke *gps, *gpsn;
bool changed = (gpf->strokes.first != NULL);
/* error checking */
if (gpf == NULL)
return false;
/* free strokes */
for (gps = gpf->strokes.first; gps; gps = gpsn) {
gpsn = gps->next;

View File

@ -1813,15 +1813,11 @@ MaskLayerShape *BKE_mask_layer_shape_duplicate(MaskLayerShape *masklay_shape)
return masklay_shape_copy;
}
bool BKE_mask_layer_shape_unlink(MaskLayer *masklay, MaskLayerShape *masklay_shape)
void BKE_mask_layer_shape_unlink(MaskLayer *masklay, MaskLayerShape *masklay_shape)
{
bool changed = (masklay_shape != NULL);
BLI_remlink(&masklay->splines_shapes, masklay_shape);
BKE_mask_layer_shape_free(masklay_shape);
return changed;
}
static int mask_layer_shape_sort_cb(void *masklay_shape_a_ptr, void *masklay_shape_b_ptr)

View File

@ -2366,12 +2366,13 @@ static void wpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P
else totindex = 0;
}
if (use_face_sel && me->mpoly) {
if (use_face_sel && me->totpoly) {
MPoly *mpoly = me->mpoly;
for (index = 0; index < totindex; index++) {
if (indexar[index] && indexar[index] <= me->totpoly) {
MPoly *mpoly = ((MPoly *)me->mpoly) + (indexar[index] - 1);
MPoly *mp = &mpoly[indexar[index] - 1];
if ((mpoly->flag & ME_FACE_SEL) == 0) {
if ((mp->flag & ME_FACE_SEL) == 0) {
indexar[index] = 0;
}
}