summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2020-06-19 22:05:38 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2020-06-19 22:05:38 +0200
commit90d21a4d8126553876d324bc0ffa24293e610550 (patch)
tree6c1fd70329c076ced15297ac3382c0d628b4ac7b
parent60b5424f53c3d8606b6d04f32340d6533d6c358f (diff)
Constify more function parametersHEADmaster
-rw-r--r--src/analyse.c2
-rw-r--r--src/analyse.h2
-rw-r--r--src/dfxml.c2
-rw-r--r--src/dfxml.h2
-rw-r--r--src/ext2_dir.c1
-rw-r--r--src/fat1x.c2
-rw-r--r--src/fat_dir.c1
-rw-r--r--src/gfs2.c2
-rw-r--r--src/gfs2.h2
-rw-r--r--src/hfs.c2
-rw-r--r--src/hfs.h2
-rw-r--r--src/hfsp.c2
-rw-r--r--src/hfsp.h2
-rw-r--r--src/hpfs.c2
-rw-r--r--src/hpfs.h2
-rw-r--r--src/ntfs_udl.c4
-rw-r--r--src/photorec_check_header.h2
17 files changed, 16 insertions, 18 deletions
diff --git a/src/analyse.c b/src/analyse.c
index b121986..46cf036 100644
--- a/src/analyse.c
+++ b/src/analyse.c
@@ -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);
diff --git a/src/analyse.h b/src/analyse.h
index 82c1b61..aaf1002 100644
--- a/src/analyse.h
+++ b/src/analyse.h
@@ -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);
diff --git a/src/dfxml.c b/src/dfxml.c
index 142d066..947436e 100644
--- a/src/dfxml.c
+++ b/src/dfxml.c
@@ -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;
diff --git a/src/dfxml.h b/src/dfxml.h
index 9f0b16c..c6cd34b 100644
--- a/src/dfxml.h
+++ b/src/dfxml.h
@@ -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);
diff --git a/src/ext2_dir.c b/src/ext2_dir.c
index 82106c1..efc19a3 100644
--- a/src/ext2_dir.c
+++ b/src/ext2_dir.c
@@ -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;
/*
diff --git a/src/fat1x.c b/src/fat1x.c
index baa6b94..43d8950 100644
--- a/src/fat1x.c
+++ b/src/fat1x.c
@@ -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);
diff --git a/src/fat_dir.c b/src/fat_dir.c
index 3c9c171..02a327b 100644
--- a/src/fat_dir.c
+++ b/src/fat_dir.c
@@ -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);
diff --git a/src/gfs2.c b/src/gfs2.c
index 9784c9c..d0eadc8 100644
--- a/src/gfs2.c
+++ b/src/gfs2.c
@@ -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;
diff --git a/src/gfs2.h b/src/gfs2.h
index 6c9859a..20d7302 100644
--- a/src/gfs2.h
+++ b/src/gfs2.h
@@ -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" */
diff --git a/src/hfs.c b/src/hfs.c
index 203ed86..a30b338 100644
--- a/src/hfs.c
+++ b/src/hfs.c
@@ -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))
diff --git a/src/hfs.h b/src/hfs.h
index 9886916..51ec025 100644
--- a/src/hfs.h
+++ b/src/hfs.h
@@ -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
diff --git a/src/hfsp.c b/src/hfsp.c
index bfdab80..d8add90 100644
--- a/src/hfsp.c
+++ b/src/hfsp.c
@@ -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)
diff --git a/src/hfsp.h b/src/hfsp.h
index daad758..f6e4b07 100644
--- a/src/hfsp.h
+++ b/src/hfsp.h
@@ -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" */
diff --git a/src/hpfs.c b/src/hpfs.c
index 43877f0..645e810 100644
--- a/src/hpfs.c
+++ b/src/hpfs.c
@@ -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;
diff --git a/src/hpfs.h b/src/hpfs.h
index b5947d4..faee3ae 100644
--- a/src/hpfs.h
+++ b/src/hpfs.h
@@ -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
diff --git a/src/ntfs_udl.c b/src/ntfs_udl.c
index e7c1770..8373550 100644
--- a/src/ntfs_udl.c
+++ b/src/ntfs_udl.c
@@ -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)
diff --git a/src/photorec_check_header.h b/src/photorec_check_header.h
index 6522d9f..ed41ff7 100644
--- a/src/photorec_check_header.h
+++ b/src/photorec_check_header.h
@@ -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)