diff options
author | ngie <ngie@FreeBSD.org> | 2016-12-03 17:17:42 +0000 |
---|---|---|
committer | ngie <ngie@FreeBSD.org> | 2016-12-03 17:17:42 +0000 |
commit | de9c1e498c9083787fed20b89b77dce7f67d668e (patch) | |
tree | 4090ad0dc9bdc4f6d8760d071cac4a3cb7f3b346 /lib/libc/db | |
parent | bf027d30f65946c403cff801d75f469e39fa3e48 (diff) | |
download | FreeBSD-src-de9c1e498c9083787fed20b89b77dce7f67d668e.zip FreeBSD-src-de9c1e498c9083787fed20b89b77dce7f67d668e.tar.gz |
MFC r297790:
r297790 (by pfg):
libc: replace 0 with NULL for pointers.
While here also cleanup some surrounding code; particularly
drop some malloc() casts.
Found with devel/coccinelle.
Diffstat (limited to 'lib/libc/db')
-rw-r--r-- | lib/libc/db/hash/hash.c | 2 | ||||
-rw-r--r-- | lib/libc/db/hash/hash_buf.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/libc/db/hash/hash.c b/lib/libc/db/hash/hash.c index 12220a9..c4bf0c6 100644 --- a/lib/libc/db/hash/hash.c +++ b/lib/libc/db/hash/hash.c @@ -771,7 +771,7 @@ next_bucket: if (__big_keydata(hashp, bufp, key, data, 1)) return (ERROR); } else { - if (hashp->cpage == 0) + if (hashp->cpage == NULL) return (ERROR); key->data = (u_char *)hashp->cpage->page + bp[ndx]; key->size = (ndx > 1 ? bp[ndx - 1] : hashp->BSIZE) - bp[ndx]; diff --git a/lib/libc/db/hash/hash_buf.c b/lib/libc/db/hash/hash_buf.c index 4445fc5..7dcd328 100644 --- a/lib/libc/db/hash/hash_buf.c +++ b/lib/libc/db/hash/hash_buf.c @@ -245,7 +245,7 @@ newbuf(HTAB *hashp, u_int32_t addr, BUFHEAD *prev_bp) */ for (xbp = bp; xbp->ovfl;) { next_xbp = xbp->ovfl; - xbp->ovfl = 0; + xbp->ovfl = NULL; xbp = next_xbp; /* Check that ovfl pointer is up date. */ @@ -350,7 +350,7 @@ __buf_free(HTAB *hashp, int do_free, int to_disk) void __reclaim_buf(HTAB *hashp, BUFHEAD *bp) { - bp->ovfl = 0; + bp->ovfl = NULL; bp->addr = 0; bp->flags = 0; BUF_REMOVE(bp); |