summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2006-09-17 02:41:55 +0800
committerkcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2006-09-17 02:41:55 +0800
commit2c244129ac12bfe6d58bee71288c2b8746dab755 (patch)
treee49592872c8b3aaa8aa2b05ef227477833a9a804
parent5f36f8a8fb4424a5b75f6c2e478a4a398ec1492a (diff)
downloadpttbbs-2c244129ac12bfe6d58bee71288c2b8746dab755.tar
pttbbs-2c244129ac12bfe6d58bee71288c2b8746dab755.tar.gz
pttbbs-2c244129ac12bfe6d58bee71288c2b8746dab755.tar.bz2
pttbbs-2c244129ac12bfe6d58bee71288c2b8746dab755.tar.lz
pttbbs-2c244129ac12bfe6d58bee71288c2b8746dab755.tar.xz
pttbbs-2c244129ac12bfe6d58bee71288c2b8746dab755.tar.zst
pttbbs-2c244129ac12bfe6d58bee71288c2b8746dab755.zip
enum usage fix, saved few bytes.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3414 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--mbbsd/bbs.c4
-rw-r--r--mbbsd/mail.c4
-rw-r--r--mbbsd/mbbsd.c4
-rw-r--r--mbbsd/pmore.c16
4 files changed, 14 insertions, 14 deletions
diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c
index 9e4f7e5b..a8f02abd 100644
--- a/mbbsd/bbs.c
+++ b/mbbsd/bbs.c
@@ -46,10 +46,10 @@ query_file_money(const fileheader_t *pfh)
}
/* hack for listing modes */
-enum {
+enum LISTMODES {
LISTMODE_DATE = 0,
LISTMODE_MONEY,
-} LISTMODES;
+};
static char *listmode_desc[] = {
"日 期",
"價 格",
diff --git a/mbbsd/mail.c b/mbbsd/mail.c
index c71ae6e3..5391d394 100644
--- a/mbbsd/mail.c
+++ b/mbbsd/mail.c
@@ -6,11 +6,11 @@ static char currmaildir[32];
static char msg_cc[] = ANSI_COLOR(32) "[群組名單]" ANSI_RESET "\n";
static char listfile[] = "list.0";
-enum {
+enum SHOWMAIL_MODES {
SHOWMAIL_NORM = 0,
SHOWMAIL_SUM,
SHOWMAIL_RANGE,
-} SHOWMAIL_MODES;
+};
static int showmail_mode = SHOWMAIL_NORM;
int
diff --git a/mbbsd/mbbsd.c b/mbbsd/mbbsd.c
index d5779b80..1e3f16fd 100644
--- a/mbbsd/mbbsd.c
+++ b/mbbsd/mbbsd.c
@@ -1786,14 +1786,14 @@ static int check_banip(char *host)
/* ------- piaip's implementation of TELNET protocol ------- */
-enum {
+enum TELNET_IAC_STATES {
IAC_NONE,
IAC_COMMAND,
IAC_WAIT_OPT,
IAC_WAIT_SE,
IAC_PROCESS_OPT,
IAC_ERROR
-} TELNET_IAC_STATES;
+};
static unsigned char iac_state = 0; /* as byte to reduce memory */
diff --git a/mbbsd/pmore.c b/mbbsd/pmore.c
index 7459a6a4..33364e28 100644
--- a/mbbsd/pmore.c
+++ b/mbbsd/pmore.c
@@ -231,16 +231,16 @@ MmappedFile mf = {
}; // current file
/* mf_* navigation commands return value meanings */
-enum {
+enum MF_NAV_COMMANDS {
MFNAV_OK, // navigation ok
MFNAV_EXCEED, // request exceeds buffer
-} MF_NAV_COMMANDS;
+};
/* Navigation units (dynamic, so not in enum const) */
#define MFNAV_PAGE (t_lines-2) // when navigation, how many lines in a page to move
/* Display system */
-enum {
+enum MF_DISP_CONST {
/* newline method (because of poor BBS implementation) */
MFDISP_NEWLINE_CLEAR = 0, // \n and cleartoeol
MFDISP_NEWLINE_SKIP,
@@ -264,7 +264,7 @@ enum {
MFDISP_RAW_MODES,
// MFDISP_RAW_NOFMT, // this is rarely used sinde we have ansi and plain
-} MF_DISP_CONST;
+};
#define MFDISP_PAGE (t_lines-1) // the real number of lines to be shown.
#define MFDISP_DIRTY() { mf.oldlineno = -1; }
@@ -319,10 +319,10 @@ typedef struct
MF_SearchRecord sr = { 0, strncmp, NULL};
-enum {
+enum MFSEARCH_DIRECTION {
MFSEARCH_FORWARD,
MFSEARCH_BACKWARD,
-} MFSEARCH_DIRECTION;
+};
// Reset structures
#define RESETMF() { memset(&mf, 0, sizeof(mf)); \
@@ -336,14 +336,14 @@ enum {
// --------------------------------------------- <Optional Modules>
#ifdef PMORE_USE_ASCII_MOVIE
-enum {
+enum _MFDISP_MOVIE_MODES {
MFDISP_MOVIE_UNKNOWN= 0,
MFDISP_MOVIE_DETECTED,
MFDISP_MOVIE_YES,
MFDISP_MOVIE_NO,
MFDISP_MOVIE_PLAYING,
MFDISP_MOVIE_PLAYING_OLD,
-} _MFDISP_MOVIE_MODES;
+};
typedef struct {
struct timeval frameclk;