From a6f3e15d6ec95e9649c08f50b41385ea293275e2 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 8 Jun 2012 05:46:00 +0000 Subject: - remove redundant NULL checks from mallocn's local linked list functions. - minor changes to warning cleanup. --- intern/guardedalloc/intern/mallocn.c | 12 +++++++++++- intern/raskter/raskter.c | 8 ++++---- source/blender/editors/mask/mask_add.c | 3 ++- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/intern/guardedalloc/intern/mallocn.c b/intern/guardedalloc/intern/mallocn.c index cad0e549060..4a30388c047 100644 --- a/intern/guardedalloc/intern/mallocn.c +++ b/intern/guardedalloc/intern/mallocn.c @@ -290,7 +290,9 @@ static void make_memhead_header(MemHead *memh, size_t len, const char *str) memt->tag3 = MEMTAG3; addtail(membase, &memh->next); - if (memh->next) memh->nextname = MEMNEXT(memh->next)->name; + if (memh->next) { + memh->nextname = MEMNEXT(memh->next)->name; + } totblock++; mem_in_use += len; @@ -681,8 +683,12 @@ static void addtail(volatile localListBase *listbase, void *vlink) { struct localLink *link = vlink; + /* for a generic API general error checks here is fine but + * the use here they will never be NULL */ +#if 0 if (link == NULL) return; if (listbase == NULL) return; +#endif link->next = NULL; link->prev = listbase->last; @@ -696,8 +702,12 @@ static void remlink(volatile localListBase *listbase, void *vlink) { struct localLink *link = vlink; + /* for a generic API general error checks here is fine but + * the use here they will never be NULL */ +#if 0 if (link == NULL) return; if (listbase == NULL) return; +#endif if (link->next) link->next->prev = link->prev; if (link->prev) link->prev->next = link->next; diff --git a/intern/raskter/raskter.c b/intern/raskter/raskter.c index 26fec52dc80..9bf1779a608 100644 --- a/intern/raskter/raskter.c +++ b/intern/raskter/raskter.c @@ -170,7 +170,7 @@ static void preprocess_all_edges(struct r_fill_context *ctx, struct poly_vert *v * for speed, but waiting on final design choices for curve-data before eliminating data the DEM code will need * if it ends up being coupled with this function. */ -int rast_scan_fill(struct r_fill_context *ctx, struct poly_vert *verts, int num_verts) +static int rast_scan_fill(struct r_fill_context *ctx, struct poly_vert *verts, int num_verts) { int x_curr; /* current pixel position in X */ int y_curr; /* current scan line being drawn */ @@ -426,9 +426,9 @@ int PLX_raskterize(float (*base_verts)[2], int num_base_verts, * for speed, but waiting on final design choices for curve-data before eliminating data the DEM code will need * if it ends up being coupled with this function. */ -int rast_scan_feather(struct r_fill_context *ctx, - float (*base_verts_f)[2], int num_base_verts, - struct poly_vert *feather_verts, float (*feather_verts_f)[2], int num_feather_verts) +static int rast_scan_feather(struct r_fill_context *ctx, + float (*base_verts_f)[2], int num_base_verts, + struct poly_vert *feather_verts, float (*feather_verts_f)[2], int num_feather_verts) { int x_curr; /* current pixel position in X */ int y_curr; /* current scan line being drawn */ diff --git a/source/blender/editors/mask/mask_add.c b/source/blender/editors/mask/mask_add.c index a8363524dd7..0bc9adb6577 100644 --- a/source/blender/editors/mask/mask_add.c +++ b/source/blender/editors/mask/mask_add.c @@ -411,7 +411,7 @@ static int add_vertex_extrude(bContext *C, Mask *mask, MaskLayer *masklay, const float tangent_co[2]; int do_cyclic_correct = FALSE; int do_recalc_src = FALSE; /* when extruding from endpoints only */ - int do_prev = FALSE; /* use prev point rather then next?? */ + int do_prev; /* use prev point rather then next?? */ if (!masklay) { return FALSE; @@ -448,6 +448,7 @@ static int add_vertex_extrude(bContext *C, Mask *mask, MaskLayer *masklay, const do_recalc_src = TRUE; } else { + do_prev = FALSE; /* quiet warning */ /* should never get here */ BLI_assert(0); } -- cgit v1.2.3