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-08-06 12:01:20 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-08-06 12:01:20 +0400
commit00ea79afa0cc50d6aff8b5323739cd8053aa8578 (patch)
tree3fee8e631aba70bc187e6798f9665db062ade1c7 /source/blender/blenlib/intern/stack.c
parent583fa7d1eaa5e13eb9d86b0fd198b0af2b6b2023 (diff)
fix for building in debug mode.
Diffstat (limited to 'source/blender/blenlib/intern/stack.c')
-rw-r--r--source/blender/blenlib/intern/stack.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/source/blender/blenlib/intern/stack.c b/source/blender/blenlib/intern/stack.c
index 84af6d29c5a..1d5bdbfdab6 100644
--- a/source/blender/blenlib/intern/stack.c
+++ b/source/blender/blenlib/intern/stack.c
@@ -21,10 +21,17 @@
*
*/
-#include "BLI_stack.h"
+/** \file blender/blenlib/intern/stack.c
+ * \ingroup bli
+ */
+
+#include <string.h>
+#include <stdlib.h> /* abort() */
+
+#include "BLI_stack.h" /* own include */
+
#include "BLI_utildefines.h"
#include "MEM_guardedalloc.h"
-#include <string.h>
typedef struct BLI_Stack {
void *data;
@@ -55,7 +62,7 @@ void BLI_stack_free(BLI_Stack *stack)
/* Gets the last element in the stack */
#define STACK_LAST_ELEM(stack__) \
- (((char*)(stack__)->data) + \
+ (((char *)(stack__)->data) + \
((stack__)->elem_size * ((stack__)->totelem - 1)))
void BLI_stack_push(BLI_Stack *stack, void *src)
@@ -67,7 +74,7 @@ void BLI_stack_push(BLI_Stack *stack, void *src)
* number of elements */
stack->maxelem = 32;
stack->data = MEM_mallocN((stack->elem_size *
- stack->maxelem), AT);
+ stack->maxelem), AT);
}
else {
/* Double stack size */
@@ -75,8 +82,8 @@ void BLI_stack_push(BLI_Stack *stack, void *src)
/* Check for overflow */
BLI_assert(maxelem > stack->maxelem);
stack->data = MEM_reallocN(stack->data,
- (stack->elem_size *
- maxelem));
+ (stack->elem_size *
+ maxelem));
stack->maxelem = maxelem;
}
}