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>2011-12-17 04:52:36 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-12-17 04:52:36 +0400
commitad96dacbc5a7cc61ccf74405927847f243a955b5 (patch)
treea2b78d3b502b99a1c7e59e8400dfd0807a896125 /source/blender/blenlib/intern/BLI_linklist.c
parent9276fb479ed1c5b472c5d831f52913157efe9288 (diff)
style edit only - move parenthesis onto second line of function definition (in keeping with most of blenders code)
also split some long lines in own code.
Diffstat (limited to 'source/blender/blenlib/intern/BLI_linklist.c')
-rw-r--r--source/blender/blenlib/intern/BLI_linklist.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/source/blender/blenlib/intern/BLI_linklist.c b/source/blender/blenlib/intern/BLI_linklist.c
index a9b8cbb6467..6300817ec03 100644
--- a/source/blender/blenlib/intern/BLI_linklist.c
+++ b/source/blender/blenlib/intern/BLI_linklist.c
@@ -35,7 +35,8 @@
#include "BLI_linklist.h"
#include "BLI_memarena.h"
-int BLI_linklist_length(LinkNode *list) {
+int BLI_linklist_length(LinkNode *list)
+{
if (0) {
return list?(1+BLI_linklist_length(list->next)):0;
} else {
@@ -70,7 +71,8 @@ LinkNode *BLI_linklist_find(LinkNode *list, int index)
return NULL;
}
-void BLI_linklist_reverse(LinkNode **listp) {
+void BLI_linklist_reverse(LinkNode **listp)
+{
LinkNode *rhead= NULL, *cur= *listp;
while (cur) {
@@ -85,7 +87,8 @@ void BLI_linklist_reverse(LinkNode **listp) {
*listp= rhead;
}
-void BLI_linklist_prepend(LinkNode **listp, void *ptr) {
+void BLI_linklist_prepend(LinkNode **listp, void *ptr)
+{
LinkNode *nlink= MEM_mallocN(sizeof(*nlink), "nlink");
nlink->link= ptr;
@@ -93,7 +96,8 @@ void BLI_linklist_prepend(LinkNode **listp, void *ptr) {
*listp= nlink;
}
-void BLI_linklist_append(LinkNode **listp, void *ptr) {
+void BLI_linklist_append(LinkNode **listp, void *ptr)
+{
LinkNode *nlink= MEM_mallocN(sizeof(*nlink), "nlink");
LinkNode *node = *listp;
@@ -110,7 +114,8 @@ void BLI_linklist_append(LinkNode **listp, void *ptr) {
}
}
-void BLI_linklist_prepend_arena(LinkNode **listp, void *ptr, MemArena *ma) {
+void BLI_linklist_prepend_arena(LinkNode **listp, void *ptr, MemArena *ma)
+{
LinkNode *nlink= BLI_memarena_alloc(ma, sizeof(*nlink));
nlink->link= ptr;
@@ -118,7 +123,8 @@ void BLI_linklist_prepend_arena(LinkNode **listp, void *ptr, MemArena *ma) {
*listp= nlink;
}
-void BLI_linklist_insert_after(LinkNode **listp, void *ptr) {
+void BLI_linklist_insert_after(LinkNode **listp, void *ptr)
+{
LinkNode *nlink= MEM_mallocN(sizeof(*nlink), "nlink");
LinkNode *node = *listp;
@@ -134,7 +140,8 @@ void BLI_linklist_insert_after(LinkNode **listp, void *ptr) {
}
}
-void BLI_linklist_free(LinkNode *list, LinkNodeFreeFP freefunc) {
+void BLI_linklist_free(LinkNode *list, LinkNodeFreeFP freefunc)
+{
while (list) {
LinkNode *next= list->next;
@@ -146,7 +153,8 @@ void BLI_linklist_free(LinkNode *list, LinkNodeFreeFP freefunc) {
}
}
-void BLI_linklist_apply(LinkNode *list, LinkNodeApplyFP applyfunc, void *userdata) {
+void BLI_linklist_apply(LinkNode *list, LinkNodeApplyFP applyfunc, void *userdata)
+{
for (; list; list= list->next)
applyfunc(list->link, userdata);
}