summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2009-01-04 20:30:12 +0100
committerChristophe Grenier <grenier@cgsecurity.org>2009-01-04 20:30:12 +0100
commitdbba3af27b57bc1771111d810e332fefb853052c (patch)
treebe6b18afb39722d38f96792cd2b5e4c46981b2a2 /src
parenta31b420f697831d4a8e9811489ad07b0b99c3fa4 (diff)
Fix for C++ compilation
Diffstat (limited to 'src')
-rw-r--r--src/fat_adv.c2
-rw-r--r--src/file_dir.c2
-rw-r--r--src/file_gz.c2
-rw-r--r--src/file_jpg.c2
-rw-r--r--src/file_mov.c30
-rw-r--r--src/file_mp3.c4
-rw-r--r--src/file_pdf.c2
-rw-r--r--src/file_tiff.c4
-rw-r--r--src/file_txt.c8
-rw-r--r--src/file_zip.c6
-rw-r--r--src/ppartsel.c4
11 files changed, 33 insertions, 33 deletions
diff --git a/src/fat_adv.c b/src/fat_adv.c
index 812efad..00701f9 100644
--- a/src/fat_adv.c
+++ b/src/fat_adv.c
@@ -1840,7 +1840,7 @@ static upart_type_t select_fat_info(const info_offset_t *info_offset, const unsi
}
*reserved=0;
*fat_length=0;
- return 0;
+ return UP_UNK;
}
#endif
diff --git a/src/file_dir.c b/src/file_dir.c
index 355a55e..456ec2e 100644
--- a/src/file_dir.c
+++ b/src/file_dir.c
@@ -43,7 +43,7 @@ const file_hint_t file_hint_dir= {
.register_header_check=&register_header_check_dir
};
-static const unsigned char *dir_header=". ";
+static const unsigned char *dir_header=(const unsigned char *)". ";
static void register_header_check_dir(file_stat_t *file_stat)
{
diff --git a/src/file_gz.c b/src/file_gz.c
index 8f3eed8..46fa573 100644
--- a/src/file_gz.c
+++ b/src/file_gz.c
@@ -118,7 +118,7 @@ static int header_check_gz(const unsigned char *buffer, const unsigned int buffe
d_stream.zfree = (free_func)0;
d_stream.opaque = (voidpf)0;
- d_stream.next_in = buffer_compr;
+ d_stream.next_in = (Bytef*)buffer_compr;
d_stream.avail_in = 0;
d_stream.next_out = buffer_uncompr;
diff --git a/src/file_jpg.c b/src/file_jpg.c
index f11d407..7c928f2 100644
--- a/src/file_jpg.c
+++ b/src/file_jpg.c
@@ -101,7 +101,7 @@ static int header_check_jpg(const unsigned char *buffer, const unsigned int buff
unsigned int tiff_size=2+(buffer[i+2]<<8)+buffer[i+3]-0x0A;
if(buffer_size - (i+0x0A) < tiff_size)
tiff_size=buffer_size - (i+0x0A);
- file_recovery_new->time=get_date_from_tiff_header((const struct tiff_entry *)&buffer[i+0x0A], tiff_size);
+ file_recovery_new->time=get_date_from_tiff_header((const TIFFHeader*)&buffer[i+0x0A], tiff_size);
}
i+=2+(buffer[i+2]<<8)+buffer[i+3];
}
diff --git a/src/file_mov.c b/src/file_mov.c
index 1816ddb..a666b6d 100644
--- a/src/file_mov.c
+++ b/src/file_mov.c
@@ -49,21 +49,21 @@ const file_hint_t file_hint_mov= {
static void register_header_check_mov(file_stat_t *file_stat)
{
- register_header_check(4, "cmov",4, &header_check_mov, file_stat);
- register_header_check(4, "cmvd",4, &header_check_mov, file_stat);
- register_header_check(4, "dcom",4, &header_check_mov, file_stat);
- register_header_check(4, "free",4, &header_check_mov, file_stat);
- register_header_check(4, "ftyp",4, &header_check_mov, file_stat);
- register_header_check(4, "jp2h",4, &header_check_mov, file_stat);
- register_header_check(4, "mdat",4, &header_check_mov, file_stat);
- register_header_check(4, "mdia",4, &header_check_mov, file_stat);
- register_header_check(4, "moov",4, &header_check_mov, file_stat);
- register_header_check(4, "PICT",4, &header_check_mov, file_stat);
- register_header_check(4, "pnot",4, &header_check_mov, file_stat);
- register_header_check(4, "skip",4, &header_check_mov, file_stat);
- register_header_check(4, "stbl",4, &header_check_mov, file_stat);
- register_header_check(4, "trak",4, &header_check_mov, file_stat);
- register_header_check(4, "wide",4, &header_check_mov, file_stat);
+ register_header_check(4, (const unsigned char*)"cmov",4, &header_check_mov, file_stat);
+ register_header_check(4, (const unsigned char*)"cmvd",4, &header_check_mov, file_stat);
+ register_header_check(4, (const unsigned char*)"dcom",4, &header_check_mov, file_stat);
+ register_header_check(4, (const unsigned char*)"free",4, &header_check_mov, file_stat);
+ register_header_check(4, (const unsigned char*)"ftyp",4, &header_check_mov, file_stat);
+ register_header_check(4, (const unsigned char*)"jp2h",4, &header_check_mov, file_stat);
+ register_header_check(4, (const unsigned char*)"mdat",4, &header_check_mov, file_stat);
+ register_header_check(4, (const unsigned char*)"mdia",4, &header_check_mov, file_stat);
+ register_header_check(4, (const unsigned char*)"moov",4, &header_check_mov, file_stat);
+ register_header_check(4, (const unsigned char*)"PICT",4, &header_check_mov, file_stat);
+ register_header_check(4, (const unsigned char*)"pnot",4, &header_check_mov, file_stat);
+ register_header_check(4, (const unsigned char*)"skip",4, &header_check_mov, file_stat);
+ register_header_check(4, (const unsigned char*)"stbl",4, &header_check_mov, file_stat);
+ register_header_check(4, (const unsigned char*)"trak",4, &header_check_mov, file_stat);
+ register_header_check(4, (const unsigned char*)"wide",4, &header_check_mov, file_stat);
}
static int header_check_mov(const unsigned char *buffer, const unsigned int buffer_size, const unsigned int safe_header_only, const file_recovery_t *file_recovery, file_recovery_t *file_recovery_new)
diff --git a/src/file_mp3.c b/src/file_mp3.c
index 469224c..0723296 100644
--- a/src/file_mp3.c
+++ b/src/file_mp3.c
@@ -318,11 +318,11 @@ static int data_check_mp3(const unsigned char *buffer, const unsigned int buffer
/* FIXME */
if(file_recovery->calculated_file_size + 5100 >= file_recovery->file_size + buffer_size/2)
return 1;
- if((pos_lyrics=pos_in_mem(&buffer[i],4096,"LYRICS200",9)) != 0)
+ if((pos_lyrics=pos_in_mem(&buffer[i], 4096, (const unsigned char*)"LYRICS200", 9)) != 0)
{
file_recovery->calculated_file_size+=pos_lyrics;
}
- else if((pos_lyrics=pos_in_mem(&buffer[i],5100,"LYRICSEND",9)) != 0)
+ else if((pos_lyrics=pos_in_mem(&buffer[i], 5100, (const unsigned char*)"LYRICSEND", 9)) != 0)
{
file_recovery->calculated_file_size+=pos_lyrics;
}
diff --git a/src/file_pdf.c b/src/file_pdf.c
index 61e16a0..90d7d56 100644
--- a/src/file_pdf.c
+++ b/src/file_pdf.c
@@ -65,7 +65,7 @@ static int header_check_pdf(const unsigned char *buffer, const unsigned int buff
file_recovery_new->extension="ai";
else
file_recovery_new->extension=file_hint_pdf.extension;
- if((linearized=td_memmem(buffer, 512, sig_linearized,sizeof(sig_linearized))) != NULL)
+ if((linearized=(const unsigned char *)td_memmem(buffer, 512, sig_linearized, sizeof(sig_linearized))) != NULL)
{
linearized+=sizeof(sig_linearized);
while(*linearized!='>' && linearized<=buffer+512)
diff --git a/src/file_tiff.c b/src/file_tiff.c
index 56e795e..edc506b 100644
--- a/src/file_tiff.c
+++ b/src/file_tiff.c
@@ -352,7 +352,7 @@ static uint64_t header_check_tiff_le(FILE *in, const uint32_t tiff_diroff, const
{
unsigned int j;
uint32_t *subifd_offsetp;
- subifd_offsetp=(uint32_t *)malloc(nbr*sizeof(*subifd_offsetp));
+ subifd_offsetp=(uint32_t *)MALLOC(nbr*sizeof(*subifd_offsetp));
if(fseek(in, le32(entry->tdir_offset), SEEK_SET) < 0)
return -1;
if(fread(subifd_offsetp, sizeof(*subifd_offsetp), nbr, in) != nbr)
@@ -474,7 +474,7 @@ static uint64_t header_check_tiff_be(FILE *in, const uint32_t tiff_diroff, const
{
unsigned int j;
uint32_t *subifd_offsetp;
- subifd_offsetp=(uint32_t *)malloc(nbr*sizeof(*subifd_offsetp));
+ subifd_offsetp=(uint32_t *)MALLOC(nbr*sizeof(*subifd_offsetp));
if(fseek(in, be32(entry->tdir_offset), SEEK_SET) < 0)
return -1;
if(fread(subifd_offsetp, sizeof(*subifd_offsetp), nbr, in) != nbr)
diff --git a/src/file_txt.c b/src/file_txt.c
index c390484..baf2802 100644
--- a/src/file_txt.c
+++ b/src/file_txt.c
@@ -592,7 +592,7 @@ static int header_check_txt(const unsigned char *buffer, const unsigned int buff
buffer_lower_size=buffer_size_test+16;
buffer_lower=(char *)MALLOC(buffer_lower_size);
}
- l=UTF2Lat(buffer_lower,buffer,buffer_size_test);
+ l=UTF2Lat((unsigned char*)buffer_lower, buffer, buffer_size_test);
/* strncasecmp */
if(memcmp(buffer_lower,header_bat,sizeof(header_bat))==0)
{
@@ -621,9 +621,9 @@ static int header_check_txt(const unsigned char *buffer, const unsigned int buff
if(buffer[0]=='#' && buffer[1]=='!')
{
unsigned int ll=l-2;
- const unsigned char *haystack=buffer_lower+2;
+ const unsigned char *haystack=(const unsigned char *)buffer_lower+2;
const unsigned char *res;
- res=memchr(haystack,'\n',ll);
+ res=(const unsigned char *)memchr(haystack,'\n',ll);
if(res!=NULL)
ll=res-haystack;
if(td_memmem(haystack, ll, header_sig_perl, sizeof(header_sig_perl)) != NULL)
@@ -822,7 +822,7 @@ static int data_check_txt(const unsigned char *buffer, const unsigned int buffer
{
unsigned int i;
char *buffer_lower=(char *)MALLOC(buffer_size+16);
- i=UTF2Lat(buffer_lower,&buffer[buffer_size/2],buffer_size/2);
+ i=UTF2Lat((unsigned char*)buffer_lower, &buffer[buffer_size/2], buffer_size/2);
if(i<buffer_size/2)
{
const char sign_html_end[] = "</html>";
diff --git a/src/file_zip.c b/src/file_zip.c
index 21870bf..c59047f 100644
--- a/src/file_zip.c
+++ b/src/file_zip.c
@@ -562,11 +562,11 @@ static int header_check_zip(const unsigned char *buffer, const unsigned int buff
file_recovery_new->extension="odt";
else if(memcmp(&buffer[30],"[Content_Types].xml",19)==0)
{
- if(pos_in_mem(&buffer[0],2000,"word",4)!=0)
+ if(pos_in_mem(&buffer[0], 2000, (const unsigned char*)"word", 4)!=0)
file_recovery_new->extension="docx";
- else if(pos_in_mem(&buffer[0],2000,"xl",2)!=0)
+ else if(pos_in_mem(&buffer[0], 2000, (const unsigned char*)"xl", 2)!=0)
file_recovery_new->extension="xlsx";
- else if(pos_in_mem(&buffer[0],2000,"ppt",3)!=0)
+ else if(pos_in_mem(&buffer[0], 2000, (const unsigned char*)"ppt", 3)!=0)
file_recovery_new->extension="pptx";
else
file_recovery_new->extension="docx";
diff --git a/src/ppartsel.c b/src/ppartsel.c
index 63662da..f22b9d6 100644
--- a/src/ppartsel.c
+++ b/src/ppartsel.c
@@ -146,7 +146,7 @@ void menu_photorec(disk_t *disk_car, const int verbose, const char *recup_dir, f
char *res;
(*current_cmd)+=6;
if(recup_dir!=NULL)
- res=recup_dir;
+ res=(char *)recup_dir;
else
{
res=ask_location("Do you want to save recovered files in %s%s ? [Y/N]\nDo not choose to write the files to the same partition they were stored on.","");
@@ -359,7 +359,7 @@ void menu_photorec(disk_t *disk_car, const int verbose, const char *recup_dir, f
ask_mode_ext2(disk_car, partition, &mode_ext2, &carve_free_space_only);
menu=0;
if(recup_dir!=NULL)
- res=recup_dir;
+ res=(char *)recup_dir;
else
{
res=ask_location("Do you want to save recovered files in %s%s ? [Y/N]\nDo not choose to write the files to the same partition they were stored on.","");