Constify more function parameters

This commit is contained in:
Christophe Grenier 2020-06-19 22:05:38 +02:00
parent 60b5424f53
commit 90d21a4d81
17 changed files with 16 additions and 18 deletions

View file

@ -220,7 +220,7 @@ int search_type_0(const unsigned char *buffer, disk_t *disk, partition_t *partit
return 0;
}
int search_type_1(const unsigned char *buffer, disk_t *disk, partition_t *partition, const int verbose, const int dump_ind)
int search_type_1(const unsigned char *buffer, const disk_t *disk, partition_t *partition, const int verbose, const int dump_ind)
{
const struct disklabel *bsd_header=(const struct disklabel *)(buffer+0x200);
const struct disk_super_block *beos_block=(const struct disk_super_block*)(buffer+0x200);

View file

@ -24,7 +24,7 @@ extern "C" {
#endif
int search_type_0(const unsigned char *buffer, disk_t *disk_car,partition_t *partition,const int verbose, const int dump_ind);
int search_type_1(const unsigned char *buffer, disk_t *disk_car,partition_t *partition,const int verbose, const int dump_ind);
int search_type_1(const unsigned char *buffer, const disk_t *disk_car, partition_t *partition, const int verbose, const int dump_ind);
int search_type_2(const unsigned char *buffer, disk_t *disk_car,partition_t *partition,const int verbose, const int dump_ind);
int search_type_8(unsigned char *buffer, disk_t *disk_car,partition_t *partition,const int verbose, const int dump_ind);
int search_type_16(unsigned char *buffer, disk_t *disk_car,partition_t *partition,const int verbose, const int dump_ind);

View file

@ -263,7 +263,7 @@ void xml_add_DFXML_creator(const char *package, const char *version)
xml_pop("creator");
}
void xml_setup(disk_t *disk, const partition_t *partition)
void xml_setup(const disk_t *disk, const partition_t *partition)
{
if(xml_handle==NULL)
return;

View file

@ -35,7 +35,7 @@ void xml_push(const char *tag, const char *attribute);
void xml_pop(const char *tag);
void xml_out2s(const char *tag, const char *value);
void xml_out2i(const char *tag, const uint64_t value);
void xml_setup(disk_t *disk, const partition_t *partition);
void xml_setup(const disk_t *disk, const partition_t *partition);
void xml_set_command_line(const int argc, char **argv);
void xml_clear_command_line(void);
void xml_add_DFXML_creator(const char *package, const char *version);

View file

@ -96,7 +96,6 @@ static struct struct_io_manager my_struct_manager = {
.write_blk64=&my_write_blk64,
#endif
};
static int ext2_dir(disk_t *disk_car, const partition_t *partition, dir_data_t *dir_data, const unsigned long int cluster, file_info_t *dir_list);
static io_channel shared_ioch=NULL;
/*

View file

@ -62,7 +62,7 @@ static void dump_fat1x_ncurses(disk_t *disk_car, const partition_t *partition, c
}
#endif
static void dump_fat1x(disk_t *disk_car, partition_t *partition, const unsigned char *buffer_bs, char **current_cmd)
static void dump_fat1x(disk_t *disk_car, const partition_t *partition, const unsigned char *buffer_bs, char **current_cmd)
{
log_info("Boot sector\n");
dump_log(buffer_bs, FAT1x_BOOT_SECTOR_SIZE);

View file

@ -57,7 +57,6 @@ struct fat_dir_struct
static int fat1x_rootdir(disk_t *disk_car, const partition_t *partition, const dir_data_t *dir_data, const struct fat_boot_sector*fat_header, file_info_t *dir_list);
static int fat_dir(disk_t *disk_car, const partition_t *partition, dir_data_t *dir_data, const unsigned long int first_cluster, file_info_t *dir_list);
static inline void fat16_towchar(wchar_t *dst, const uint8_t *src, size_t len);
static int fat_copy(disk_t *disk_car, const partition_t *partition, dir_data_t *dir_data, const file_info_t *file);
static void dir_partition_fat_close(dir_data_t *dir_data);

View file

@ -78,7 +78,7 @@ int check_gfs2(disk_t *disk, partition_t *partition)
return 0;
}
int recover_gfs2(disk_t *disk, const struct gfs2_sb *sb, partition_t *partition, const int dump_ind)
int recover_gfs2(const disk_t *disk, const struct gfs2_sb *sb, partition_t *partition, const int dump_ind)
{
if(test_gfs2(disk,sb,partition,dump_ind)!=0)
return 1;

View file

@ -79,7 +79,7 @@ struct gfs2_sb {
//
int check_gfs2(disk_t *disk_car, partition_t *partition);
int recover_gfs2(disk_t *disk_car, const struct gfs2_sb *sb, partition_t *partition, const int dump_ind);
int recover_gfs2(const disk_t *disk_car, const struct gfs2_sb *sb, partition_t *partition, const int dump_ind);
#ifdef __cplusplus
} /* closing brace for extern "C" */

View file

@ -83,7 +83,7 @@ int recover_HFS(disk_t *disk_car, const hfs_mdb_t *hfs_mdb,partition_t *partitio
return 0;
}
int test_HFS(disk_t *disk_car, const hfs_mdb_t *hfs_mdb, const partition_t *partition, const int verbose, const int dump_ind)
int test_HFS(const disk_t *disk_car, const hfs_mdb_t *hfs_mdb, const partition_t *partition, const int verbose, const int dump_ind)
{
/* Check for HFS signature */
if (hfs_mdb->drSigWord!=be16(HFS_SUPER_MAGIC))

View file

@ -76,7 +76,7 @@ struct hfs_mdb {
hfs_extent_rec drCTExtRec; /* 0x96 catalog B-tree's first 3 extents */
} __attribute__ ((gcc_struct, __packed__));
int check_HFS(disk_t *disk_car,partition_t *partition,const int verbose);
int test_HFS(disk_t *disk_car, const hfs_mdb_t *hfs_mdb, const partition_t *partition, const int verbose, const int dump_ind);
int test_HFS(const disk_t *disk_car, const hfs_mdb_t *hfs_mdb, const partition_t *partition, const int verbose, const int dump_ind);
int recover_HFS(disk_t *disk_car, const hfs_mdb_t *hfs_mdb,partition_t *partition,const int verbose, const int dump_ind, const int backup);
#ifdef __cplusplus

View file

@ -76,7 +76,7 @@ int check_HFSP(disk_t *disk_car,partition_t *partition,const int verbose)
return 0;
}
int recover_HFSP(disk_t *disk_car, const struct hfsp_vh *vh,partition_t *partition,const int verbose, const int dump_ind, const int backup)
int recover_HFSP(disk_t *disk_car, const struct hfsp_vh *vh, partition_t *partition, const int verbose, const int dump_ind, const int backup)
{
uint64_t part_size;
if(test_HFSP(disk_car,vh,partition,verbose,dump_ind)!=0)

View file

@ -150,7 +150,7 @@ typedef struct hfsp_vh {
int check_HFSP(disk_t *disk_car,partition_t *partition,const int verbose);
int test_HFSP(const disk_t *disk_car, const struct hfsp_vh *vh, const partition_t *partition, const int verbose, const int dump_ind);
int recover_HFSP(disk_t *disk_car, const struct hfsp_vh *vh,partition_t *partition,const int verbose, const int dump_ind, const int backup);
int recover_HFSP(disk_t *disk_car, const struct hfsp_vh *vh, partition_t *partition, const int verbose, const int dump_ind, const int backup);
#ifdef __cplusplus
} /* closing brace for extern "C" */

View file

@ -70,7 +70,7 @@ static int test_HPFS(const disk_t *disk_car, const struct fat_boot_sector *hpfs_
return 1;
}
int recover_HPFS(disk_t *disk_car, const struct fat_boot_sector *hpfs_header, partition_t *partition, const int verbose)
int recover_HPFS(const disk_t *disk_car, const struct fat_boot_sector *hpfs_header, partition_t *partition, const int verbose)
{
if(test_HPFS(disk_car, hpfs_header, partition, verbose,0)!=0)
return 1;

View file

@ -26,7 +26,7 @@
extern "C" {
#endif
int recover_HPFS(disk_t *disk_car, const struct fat_boot_sector *hpfs_header, partition_t *partition, const int verbose);
int recover_HPFS(const disk_t *disk_car, const struct fat_boot_sector *hpfs_header, partition_t *partition, const int verbose);
int check_HPFS(disk_t *disk_car,partition_t *partition, const int verbose);
#ifdef __cplusplus

View file

@ -1593,7 +1593,7 @@ static void ntfs_undelete_menu_ncurses(const disk_t *disk_car, const partition_t
}
#endif
static void ntfs_undelete_cli(dir_data_t *dir_data, file_info_t *dir_list)
static void ntfs_undelete_cli(dir_data_t *dir_data, const file_info_t *dir_list)
{
unsigned int file_ok=0;
unsigned int file_bad=0;
@ -1617,7 +1617,7 @@ static void ntfs_undelete_cli(dir_data_t *dir_data, file_info_t *dir_list)
opts.dest=NULL;
}
static void ntfs_undelete_menu(disk_t *disk_car, const partition_t *partition, dir_data_t *dir_data, file_info_t *dir_list, char**current_cmd)
static void ntfs_undelete_menu(const disk_t *disk_car, const partition_t *partition, dir_data_t *dir_data, file_info_t *dir_list, char**current_cmd)
{
log_list_file(disk_car, partition, dir_data, dir_list);
if(*current_cmd!=NULL)

View file

@ -92,7 +92,7 @@ static pstatus_t photorec_new_file(file_recovery_t *file_recovery, struct ph_par
return PSTATUS_OK;
}
static pstatus_t photorec_header_found(file_recovery_t *file_recovery_new, file_recovery_t *file_recovery, struct ph_param *params, const struct ph_options *options, alloc_data_t *list_search_space, const unsigned char *buffer, pfstatus_t *file_recovered, const uint64_t offset)
static pstatus_t photorec_header_found(const file_recovery_t *file_recovery_new, file_recovery_t *file_recovery, struct ph_param *params, const struct ph_options *options, alloc_data_t *list_search_space, const unsigned char *buffer, pfstatus_t *file_recovered, const uint64_t offset)
{
*file_recovered=PFSTATUS_BAD;
if(file_recovery_new->file_stat==NULL || file_recovery_new->file_stat->file_hint==NULL)