From 9a74512ffdc1628f1b87d2191439915c63b9104f Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Thu, 8 Aug 2013 22:31:41 -0700 Subject: Stop casting return values from malloc Signed-off-by: Alan Coopersmith --- src/misc.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/misc.c') diff --git a/src/misc.c b/src/misc.c index 1693446..d2e9150 100644 --- a/src/misc.c +++ b/src/misc.c @@ -57,7 +57,7 @@ IceAllocScratch ( if (iceConn->scratch) free (iceConn->scratch); - iceConn->scratch = (char *) malloc ((unsigned) size); + iceConn->scratch = malloc (size); iceConn->scratch_size = size; } @@ -421,8 +421,7 @@ _IceAddOpcodeMapping ( } else if (iceConn->process_msg_info == NULL) { - iceConn->process_msg_info = (_IceProcessMsgInfo *) malloc ( - sizeof (_IceProcessMsgInfo)); + iceConn->process_msg_info = malloc (sizeof (_IceProcessMsgInfo)); iceConn->his_min_opcode = iceConn->his_max_opcode = hisOpcode; } else if (hisOpcode < iceConn->his_min_opcode) @@ -432,7 +431,7 @@ _IceAddOpcodeMapping ( int newsize = iceConn->his_max_opcode - hisOpcode + 1; int i; - iceConn->process_msg_info = (_IceProcessMsgInfo *) malloc ( + iceConn->process_msg_info = malloc ( newsize * sizeof (_IceProcessMsgInfo)); memcpy (&iceConn->process_msg_info[ @@ -459,7 +458,7 @@ _IceAddOpcodeMapping ( int newsize = hisOpcode - iceConn->his_min_opcode + 1; int i; - iceConn->process_msg_info = (_IceProcessMsgInfo *) malloc ( + iceConn->process_msg_info = malloc ( newsize * sizeof (_IceProcessMsgInfo)); memcpy (iceConn->process_msg_info, oldVec, -- cgit v1.2.3