From 973e9fb294dc05a384ecae7623923ae53cb81806 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Tue, 28 Feb 2012 12:42:08 +0200 Subject: Add const qualifiers where they are accidentally cast away This only produces warnings under -Wcast-qual, but it's more correct and consistent in any case. --- src/include/c.h | 2 +- src/include/utils/pg_crc.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/include') diff --git a/src/include/c.h b/src/include/c.h index 7396adbaa77..82acd14a9b4 100644 --- a/src/include/c.h +++ b/src/include/c.h @@ -478,7 +478,7 @@ typedef NameData *Name; * PointerIsValid * True iff pointer is valid. */ -#define PointerIsValid(pointer) ((void*)(pointer) != NULL) +#define PointerIsValid(pointer) ((const void*)(pointer) != NULL) /* * PointerIsAligned diff --git a/src/include/utils/pg_crc.h b/src/include/utils/pg_crc.h index d5273d0f96c..0652c0ad3b8 100644 --- a/src/include/utils/pg_crc.h +++ b/src/include/utils/pg_crc.h @@ -40,7 +40,7 @@ typedef uint32 pg_crc32; /* Accumulate some (more) bytes into a CRC */ #define COMP_CRC32(crc, data, len) \ do { \ - unsigned char *__data = (unsigned char *) (data); \ + const unsigned char *__data = (const unsigned char *) (data); \ uint32 __len = (len); \ \ while (__len-- > 0) \ -- cgit v1.2.3