comparison src/dmlib.c @ 1451:4f82e7cda289

Cleanups.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 10 May 2018 15:54:18 +0300
parents 132706e3b94b
children 3a1f4e810874
comparison
equal deleted inserted replaced
1450:61a486e25dc7 1451:4f82e7cda289
78 } 78 }
79 79
80 80
81 /* Memory handling routines 81 /* Memory handling routines
82 */ 82 */
83 void *dmMalloc(size_t l) 83 void *dmMalloc(size_t len)
84 { 84 {
85 return malloc(l); 85 return malloc(len);
86 } 86 }
87 87
88 88
89 void *dmMalloc0(size_t l) 89 void *dmMalloc0(size_t len)
90 { 90 {
91 return calloc(1, l); 91 return calloc(1, len);
92 } 92 }
93 93
94 94
95 void *dmCalloc(size_t n, size_t l) 95 void *dmCalloc(size_t n, size_t len)
96 { 96 {
97 return calloc(n, l); 97 return calloc(n, len);
98 } 98 }
99 99
100 100
101 void *dmRealloc(void *p, size_t l) 101 void *dmRealloc(void *ptr, size_t len)
102 { 102 {
103 return realloc(p, l); 103 return realloc(ptr, len);
104 } 104 }
105 105
106 106
107 void dmFree(void *p) 107 void dmFree(void *ptr)
108 { 108 {
109 /* Check for NULL pointers for portability due to some libc 109 /* Check for NULL pointers for portability due to some libc
110 * implementations not handling free(NULL) too well. 110 * implementations not handling free(NULL) too well.
111 */ 111 */
112 if (p) free(p); 112 if (ptr) free(ptr);
113 } 113 }
114 114
115 115
116 #ifndef DM_HAVE_MEMSET 116 #ifndef DM_HAVE_MEMSET
117 void * dmMemset(void *ptr, const int c, size_t n) 117 void * dmMemset(void *ptr, const int c, size_t n)