From b7a3d0755ff06dd98d60e27e00b89ad891dbf367 Mon Sep 17 00:00:00 2001 From: Christophe Grenier Date: Sat, 25 May 2013 13:09:02 +0200 Subject: [PATCH] Fix various warning reported by gcc --- src/exfat_dir.c | 4 ++-- src/ext2p.c | 7 +++++-- src/file_doc.c | 4 ++-- src/file_lzh.c | 2 +- src/hdaccess.c | 2 +- src/io_redir.c | 5 ++--- src/log_part.c | 2 +- src/sessionp.c | 4 ++-- 8 files changed, 16 insertions(+), 14 deletions(-) diff --git a/src/exfat_dir.c b/src/exfat_dir.c index a4fee563..040088f3 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<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 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 2a16bc62..669b2b2d 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 60eeb49d..e9df0455 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 a8f85ca7..be40cdba 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 dd60a682..7b20fac5 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 e325d069..fb9b0f98 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);