diff options
| author | Peter Eisentraut <peter@eisentraut.org> | 2025-12-03 09:54:15 +0100 |
|---|---|---|
| committer | Peter Eisentraut <peter@eisentraut.org> | 2025-12-03 09:54:15 +0100 |
| commit | 756a43689324b473ee07549a6eb7a53a203df5ad (patch) | |
| tree | b72ab16ee77de3e82288c76c7b9493b93d378216 /contrib/bloom/blutils.c | |
| parent | 8c6bbd674ed810df9af5ec42f6b38c205e3ad365 (diff) | |
Don't rely on pointer arithmetic with Pointer type
The comment for the Pointer type says 'XXX Pointer arithmetic is done
with this, so it can't be void * under "true" ANSI compilers.'. This
fixes that. Change from Pointer to use char * explicitly where
pointer arithmetic is needed. This makes the meaning of the code
clearer locally and removes a dependency on the actual definition of
the Pointer type. (The definition of the Pointer type is not changed
in this commit.)
Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Reviewed-by: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Discussion: https://www.postgresql.org/message-id/4154950a-47ae-4223-bd01-1235cc50e933%40eisentraut.org
Diffstat (limited to 'contrib/bloom/blutils.c')
| -rw-r--r-- | contrib/bloom/blutils.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/contrib/bloom/blutils.c b/contrib/bloom/blutils.c index bf50037a71a..bbeefc3a75b 100644 --- a/contrib/bloom/blutils.c +++ b/contrib/bloom/blutils.c @@ -324,7 +324,7 @@ BloomPageAddItem(BloomState *state, Page page, BloomTuple *tuple) { BloomTuple *itup; BloomPageOpaque opaque; - Pointer ptr; + char *ptr; /* We shouldn't be pointed to an invalid page */ Assert(!PageIsNew(page) && !BloomPageIsDeleted(page)); @@ -340,7 +340,7 @@ BloomPageAddItem(BloomState *state, Page page, BloomTuple *tuple) /* Adjust maxoff and pd_lower */ opaque->maxoff++; - ptr = (Pointer) BloomPageGetTuple(state, page, opaque->maxoff + 1); + ptr = (char *) BloomPageGetTuple(state, page, opaque->maxoff + 1); ((PageHeader) page)->pd_lower = ptr - page; /* Assert we didn't overrun available space */ |
