rd_field_new_frm_string(t_rd_type t, char *s)
{
t_rdata_field *new;
- new = malloc(1 * sizeof t_rdata_field ) ;
+ MALLOC(new, t_rdata_field);
if (!new)
return NULL;
rd_count = rr_rd_count(rr);
/* grow the array */
- rr->rdata_fields = xrealloc(rr->rdata_fields,
- (rd_count + 1) * sizeof(t_rdata_field *));
+ XREALLOC(rr->rdata_fields, t_rdata_field, (rd_count + 1));
/* add the new member */
rr->rdata_fields[rd_count] = f;
* Memory management macro's
*/
#define MALLOC(ptr, type) \
- XMALLOC((ptr), (type), 1)
+ XMALLOC((ptr), type, 1)
#define XMALLOC(ptr, type, count) \
- (ptr) = ((type) *) malloc((count) * sizeof(type))
+ (ptr) = (type *) malloc((count) * sizeof(type))
#define REALLOC(ptr, type) \
- XREALLOC((ptr), (type), 1)
+ XREALLOC((ptr), type, 1)
#define XREALLOC(ptr, type, count) \
- (ptr) == ((type) *) realloc((count) * sizeof(type))
+ (ptr) == (type *) realloc((ptr), (count) * sizeof(type))
#define FREE(ptr) \
- do { free(ptr); (ptr) = NULL; } while (0)
+ do { free((ptr)); (ptr) = NULL; } while (0)
#define DEP printf("DEPRICATED FUNCTION!\n");