From 1b81d865259bb7f60f4269ff52d94968e6ba0f5b Mon Sep 17 00:00:00 2001 From: "Pedro F. Giffuni" Date: Mon, 18 May 2015 16:28:13 +0000 Subject: [PATCH] Drop some unnecessary casts. Reported by: Clang static analyzer Obtained from: NetBSD --- lib/libc/db/hash/hash.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/libc/db/hash/hash.c b/lib/libc/db/hash/hash.c index af80929112b0..e6da5fea4786 100644 --- a/lib/libc/db/hash/hash.c +++ b/lib/libc/db/hash/hash.c @@ -808,7 +808,7 @@ __expand_table(HTAB *hashp) hashp->DSIZE = dirsize << 1; } if ((hashp->dir[new_segnum] = - (SEGMENT)calloc(hashp->SGSIZE, sizeof(SEGMENT))) == NULL) + calloc(hashp->SGSIZE, sizeof(SEGMENT))) == NULL) return (-1); hashp->exsegs++; hashp->nsegs++; @@ -877,7 +877,7 @@ alloc_segs(HTAB *hashp, int nsegs) int save_errno; if ((hashp->dir = - (SEGMENT *)calloc(hashp->DSIZE, sizeof(SEGMENT *))) == NULL) { + calloc(hashp->DSIZE, sizeof(SEGMENT *))) == NULL) { save_errno = errno; (void)hdestroy(hashp); errno = save_errno; @@ -887,8 +887,7 @@ alloc_segs(HTAB *hashp, int nsegs) if (nsegs == 0) return (0); /* Allocate segments */ - if ((store = (SEGMENT)calloc(nsegs << hashp->SSHIFT, - sizeof(SEGMENT))) == NULL) { + if ((store = calloc(nsegs << hashp->SSHIFT, sizeof(SEGMENT))) == NULL) { save_errno = errno; (void)hdestroy(hashp); errno = save_errno;