Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd594eec

Browse files
committed
Standardize on just one spelling of BITSPERBYTE.
1 parent81ddc46 commitd594eec

File tree

2 files changed

+10
-18
lines changed

2 files changed

+10
-18
lines changed

‎src/backend/lib/bit.c

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,40 +8,34 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/lib/Attic/bit.c,v 1.9 2000/01/26 05:56:26 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/lib/Attic/bit.c,v 1.10 2000/08/20 19:31:37 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
1515

16-
/*
17-
* utils/memutils.h contains declarations of the functions in this file
18-
*/
1916
#include"postgres.h"
2017

2118
#include"utils/bit.h"
2219

20+
2321
void
2422
BitArraySetBit(BitArraybitArray,BitIndexbitIndex)
2523
{
26-
bitArray[bitIndex /BitsPerByte]
27-
|= (1 << (BitsPerByte- (bitIndex %BitsPerByte)-1));
28-
return;
24+
bitArray[bitIndex /BITSPERBYTE] |=
25+
(1 << (BITSPERBYTE-1- (bitIndex %BITSPERBYTE)));
2926
}
3027

3128
void
3229
BitArrayClearBit(BitArraybitArray,BitIndexbitIndex)
3330
{
34-
bitArray[bitIndex /BitsPerByte]
35-
&= ~(1 << (BitsPerByte- (bitIndex %BitsPerByte)-1));
36-
return;
31+
bitArray[bitIndex /BITSPERBYTE] &=
32+
~(1 << (BITSPERBYTE-1- (bitIndex %BITSPERBYTE)));
3733
}
3834

3935
bool
4036
BitArrayBitIsSet(BitArraybitArray,BitIndexbitIndex)
4137
{
42-
return ((bool) (((bitArray[bitIndex /BitsPerByte]&
43-
(1 << (BitsPerByte- (bitIndex %BitsPerByte)
44-
-1)
45-
)
46-
)!=0) ?1 :0));
38+
return ((bitArray[bitIndex /BITSPERBYTE]&
39+
(1 << (BITSPERBYTE-1- (bitIndex %BITSPERBYTE)))
40+
)!=0);
4741
}

‎src/include/utils/bit.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $Id: bit.h,v 1.7 2000/01/26 05:58:37momjian Exp $
10+
* $Id: bit.h,v 1.8 2000/08/20 19:31:37tgl Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -17,8 +17,6 @@
1717
typedefbits8*BitArray;
1818
typedefuint32BitIndex;
1919

20-
#defineBitsPerByte8
21-
2220
/*
2321
* BitArraySetBit
2422
*Sets (to 1) the value of a bit in a bit array.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp