Committer: Diego Biurrun <diego@xxxxxxxxxx> Date: 15/04/2010 at 19:57:31 Revision: 4288 Revision-id: diego@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Branch nick: trunk Log: Remove pointless CALLOC macro. Modified: M lib/ipsec/pfkey.c === modified file 'lib/ipsec/pfkey.c' --- lib/ipsec/pfkey.c 2010-04-09 16:24:44 +0000 +++ lib/ipsec/pfkey.c 2010-04-15 16:57:21 +0000 @@ -51,8 +51,6 @@ #include "libpfkey.h" #include "pfkeyv2.h" -#define CALLOC(size, cast) (cast) calloc(1, (size)) - static int findsupportedmap __P((int)); static int setsupportedmap __P((struct sadb_supported *)); static struct sadb_alg *findsupportedalg __P((u_int, u_int)); @@ -423,7 +421,7 @@ len += sizeof(struct sadb_spirange); } - if ((newmsg = CALLOC((size_t) len, struct sadb_msg *)) == NULL) { + if ((newmsg = calloc(1, (size_t) len)) == NULL) { __ipsec_set_strerror(strerror(errno)); return -1; } @@ -604,7 +602,7 @@ + sizeof(struct sadb_address) + PFKEY_ALIGN8(sysdep_sa_len(dst)); - if ((newmsg = CALLOC((size_t) len, struct sadb_msg *)) == NULL) { + if ((newmsg = calloc(1, (size_t) len)) == NULL) { __ipsec_set_strerror(strerror(errno)); return -1; } @@ -1173,7 +1171,7 @@ + PFKEY_ALIGN8(sysdep_sa_len(dst)) + policylen; - if ((newmsg = CALLOC(len, struct sadb_msg *)) == NULL) { + if ((newmsg = calloc(1, len)) == NULL) { __ipsec_set_strerror(strerror(errno)); return -1; } @@ -1341,7 +1339,7 @@ } #endif - if ((newmsg = CALLOC((size_t) len, struct sadb_msg *)) == NULL) { + if ((newmsg = calloc(1, (size_t) len)) == NULL) { __ipsec_set_strerror(strerror(errno)); return -1; } @@ -1532,7 +1530,7 @@ + sizeof(struct sadb_address) + PFKEY_ALIGN8(sysdep_sa_len(dst)); - if ((newmsg = CALLOC((size_t) len, struct sadb_msg *)) == NULL) { + if ((newmsg = calloc(1, (size_t) len)) == NULL) { __ipsec_set_strerror(strerror(errno)); return -1; } @@ -1614,7 +1612,7 @@ /* create new sadb_msg to send. */ len = sizeof(struct sadb_msg); - if ((newmsg = CALLOC((size_t) len, struct sadb_msg *)) == NULL) { + if ((newmsg = calloc(1, (size_t) len)) == NULL) { __ipsec_set_strerror(strerror(errno)); return -1; } @@ -1691,7 +1689,7 @@ + sizeof(struct sadb_lifetime) + policylen; - if ((newmsg = CALLOC((size_t) len, struct sadb_msg *)) == NULL) { + if ((newmsg = calloc(1, (size_t) len)) == NULL) { __ipsec_set_strerror(strerror(errno)); return -1; } @@ -1749,7 +1747,7 @@ len = sizeof(struct sadb_msg) + sizeof(xpl); - if ((newmsg = CALLOC((size_t) len, struct sadb_msg *)) == NULL) { + if ((newmsg = calloc(1, (size_t) len)) == NULL) { __ipsec_set_strerror(strerror(errno)); return -1; } @@ -1862,7 +1860,7 @@ /* read real message */ reallen = PFKEY_UNUNIT64(buf.sadb_msg_len); - if ((newmsg = CALLOC((size_t) reallen, struct sadb_msg *)) == 0) { + if ((newmsg = calloc(1, (size_t) reallen)) == 0) { __ipsec_set_strerror(strerror(errno)); return NULL; }