comparison lwar/util.c @ 2:7317fbe024af

Clean up insane number of compiler warnings under -Wall
author lost@l-w.ca
date Thu, 20 Jan 2011 22:39:46 -0700
parents 2c24602be78f
children
comparison
equal deleted inserted replaced
1:96c4dc89016e 2:7317fbe024af
50 void *ptr; 50 void *ptr;
51 51
52 if (size == 0) 52 if (size == 0)
53 { 53 {
54 lw_free(optr); 54 lw_free(optr);
55 return; 55 return NULL;
56 } 56 }
57 57
58 ptr = realloc(optr, size); 58 ptr = realloc(optr, size);
59 if (!ptr) 59 if (!ptr)
60 { 60 {
61 fprintf(stderr, "lw_realloc(): memory allocation error\n"); 61 fprintf(stderr, "lw_realloc(): memory allocation error\n");
62 exit(1); 62 exit(1);
63 } 63 }
64 return ptr;
64 } 65 }
65 66
66 void lw_free(void *ptr) 67 void lw_free(void *ptr)
67 { 68 {
68 if (ptr) 69 if (ptr)