From 903fabc3e414ca43357a3f26bbb4e87254e7c339 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Tue, 22 Jun 2004 23:44:46 +0000 Subject: [PATCH] remove malloc casts --- src/os/win32/win32_sigar.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/os/win32/win32_sigar.c b/src/os/win32/win32_sigar.c index 707d7329..e9d5e1c6 100644 --- a/src/os/win32/win32_sigar.c +++ b/src/os/win32/win32_sigar.c @@ -80,7 +80,7 @@ static PERF_OBJECT_TYPE *get_perf_object(sigar_t *sigar, char *counter_key, *err = SIGAR_OK; if (!sigar->perfbuf) { - sigar->perfbuf = (char *)malloc(PERFBUF_SIZE); + sigar->perfbuf = malloc(PERFBUF_SIZE); sigar->perfbuf_size = PERFBUF_SIZE; } @@ -92,8 +92,8 @@ static PERF_OBJECT_TYPE *get_perf_object(sigar_t *sigar, char *counter_key, if (retval == ERROR_MORE_DATA) { sigar->perfbuf_size += PERFBUF_SIZE; - sigar->perfbuf = (char *)realloc(sigar->perfbuf, - sigar->perfbuf_size); + sigar->perfbuf = + realloc(sigar->perfbuf, sigar->perfbuf_size); } else { *err = retval; @@ -1727,8 +1727,7 @@ sigar_net_interface_list_get(sigar_t *sigar, iflist->number = 0; iflist->size = num; iflist->data = - (char **)malloc(sizeof(*(iflist->data)) * - iflist->size); + malloc(sizeof(*(iflist->data)) * iflist->size); for (i=0; iget_tcp_table(tcp, &size, FALSE); if (rc) { free(tcp); @@ -1831,7 +1830,7 @@ static int net_conn_get_udp(sigar_t *sigar, if (rc != ERROR_INSUFFICIENT_BUFFER) { return GetLastError(); } - udp = (PMIB_UDPTABLE)malloc(size); + udp = malloc(size); rc = sigar->get_udp_table(udp, &size, FALSE); if (rc) { free(udp);