From 5453c0245ee0d0ac6d29d8377966deffc75e48bb Mon Sep 17 00:00:00 2001 From: Martin Nilsson <nilsson@opera.com> Date: Wed, 3 Sep 2014 20:25:52 +0200 Subject: [PATCH] Don't cast memset void* argument. --- src/builtin.cmod | 2 +- src/configure.in | 4 ++-- src/malloc.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/builtin.cmod b/src/builtin.cmod index ce2f682498..4dafedb2a3 100644 --- a/src/builtin.cmod +++ b/src/builtin.cmod @@ -3448,7 +3448,7 @@ PIKECLASS Buffer } memmove(p, (char*)p+len, end<<shift); // Copy NUL-termination if( s->flags & STRING_CLEAR_ON_EXIT) - guaranteed_memset((char*)p+len+(end<<shift) , 0, len ); + guaranteed_memset(p+len+(end<<shift) , 0, len ); s->len -= index; if(!vdiscard) diff --git a/src/configure.in b/src/configure.in index d805d81be6..920e990c1d 100644 --- a/src/configure.in +++ b/src/configure.in @@ -6972,7 +6972,7 @@ int my_socketpair(int family, int type, int protocol, int sv[2]) int retries=0; ACCEPT_SIZE_T len; - memset((char *)&addr,0,sizeof(struct sockaddr_in)); + memset(&addr,0,sizeof(struct sockaddr_in)); if(socketpair_fd==-1) { @@ -6982,7 +6982,7 @@ int my_socketpair(int family, int type, int protocol, int sv[2]) return -1; } - memset((char *)&my_addr,0,sizeof(struct sockaddr_in)); + memset(&my_addr,0,sizeof(struct sockaddr_in)); my_addr.sin_family=AF_INET; my_addr.sin_addr.s_addr=htonl(INADDR_ANY); my_addr.sin_port=htons(0); diff --git a/src/malloc.c b/src/malloc.c index 2cec7b1062..74aadf170d 100644 --- a/src/malloc.c +++ b/src/malloc.c @@ -3968,7 +3968,7 @@ static void** ialloc(mstate m, assert(!is_mmapped(p)); if (opts & 0x2) { /* optionally clear the elements */ - memset((size_t*)mem, 0, remainder_size - SIZE_T_SIZE - array_size); + memset(mem, 0, remainder_size - SIZE_T_SIZE - array_size); } /* If not provided, allocate the pointer array as final part of chunk */ -- GitLab