diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-06-08 09:46:00 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-06-08 09:46:00 +0400 |
commit | a6f3e15d6ec95e9649c08f50b41385ea293275e2 (patch) | |
tree | 88046e5b15d4f28a18236c99378e1361c8368f57 /intern | |
parent | 36db2a2cff58d3bd3dd0f7e8e0d2fbec36e32412 (diff) |
- remove redundant NULL checks from mallocn's local linked list functions.
- minor changes to warning cleanup.
Diffstat (limited to 'intern')
-rw-r--r-- | intern/guardedalloc/intern/mallocn.c | 12 | ||||
-rw-r--r-- | intern/raskter/raskter.c | 8 |
2 files changed, 15 insertions, 5 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 */ |