From 4a6005666e1f62442cb55fabd946f454605e340e Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Tue, 26 Oct 1999 14:35:51 +0000 Subject: [PATCH] ChangeLog, mke2fs.c: mke2fs.c (PRS): Fix gcc warnings; add const to some char * variables, including in struct mke2fs_defaults. --- misc/ChangeLog | 3 +++ misc/mke2fs.c | 38 +++++++++++++++++++------------------- 2 files changed, 22 insertions(+), 19 deletions(-) diff --git a/misc/ChangeLog b/misc/ChangeLog index 40f15b3..4a936fa 100644 --- a/misc/ChangeLog +++ b/misc/ChangeLog @@ -1,5 +1,8 @@ 1999-10-26 + * mke2fs.c (PRS): Fix gcc warnings; add const to some char * + variables, including in struct mke2fs_defaults. + * fsck.c (wait_one): Fix gcc warnings; add #include for ctype.h, add const to char * variables, and use NOARGS to declare functions that take no arguments. Also fix a memory leak diff --git a/misc/mke2fs.c b/misc/mke2fs.c index 5ab30eb..e06c5f7 100644 --- a/misc/mke2fs.c +++ b/misc/mke2fs.c @@ -201,10 +201,10 @@ static void check_mount(NOARGS) */ static char default_str[] = "default"; struct mke2fs_defaults { - char *type; - int size; - int blocksize; - int inode_ratio; + const char *type; + int size; + int blocksize; + int inode_ratio; } settings[] = { { default_str, 0, 4096, 8192 }, { default_str, 512, 1024, 4096 }, @@ -710,24 +710,24 @@ static __u32 ok_features[3] = { static void PRS(int argc, char *argv[]) { - int c; - int size; - char * tmp; - blk_t max = 8192; - int blocksize = 0; - int inode_ratio = 0; - int reserved_ratio = 5; - ino_t num_inodes = 0; + int c; + int size; + char * tmp; + blk_t max = 8192; + int blocksize = 0; + int inode_ratio = 0; + int reserved_ratio = 5; + ino_t num_inodes = 0; errcode_t retval; - int sparse_option = 0; - char *oldpath = getenv("PATH"); + int sparse_option = 0; + char * oldpath = getenv("PATH"); struct ext2fs_sb *param_ext2 = (struct ext2fs_sb *) ¶m; - char *raid_opts = 0; - char *fs_type = 0; - char *feature_set = "filetype,sparse_super"; - blk_t dev_size; + char * raid_opts = 0; + char * fs_type = 0; + const char * feature_set = "filetype,sparse_super"; + blk_t dev_size; #ifdef linux - struct utsname ut; + struct utsname ut; if (uname(&ut)) { perror("uname"); -- 1.8.3.1