From: Miek Gieben Date: Mon, 13 Dec 2004 12:53:30 +0000 (+0000) Subject: compiles - but warnings are still there X-Git-Tag: release-0.50~711 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3d80751bf9260adb89bcac067113915d80737477;p=thirdparty%2Fldns.git compiles - but warnings are still there --- diff --git a/packet.c b/packet.c index 3b246215..3de393ea 100644 --- a/packet.c +++ b/packet.c @@ -205,7 +205,7 @@ dns_packet_new() if (!packet) return NULL; - MALLOC(packet_header, t_header); + MALLOC(packet->header, t_header); if (!packet->header) return NULL; diff --git a/rdata.c b/rdata.c index c893075c..cb4a8877 100644 --- a/rdata.c +++ b/rdata.c @@ -90,7 +90,7 @@ t_rdata_field * 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; diff --git a/rr.c b/rr.c index ccf36864..7a8865c8 100644 --- a/rr.c +++ b/rr.c @@ -81,8 +81,7 @@ rr_push_rd_field(t_rr *rr, t_rdata_field *f) 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; diff --git a/util.h b/util.h index deaa3990..7b942eb9 100644 --- a/util.h +++ b/util.h @@ -18,19 +18,19 @@ * 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");