diff options
| author | Peter Eisentraut | 2019-01-29 00:16:24 +0000 |
|---|---|---|
| committer | Peter Eisentraut | 2019-02-13 10:50:16 +0000 |
| commit | 37d9916020286caec810f4de61fbd0de3568454d (patch) | |
| tree | d9d80040f72093664d8a20b55de2a670988d281e /src/bin | |
| parent | cf40dc65b676c8df1ee12f060b40f0e37a183e04 (diff) | |
More unconstify use
Replace casts whose only purpose is to cast away const with the
unconstify() macro.
Discussion: https://www.postgresql.org/message-id/flat/53a28052-f9f3-1808-fed9-460fd43035ab%402ndquadrant.com
Diffstat (limited to 'src/bin')
| -rw-r--r-- | src/bin/pg_basebackup/pg_basebackup.c | 2 | ||||
| -rw-r--r-- | src/bin/pg_basebackup/walmethods.c | 2 | ||||
| -rw-r--r-- | src/bin/pg_dump/compress_io.c | 2 | ||||
| -rw-r--r-- | src/bin/psql/prompt.c | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/src/bin/pg_basebackup/pg_basebackup.c b/src/bin/pg_basebackup/pg_basebackup.c index 594d67c9e91..3d2d4cd0b94 100644 --- a/src/bin/pg_basebackup/pg_basebackup.c +++ b/src/bin/pg_basebackup/pg_basebackup.c @@ -1970,7 +1970,7 @@ BaseBackup(void) */ if (format == 'p' && !PQgetisnull(res, i, 1)) { - char *path = (char *) get_tablespace_mapping(PQgetvalue(res, i, 1)); + char *path = unconstify(char *, get_tablespace_mapping(PQgetvalue(res, i, 1))); verify_dir_is_empty_or_create(path, &made_tablespace_dirs, &found_tablespace_dirs); } diff --git a/src/bin/pg_basebackup/walmethods.c b/src/bin/pg_basebackup/walmethods.c index 7410af3e637..165b3a1e896 100644 --- a/src/bin/pg_basebackup/walmethods.c +++ b/src/bin/pg_basebackup/walmethods.c @@ -496,7 +496,7 @@ tar_write(Walfile f, const void *buf, size_t count) #ifdef HAVE_LIBZ else { - if (!tar_write_compressed_data((void *) buf, count, false)) + if (!tar_write_compressed_data(unconstify(void *, buf), count, false)) return -1; ((TarMethodFile *) f)->currpos += count; return count; diff --git a/src/bin/pg_dump/compress_io.c b/src/bin/pg_dump/compress_io.c index e34e6c5618f..d904ec62ad1 100644 --- a/src/bin/pg_dump/compress_io.c +++ b/src/bin/pg_dump/compress_io.c @@ -312,7 +312,7 @@ static void WriteDataToArchiveZlib(ArchiveHandle *AH, CompressorState *cs, const char *data, size_t dLen) { - cs->zp->next_in = (void *) data; + cs->zp->next_in = (void *) unconstify(char *, data); cs->zp->avail_in = dLen; DeflateCompressorZlib(AH, cs, false); diff --git a/src/bin/psql/prompt.c b/src/bin/psql/prompt.c index 73394dc828d..4514cf8551c 100644 --- a/src/bin/psql/prompt.c +++ b/src/bin/psql/prompt.c @@ -181,7 +181,7 @@ get_prompt(promptStatus_t status, ConditionalStack cstack) case '5': case '6': case '7': - *buf = (char) strtol(p, (char **) &p, 8); + *buf = (char) strtol(p, unconstify(char **, &p), 8); --p; break; case 'R': |
