summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2013-11-03 15:34:55 +0100
committerChristophe Grenier <grenier@cgsecurity.org>2013-11-03 15:34:55 +0100
commit1398b863c2a47d2da492e8a66995e65cc3aded75 (patch)
treef67ce2fe9140ed7dacac5eaa8999a6e032fb2f3b
parent191a261516d0f55336f37ced9fa3695d66d225d9 (diff)
TestDisk: remove align parameter from write_part() function
-rw-r--r--src/common.h2
-rw-r--r--src/godmode.c8
-rw-r--r--src/partgpt.h2
-rw-r--r--src/partgptro.c2
-rw-r--r--src/partgptw.c4
-rw-r--r--src/parthumax.c4
-rw-r--r--src/parti386.c4
-rw-r--r--src/partmac.c4
-rw-r--r--src/partsun.c4
-rw-r--r--src/partxbox.c4
10 files changed, 19 insertions, 19 deletions
diff --git a/src/common.h b/src/common.h
index 31794d8..6e4dc8b 100644
--- a/src/common.h
+++ b/src/common.h
@@ -331,7 +331,7 @@ struct arch_fnct_struct
const char *part_name_option;
const char *msg_part_type;
list_part_t *(*read_part)(disk_t *disk, const int verbose,const int saveheader);
- int (*write_part)(disk_t *disk, const list_part_t *list_part, const int ro, const int verbose, const int align);
+ int (*write_part)(disk_t *disk, const list_part_t *list_part, const int ro, const int verbose);
list_part_t *(*init_part_order)(const disk_t *disk, list_part_t *list_part);
/* geometry must be initialized to 0,0,0 in get_geometry_from_mbr()*/
int (*get_geometry_from_mbr)(const unsigned char *buffer, const int verbose, CHSgeometry_t *geometry);
diff --git a/src/godmode.c b/src/godmode.c
index f7832ef..3e8107b 100644
--- a/src/godmode.c
+++ b/src/godmode.c
@@ -463,7 +463,7 @@ static uint64_t get_min_location(const disk_t *disk)
else if(disk->arch==&arch_mac)
return 4096;
else if(disk->arch==&arch_sun)
- return disk->geom.heads_per_cylinder * disk->geom.sectors_per_head * disk->sector_size;
+ return (uint64_t)disk->geom.heads_per_cylinder * disk->geom.sectors_per_head * disk->sector_size;
else if(disk->arch==&arch_xbox)
return 0x800;
/* arch_none */
@@ -1139,7 +1139,7 @@ static list_part_t *add_ext_part_i386(disk_t *disk, list_part_t *list_part, cons
if(deb->part->part_offset%(1024*1024)==0)
tmp=1024*1024;
else
- tmp=disk->geom.sectors_per_head * disk->sector_size;
+ tmp=(uint64_t)disk->geom.sectors_per_head * disk->sector_size;
if(tmp < part_extended_offset)
part_extended_offset=tmp;
}
@@ -1404,7 +1404,7 @@ int interface_recovery(disk_t *disk_car, const list_part_t * list_part_org, cons
)
{
log_info("write!\n");
- if(disk_car->arch->write_part(disk_car,list_part,RW,verbose,align))
+ if(disk_car->arch->write_part(disk_car, list_part, RW, verbose))
{
display_message(msg_PART_WR_ERR);
}
@@ -1423,7 +1423,7 @@ int interface_recovery(disk_t *disk_car, const list_part_t * list_part_org, cons
if(disk_car->arch->write_part!=NULL)
{
log_info("simulate write!\n");
- disk_car->arch->write_part(disk_car,list_part,RO,verbose,align);
+ disk_car->arch->write_part(disk_car, list_part, RO, verbose);
}
break;
case 'S':
diff --git a/src/partgpt.h b/src/partgpt.h
index 42e5e52..f3fe8ad 100644
--- a/src/partgpt.h
+++ b/src/partgpt.h
@@ -63,7 +63,7 @@ struct systypes_gtp {
};
list_part_t *add_partition_gpt_cli(disk_t *disk_car,list_part_t *list_part, char **current_cmd);
-int write_part_gpt(disk_t *disk_car, const list_part_t *list_part, const int ro, const int verbose, const int align);
+int write_part_gpt(disk_t *disk_car, const list_part_t *list_part, const int ro, const int verbose);
#ifdef __cplusplus
} /* closing brace for extern "C" */
diff --git a/src/partgptro.c b/src/partgptro.c
index 9044a90..1a1753d 100644
--- a/src/partgptro.c
+++ b/src/partgptro.c
@@ -29,7 +29,7 @@
#include "common.h"
#include "partgpt.h"
-int write_part_gpt(disk_t *disk_car, const list_part_t *list_part, const int ro, const int verbose, const int align)
+int write_part_gpt(disk_t *disk_car, const list_part_t *list_part, const int ro, const int verbose)
{
if(ro==0)
return -1;
diff --git a/src/partgptw.c b/src/partgptw.c
index 1aad89f..9bebfd1 100644
--- a/src/partgptw.c
+++ b/src/partgptw.c
@@ -188,12 +188,12 @@ static int write_part_gpt_i386(disk_t *disk_car, const list_part_t *list_part)
if(insert_error>0)
free(new_partition);
}
- arch_i386.write_part(disk_car, list_part_i386, 0, 0, 0);
+ arch_i386.write_part(disk_car, list_part_i386, 0, 0);
part_free_list(list_part_i386);
return 0;
}
-int write_part_gpt(disk_t *disk_car, const list_part_t *list_part, const int ro, const int verbose, const int align)
+int write_part_gpt(disk_t *disk_car, const list_part_t *list_part, const int ro, const int verbose)
{
struct gpt_hdr *gpt;
struct gpt_ent* gpt_entries;
diff --git a/src/parthumax.c b/src/parthumax.c
index 4fefd51..9fb59ad 100644
--- a/src/parthumax.c
+++ b/src/parthumax.c
@@ -43,7 +43,7 @@
#include "parthumax.h"
static list_part_t *read_part_humax(disk_t *disk_car, const int verbose, const int saveheader);
-static int write_part_humax(disk_t *disk_car, const list_part_t *list_part, const int ro , const int verbose, const int align);
+static int write_part_humax(disk_t *disk_car, const list_part_t *list_part, const int ro , const int verbose);
static list_part_t *init_part_order_humax(const disk_t *disk_car, list_part_t *list_part);
static void set_next_status_humax(const disk_t *disk_car, partition_t *partition);
static int test_structure_humax(list_part_t *list_part);
@@ -144,7 +144,7 @@ static list_part_t *read_part_humax(disk_t *disk_car, const int verbose, const i
return new_list_part;
}
-static int write_part_humax(disk_t *disk_car, const list_part_t *list_part, const int ro, const int verbose, const int align)
+static int write_part_humax(disk_t *disk_car, const list_part_t *list_part, const int ro, const int verbose)
{
/* TODO: Implement it */
if(ro==0)
diff --git a/src/parti386.c b/src/parti386.c
index 13374a6..1a09583 100644
--- a/src/parti386.c
+++ b/src/parti386.c
@@ -95,7 +95,7 @@ static int write_all_log_i386(disk_t *disk_car, const list_part_t *list_part, co
static int diff(const unsigned char buffer[DEFAULT_SECTOR_SIZE], const unsigned char buffer_org[DEFAULT_SECTOR_SIZE]);
static list_part_t *read_part_i386(disk_t *disk_car, const int verbose, const int saveheader);
-static int write_part_i386(disk_t *disk_car, const list_part_t *list_part, const int ro , const int verbose, const int align);
+static int write_part_i386(disk_t *disk_car, const list_part_t *list_part, const int ro , const int verbose);
static list_part_t *init_part_order_i386(const disk_t *disk_car, list_part_t *list_part);
static int write_MBR_code_i386(disk_t *disk_car);
static int write_MBR_code_i386_aux(unsigned char *buffer);
@@ -650,7 +650,7 @@ static int test_MBR_over(disk_t *disk_car,list_part_t *list_part)
return res;
}
-static int write_part_i386(disk_t *disk_car, const list_part_t *list_part, const int ro, const int verbose, const int align)
+static int write_part_i386(disk_t *disk_car, const list_part_t *list_part, const int ro, const int verbose)
{
int res=0;
res+=write_mbr_i386(disk_car,list_part,ro,verbose);
diff --git a/src/partmac.c b/src/partmac.c
index d43cc2d..5fe2053 100644
--- a/src/partmac.c
+++ b/src/partmac.c
@@ -49,7 +49,7 @@
static int check_part_mac(disk_t *disk_car, const int verbose,partition_t *partition,const int saveheader);
static list_part_t *read_part_mac(disk_t *disk_car, const int verbose, const int saveheader);
-static int write_part_mac(disk_t *disk_car, const list_part_t *list_part, const int ro , const int verbose, const int align);
+static int write_part_mac(disk_t *disk_car, const list_part_t *list_part, const int ro , const int verbose);
static list_part_t *init_part_order_mac(const disk_t *disk_car, list_part_t *list_part);
static void set_next_status_mac(const disk_t *disk_car, partition_t *partition);
static int set_part_type_mac(partition_t *partition, unsigned int part_type_mac);
@@ -196,7 +196,7 @@ static list_part_t *read_part_mac(disk_t *disk_car, const int verbose, const int
return new_list_part;
}
-static int write_part_mac(disk_t *disk_car, const list_part_t *list_part, const int ro, const int verbose, const int align)
+static int write_part_mac(disk_t *disk_car, const list_part_t *list_part, const int ro, const int verbose)
{
/* TODO: Implement it */
if(ro==0)
diff --git a/src/partsun.c b/src/partsun.c
index 77e6b19..0c749e7 100644
--- a/src/partsun.c
+++ b/src/partsun.c
@@ -52,7 +52,7 @@
static int check_part_sun(disk_t *disk_car, const int verbose,partition_t *partition,const int saveheader);
static int get_geometry_from_sunmbr(const unsigned char *buffer, const int verbose, CHSgeometry_t *geometry);
static list_part_t *read_part_sun(disk_t *disk_car, const int verbose, const int saveheader);
-static int write_part_sun(disk_t *disk_car, const list_part_t *list_part, const int ro , const int verbose, const int align);
+static int write_part_sun(disk_t *disk_car, const list_part_t *list_part, const int ro , const int verbose);
static list_part_t *init_part_order_sun(const disk_t *disk_car, list_part_t *list_part);
static void set_next_status_sun(const disk_t *disk_car, partition_t *partition);
static int test_structure_sun(list_part_t *list_part);
@@ -171,7 +171,7 @@ static list_part_t *read_part_sun(disk_t *disk_car, const int verbose, const int
return new_list_part;
}
-static int write_part_sun(disk_t *disk_car, const list_part_t *list_part, const int ro, const int verbose, const int align)
+static int write_part_sun(disk_t *disk_car, const list_part_t *list_part, const int ro, const int verbose)
{
/* TODO: Implement it */
if(ro==0)
diff --git a/src/partxbox.c b/src/partxbox.c
index 78e8d4b..5101e0e 100644
--- a/src/partxbox.c
+++ b/src/partxbox.c
@@ -46,7 +46,7 @@
static int check_part_xbox(disk_t *disk_car, const int verbose,partition_t *partition,const int saveheader);
static list_part_t *read_part_xbox(disk_t *disk_car, const int verbose, const int saveheader);
-static int write_part_xbox(disk_t *disk_car, const list_part_t *list_part, const int ro , const int verbose, const int align);
+static int write_part_xbox(disk_t *disk_car, const list_part_t *list_part, const int ro , const int verbose);
static list_part_t *init_part_order_xbox(const disk_t *disk_car, list_part_t *list_part);
static void set_next_status_xbox(const disk_t *disk_car, partition_t *partition);
static int test_structure_xbox(list_part_t *list_part);
@@ -131,7 +131,7 @@ static list_part_t *read_part_xbox(disk_t *disk_car, const int verbose, const in
return new_list_part;
}
-static int write_part_xbox(disk_t *disk_car, const list_part_t *list_part, const int ro, const int verbose, const int align)
+static int write_part_xbox(disk_t *disk_car, const list_part_t *list_part, const int ro, const int verbose)
{
/* TODO: Implement it */
if(ro==0)