提交 880ee18a 创建 作者: Austin Clements's avatar Austin Clements

mkfs must be compiled 32-bit. Fix mkfs warnings

上级 1e8035be
...@@ -127,7 +127,7 @@ _forktest: forktest.o $(ULIB) ...@@ -127,7 +127,7 @@ _forktest: forktest.o $(ULIB)
$(OBJDUMP) -S _forktest > forktest.asm $(OBJDUMP) -S _forktest > forktest.asm
mkfs: mkfs.c fs.h mkfs: mkfs.c fs.h
gcc -Wall -o mkfs mkfs.c gcc -m32 -Werror -Wall -o mkfs mkfs.c
UPROGS=\ UPROGS=\
_cat\ _cat\
......
...@@ -82,7 +82,7 @@ main(int argc, char *argv[]) ...@@ -82,7 +82,7 @@ main(int argc, char *argv[])
usedblocks = ninodes / IPB + 3 + bitblocks; usedblocks = ninodes / IPB + 3 + bitblocks;
freeblock = usedblocks; freeblock = usedblocks;
printf("used %d (bit %d ninode %lu) free %u total %d\n", usedblocks, printf("used %d (bit %d ninode %u) free %u total %d\n", usedblocks,
bitblocks, ninodes/IPB + 1, freeblock, nblocks+usedblocks); bitblocks, ninodes/IPB + 1, freeblock, nblocks+usedblocks);
assert(nblocks + usedblocks == size); assert(nblocks + usedblocks == size);
...@@ -230,7 +230,7 @@ balloc(int used) ...@@ -230,7 +230,7 @@ balloc(int used)
for(i = 0; i < used; i++) { for(i = 0; i < used; i++) {
buf[i/8] = buf[i/8] | (0x1 << (i%8)); buf[i/8] = buf[i/8] | (0x1 << (i%8));
} }
printf("balloc: write bitmap block at sector %lu\n", ninodes/IPB + 3); printf("balloc: write bitmap block at sector %u\n", ninodes/IPB + 3);
wsect(ninodes / IPB + 3, buf); wsect(ninodes / IPB + 3, buf);
} }
......
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论