diff options
author | Theodore Ts'o <tytso@mit.edu> | 1997-08-11 20:29:22 +0000 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 1997-08-11 20:29:22 +0000 |
commit | 3cb6c5021d722e17b7105d1bc090880671f6fc6d (patch) | |
tree | 7753483488fc1f68272993f38d727dfd041cbf63 /lib/ext2fs/icount.c | |
parent | 4cbe8af4b0d0c72fb28bb500c1bd8a46b00fdde3 (diff) | |
download | e2fsprogs-3cb6c5021d722e17b7105d1bc090880671f6fc6d.tar.gz |
Many files:
dosio.c: New file to do DOS/BIOS disk accesses.
namei.c (open_namei): Make pathlen be of type size_t.
llseek.c: Always #include stdlib.h since it's need to define
size_t.
io.h: Use errcode_t for magic numbers.
icount.c (get_icount_el), dupfs.c (ext2fs_dup_handle), dblist.c
(dir_block_cmp): Use size_t where appropriate.
read_bb.c (ext2fs_read_bb_inode), cmp_bitmaps.c
(ext2fs_compare_inode_bitmap): Use blk_t, ino_t and size_t
where appropriate.
closefs.c (ext2fs_flush): Use dgrp_t instead of int where
appropriate.
openfs.c (ext2fs_open), check_desc.c (ext2fs_check_desc): Use blk_t
instead of int where appropriate.
rw_bitmaps.c (read_bitmaps), irel_ma.c, inode.c (ext2fs_write_inode),
initialize.c (ext2fs_initialize): brel_ma.c: Fix to make be
16-bit safe.
link.c (ext2fs_link), unlink.c (ext2fs_unlink), lookup.c (lookup_proc),
ismounted.c (ext2fs_check_if_mounted), block.c (xlate_func):
Add #pragma argsused for Turbo C.
Diffstat (limited to 'lib/ext2fs/icount.c')
-rw-r--r-- | lib/ext2fs/icount.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/ext2fs/icount.c b/lib/ext2fs/icount.c index 5bffc18a..a91496a2 100644 --- a/lib/ext2fs/icount.c +++ b/lib/ext2fs/icount.c @@ -48,7 +48,7 @@ struct ext2_icount_el { }; struct ext2_icount { - int magic; + errcode_t magic; ext2fs_inode_bitmap single; ext2fs_inode_bitmap multiple; ino_t count; @@ -84,7 +84,7 @@ errcode_t ext2fs_create_icount2(ext2_filsys fs, int flags, int size, if (hint) { EXT2_CHECK_MAGIC(hint, EXT2_ET_MAGIC_ICOUNT); if (hint->size > size) - size = hint->size; + size = (size_t) hint->size; } icount = malloc(sizeof(struct ext2_icount)); @@ -119,7 +119,7 @@ errcode_t ext2fs_create_icount2(ext2_filsys fs, int flags, int size, icount->size += fs->super->s_inodes_count / 50; } - bytes = icount->size * sizeof(struct ext2_icount_el); + bytes = (size_t) (icount->size * sizeof(struct ext2_icount_el)); #if 0 printf("Icount allocated %d entries, %d bytes.\n", icount->size, bytes); @@ -172,7 +172,7 @@ static struct ext2_icount_el *insert_icount_el(ext2_icount_t icount, if (icount->count >= icount->size) { if (icount->count) { - new_size = icount->list[icount->count-1].ino; + new_size = icount->list[(unsigned)icount->count-1].ino; new_size = icount->count * ((float) new_size / icount->num_inodes); } @@ -181,14 +181,14 @@ static struct ext2_icount_el *insert_icount_el(ext2_icount_t icount, #if 0 printf("Reallocating icount %d entries...\n", new_size); #endif - new_list = realloc(icount->list, - new_size * sizeof(struct ext2_icount_el)); + new_list = realloc(icount->list, (size_t) new_size * + sizeof(struct ext2_icount_el)); if (!new_list) return 0; icount->size = new_size; icount->list = new_list; } - num = icount->count - pos; + num = (int) icount->count - pos; if (num < 0) return 0; /* should never happen */ if (num) { @@ -218,8 +218,8 @@ static struct ext2_icount_el *get_icount_el(ext2_icount_t icount, return 0; if (create && ((icount->count == 0) || - (ino > icount->list[icount->count-1].ino))) { - return insert_icount_el(icount, ino, icount->count); + (ino > icount->list[(unsigned)icount->count-1].ino))) { + return insert_icount_el(icount, ino, (unsigned) icount->count); } if (icount->count == 0) return 0; @@ -232,7 +232,7 @@ static struct ext2_icount_el *get_icount_el(ext2_icount_t icount, printf("Non-cursor get_icount_el: %u\n", ino); #endif low = 0; - high = icount->count-1; + high = (int) icount->count-1; while (low <= high) { #if 0 mid = (low+high)/2; |