diff options
Diffstat (limited to 'src/backend/utils')
-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 | ||||
-rw-r--r-- | src/backend/utils/mb/conv.c | 20 |
5 files changed, 22 insertions, 22 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) { diff --git a/src/backend/utils/mb/conv.c b/src/backend/utils/mb/conv.c index 8af157b2d5e..0d7f471a15b 100644 --- a/src/backend/utils/mb/conv.c +++ b/src/backend/utils/mb/conv.c @@ -247,8 +247,8 @@ compare1(const void *p1, const void *p2) uint32 v1, v2; - v1 = *(uint32 *) p1; - v2 = ((pg_utf_to_local *) p2)->utf; + v1 = *(const uint32 *) p1; + v2 = ((const pg_utf_to_local *) p2)->utf; return (v1 > v2) ? 1 : ((v1 == v2) ? 0 : -1); } @@ -262,8 +262,8 @@ compare2(const void *p1, const void *p2) uint32 v1, v2; - v1 = *(uint32 *) p1; - v2 = ((pg_local_to_utf *) p2)->code; + v1 = *(const uint32 *) p1; + v2 = ((const pg_local_to_utf *) p2)->code; return (v1 > v2) ? 1 : ((v1 == v2) ? 0 : -1); } @@ -279,10 +279,10 @@ compare3(const void *p1, const void *p2) d1, d2; - s1 = *(uint32 *) p1; - s2 = *((uint32 *) p1 + 1); - d1 = ((pg_utf_to_local_combined *) p2)->utf1; - d2 = ((pg_utf_to_local_combined *) p2)->utf2; + s1 = *(const uint32 *) p1; + s2 = *((const uint32 *) p1 + 1); + d1 = ((const pg_utf_to_local_combined *) p2)->utf1; + d2 = ((const pg_utf_to_local_combined *) p2)->utf2; return (s1 > d1 || (s1 == d1 && s2 > d2)) ? 1 : ((s1 == d1 && s2 == d2) ? 0 : -1); } @@ -296,8 +296,8 @@ compare4(const void *p1, const void *p2) uint32 v1, v2; - v1 = *(uint32 *) p1; - v2 = ((pg_local_to_utf_combined *) p2)->code; + v1 = *(const uint32 *) p1; + v2 = ((const pg_local_to_utf_combined *) p2)->code; return (v1 > v2) ? 1 : ((v1 == v2) ? 0 : -1); } |