aboutsummaryrefslogtreecommitdiff
path: root/util-linux/fsck_minix.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2006-03-10 19:22:06 +0000
committerRob Landley <rob@landley.net>2006-03-10 19:22:06 +0000
commitbc68cd14ccaebc17e7e03a08e51fddfb91007624 (patch)
treebeb32cedafc6232bf8a49fe90f0769d471ea6791 /util-linux/fsck_minix.c
parentdae6aa28598cb2353291f18ca52e768c3259165a (diff)
downloadbusybox-bc68cd14ccaebc17e7e03a08e51fddfb91007624.tar.gz
Patch from Denis Vlasenko turning static const int (which gets emitted into
the busybox binary) into enums (which don't).
Diffstat (limited to 'util-linux/fsck_minix.c')
-rw-r--r--util-linux/fsck_minix.c51
1 files changed, 27 insertions, 24 deletions
diff --git a/util-linux/fsck_minix.c b/util-linux/fsck_minix.c
index 1d3e90aa8..d7d81f130 100644
--- a/util-linux/fsck_minix.c
+++ b/util-linux/fsck_minix.c
@@ -98,26 +98,8 @@
#include <sys/param.h>
#include "busybox.h"
-static const int MINIX_ROOT_INO = 1;
-static const int MINIX_LINK_MAX = 250;
-static const int MINIX2_LINK_MAX = 65530;
-
-static const int MINIX_I_MAP_SLOTS = 8;
-static const int MINIX_Z_MAP_SLOTS = 64;
-static const int MINIX_SUPER_MAGIC = 0x137F; /* original minix fs */
-static const int MINIX_SUPER_MAGIC2 = 0x138F; /* minix fs, 30 char names */
-static const int MINIX2_SUPER_MAGIC = 0x2468; /* minix V2 fs */
-static const int MINIX2_SUPER_MAGIC2 = 0x2478; /* minix V2 fs, 30 char names */
-static const int MINIX_VALID_FS = 0x0001; /* Clean fs. */
-static const int MINIX_ERROR_FS = 0x0002; /* fs has errors. */
-
-#define MINIX_INODES_PER_BLOCK ((BLOCK_SIZE)/(sizeof (struct minix_inode)))
-#define MINIX2_INODES_PER_BLOCK ((BLOCK_SIZE)/(sizeof (struct minix2_inode)))
-
-static const int MINIX_V1 = 0x0001; /* original minix fs */
-static const int MINIX_V2 = 0x0002; /* minix V2 fs */
-
-#define INODE_VERSION(inode) inode->i_sb->u.minix_sb.s_version
+#define BLOCK_SIZE_BITS 10
+#define BLOCK_SIZE (1<<BLOCK_SIZE_BITS)
/*
* This is the original minix inode layout on disk.
@@ -151,6 +133,29 @@ struct minix2_inode {
uint32_t i_zone[10];
};
+enum {
+ MINIX_ROOT_INO = 1,
+ MINIX_LINK_MAX = 250,
+ MINIX2_LINK_MAX = 65530,
+
+ MINIX_I_MAP_SLOTS = 8,
+ MINIX_Z_MAP_SLOTS = 64,
+ MINIX_SUPER_MAGIC = 0x137F, /* original minix fs */
+ MINIX_SUPER_MAGIC2 = 0x138F, /* minix fs, 30 char names */
+ MINIX2_SUPER_MAGIC = 0x2468, /* minix V2 fs */
+ MINIX2_SUPER_MAGIC2 = 0x2478, /* minix V2 fs, 30 char names */
+ MINIX_VALID_FS = 0x0001, /* Clean fs. */
+ MINIX_ERROR_FS = 0x0002, /* fs has errors. */
+
+ MINIX_INODES_PER_BLOCK = ((BLOCK_SIZE)/(sizeof (struct minix_inode))),
+ MINIX2_INODES_PER_BLOCK = ((BLOCK_SIZE)/(sizeof (struct minix2_inode))),
+
+ MINIX_V1 = 0x0001, /* original minix fs */
+ MINIX_V2 = 0x0002 /* minix V2 fs */
+};
+
+#define INODE_VERSION(inode) inode->i_sb->u.minix_sb.s_version
+
/*
* minix super-block data on disk
*/
@@ -172,8 +177,6 @@ struct minix_dir_entry {
char name[0];
};
-#define BLOCK_SIZE_BITS 10
-#define BLOCK_SIZE (1<<BLOCK_SIZE_BITS)
#define NAME_MAX 255 /* # chars in a file name */
@@ -187,7 +190,7 @@ struct minix_dir_entry {
#define volatile
#endif
-static const int ROOT_INO = 1;
+enum { ROOT_INO = 1 };
#define UPPER(size,n) ((size+((n)-1))/(n))
#define INODE_SIZE (sizeof(struct minix_inode))
@@ -219,7 +222,7 @@ static struct termios termios;
static int termios_set = 0;
/* File-name data */
-static const int MAX_DEPTH = 32;
+enum { MAX_DEPTH = 32 };
static int name_depth = 0;
// static char name_list[MAX_DEPTH][BUFSIZ + 1];
static char **name_list = NULL;