OSDN Git Service

hash.h's use of BSHIFT conflicts with <sys/param.h> on my
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 4 Oct 1998 20:19:08 +0000 (20:19 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 4 Oct 1998 20:19:08 +0000 (20:19 +0000)
system.  Finally got tired of looking at the compiler warning messages.
BSHIFT isn't all that useful, so I just took out the macro.

src/backend/access/hash/hashovfl.c
src/include/access/hash.h

index 8809091..c0800f4 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/access/hash/hashovfl.c,v 1.17 1998/09/01 03:20:57 momjian Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/access/hash/hashovfl.c,v 1.18 1998/10/04 20:19:08 tgl Exp $
  *
  * NOTES
  *       Overflow pages look like ordinary relation pages.
@@ -121,11 +121,11 @@ _hash_getovfladdr(Relation rel, Buffer *metabufp)
        splitnum = metap->OVFL_POINT;
        max_free = metap->SPARES[splitnum];
 
-       free_page = (max_free - 1) >> (metap->BSHIFT + BYTE_TO_BIT);
+       free_page = (max_free - 1) >> (metap->hashm_bshift + BYTE_TO_BIT);
        free_bit = (max_free - 1) & (BMPGSZ_BIT(metap) - 1);
 
        /* Look through all the free maps to find the first free block */
-       first_page = metap->LAST_FREED >> (metap->BSHIFT + BYTE_TO_BIT);
+       first_page = metap->LAST_FREED >> (metap->hashm_bshift + BYTE_TO_BIT);
        for (i = first_page; i <= free_page; i++)
        {
                Page            mappage;
@@ -369,7 +369,7 @@ _hash_freeovflpage(Relation rel, Buffer ovflbuf)
        if (ovflpgno < metap->LAST_FREED)
                metap->LAST_FREED = ovflpgno;
 
-       bitmappage = (ovflpgno >> (metap->BSHIFT + BYTE_TO_BIT));
+       bitmappage = (ovflpgno >> (metap->hashm_bshift + BYTE_TO_BIT));
        bitmapbit = ovflpgno & (BMPGSZ_BIT(metap) - 1);
 
        blkno = metap->hashm_mapp[bitmappage];
index fe49bad..019fb7d 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Copyright (c) 1994, Regents of the University of California
  *
- * $Id: hash.h,v 1.19 1998/09/01 04:34:11 momjian Exp $
+ * $Id: hash.h,v 1.20 1998/10/04 20:19:06 tgl Exp $
  *
  * NOTES
  *             modeled after Margo Seltzer's hash implementation for unix.
@@ -165,7 +165,6 @@ typedef struct HashMetaPageData
 typedef HashMetaPageData *HashMetaPage;
 
 /* Short hands for accessing structure */
-#define BSHIFT                 hashm_bshift
 #define OVFL_POINT             hashm_ovflpoint
 #define LAST_FREED             hashm_lastfreed
 #define MAX_BUCKET             hashm_maxbucket