- remove redundant NULL checks from mallocn's local linked list functions.

- minor changes to warning cleanup.
This commit is contained in:
Campbell Barton 2012-06-08 05:46:00 +00:00
parent 36db2a2cff
commit a6f3e15d6e
3 changed files with 17 additions and 6 deletions

@ -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;

@ -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 */

@ -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);
}