From 608df81932797cb5725d03699fa2a5a3e21bd44d Mon Sep 17 00:00:00 2001 From: Liu Aleaxander Date: Sat, 8 Aug 2009 15:51:34 +0800 Subject: [PATCH] Core: get the rid of the ld warnings we extern the SecPerClust from diskstart.inc and used in fat.c, but we also defined another SecPerClust in ext2.c. So we should be better to make more things in _static_, just like hpa told. --- core/ext2.c | 8 ++++---- core/fat.c | 3 ++- core/fs.c | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/core/ext2.c b/core/ext2.c index 115ed21..8c019e2 100644 --- a/core/ext2.c +++ b/core/ext2.c @@ -28,10 +28,10 @@ extern char Files[]; struct ext2_inode this_inode; struct ext2_super_block sb; -uint16_t ClustByteShift, ClustShift; -uint32_t SecPerClust, ClustSize, ClustMask; -uint32_t PtrsPerBlock1, PtrsPerBlock2, PtrsPerBlock3; -int DescPerBlock, InodePerBlock; +static uint16_t ClustByteShift, ClustShift; +static uint32_t SecPerClust, ClustSize, ClustMask; +static uint32_t PtrsPerBlock1, PtrsPerBlock2, PtrsPerBlock3; +static int DescPerBlock, InodePerBlock; extern char trackbuf[8192]; char SymlinkBuf[SYMLINK_SECTORS * SECTOR_SIZE + 64]; diff --git a/core/fat.c b/core/fat.c index ff71063..9b5117e 100644 --- a/core/fat.c +++ b/core/fat.c @@ -22,6 +22,7 @@ struct open_file_t { extern char Files[MAX_OPEN * sizeof(struct open_file_t)]; extern char trackbuf[8192]; +extern uint8_t SecPerClust; /* the fat bpb data */ @@ -41,7 +42,7 @@ uint8_t DriveNumber; /* BIOS drive number */ uint8_t ClustShift; /* Shift count for sectors/cluster */ uint8_t ClustByteShift; /* Shift count for bytes/cluster */ -int CurrentDir; +static int CurrentDir; int PrevDir; /* used for long name entry */ diff --git a/core/fs.c b/core/fs.c index 89e44ce..77e18e2 100644 --- a/core/fs.c +++ b/core/fs.c @@ -91,7 +91,7 @@ void fs_init(com32sys_t *regs) /* set up the fs stucture */ fs.fs_name = ops->fs_name; fs.fs_ops = ops; - if (! strcmp(fs.fs_name, "pxe")) + if (!strcmp(fs.fs_name, "pxe")) fs.fs_dev = NULL; else fs.fs_dev = device_init(regs->edx.b[0], regs->edx.b[1], regs->ecx.l, \ -- 2.7.4