52
52
typedef struct manifest_file
53
53
{
54
54
uint32 status ; /* hash status */
55
- char * pathname ;
55
+ const char * pathname ;
56
56
size_t size ;
57
57
pg_checksum_type checksum_type ;
58
58
int checksum_length ;
@@ -70,7 +70,7 @@ typedef struct manifest_file
70
70
*/
71
71
#define SH_PREFIX manifest_files
72
72
#define SH_ELEMENT_TYPE manifest_file
73
- #define SH_KEY_TYPE char *
73
+ #define SH_KEY_TYPE const char *
74
74
#define SH_KEY pathname
75
75
#define SH_HASH_KEY (tb , key ) hash_string(key)
76
76
#define SH_EQUAL (tb , a , b ) (strcmp(a, b) == 0)
@@ -123,7 +123,7 @@ static void verifybackup_version_cb(JsonManifestParseContext *context,
123
123
static void verifybackup_system_identifier (JsonManifestParseContext * context ,
124
124
uint64 manifest_system_identifier );
125
125
static void verifybackup_per_file_cb (JsonManifestParseContext * context ,
126
- char * pathname , size_t size ,
126
+ const char * pathname , size_t size ,
127
127
pg_checksum_type checksum_type ,
128
128
int checksum_length ,
129
129
uint8 * checksum_payload );
@@ -155,7 +155,7 @@ static void report_backup_error(verifier_context *context,
155
155
pg_attribute_printf (2 , 3 );
156
156
static void report_fatal_error (const char * pg_restrict fmt ,...)
157
157
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 );
159
159
160
160
static void progress_report (bool finished );
161
161
static void usage (void );
@@ -546,7 +546,7 @@ verifybackup_system_identifier(JsonManifestParseContext *context,
546
546
*/
547
547
static void
548
548
verifybackup_per_file_cb (JsonManifestParseContext * context ,
549
- char * pathname , size_t size ,
549
+ const char * pathname , size_t size ,
550
550
pg_checksum_type checksum_type ,
551
551
int checksum_length , uint8 * checksum_payload )
552
552
{
@@ -852,7 +852,7 @@ verify_file_checksum(verifier_context *context, manifest_file *m,
852
852
char * fullpath , uint8 * buffer )
853
853
{
854
854
pg_checksum_context checksum_ctx ;
855
- char * relpath = m -> pathname ;
855
+ const char * relpath = m -> pathname ;
856
856
int fd ;
857
857
int rc ;
858
858
size_t bytes_read = 0 ;
@@ -1016,13 +1016,13 @@ report_fatal_error(const char *pg_restrict fmt,...)
1016
1016
* "aa/bb" is not a prefix of "aa/bbb", but it is a prefix of "aa/bb/cc".
1017
1017
*/
1018
1018
static bool
1019
- should_ignore_relpath (verifier_context * context , char * relpath )
1019
+ should_ignore_relpath (verifier_context * context , const char * relpath )
1020
1020
{
1021
1021
SimpleStringListCell * cell ;
1022
1022
1023
1023
for (cell = context -> ignore_list .head ; cell != NULL ; cell = cell -> next )
1024
1024
{
1025
- char * r = relpath ;
1025
+ const char * r = relpath ;
1026
1026
char * v = cell -> val ;
1027
1027
1028
1028
while (* v != '\0' && * r == * v )
0 commit comments