1999-10-26 <tytso@valinux.com>
+ * 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
*/
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 },
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");