Author: pfg
Date: Mon May 18 16:28:13 2015
New Revision: 283068
URL: https://svnweb.freebsd.org/changeset/base/283068

Log:
  Drop some unnecessary casts.
  
  Reported by:  Clang static analyzer
  Obtained from:        NetBSD

Modified:
  head/lib/libc/db/hash/hash.c

Modified: head/lib/libc/db/hash/hash.c
==============================================================================
--- head/lib/libc/db/hash/hash.c        Mon May 18 16:18:04 2015        
(r283067)
+++ head/lib/libc/db/hash/hash.c        Mon May 18 16:28:13 2015        
(r283068)
@@ -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;
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to