summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2009-03-06 19:38:48 +0100
committerChristophe Grenier <grenier@cgsecurity.org>2009-03-06 19:38:48 +0100
commit22d825524dfd64368c55183b0dcad4b9048601d5 (patch)
treea0efe56d431fe34a14c5e8db701d4e07ecd9497a
parentc01909eefa4b438b3947bdea74d45a7a1b4ce2e0 (diff)
code cleanup, fix signed/unsigned warnings
-rw-r--r--src/fnctdsk.c1
-rw-r--r--src/hdaccess.c2
-rw-r--r--src/intrf.c4
-rw-r--r--src/intrfn.c2
-rw-r--r--src/ntfs_dir.c5
-rw-r--r--src/ntfs_udl.c9
-rw-r--r--src/phmain.c4
7 files changed, 11 insertions, 16 deletions
diff --git a/src/fnctdsk.c b/src/fnctdsk.c
index d1b27bf..02e814e 100644
--- a/src/fnctdsk.c
+++ b/src/fnctdsk.c
@@ -287,7 +287,6 @@ int is_part_overlapping(const list_part_t *list_part)
return 1;
element=next;
}
- return 0;
}
void partition_reset(partition_t *partition, const arch_fnct_t *arch)
diff --git a/src/hdaccess.c b/src/hdaccess.c
index 74a5f3f..1901073 100644
--- a/src/hdaccess.c
+++ b/src/hdaccess.c
@@ -196,7 +196,7 @@ static list_disk_t *hd_glob_parse(const char *device_pattern, list_disk_t *list_
list_disk_t *hd_parse(list_disk_t *list_disk, const int verbose, const arch_fnct_t *arch, const int testdisk_mode)
{
- int i;
+ unsigned int i;
#ifdef DJGPP
int ind_stop=0;
for(i=0x80;(i<0x88)&&!ind_stop;i++)
diff --git a/src/intrf.c b/src/intrf.c
index 208bb19..f646757 100644
--- a/src/intrf.c
+++ b/src/intrf.c
@@ -95,7 +95,7 @@ int screen_buffer_add(const char *_format, ...)
/* log_trace("aff_intr_buffer_screen %d =>%s<=\n",intr_nbr_line,tmp_line); */
if(intr_nbr_line==MAX_LINES)
{
- log_warning("Buffer can't store more than %u lines.\n", MAX_LINES);
+ log_warning("Buffer can't store more than %d lines.\n", MAX_LINES);
intr_nbr_line++;
}
return 0;
@@ -147,7 +147,7 @@ const char *aff_part_aux(const unsigned int newline, const disk_t *disk_car, con
if((newline&AFF_PART_ORDER)==AFF_PART_ORDER)
{
if((partition->status!=STATUS_EXT_IN_EXT) && (partition->order!=NO_ORDER))
- pos+=snprintf(&msg[pos],sizeof(msg)-pos-1,"%2d ", partition->order);
+ pos+=snprintf(&msg[pos],sizeof(msg)-pos-1,"%2u ", partition->order);
else
pos+=snprintf(&msg[pos],sizeof(msg)-pos-1," ");
}
diff --git a/src/intrfn.c b/src/intrfn.c
index 0df480a..1029964 100644
--- a/src/intrfn.c
+++ b/src/intrfn.c
@@ -1083,7 +1083,7 @@ int start_ncurses(const char *prog_name, const char *real_prog_name)
{
end_ncurses();
printf("%s need 24 lines to work.\nPlease enlarge the terminal and restart %s.\n",prog_name,prog_name);
- log_critical("Terminal has only %u lines\n",LINES);
+ log_critical("Terminal has only %d lines\n",LINES);
return 1;
}
return 0;
diff --git a/src/ntfs_dir.c b/src/ntfs_dir.c
index e13b7d4..0a139e5 100644
--- a/src/ntfs_dir.c
+++ b/src/ntfs_dir.c
@@ -179,7 +179,7 @@ static int ntfs_td_list_entry( struct ntfs_dir_struct *ls, const ntfschar *name
{
char *filename = NULL;
int result = 0;
- filename = calloc (1, MAX_PATH);
+ filename = (char *)calloc (1, MAX_PATH);
if (!filename)
{
log_critical("ntfs_td_list_entry calloc failed\n");
@@ -319,6 +319,8 @@ static file_data_t *ntfs_dir(disk_t *disk_car, const partition_t *partition, dir
return ls->dir_list;
}
+enum { bufsize = 4096 };
+
static int ntfs_copy(disk_t *disk_car, const partition_t *partition, dir_data_t *dir_data, const file_data_t *file)
{
const unsigned long int first_inode=file->stat.st_ino;
@@ -330,7 +332,6 @@ static int ntfs_copy(disk_t *disk_car, const partition_t *partition, dir_data_t
return -1;
}
{
- const int bufsize = 4096;
char *buffer;
char *new_file;
ntfs_attr *attr;
diff --git a/src/ntfs_udl.c b/src/ntfs_udl.c
index 1bdeea1..2210791 100644
--- a/src/ntfs_udl.c
+++ b/src/ntfs_udl.c
@@ -395,13 +395,8 @@ static int get_filenames(struct ufile *file, ntfs_volume* vol)
}
name->parent_name = NULL;
-
- {
- long long inode_num;
- name->parent_mref = attr->parent_directory;
- inode_num = MREF(name->parent_mref);
- get_parent_name(name, vol);
- }
+ name->parent_mref = attr->parent_directory;
+ get_parent_name(name, vol);
if (name->name_space < space) {
file->pref_name = name->name;
diff --git a/src/phmain.c b/src/phmain.c
index 94b97b5..1df9731 100644
--- a/src/phmain.c
+++ b/src/phmain.c
@@ -210,7 +210,7 @@ int main( int argc, char **argv )
td_ext2fs_version(), td_ntfs_version(), td_ewf_version());
#if defined(HAVE_LIBJPEG)
#if defined(JPEG_LIB_VERSION)
- printf("%u", JPEG_LIB_VERSION);
+ printf("%d", JPEG_LIB_VERSION);
#else
printf("yes");
#endif
@@ -293,7 +293,7 @@ int main( int argc, char **argv )
td_ext2fs_version(), td_ntfs_version(), td_ewf_version());
#if defined(HAVE_LIBJPEG)
#if defined(JPEG_LIB_VERSION)
- log_info("%u", JPEG_LIB_VERSION);
+ log_info("%d", JPEG_LIB_VERSION);
#else
log_info("yes");
#endif