1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-27 12:41:57 +03:00

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.
This commit is contained in:
Peter Eisentraut
2011-09-11 21:54:32 +03:00
parent 02bca4f351
commit 1b81c2fe6e
55 changed files with 219 additions and 218 deletions

View File

@ -322,7 +322,7 @@ typedef struct
static int
comparecost(const void *a, const void *b)
{
return ((SPLITCOST *) a)->cost - ((SPLITCOST *) b)->cost;
return ((const SPLITCOST *) a)->cost - ((const SPLITCOST *) b)->cost;
}

View File

@ -276,24 +276,25 @@ parse_hstore(HSParser *state)
static int
comparePairs(const void *a, const void *b)
{
if (((Pairs *) a)->keylen == ((Pairs *) b)->keylen)
const Pairs *pa = a;
const Pairs *pb = b;
if (pa->keylen == pb->keylen)
{
int res = memcmp(((Pairs *) a)->key,
((Pairs *) b)->key,
((Pairs *) a)->keylen);
int res = memcmp(pa->key, pb->key, pa->keylen);
if (res)
return res;
/* guarantee that needfree will be later */
if (((Pairs *) b)->needfree == ((Pairs *) a)->needfree)
if (pb->needfree == pa->needfree)
return 0;
else if (((Pairs *) a)->needfree)
else if (pa->needfree)
return 1;
else
return -1;
}
return (((Pairs *) a)->keylen > ((Pairs *) b)->keylen) ? 1 : -1;
return (pa->keylen > pb->keylen) ? 1 : -1;
}
/*