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-05-12 19:02:10 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-05-12 19:02:10 +0400
commit2f2b15bbb2a30ee312d65c627d54a12445f4b987 (patch)
tree7d2d442d5351a04887bbe4aac0f039c3f1d416cd /source/blender/blenlib/intern/BLI_linklist.c
parent23c0d49a7c6aacde784843b14d5b3eece7fe61df (diff)
style cleanup: whitespace, bli & makesdna
Diffstat (limited to 'source/blender/blenlib/intern/BLI_linklist.c')
-rw-r--r--source/blender/blenlib/intern/BLI_linklist.c46
1 files changed, 23 insertions, 23 deletions
diff --git a/source/blender/blenlib/intern/BLI_linklist.c b/source/blender/blenlib/intern/BLI_linklist.c
index 5c7d7089825..0e630efc349 100644
--- a/source/blender/blenlib/intern/BLI_linklist.c
+++ b/source/blender/blenlib/intern/BLI_linklist.c
@@ -38,12 +38,12 @@
int BLI_linklist_length(LinkNode *list)
{
if (0) {
- return list?(1+BLI_linklist_length(list->next)):0;
+ return list ? (1 + BLI_linklist_length(list->next)) : 0;
}
else {
int len;
- for (len=0; list; list= list->next)
+ for (len = 0; list; list = list->next)
len++;
return len;
@@ -54,7 +54,7 @@ int BLI_linklist_index(LinkNode *list, void *ptr)
{
int index;
- for (index = 0; list; list= list->next, index++)
+ for (index = 0; list; list = list->next, index++)
if (list->link == ptr)
return index;
@@ -65,7 +65,7 @@ LinkNode *BLI_linklist_find(LinkNode *list, int index)
{
int i;
- for (i = 0; list; list= list->next, i++)
+ for (i = 0; list; list = list->next, i++)
if (i == index)
return list;
@@ -74,32 +74,32 @@ LinkNode *BLI_linklist_find(LinkNode *list, int index)
void BLI_linklist_reverse(LinkNode **listp)
{
- LinkNode *rhead= NULL, *cur= *listp;
+ LinkNode *rhead = NULL, *cur = *listp;
while (cur) {
- LinkNode *next= cur->next;
+ LinkNode *next = cur->next;
- cur->next= rhead;
- rhead= cur;
+ cur->next = rhead;
+ rhead = cur;
- cur= next;
+ cur = next;
}
- *listp= rhead;
+ *listp = rhead;
}
void BLI_linklist_prepend(LinkNode **listp, void *ptr)
{
- LinkNode *nlink= MEM_mallocN(sizeof(*nlink), "nlink");
- nlink->link= ptr;
+ LinkNode *nlink = MEM_mallocN(sizeof(*nlink), "nlink");
+ nlink->link = ptr;
- nlink->next= *listp;
- *listp= nlink;
+ nlink->next = *listp;
+ *listp = nlink;
}
void BLI_linklist_append(LinkNode **listp, void *ptr)
{
- LinkNode *nlink= MEM_mallocN(sizeof(*nlink), "nlink");
+ LinkNode *nlink = MEM_mallocN(sizeof(*nlink), "nlink");
LinkNode *node = *listp;
nlink->link = ptr;
@@ -118,16 +118,16 @@ void BLI_linklist_append(LinkNode **listp, void *ptr)
void BLI_linklist_prepend_arena(LinkNode **listp, void *ptr, MemArena *ma)
{
- LinkNode *nlink= BLI_memarena_alloc(ma, sizeof(*nlink));
- nlink->link= ptr;
+ LinkNode *nlink = BLI_memarena_alloc(ma, sizeof(*nlink));
+ nlink->link = ptr;
- nlink->next= *listp;
- *listp= nlink;
+ nlink->next = *listp;
+ *listp = nlink;
}
void BLI_linklist_insert_after(LinkNode **listp, void *ptr)
{
- LinkNode *nlink= MEM_mallocN(sizeof(*nlink), "nlink");
+ LinkNode *nlink = MEM_mallocN(sizeof(*nlink), "nlink");
LinkNode *node = *listp;
nlink->link = ptr;
@@ -145,18 +145,18 @@ void BLI_linklist_insert_after(LinkNode **listp, void *ptr)
void BLI_linklist_free(LinkNode *list, LinkNodeFreeFP freefunc)
{
while (list) {
- LinkNode *next= list->next;
+ LinkNode *next = list->next;
if (freefunc)
freefunc(list->link);
MEM_freeN(list);
- list= next;
+ list = next;
}
}
void BLI_linklist_apply(LinkNode *list, LinkNodeApplyFP applyfunc, void *userdata)
{
- for (; list; list= list->next)
+ for (; list; list = list->next)
applyfunc(list->link, userdata);
}