summaryrefslogtreecommitdiff
path: root/src/common/malloc.c
diff options
context:
space:
mode:
authorChuck Miller <shadowmil@gmail.com>2009-12-25 05:00:31 -0500
committerJared Adams <jaxad0127@gmail.com>2009-12-26 00:40:11 -0700
commit634aeeb9d58b01f9de6632a014a063ef0c4cf31e (patch)
tree70023dd2bcc12a3f96ec6f118d80e27411920531 /src/common/malloc.c
parent113fcc4f0a7a0921e94bc415515dd4b393a29d60 (diff)
downloadtmwa-634aeeb9d58b01f9de6632a014a063ef0c4cf31e.tar.gz
tmwa-634aeeb9d58b01f9de6632a014a063ef0c4cf31e.tar.bz2
tmwa-634aeeb9d58b01f9de6632a014a063ef0c4cf31e.tar.xz
tmwa-634aeeb9d58b01f9de6632a014a063ef0c4cf31e.zip
Used the "indent" C formatting program from GNU to do some clean ups
The command options used was: -nbad -bap -sc -bl -blf -bli0 -cli4 -cbi0 -di5 -nbc -bls -ip2 -nut -ts4 -bap -i4 -sob -npsl
Diffstat (limited to 'src/common/malloc.c')
-rw-r--r--src/common/malloc.c75
1 files changed, 42 insertions, 33 deletions
diff --git a/src/common/malloc.c b/src/common/malloc.c
index eda9bc2..3b302b7 100644
--- a/src/common/malloc.c
+++ b/src/common/malloc.c
@@ -2,43 +2,52 @@
#include <stdlib.h>
#include "malloc.h"
-void* aMalloc_( size_t size, const char *file, int line, const char *func )
+void *aMalloc_ (size_t size, const char *file, int line, const char *func)
{
- void *ret;
-
-// printf("%s:%d: in func %s: malloc %d\n",file,line,func,size);
- ret=malloc(size);
- if(ret==NULL){
- printf("%s:%d: in func %s: malloc error out of memory!\n",file,line,func);
- exit(1);
-
- }
- return ret;
+ void *ret;
+
+// printf("%s:%d: in func %s: malloc %d\n",file,line,func,size);
+ ret = malloc (size);
+ if (ret == NULL)
+ {
+ printf ("%s:%d: in func %s: malloc error out of memory!\n", file,
+ line, func);
+ exit (1);
+
+ }
+ return ret;
}
-void* aCalloc_( size_t num, size_t size, const char *file, int line, const char *func )
+
+void *aCalloc_ (size_t num, size_t size, const char *file, int line,
+ const char *func)
{
- void *ret;
-
-// printf("%s:%d: in func %s: calloc %d %d\n",file,line,func,num,size);
- ret=calloc(num,size);
- if(ret==NULL){
- printf("%s:%d: in func %s: calloc error out of memory!\n",file,line,func);
- exit(1);
-
- }
- return ret;
+ void *ret;
+
+// printf("%s:%d: in func %s: calloc %d %d\n",file,line,func,num,size);
+ ret = calloc (num, size);
+ if (ret == NULL)
+ {
+ printf ("%s:%d: in func %s: calloc error out of memory!\n", file,
+ line, func);
+ exit (1);
+
+ }
+ return ret;
}
-void* aRealloc_( void *p, size_t size, const char *file, int line, const char *func )
+void *aRealloc_ (void *p, size_t size, const char *file, int line,
+ const char *func)
{
- void *ret;
-
-// printf("%s:%d: in func %s: realloc %p %d\n",file,line,func,p,size);
- ret=realloc(p,size);
- if(ret==NULL){
- printf("%s:%d: in func %s: realloc error out of memory!\n",file,line,func);
- exit(1);
-
- }
- return ret;
+ void *ret;
+
+// printf("%s:%d: in func %s: realloc %p %d\n",file,line,func,p,size);
+ ret = realloc (p, size);
+ if (ret == NULL)
+ {
+ printf ("%s:%d: in func %s: realloc error out of memory!\n", file,
+ line, func);
+ exit (1);
+
+ }
+ return ret;
}