diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-02-13 13:52:18 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-02-13 13:52:18 +0300 |
commit | 0955c664aa7c5fc5f0bd345c58219c40f04ab9c1 (patch) | |
tree | 20b6a2ab2e1130d75d119eba09f3b195a33a9434 /source/blender/blenlib/intern/listbase.c | |
parent | f3bd89b1b7a86778ff4c633a6b4115309a1b3c7e (diff) |
fix for warnings from Sparse static source code checker, mostly BKE/BLI and python functions.
- use NULL rather then 0 where possible (makes code & function calls more readable IMHO).
- set static variables and functions (exposed some unused vars/funcs).
- use func(void) rather then func() for definitions.
Diffstat (limited to 'source/blender/blenlib/intern/listbase.c')
-rw-r--r-- | source/blender/blenlib/intern/listbase.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/source/blender/blenlib/intern/listbase.c b/source/blender/blenlib/intern/listbase.c index b8b0b5b6eda..975479a3875 100644 --- a/source/blender/blenlib/intern/listbase.c +++ b/source/blender/blenlib/intern/listbase.c @@ -48,9 +48,9 @@ /* Ripped this from blender.c */ void BLI_movelisttolist(ListBase *dst, ListBase *src) { - if (src->first==0) return; + if (src->first==NULL) return; - if (dst->first==0) { + if (dst->first==NULL) { dst->first= src->first; dst->last= src->last; } @@ -59,7 +59,7 @@ void BLI_movelisttolist(ListBase *dst, ListBase *src) ((Link *)src->first)->prev= dst->last; dst->last= src->last; } - src->first= src->last= 0; + src->first= src->last= NULL; } void BLI_addhead(ListBase *listbase, void *vlink) @@ -89,7 +89,7 @@ void BLI_addtail(ListBase *listbase, void *vlink) link->prev = listbase->last; if (listbase->last) ((Link *)listbase->last)->next = link; - if (listbase->first == 0) listbase->first = link; + if (listbase->first == NULL) listbase->first = link; listbase->last = link; } @@ -152,7 +152,7 @@ void BLI_insertlink(ListBase *listbase, void *vprevlink, void *vnewlink) /* insert before first element */ if (prevlink == NULL) { newlink->next= listbase->first; - newlink->prev= 0; + newlink->prev= NULL; newlink->next->prev= newlink; listbase->first= newlink; return; @@ -251,7 +251,7 @@ void BLI_insertlinkbefore(ListBase *listbase, void *vnextlink, void *vnewlink) /* insert at end of list */ if (nextlink == NULL) { newlink->prev= listbase->last; - newlink->next= 0; + newlink->next= NULL; ((Link *)listbase->last)->next= newlink; listbase->last= newlink; return; @@ -422,7 +422,7 @@ void BLI_duplicatelist(ListBase *dst, const ListBase *src) /* in this order, to ensure it works if dst == src */ src_link= src->first; - dst->first= dst->last= 0; + dst->first= dst->last= NULL; while(src_link) { dst_link= MEM_dupallocN(src_link); |