diff options
author | wens <wens@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2009-06-12 22:59:04 +0800 |
---|---|---|
committer | wens <wens@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2009-06-12 22:59:04 +0800 |
commit | 1dc564bc0c0626e0491012c32b5e11c7e677a6f8 (patch) | |
tree | 81a745b1b6e427bd4ca53c378c943b660b19f955 | |
parent | fcd5c94f7170a7b0fd2622eac9bf13d07a09e530 (diff) | |
download | pttbbs-1dc564bc0c0626e0491012c32b5e11c7e677a6f8.tar pttbbs-1dc564bc0c0626e0491012c32b5e11c7e677a6f8.tar.gz pttbbs-1dc564bc0c0626e0491012c32b5e11c7e677a6f8.tar.bz2 pttbbs-1dc564bc0c0626e0491012c32b5e11c7e677a6f8.tar.lz pttbbs-1dc564bc0c0626e0491012c32b5e11c7e677a6f8.tar.xz pttbbs-1dc564bc0c0626e0491012c32b5e11c7e677a6f8.tar.zst pttbbs-1dc564bc0c0626e0491012c32b5e11c7e677a6f8.zip |
Eliminate warnings
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4580 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | mbbsd/chc.c | 4 | ||||
-rw-r--r-- | mbbsd/chess.c | 2 | ||||
-rw-r--r-- | mbbsd/gomo.c | 18 | ||||
-rw-r--r-- | mbbsd/reversi.c | 14 |
4 files changed, 19 insertions, 19 deletions
diff --git a/mbbsd/chc.c b/mbbsd/chc.c index 1b490699..b250a01e 100644 --- a/mbbsd/chc.c +++ b/mbbsd/chc.c @@ -267,7 +267,7 @@ chc_drawline(const ChessInfo* info, int line) static void chc_log_machine_step(FILE* fp, board_t board, const drc_t *step) { - const static char chess_char[8] = { + static const char chess_char[8] = { 0, 'K', 'A', 'B', 'R', 'N', 'C', 'P' }; /* We have black at bottom in rc_t but the standard is @@ -960,7 +960,7 @@ chc_replay(FILE* fp) } } else { /* " 1. Ch2-e2 Nb9-c7" */ - drc_t step = { CHESS_STEP_NORMAL }; + drc_t step = { .type = CHESS_STEP_NORMAL }; const char *p = strchr(buf, '.'); if (p == NULL) continue; diff --git a/mbbsd/chess.c b/mbbsd/chess.c index 03475926..7c58b6a8 100644 --- a/mbbsd/chess.c +++ b/mbbsd/chess.c @@ -59,7 +59,7 @@ static const struct ChessReplayMap_t ChessReplayMap[] = { { "chc", 3, &chc_replay }, { "go", 2, &gochess_replay }, { "reversi",7, &reversi_replay }, - { NULL } + { NULL ,0, NULL } }; static ChessInfo * CurrentPlayingGameInfo; diff --git a/mbbsd/gomo.c b/mbbsd/gomo.c index 575d4aee..b8a74cb6 100644 --- a/mbbsd/gomo.c +++ b/mbbsd/gomo.c @@ -37,7 +37,7 @@ static void gomo_drawstep(ChessInfo* info, const gomo_step_t* step); static void gomo_gameend(ChessInfo* info, ChessGameResult result); static void gomo_genlog(ChessInfo* info, FILE* fp, ChessGameResult result); -const static ChessActions gomo_actions = { +static const ChessActions gomo_actions = { &gomo_init_user, &gomo_init_user_userec, (void (*)(void*)) &gomo_init_board, @@ -54,7 +54,7 @@ const static ChessActions gomo_actions = { &gomo_genlog }; -const static ChessConstants gomo_constants = { +static const ChessConstants gomo_constants = { sizeof(gomo_step_t), MAX_TIME, BRDSIZ, @@ -241,9 +241,9 @@ gomoku_usr_put(userec_t* userec, const ChessUser* user) static char* gomo_getstep(const gomo_step_t* step, char buf[]) { - const static char* const ColName = "¢Ï¢Ð¢Ñ¢Ò¢Ó¢Ô¢Õ¢Ö¢×¢Ø¢Ù¢Ú¢Û¢Ü"; - const static char* const RawName = "151413121110¢¸¢·¢¶¢µ¢´¢³¢²¢±¢°"; - const static int ansi_length = sizeof(ANSI_COLOR(30;43)) - 1; + static const char* const ColName = "¢Ï¢Ð¢Ñ¢Ò¢Ó¢Ô¢Õ¢Ö¢×¢Ø¢Ù¢Ú¢Û¢Ü"; + static const char* const RawName = "151413121110¢¸¢·¢¶¢µ¢´¢³¢²¢±¢°"; + static const int ansi_length = sizeof(ANSI_COLOR(30;43)) - 1; strcpy(buf, turn_color[step->color]); buf[ansi_length ] = ColName[step->loc.c * 2]; @@ -282,13 +282,13 @@ gomo_init_board(board_t board) static void gomo_drawline(const ChessInfo* info, int line) { - const static char* const BoardPic[] = { + static const char* const BoardPic[] = { "ùÝ", "ùç", "ùç", "ùß", "ùò", "¢q", "¢q", "ùô", "ùò", "¢q", "¡Ï", "ùô", "ùã", "ùí", "ùí", "ùå", }; - const static int BoardPicIndex[] = + static const int BoardPicIndex[] = { 0, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 3 }; board_p board = (board_p) info->board; @@ -420,7 +420,7 @@ gomo_gameend(ChessInfo* info, ChessGameResult result) } static void -gomo_genlog(ChessInfo* info, FILE* fp, ChessGameResult result) +gomo_genlog(ChessInfo* info, FILE* fp, ChessGameResult result GCC_UNUSED) { char buf[ANSILINELEN] = ""; const int nStep = info->history.used; @@ -481,7 +481,7 @@ static int gomo_loadlog(FILE *fp, ChessInfo *info) gomo_init_user_userec(&rec, user); } else if (buf[0] == '[') { /* "[ 1]¡´ ==> H8 [ 2]¡³ ==> H9" */ - gomo_step_t step = { CHESS_STEP_NORMAL }; + gomo_step_t step = { .type = CHESS_STEP_NORMAL }; int c, r; const char *p = buf; int i; diff --git a/mbbsd/reversi.c b/mbbsd/reversi.c index eec0c8c3..1a4a6d1f 100644 --- a/mbbsd/reversi.c +++ b/mbbsd/reversi.c @@ -74,7 +74,7 @@ static const ChessActions reversi_actions = { &reversi_genlog }; -const static ChessConstants reversi_constants = { +static const ChessConstants reversi_constants = { sizeof(reversi_step_t), MAX_TIME, BRDSIZ, @@ -225,7 +225,7 @@ reversi_prepare_play(ChessInfo* info) result = !caculate_hint(board, TURN_TO_COLOR(info->turn)); if (result) { - reversi_step_t step = { CHESS_STEP_SPECIAL, TURN_TO_COLOR(info->turn) }; + reversi_step_t step = { .type = CHESS_STEP_SPECIAL, .color = TURN_TO_COLOR(info->turn) }; if (info->turn == info->myturn) { ChessStepSend(info, &step); ChessHistoryAppend(info, &step); @@ -241,7 +241,7 @@ reversi_prepare_play(ChessInfo* info) } static int -reversi_select(ChessInfo* info, rc_t loc, ChessGameResult* result) +reversi_select(ChessInfo* info, rc_t loc, ChessGameResult* result GCC_UNUSED) { board_p board = (board_p) info->board; @@ -303,7 +303,7 @@ reversi_prepare_step(ChessInfo* info, const reversi_step_t* step) } static void -reversi_drawstep(ChessInfo* info, const void* move) +reversi_drawstep(ChessInfo* info, const void* move GCC_UNUSED) { ChessRedraw(info); } @@ -334,14 +334,14 @@ reversi_post_game(ChessInfo* info) } static void -reversi_gameend(ChessInfo* info, ChessGameResult result) +reversi_gameend(ChessInfo* info GCC_UNUSED, ChessGameResult result GCC_UNUSED) { /* nothing to do now * TODO game record */ } static void -reversi_genlog(ChessInfo* info, FILE* fp, ChessGameResult result) +reversi_genlog(ChessInfo* info, FILE* fp, ChessGameResult result GCC_UNUSED) { char buf[ANSILINELEN] = ""; const int nStep = info->history.used; @@ -405,7 +405,7 @@ reversi_loadlog(FILE *fp, ChessInfo *info) reversi_init_user_userec(&rec, user); } else if (buf[0] == '[') { /* "[ 1]¡´ ==> C4 [ 2]¡³ ==> C5" */ - reversi_step_t step = { CHESS_STEP_NORMAL }; + reversi_step_t step = { .type = CHESS_STEP_NORMAL }; int c, r; const char *p = buf; int i; |