diff options
author | Peter Eisentraut <peter_e@gmx.net> | 2011-09-11 21:54:32 +0300 |
---|---|---|
committer | Peter Eisentraut <peter_e@gmx.net> | 2011-09-11 21:54:32 +0300 |
commit | 1b81c2fe6ee2b26d37610c3d381a87fa17af0a7c (patch) | |
tree | 09075f19d47fd81df20beb96e27e0f21ad2a0729 /src/backend/utils/adt | |
parent | 02bca4f35164dd1873eab9b8e6167e42a79157c4 (diff) | |
download | postgresql-1b81c2fe6ee2b26d37610c3d381a87fa17af0a7c.tar.gz postgresql-1b81c2fe6ee2b26d37610c3d381a87fa17af0a7c.zip |
Remove many -Wcast-qual warnings
This addresses only those cases that are easy to fix by adding or
moving a const qualifier or removing an unnecessary cast. There are
many more complicated cases remaining.
Diffstat (limited to 'src/backend/utils/adt')
-rw-r--r-- | src/backend/utils/adt/tsgistidx.c | 8 | ||||
-rw-r--r-- | src/backend/utils/adt/tsquery_gist.c | 4 | ||||
-rw-r--r-- | src/backend/utils/adt/tsrank.c | 8 | ||||
-rw-r--r-- | src/backend/utils/adt/xml.c | 4 |
4 files changed, 12 insertions, 12 deletions
diff --git a/src/backend/utils/adt/tsgistidx.c b/src/backend/utils/adt/tsgistidx.c index 1ac2b17237f..72f4a784d27 100644 --- a/src/backend/utils/adt/tsgistidx.c +++ b/src/backend/utils/adt/tsgistidx.c @@ -131,8 +131,8 @@ gtsvectorout(PG_FUNCTION_ARGS) static int compareint(const void *va, const void *vb) { - int4 a = *((int4 *) va); - int4 b = *((int4 *) vb); + int4 a = *((const int4 *) va); + int4 b = *((const int4 *) vb); if (a == b) return 0; @@ -593,8 +593,8 @@ typedef struct static int comparecost(const void *va, const void *vb) { - SPLITCOST *a = (SPLITCOST *) va; - SPLITCOST *b = (SPLITCOST *) vb; + const SPLITCOST *a = (const SPLITCOST *) va; + const SPLITCOST *b = (const SPLITCOST *) vb; if (a->cost == b->cost) return 0; diff --git a/src/backend/utils/adt/tsquery_gist.c b/src/backend/utils/adt/tsquery_gist.c index bef86036dc1..d4468d617a4 100644 --- a/src/backend/utils/adt/tsquery_gist.c +++ b/src/backend/utils/adt/tsquery_gist.c @@ -156,10 +156,10 @@ typedef struct static int comparecost(const void *a, const void *b) { - if (((SPLITCOST *) a)->cost == ((SPLITCOST *) b)->cost) + if (((const SPLITCOST *) a)->cost == ((const SPLITCOST *) b)->cost) return 0; else - return (((SPLITCOST *) a)->cost > ((SPLITCOST *) b)->cost) ? 1 : -1; + return (((const SPLITCOST *) a)->cost > ((const SPLITCOST *) b)->cost) ? 1 : -1; } #define WISH_F(a,b,c) (double)( -(double)(((a)-(b))*((a)-(b))*((a)-(b)))*(c) ) diff --git a/src/backend/utils/adt/tsrank.c b/src/backend/utils/adt/tsrank.c index 564d855817a..5a50b771fba 100644 --- a/src/backend/utils/adt/tsrank.c +++ b/src/backend/utils/adt/tsrank.c @@ -134,8 +134,8 @@ static int compareQueryOperand(const void *a, const void *b, void *arg) { char *operand = (char *) arg; - QueryOperand *qa = (*(QueryOperand **) a); - QueryOperand *qb = (*(QueryOperand **) b); + QueryOperand *qa = (*(QueryOperand * const *) a); + QueryOperand *qb = (*(QueryOperand * const *) b); return tsCompareString(operand + qa->distance, qa->length, operand + qb->distance, qb->length, @@ -498,8 +498,8 @@ typedef struct static int compareDocR(const void *va, const void *vb) { - DocRepresentation *a = (DocRepresentation *) va; - DocRepresentation *b = (DocRepresentation *) vb; + const DocRepresentation *a = (const DocRepresentation *) va; + const DocRepresentation *b = (const DocRepresentation *) vb; if (a->pos == b->pos) return 0; diff --git a/src/backend/utils/adt/xml.c b/src/backend/utils/adt/xml.c index 99b978c42c0..93ff366cd74 100644 --- a/src/backend/utils/adt/xml.c +++ b/src/backend/utils/adt/xml.c @@ -396,7 +396,7 @@ cstring_to_xmltype(const char *string) static xmltype * xmlBuffer_to_xmltype(xmlBufferPtr buf) { - return (xmltype *) cstring_to_text_with_len((char *) xmlBufferContent(buf), + return (xmltype *) cstring_to_text_with_len((const char *) xmlBufferContent(buf), xmlBufferLength(buf)); } #endif @@ -1267,7 +1267,7 @@ static bool print_xml_decl(StringInfo buf, const xmlChar *version, pg_enc encoding, int standalone) { - if ((version && strcmp((char *) version, PG_XML_DEFAULT_VERSION) != 0) + if ((version && strcmp((const char *) version, PG_XML_DEFAULT_VERSION) != 0) || (encoding && encoding != PG_UTF8) || standalone != -1) { |