1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-31 17:02:12 +03:00

Fix most -Wundef warnings

In some cases #if was used instead of #ifdef in an inconsistent style.
Cleaning this up also helps when analyzing cases like
38d8dce61f where this makes a
difference.

There are no behavior changes here, but the change in pg_bswap.h would
prevent possible accidental misuse by third-party code.

Discussion: https://www.postgresql.org/message-id/flat/3b615ca5-c595-3f1d-fdf7-a429e564f614%402ndquadrant.com
This commit is contained in:
Peter Eisentraut
2019-10-19 18:21:58 +02:00
parent 48cc59ed24
commit 5d3587d14b
11 changed files with 27 additions and 19 deletions

View File

@@ -243,7 +243,7 @@ struct HTAB
*/
#define MOD(x,y) ((x) & ((y)-1))
#if HASH_STATISTICS
#ifdef HASH_STATISTICS
static long hash_accesses,
hash_collisions,
hash_expansions;
@@ -706,7 +706,7 @@ init_htab(HTAB *hashp, long nelem)
/* Choose number of entries to allocate at a time */
hctl->nelem_alloc = choose_nelem_alloc(hctl->entrysize);
#if HASH_DEBUG
#ifdef HASH_DEBUG
fprintf(stderr, "init_htab:\n%s%p\n%s%ld\n%s%ld\n%s%d\n%s%ld\n%s%u\n%s%x\n%s%x\n%s%ld\n",
"TABLE POINTER ", hashp,
"DIRECTORY SIZE ", hctl->dsize,
@@ -832,7 +832,7 @@ hash_destroy(HTAB *hashp)
void
hash_stats(const char *where, HTAB *hashp)
{
#if HASH_STATISTICS
#ifdef HASH_STATISTICS
fprintf(stderr, "%s: this HTAB -- accesses %ld collisions %ld\n",
where, hashp->hctl->accesses, hashp->hctl->collisions);
@@ -933,7 +933,7 @@ hash_search_with_hash_value(HTAB *hashp,
HASHBUCKET *prevBucketPtr;
HashCompareFunc match;
#if HASH_STATISTICS
#ifdef HASH_STATISTICS
hash_accesses++;
hctl->accesses++;
#endif
@@ -988,7 +988,7 @@ hash_search_with_hash_value(HTAB *hashp,
break;
prevBucketPtr = &(currBucket->link);
currBucket = *prevBucketPtr;
#if HASH_STATISTICS
#ifdef HASH_STATISTICS
hash_collisions++;
hctl->collisions++;
#endif
@@ -1130,7 +1130,7 @@ hash_update_hash_key(HTAB *hashp,
HASHBUCKET *oldPrevPtr;
HashCompareFunc match;
#if HASH_STATISTICS
#ifdef HASH_STATISTICS
hash_accesses++;
hctl->accesses++;
#endif
@@ -1204,7 +1204,7 @@ hash_update_hash_key(HTAB *hashp,
break;
prevBucketPtr = &(currBucket->link);
currBucket = *prevBucketPtr;
#if HASH_STATISTICS
#ifdef HASH_STATISTICS
hash_collisions++;
hctl->collisions++;
#endif