can't increment/decrement void *, but gcc lets you anyway
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Thu, 21 Nov 1991 03:33:14 +0000 (19:33 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Thu, 21 Nov 1991 03:33:14 +0000 (19:33 -0800)
SCCS-vsn: lib/libc/db/mpool/mpool.c 5.2

usr/src/lib/libc/db/mpool/mpool.c

index 07a365f..f8e6d82 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)mpool.c    5.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)mpool.c    5.2 (Berkeley) %G%";
 #endif /* LIBC_SCCS and not lint */
 
 #include <sys/param.h>
 #endif /* LIBC_SCCS and not lint */
 
 #include <sys/param.h>
@@ -236,7 +236,7 @@ mpool_put(mp, page, flags)
 #ifdef STATISTICS
        ++mp->pageput;
 #endif
 #ifdef STATISTICS
        ++mp->pageput;
 #endif
-       baddr = page - sizeof(BKT);
+       baddr = (BKT *)((char *)page - sizeof(BKT));
 #ifdef DEBUG
        if (!(baddr->flags & MPOOL_PINNED))
                err("mpool_put: page %d not pinned", b->pgno);
 #ifdef DEBUG
        if (!(baddr->flags & MPOOL_PINNED))
                err("mpool_put: page %d not pinned", b->pgno);