X-Git-Url: http://git.silcnet.org/gitweb/?a=blobdiff_plain;f=lib%2Fsilcutil%2Fsilcstack.c;h=0e4b67de83c38cfabf51c4fd698319e134fe2c57;hb=40f8443d8d3a6577336ee66d18e04d9ac4d956bb;hp=30565e1fb4a759b87869d9d7afd1847379483508;hpb=0f0340b9fbce9704cc7171f8f0104ce9103d2de6;p=silc.git diff --git a/lib/silcutil/silcstack.c b/lib/silcutil/silcstack.c index 30565e1f..0e4b67de 100644 --- a/lib/silcutil/silcstack.c +++ b/lib/silcutil/silcstack.c @@ -19,7 +19,7 @@ /* #define SILC_STACK_DEBUG 1 */ -#include "silcincludes.h" +#include "silc.h" /* Allocate the stack */ @@ -145,7 +145,7 @@ SilcUInt32 silc_stack_pop(SilcStack stack) memory, otherwise memory is aligned. Returns pointer to the memory or NULL on error. */ -void *silc_stack_malloc(SilcStack stack, SilcUInt32 size, bool aligned) +void *silc_stack_malloc(SilcStack stack, SilcUInt32 size, SilcBool aligned) { void *ptr; SilcUInt32 bsize, bsize2; @@ -231,7 +231,7 @@ void *silc_stack_malloc(SilcStack stack, SilcUInt32 size, bool aligned) the old memory remains intact. */ void *silc_stack_realloc(SilcStack stack, SilcUInt32 old_size, - void *ptr, SilcUInt32 size, bool aligned) + void *ptr, SilcUInt32 size, SilcBool aligned) { SilcUInt32 si = stack->frame->si; SilcUInt32 bsize; @@ -258,7 +258,8 @@ void *silc_stack_realloc(SilcStack stack, SilcUInt32 old_size, /* Align the old size if needed */ old_size = (aligned ? - SILC_STACK_ALIGN(old_size, SILC_STACK_DEFAULT_ALIGN) : old_size); + SILC_STACK_ALIGN(old_size, + SILC_STACK_DEFAULT_ALIGN) : old_size); /* Compute the size of current stack block */ bsize = SILC_STACK_BLOCK_SIZE(stack, si); @@ -275,7 +276,8 @@ void *silc_stack_realloc(SilcStack stack, SilcUInt32 old_size, /* Now check that the new size fits to this block */ if (stack->stack[si]->bytes_left >= size) { /* It fits, so simply return the old pointer */ - size = (aligned ? SILC_STACK_ALIGN(size, SILC_STACK_DEFAULT_ALIGN) : size); + size = (aligned ? SILC_STACK_ALIGN(size, + SILC_STACK_DEFAULT_ALIGN) : size); stack->stack[si]->bytes_left -= (size - old_size); SILC_STACK_STAT(stack, bytes_malloc, (size - old_size)); return ptr;