summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2013-05-25 13:09:02 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2013-05-25 13:09:02 +0200
commitb7a3d0755ff06dd98d60e27e00b89ad891dbf367 (patch)
tree6c438cb796c1d5c5c82cc4cadcc52282bdc7013d
parentcf15e5dcd2f75edef2f1ddb382ec08b628a7823f (diff)
Fix various warning reported by gcc
-rw-r--r--src/exfat_dir.c4
-rw-r--r--src/ext2p.c7
-rw-r--r--src/file_doc.c4
-rw-r--r--src/file_lzh.c2
-rw-r--r--src/hdaccess.c2
-rw-r--r--src/io_redir.c5
-rw-r--r--src/log_part.c2
-rw-r--r--src/sessionp.c4
8 files changed, 16 insertions, 14 deletions
diff --git a/src/exfat_dir.c b/src/exfat_dir.c
index a4fee56..040088f 100644
--- a/src/exfat_dir.c
+++ b/src/exfat_dir.c
@@ -167,7 +167,7 @@ static int exfat_dir(disk_t *disk, const partition_t *partition, dir_data_t *dir
unsigned int cluster;
unsigned char *buffer_dir=(unsigned char *)MALLOC(NBR_CLUSTER_MAX << cluster_shift);
unsigned int nbr_cluster;
- unsigned int clus_blocknr;
+// unsigned int clus_blocknr;
unsigned int total_clusters;
exfat_method_t exfat_meth=exFAT_FOLLOW_CLUSTER;
int stop=0;
@@ -176,7 +176,7 @@ static int exfat_dir(disk_t *disk, const partition_t *partition, dir_data_t *dir
else
cluster=first_cluster;
memset(buffer_dir, 0, NBR_CLUSTER_MAX<<cluster_shift);
- clus_blocknr=le32(exfat_header->clus_blocknr);
+// clus_blocknr=le32(exfat_header->clus_blocknr);
total_clusters=le32(exfat_header->total_clusters);
nbr_cluster=0;
while(!is_EOC(cluster) && cluster>=2 && nbr_cluster<NBR_CLUSTER_MAX && stop==0)
diff --git a/src/ext2p.c b/src/ext2p.c
index 80fe951..41379c4 100644
--- a/src/ext2p.c
+++ b/src/ext2p.c
@@ -53,11 +53,14 @@ unsigned int ext2_remove_used_space(disk_t *disk, const partition_t *partition,
dir_data_t dir_data;
switch(dir_partition_ext2_init(disk, partition, &dir_data, 0))
{
- case -2:
- case -1:
+ case DIR_PART_ENOSYS:
+ return 0;
+ case DIR_PART_EIO:
log_partition(disk, partition);
log_error("Can't open filesystem. Filesystem seems damaged.\n");
return 0;
+ case DIR_PART_OK:
+ break;
}
{
const unsigned int sizeof_buffer=512;
diff --git a/src/file_doc.c b/src/file_doc.c
index b772bfd..c8654e1 100644
--- a/src/file_doc.c
+++ b/src/file_doc.c
@@ -660,12 +660,12 @@ static void OLE_parse_summary_aux(const unsigned char *dataPt, const unsigned in
return ;
pos=get32u(dataPt, 44);
{
- unsigned int size;
+// unsigned int size;
unsigned int numEntries;
unsigned int i;
if(pos+8 > dirLen)
return ;
- size=get32u(dataPt, pos);
+// size=get32u(dataPt, pos);
numEntries=get32u(dataPt, pos+4);
#ifdef DEBUG_OLE
log_info("Property Info %u - %u at 0x%x\n", numEntries, size, pos);
diff --git a/src/file_lzh.c b/src/file_lzh.c
index 2a16bc6..669b2b2 100644
--- a/src/file_lzh.c
+++ b/src/file_lzh.c
@@ -133,7 +133,7 @@ static int header_check_lzh(const unsigned char *buffer, const unsigned int buff
/* Level 2 */
case 2:
{
- const struct lzh_level2 *hdr=(const struct lzh_level2 *)buffer;
+// const struct lzh_level2 *hdr=(const struct lzh_level2 *)buffer;
reset_file_recovery(file_recovery_new);
file_recovery_new->extension=file_hint_lzh.extension;
return 1;
diff --git a/src/hdaccess.c b/src/hdaccess.c
index 60eeb49..e9df045 100644
--- a/src/hdaccess.c
+++ b/src/hdaccess.c
@@ -1117,7 +1117,7 @@ static void file_clean(disk_t *disk)
}
#endif
close(data->handle);
- data->handle=NULL;
+ data->handle=0;
}
generic_clean(disk);
}
diff --git a/src/io_redir.c b/src/io_redir.c
index a8f85ca..be40cdb 100644
--- a/src/io_redir.c
+++ b/src/io_redir.c
@@ -56,7 +56,7 @@ struct info_io_redir
};
static int io_redir_pread(disk_t *disk_car, void *buffer, const unsigned int count, const uint64_t offset);
-static int io_redir_clean(disk_t *clean);
+static void io_redir_clean(disk_t *clean);
int io_redir_add_redir(disk_t *disk_car, const uint64_t org_offset, const unsigned int size, const uint64_t new_offset, const void *mem)
{
@@ -217,7 +217,7 @@ static int io_redir_pread(disk_t *disk_car, void *buffer, const unsigned int cou
return count;
}
-static int io_redir_clean(disk_t *disk_car)
+static void io_redir_clean(disk_t *disk_car)
{
if(disk_car->data)
{
@@ -227,6 +227,5 @@ static int io_redir_clean(disk_t *disk_car)
free(disk_car->data);
disk_car->data=NULL;
}
- return 0;
}
diff --git a/src/log_part.c b/src/log_part.c
index dd60a68..7b20fac 100644
--- a/src/log_part.c
+++ b/src/log_part.c
@@ -45,7 +45,7 @@ void log_partition(const disk_t *disk, const partition_t *partition)
void log_all_partitions(const disk_t *disk, const list_part_t *list_part)
{
- list_part_t *element;
+ const list_part_t *element;
for(element=list_part; element!=NULL; element=element->next)
log_partition(disk, element->part);
}
diff --git a/src/sessionp.c b/src/sessionp.c
index e325d06..fb9b0f9 100644
--- a/src/sessionp.c
+++ b/src/sessionp.c
@@ -61,7 +61,7 @@ int session_load(char **cmd_device, char **current_cmd, alloc_data_t *list_free_
int taille;
struct stat stat_rec;
unsigned int buffer_size;
- time_t my_time;
+// time_t my_time;
char *info=NULL;
f_session=fopen(SESSION_FILENAME,"rb");
if(!f_session)
@@ -86,7 +86,7 @@ int session_load(char **cmd_device, char **current_cmd, alloc_data_t *list_free_
}
pos++;
/* load time */
- my_time=strtol(pos,&pos,10);
+ strtol(pos,&pos,10); // my_time=strtol(pos,&pos,10);
if(pos==NULL)
{
free(buffer);