5252typedef struct manifest_file
5353{
5454 uint32 status ; /* hash status */
55- char * pathname ;
55+ const char * pathname ;
5656 size_t size ;
5757 pg_checksum_type checksum_type ;
5858 int checksum_length ;
@@ -70,7 +70,7 @@ typedef struct manifest_file
7070 */
7171#define SH_PREFIX manifest_files
7272#define SH_ELEMENT_TYPE manifest_file
73- #define SH_KEY_TYPE char *
73+ #define SH_KEY_TYPE const char *
7474#define SH_KEY pathname
7575#define SH_HASH_KEY (tb , key ) hash_string(key)
7676#define SH_EQUAL (tb , a , b ) (strcmp(a, b) == 0)
@@ -123,7 +123,7 @@ static void verifybackup_version_cb(JsonManifestParseContext *context,
123123static void verifybackup_system_identifier (JsonManifestParseContext * context ,
124124 uint64 manifest_system_identifier );
125125static void verifybackup_per_file_cb (JsonManifestParseContext * context ,
126- char * pathname , size_t size ,
126+ const char * pathname , size_t size ,
127127 pg_checksum_type checksum_type ,
128128 int checksum_length ,
129129 uint8 * checksum_payload );
@@ -155,7 +155,7 @@ static void report_backup_error(verifier_context *context,
155155 pg_attribute_printf (2 , 3 );
156156static void report_fatal_error (const char * pg_restrict fmt ,...)
157157 pg_attribute_printf (1 , 2 ) pg_attribute_noreturn ();
158- static bool should_ignore_relpath (verifier_context * context , char * relpath );
158+ static bool should_ignore_relpath (verifier_context * context , const char * relpath );
159159
160160static void progress_report (bool finished );
161161static void usage (void );
@@ -546,7 +546,7 @@ verifybackup_system_identifier(JsonManifestParseContext *context,
546546 */
547547static void
548548verifybackup_per_file_cb (JsonManifestParseContext * context ,
549- char * pathname , size_t size ,
549+ const char * pathname , size_t size ,
550550 pg_checksum_type checksum_type ,
551551 int checksum_length , uint8 * checksum_payload )
552552{
@@ -852,7 +852,7 @@ verify_file_checksum(verifier_context *context, manifest_file *m,
852852 char * fullpath , uint8 * buffer )
853853{
854854 pg_checksum_context checksum_ctx ;
855- char * relpath = m -> pathname ;
855+ const char * relpath = m -> pathname ;
856856 int fd ;
857857 int rc ;
858858 size_t bytes_read = 0 ;
@@ -1016,13 +1016,13 @@ report_fatal_error(const char *pg_restrict fmt,...)
10161016 * "aa/bb" is not a prefix of "aa/bbb", but it is a prefix of "aa/bb/cc".
10171017 */
10181018static bool
1019- should_ignore_relpath (verifier_context * context , char * relpath )
1019+ should_ignore_relpath (verifier_context * context , const char * relpath )
10201020{
10211021 SimpleStringListCell * cell ;
10221022
10231023 for (cell = context -> ignore_list .head ; cell != NULL ; cell = cell -> next )
10241024 {
1025- char * r = relpath ;
1025+ const char * r = relpath ;
10261026 char * v = cell -> val ;
10271027
10281028 while (* v != '\0' && * r == * v )
0 commit comments