Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-06-08 09:46:00 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-06-08 09:46:00 +0400
commita6f3e15d6ec95e9649c08f50b41385ea293275e2 (patch)
tree88046e5b15d4f28a18236c99378e1361c8368f57
parent36db2a2cff58d3bd3dd0f7e8e0d2fbec36e32412 (diff)
- remove redundant NULL checks from mallocn's local linked list functions.
- minor changes to warning cleanup.
-rw-r--r--intern/guardedalloc/intern/mallocn.c12
-rw-r--r--intern/raskter/raskter.c8
-rw-r--r--source/blender/editors/mask/mask_add.c3
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);
}