1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-21 00:42:43 +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

@@ -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);
}