mirror of
https://github.com/postgres/postgres.git
synced 2025-12-09 02:08:45 +03:00
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.
This commit is contained in:
@@ -217,10 +217,10 @@ pg_wcssize(const unsigned char *pwcs, size_t len, int encoding,
|
||||
|
||||
for (; *pwcs && len > 0; pwcs += chlen)
|
||||
{
|
||||
chlen = PQmblen((char *) pwcs, encoding);
|
||||
chlen = PQmblen((const char *) pwcs, encoding);
|
||||
if (len < (size_t) chlen)
|
||||
break;
|
||||
w = PQdsplen((char *) pwcs, encoding);
|
||||
w = PQdsplen((const char *) pwcs, encoding);
|
||||
|
||||
if (chlen == 1) /* single-byte char */
|
||||
{
|
||||
@@ -298,10 +298,10 @@ pg_wcsformat(const unsigned char *pwcs, size_t len, int encoding,
|
||||
|
||||
for (; *pwcs && len > 0; pwcs += chlen)
|
||||
{
|
||||
chlen = PQmblen((char *) pwcs, encoding);
|
||||
chlen = PQmblen((const char *) pwcs, encoding);
|
||||
if (len < (size_t) chlen)
|
||||
break;
|
||||
w = PQdsplen((char *) pwcs, encoding);
|
||||
w = PQdsplen((const char *) pwcs, encoding);
|
||||
|
||||
if (chlen == 1) /* single-byte char */
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user