summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2012-09-10 22:11:07 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2012-09-10 22:11:07 +0200
commit8e8265e705606ea2a12b97df9a958141f50360bb (patch)
tree8ecc2fdfec905e2d153fa994523c33def85ded94 /src
parente7c591bb3f22b34cee74d1b2a0166c503fb877fa (diff)
constify a few variables
Diffstat (limited to 'src')
-rw-r--r--src/askloc.c3
-rw-r--r--src/ext2.c2
-rw-r--r--src/fat_adv.c3
-rw-r--r--src/ntfs_udl.c3
4 files changed, 4 insertions, 7 deletions
diff --git a/src/askloc.c b/src/askloc.c
index 846415f..8ea15c1 100644
--- a/src/askloc.c
+++ b/src/askloc.c
@@ -550,12 +550,11 @@ char *ask_location(const char*msg, const char *src_dir, const char *dst_org)
static void dir_aff_entry(WINDOW *window, file_info_t *file_info)
{
- struct tm *tm_p;
char str[11];
char datestr[80];
if(file_info->stat.st_mtime!=0)
{
- tm_p = localtime(&file_info->stat.st_mtime);
+ const struct tm *tm_p= localtime(&file_info->stat.st_mtime);
snprintf(datestr, sizeof(datestr),"%2d-%s-%4d %02d:%02d",
tm_p->tm_mday, monstr[tm_p->tm_mon],
1900 + tm_p->tm_year, tm_p->tm_hour,
diff --git a/src/ext2.c b/src/ext2.c
index e162e20..f9402e4 100644
--- a/src/ext2.c
+++ b/src/ext2.c
@@ -129,7 +129,7 @@ int recover_EXT2(disk_t *disk, const struct ext2_super_block *sb,partition_t *pa
partition->sb_size=EXT2_SUPERBLOCK_SIZE;
if(le16(sb->s_block_group_nr)>0)
{
- unsigned long int block_nr=(le32(sb->s_first_data_block)+le16(sb->s_block_group_nr)*le32(sb->s_blocks_per_group));
+ const unsigned long int block_nr=(le32(sb->s_first_data_block)+le16(sb->s_block_group_nr)*le32(sb->s_blocks_per_group));
if(partition->part_offset< (uint64_t)block_nr * (EXT2_MIN_BLOCK_SIZE<<le32(sb->s_log_block_size)))
{
log_error("recover_EXT2: part_offset problem\n");
diff --git a/src/fat_adv.c b/src/fat_adv.c
index 1674383..f9be08a 100644
--- a/src/fat_adv.c
+++ b/src/fat_adv.c
@@ -203,7 +203,6 @@ static int ask_root_directory(disk_t *disk_car, const partition_t *partition, co
for(i=0,current_file=dir_list;(current_file!=NULL) && (i<offset);current_file=current_file->next,i++);
for(i=offset;(current_file!=NULL) &&((i-offset)<INTER_DIR);i++,current_file=current_file->next)
{
- struct tm *tm_p;
char str[11];
char datestr[80];
wmove(window,8+i-offset,0);
@@ -217,7 +216,7 @@ static int ask_root_directory(disk_t *disk_car, const partition_t *partition, co
waddstr(window, " ");
if(current_file->stat.st_mtime!=0)
{
- tm_p = localtime(&current_file->stat.st_mtime);
+ const struct tm *tm_p=localtime(&current_file->stat.st_mtime);
snprintf(datestr, sizeof(datestr),"%2d-%s-%4d %02d:%02d",
tm_p->tm_mday, monstr[tm_p->tm_mon],
1900 + tm_p->tm_year, tm_p->tm_hour,
diff --git a/src/ntfs_udl.c b/src/ntfs_udl.c
index f5f6b36..d4f10fc 100644
--- a/src/ntfs_udl.c
+++ b/src/ntfs_udl.c
@@ -1273,7 +1273,6 @@ static void ntfs_undelete_menu_ncurses(disk_t *disk_car, const partition_t *part
td_list_for_each(file_walker,&dir_list->list)
{
char datestr[80];
- struct tm *tm_p;
file_info_t *file_info;
file_info=td_list_entry(file_walker, file_info_t, list);
if((file_info->status&FILE_STATUS_DELETED)!=0)
@@ -1293,7 +1292,7 @@ static void ntfs_undelete_menu_ncurses(disk_t *disk_car, const partition_t *part
wbkgdset(window,' ' | COLOR_PAIR(2));
if(file_info->stat.st_mtime!=0)
{
- tm_p = localtime(&file_info->stat.st_mtime);
+ const struct tm *tm_p= localtime(&file_info->stat.st_mtime);
snprintf(datestr, sizeof(datestr),"%2d-%s-%4d %02d:%02d",
tm_p->tm_mday, monstr[tm_p->tm_mon],
1900 + tm_p->tm_year, tm_p->tm_hour,