e2fsprogs/e2fsprogs-codecleanup.diff

176 lines
4.7 KiB
Diff
Raw Normal View History

--- debugfs/debugfs.c
+++ debugfs/debugfs.c
@@ -42,6 +42,9 @@
ext2_filsys current_fs = NULL;
ext2_ino_t root, cwd;
+extern int debugfs_read_inode_full(ext2_ino_t, struct ext2_inode *,
+ const char *, int);
+
static void open_filesystem(char *device, int open_flags, blk_t superblock,
blk_t blocksize, int catastrophic,
char *data_filename)
@@ -377,10 +380,10 @@
else
fprintf(lb->f, ", ");
if (lb->first_block == lb->last_block)
- fprintf(lb->f, "(%lld):%u", lb->first_bcnt, lb->first_block);
+ fprintf(lb->f, "(%lld):%u", lb->first_bcnt, (long long)lb->first_block);
else
fprintf(lb->f, "(%lld-%lld):%u-%u", lb->first_bcnt,
- lb->last_bcnt, lb->first_block, lb->last_block);
+ (long long)lb->last_bcnt, (long long)lb->first_block, lb->last_block);
lb->first_block = 0;
}
@@ -507,7 +510,7 @@
list_blocks_proc, (void *)&lb);
finish_range(&lb);
if (lb.total)
- fprintf(f, "\n%sTOTAL: %lld\n", prefix, lb.total);
+ fprintf(f, "\n%sTOTAL: %lld\n", prefix, (long long)lb.total);
fprintf(f,"\n");
}
@@ -538,7 +541,7 @@
__u64 i_size = (inode->i_size |
((unsigned long long)inode->i_size_high << 32));
- fprintf(out, "%lld\n", i_size);
+ fprintf(out, "%lld\n", (long long)i_size);
} else
fprintf(out, "%d\n", inode->i_size);
if (current_fs->super->s_creator_os == EXT2_OS_HURD)
--- debugfs/ls.c
+++ debugfs/ls.c
@@ -92,8 +92,8 @@
if (LINUX_S_ISDIR(inode.i_mode))
fprintf(ls->f, "%5d", inode.i_size);
else
- fprintf(ls->f, "%5lld", inode.i_size |
- ((__u64)inode.i_size_high << 32));
+ fprintf(ls->f, "%5lld", (long long) (inode.i_size |
+ ((__u64)inode.i_size_high << 32)));
fprintf (ls->f, " %s %s\n", datestr, name);
} else {
sprintf(tmp, "%c%u%c (%d) %s ", lbr, dirent->inode, rbr,
--- debugfs/lsdel.c
+++ debugfs/lsdel.c
@@ -190,7 +190,7 @@
for (i = 0; i < num_delarray; i++) {
fprintf(out, "%6u %6d %6o %6llu %4d/%4d %s", delarray[i].ino,
delarray[i].uid, delarray[i].mode, delarray[i].size,
- delarray[i].free_blocks, delarray[i].num_blocks,
+ (unsigned long long)delarray[i].free_blocks, delarray[i].num_blocks,
time_to_string(delarray[i].dtime));
}
fprintf(out, "%d deleted inodes found.\n", num_delarray);
--- e2fsck/message.c
+++ e2fsck/message.c
@@ -263,7 +263,7 @@
else
printf("%u", inode->i_size);
#else
- printf("%llu", (inode->i_size |
+ printf("%llu", (unsigned long long)(inode->i_size |
((__u64) inode->i_size_high << 32)));
#endif
}
@@ -376,7 +376,7 @@
#ifdef EXT2_NO_64_TYPE
printf("%d", ctx->blkcount);
#else
- printf("%lld", ctx->blkcount);
+ printf("%lld", (long long)ctx->blkcount);
#endif
break;
case 'c':
@@ -401,7 +401,7 @@
#ifdef EXT2_NO_64_TYPE
printf("%u", ctx->num);
#else
- printf("%llu", ctx->num);
+ printf("%llu", (unsigned long long)ctx->num);
#endif
break;
case 'p':
@@ -427,7 +427,7 @@
#ifdef EXT2_NO_64_TYPE
printf("0x%x", ctx->num);
#else
- printf("0x%llx", ctx->num);
+ printf("0x%llx", (unsigned long long)ctx->num);
#endif
break;
default:
--- e2fsck/pass1.c
+++ e2fsck/pass1.c
@@ -55,6 +55,9 @@
#define _INLINE_ inline
#endif
+extern void e2fsck_write_inode_full(e2fsck_t, unsigned long,
+ struct ext2_inode *, int, const char *);
+
static int process_block(ext2_filsys fs, blk_t *blocknr,
e2_blkcnt_t blockcnt, blk_t ref_blk,
int ref_offset, void *priv_data);
--- lib/et/error_message.c
+++ lib/et/error_message.c
@@ -35,7 +35,6 @@
int offset;
struct et_list *et;
errcode_t table_num;
- int started = 0;
char *cp;
offset = (int) (code & ((1<<ERRCODE_RANGE)-1));
--- lib/ss/error.c
+++ lib/ss/error.c
@@ -19,11 +19,10 @@
#include <stdarg.h>
-char * ss_name(sci_idx)
- int sci_idx;
+char * ss_name(int sci_idx)
{
- register char *ret_val;
- register ss_data *infop;
+ char *ret_val;
+ ss_data *infop;
infop = ss_info(sci_idx);
if (infop->current_request == (char const *)NULL) {
@@ -36,8 +35,8 @@
return(ret_val);
}
else {
- register char *cp;
- register char const *cp1;
+ char *cp;
+ char const *cp1;
ret_val = malloc((unsigned)sizeof(char) *
(strlen(infop->subsystem_name)+
strlen(infop->current_request)+
@@ -59,7 +58,7 @@
void ss_error (int sci_idx, long code, const char * fmt, ...)
{
- register char *whoami;
+ char *whoami;
va_list pvar;
va_start (pvar, fmt);
--- resize/sim_progress.c
+++ resize/sim_progress.c
@@ -87,7 +87,7 @@
return retval;
memset(prog, 0, sizeof(struct ext2_sim_progress));
- retval = ext2fs_get_mem(strlen(label)+1, (void **) &prog->label);
+ retval = ext2fs_get_mem(strlen(label)+1, &prog->label);
if (retval) {
free(prog);
return retval;