diff options
Diffstat (limited to 'intern/ghost/test/multitest/Util.c')
-rw-r--r-- | intern/ghost/test/multitest/Util.c | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/intern/ghost/test/multitest/Util.c b/intern/ghost/test/multitest/Util.c index dfef6e347b0..bacd0a313d4 100644 --- a/intern/ghost/test/multitest/Util.c +++ b/intern/ghost/test/multitest/Util.c @@ -35,28 +35,31 @@ #include "Util.h" -void* memdbl(void *mem, int *size_pr, int item_size) { - int cur_size= *size_pr; - int new_size= cur_size?(cur_size*2):1; - void *nmem= MEM_mallocN(new_size*item_size, "memdbl"); +void *memdbl(void *mem, int *size_pr, int item_size) +{ + int cur_size = *size_pr; + int new_size = cur_size ? (cur_size * 2) : 1; + void *nmem = MEM_mallocN(new_size * item_size, "memdbl"); - memcpy(nmem, mem, cur_size*item_size); + memcpy(nmem, mem, cur_size * item_size); MEM_freeN(mem); - *size_pr= new_size; + *size_pr = new_size; return nmem; } -char* string_dup(char *str) { - int len= strlen(str); - char *nstr= MEM_mallocN(len + 1, "string_dup"); +char *string_dup(char *str) +{ + int len = strlen(str); + char *nstr = MEM_mallocN(len + 1, "string_dup"); - memcpy(nstr, str, len+1); + memcpy(nstr, str, len + 1); return nstr; } -void fatal(char *fmt, ...) { +void fatal(char *fmt, ...) +{ va_list ap; fprintf(stderr, "FATAL: "); |