]> granicus.if.org Git - postgresql/commitdiff
Standardize on just one spelling of BITSPERBYTE.
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 20 Aug 2000 19:31:37 +0000 (19:31 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 20 Aug 2000 19:31:37 +0000 (19:31 +0000)
src/backend/lib/bit.c
src/include/utils/bit.h

index dbfa89e7ccde8a49cf922ce120aa79a3935ae652..2a0bcb24df7456dc3b2fbaf5faeadbdf47c3e544 100644 (file)
@@ -8,40 +8,34 @@
  *
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/lib/Attic/bit.c,v 1.9 2000/01/26 05:56:26 momjian Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/lib/Attic/bit.c,v 1.10 2000/08/20 19:31:37 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
 
-/*
- * utils/memutils.h contains declarations of the functions in this file
- */
 #include "postgres.h"
 
 #include "utils/bit.h"
 
+
 void
 BitArraySetBit(BitArray bitArray, BitIndex bitIndex)
 {
-       bitArray[bitIndex / BitsPerByte]
-       |= (1 << (BitsPerByte - (bitIndex % BitsPerByte) - 1));
-       return;
+       bitArray[bitIndex / BITSPERBYTE] |=
+               (1 << (BITSPERBYTE - 1 - (bitIndex % BITSPERBYTE)));
 }
 
 void
 BitArrayClearBit(BitArray bitArray, BitIndex bitIndex)
 {
-       bitArray[bitIndex / BitsPerByte]
-       &= ~(1 << (BitsPerByte - (bitIndex % BitsPerByte) - 1));
-       return;
+       bitArray[bitIndex / BITSPERBYTE] &=
+               ~(1 << (BITSPERBYTE - 1 - (bitIndex % BITSPERBYTE)));
 }
 
 bool
 BitArrayBitIsSet(BitArray bitArray, BitIndex bitIndex)
 {
-       return ((bool) (((bitArray[bitIndex / BitsPerByte] &
-                                         (1 << (BitsPerByte - (bitIndex % BitsPerByte)
-                                                        - 1)
-                                          )
-                                         ) != 0) ? 1 : 0));
+       return ((bitArray[bitIndex / BITSPERBYTE] &
+                        (1 << (BITSPERBYTE - 1 - (bitIndex % BITSPERBYTE)))
+               ) != 0);
 }
index 1587b2410c94bff01acc66ae206e8bba09bcbc92..1c4443cdd0785244c14f2764e27393fd07f6e2ed 100644 (file)
@@ -7,7 +7,7 @@
  * Portions Copyright (c) 1996-2000, PostgreSQL, Inc
  * Portions Copyright (c) 1994, Regents of the University of California
  *
- * $Id: bit.h,v 1.7 2000/01/26 05:58:37 momjian Exp $
+ * $Id: bit.h,v 1.8 2000/08/20 19:31:37 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -17,8 +17,6 @@
 typedef bits8 *BitArray;
 typedef uint32 BitIndex;
 
-#define BitsPerByte            8
-
 /*
  * BitArraySetBit
  *             Sets (to 1) the value of a bit in a bit array.