From 625a21e8e53e8863ce1c689ede55fc808807daca Mon Sep 17 00:00:00 2001 From: Hourier Date: Tue, 7 Jul 2020 20:41:01 +0900 Subject: [PATCH] [Refactor] #40534 Unified vowel-checker.c/h into english.c/h --- Hengband/Hengband/Hengband.vcxproj | 2 -- Hengband/Hengband/Hengband.vcxproj.filters | 6 ------ src/Makefile.am | 1 - src/birth/history-editor.c | 4 +++- src/cmd-action/cmd-spell.c | 4 +++- src/core/scores.c | 4 +++- src/flavor/flavor-describer.c | 2 +- src/io/chuukei.c | 4 +++- src/io/targeting.c | 5 ++++- src/locale/english.c | 22 ++++++++++++++++++++++ src/locale/english.h | 1 + src/locale/vowel-checker.c | 23 ----------------------- src/locale/vowel-checker.h | 5 ----- src/monster/monster-describer.c | 5 ++++- src/object/object-flavor.c | 7 +++++-- src/player/eldritch-horror.c | 5 ++++- src/player/player-move.c | 5 ++++- src/savedata/load-util.c | 4 +++- src/status/shape-changer.c | 8 ++++---- src/store/store.c | 4 +++- src/util/angband-files.c | 2 ++ src/view/display-lore-attacks.c | 4 +++- src/view/display-lore-status.c | 4 +++- src/view/display-lore.c | 7 +++++-- 24 files changed, 80 insertions(+), 58 deletions(-) delete mode 100644 src/locale/vowel-checker.c delete mode 100644 src/locale/vowel-checker.h diff --git a/Hengband/Hengband/Hengband.vcxproj b/Hengband/Hengband/Hengband.vcxproj index ea976d15d..6cd3b78b0 100644 --- a/Hengband/Hengband/Hengband.vcxproj +++ b/Hengband/Hengband/Hengband.vcxproj @@ -221,7 +221,6 @@ - @@ -696,7 +695,6 @@ - diff --git a/Hengband/Hengband/Hengband.vcxproj.filters b/Hengband/Hengband/Hengband.vcxproj.filters index 5f2b9cde4..8c4360fe0 100644 --- a/Hengband/Hengband/Hengband.vcxproj.filters +++ b/Hengband/Hengband/Hengband.vcxproj.filters @@ -1352,9 +1352,6 @@ io - - locale - game-option @@ -3277,9 +3274,6 @@ io - - locale - util diff --git a/src/Makefile.am b/src/Makefile.am index 69d1696b7..c6185c150 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -269,7 +269,6 @@ hengband_SOURCES = \ locale/english.c locale/english.h \ locale/japanese.c locale/japanese.h \ locale/language-switcher.h \ - locale/vowel-checker.c locale/vowel-checker.h \ \ lore/combat-types-setter.c lore/combat-types-setter.h \ lore/lore-calculator.c lore/lore-calculator.h \ diff --git a/src/birth/history-editor.c b/src/birth/history-editor.c index 138a0cc3d..bc3d18150 100644 --- a/src/birth/history-editor.c +++ b/src/birth/history-editor.c @@ -1,11 +1,13 @@ #include "birth/history-editor.h" #include "io/input-key-acceptor.h" #include "io/read-pref-file.h" -#include "locale/japanese.h" #include "term/screen-processor.h" #include "term/term-color-types.h" #include "util/int-char-converter.h" #include "view/display-player.h" // 暫定。後で消す. +#ifdef JP +#include "locale/japanese.h" +#endif /*! * @brief 生い立ちメッセージを編集する。/Character background edit-mode diff --git a/src/cmd-action/cmd-spell.c b/src/cmd-action/cmd-spell.c index 758d01771..200ef610c 100644 --- a/src/cmd-action/cmd-spell.c +++ b/src/cmd-action/cmd-spell.c @@ -25,7 +25,6 @@ #include "io/input-key-acceptor.h" #include "io/input-key-requester.h" #include "io/write-diary.h" -#include "locale/japanese.h" #include "main/sound-definitions-table.h" #include "main/sound-of-music.h" #include "mind/mind.h" @@ -60,6 +59,9 @@ #include "util/buffer-shaper.h" #include "util/int-char-converter.h" #include "view/display-messages.h" +#ifdef JP +#include "locale/japanese.h" +#endif /*! * 魔法領域フラグ管理テーブル / diff --git a/src/core/scores.c b/src/core/scores.c index 95b2c544c..b9855fea7 100644 --- a/src/core/scores.c +++ b/src/core/scores.c @@ -23,7 +23,6 @@ #include "io/signal-handlers.h" #include "io/uid-checker.h" #include "io/write-diary.h" -#include "locale/japanese.h" #include "player/player-class.h" #include "player/player-personality.h" #include "player/player-sex.h" @@ -37,6 +36,9 @@ #include "util/string-processor.h" #include "view/display-messages.h" #include "world/world.h" +#ifdef JP +#include "locale/japanese.h" +#endif /* * The "highscore" file descriptor, if available. diff --git a/src/flavor/flavor-describer.c b/src/flavor/flavor-describer.c index dc067866d..7d81d1588 100644 --- a/src/flavor/flavor-describer.c +++ b/src/flavor/flavor-describer.c @@ -33,7 +33,7 @@ #include "util/string-processor.h" #ifdef JP #else -#include "locale/vowel-checker.h" +#include "locale/english.h" #include "monster-race/race-flags1.h" #include "player/player-class.h" #endif diff --git a/src/io/chuukei.c b/src/io/chuukei.c index e0b16696c..e3d1ba1e6 100644 --- a/src/io/chuukei.c +++ b/src/io/chuukei.c @@ -13,10 +13,12 @@ #include "io/files-util.h" #include "io/inet.h" #include "io/signal-handlers.h" -#include "locale/japanese.h" #include "term/gameterm.h" #include "util/angband-files.h" #include "view/display-messages.h" +#ifdef JP +#include "locale/japanese.h" +#endif #include #include diff --git a/src/io/targeting.c b/src/io/targeting.c index 023a3bd84..66fd4efc5 100644 --- a/src/io/targeting.c +++ b/src/io/targeting.c @@ -40,7 +40,6 @@ #include "io/input-key-acceptor.h" #include "io/input-key-requester.h" #include "io/screen-util.h" -#include "locale/vowel-checker.h" #include "main/sound-of-music.h" #include "monster-race/monster-race-hook.h" #include "monster-race/monster-race.h" @@ -71,6 +70,10 @@ #include "view/display-monster-status.h" #include "view/main-window-util.h" #include "world/world.h" +#ifdef JP +#else +#include "locale/english.h" +#endif /*! * @brief コンソール上におけるマップ表示の左上位置を返す / diff --git a/src/locale/english.c b/src/locale/english.c index 4281620f6..6fc2641a8 100644 --- a/src/locale/english.c +++ b/src/locale/english.c @@ -125,3 +125,25 @@ void plural_aux(char *Name) strcpy(&(Name[NameLen]), "s"); } } + +/* + * Check a char for "vowel-hood" + */ +bool is_a_vowel(int ch) +{ + switch (ch) { + case 'a': + case 'e': + case 'i': + case 'o': + case 'u': + case 'A': + case 'E': + case 'I': + case 'O': + case 'U': + return TRUE; + } + + return FALSE; +} diff --git a/src/locale/english.h b/src/locale/english.h index 49af5dac4..e432a8c95 100644 --- a/src/locale/english.h +++ b/src/locale/english.h @@ -3,3 +3,4 @@ #include "system/angband.h" void plural_aux(char * Name); +bool is_a_vowel(int ch); diff --git a/src/locale/vowel-checker.c b/src/locale/vowel-checker.c deleted file mode 100644 index 2e469c29b..000000000 --- a/src/locale/vowel-checker.c +++ /dev/null @@ -1,23 +0,0 @@ -#include "locale/vowel-checker.h" - -/* - * Check a char for "vowel-hood" - */ -bool is_a_vowel(int ch) -{ - switch (ch) { - case 'a': - case 'e': - case 'i': - case 'o': - case 'u': - case 'A': - case 'E': - case 'I': - case 'O': - case 'U': - return TRUE; - } - - return FALSE; -} diff --git a/src/locale/vowel-checker.h b/src/locale/vowel-checker.h deleted file mode 100644 index e7f77d750..000000000 --- a/src/locale/vowel-checker.h +++ /dev/null @@ -1,5 +0,0 @@ -#pragma once - -#include "system/angband.h" - -bool is_a_vowel(int ch); diff --git a/src/monster/monster-describer.c b/src/monster/monster-describer.c index 96828446f..424f6ec17 100644 --- a/src/monster/monster-describer.c +++ b/src/monster/monster-describer.c @@ -1,7 +1,6 @@ #include "monster/monster-describer.h" #include "floor/floor.h" #include "io/files-util.h" -#include "locale/vowel-checker.h" #include "monster-race/monster-race.h" #include "monster-race/race-flags1.h" #include "monster/monster-description-types.h" @@ -10,6 +9,10 @@ #include "util/quarks.h" #include "util/string-processor.h" #include "view/display-messages.h" +#ifdef JP +#else +#include "locale/english.h" +#endif /*! * @brief モンスターの呼称を作成する / Build a string describing a monster in some way. diff --git a/src/object/object-flavor.c b/src/object/object-flavor.c index 3edc6992b..8e164e2fb 100644 --- a/src/object/object-flavor.c +++ b/src/object/object-flavor.c @@ -18,8 +18,6 @@ #include "grid/trap.h" #include "inventory/inventory-slot-types.h" #include "io/files-util.h" -#include "locale/japanese.h" -#include "locale/vowel-checker.h" #include "mind/mind-sniper.h" #include "mind/mind-weaponsmith.h" #include "monster-race/monster-race.h" @@ -45,6 +43,11 @@ #include "util/quarks.h" #include "util/string-processor.h" #include "world/world.h" +#ifdef JP +#include "locale/japanese.h" +#else +#include "locale/english.h" +#endif /*! * @brief 最初から簡易な名称が明らかになるベースアイテムの判定。 / Certain items, if aware, are known instantly diff --git a/src/player/eldritch-horror.c b/src/player/eldritch-horror.c index 92a95743c..7d6482053 100644 --- a/src/player/eldritch-horror.c +++ b/src/player/eldritch-horror.c @@ -8,7 +8,6 @@ #include "core/player-update-types.h" #include "core/stuff-handler.h" #include "floor/floor.h" -#include "locale/vowel-checker.h" #include "monster-race/monster-race.h" #include "monster-race/race-flags1.h" #include "monster-race/race-flags2.h" @@ -27,6 +26,10 @@ #include "status/base-status.h" #include "view/display-messages.h" #include "world/world.h" +#ifdef JP +#else +#include "locale/english.h" +#endif /*! * @brief エルドリッチホラーの形容詞種別を決める diff --git a/src/player/player-move.c b/src/player/player-move.c index fd19130c9..79f96f8d6 100644 --- a/src/player/player-move.c +++ b/src/player/player-move.c @@ -172,7 +172,6 @@ #include "inventory/player-inventory.h" #include "io/input-key-requester.h" #include "io/targeting.h" -#include "locale/vowel-checker.h" #include "main/sound-definitions-table.h" #include "main/sound-of-music.h" #include "mind/mind-ninja.h" @@ -208,6 +207,10 @@ #include "util/bit-flags-calculator.h" #include "view/display-messages.h" #include "world/world.h" +#ifdef JP +#else +#include "locale/english.h" +#endif travel_type travel; diff --git a/src/savedata/load-util.c b/src/savedata/load-util.c index 1eca473cd..d9aba5955 100644 --- a/src/savedata/load-util.c +++ b/src/savedata/load-util.c @@ -1,6 +1,8 @@ #include "savedata/load-util.h" -#include "locale/japanese.h" #include "term/screen-processor.h" +#ifdef JP +#include "locale/japanese.h" +#endif FILE *loading_savefile; byte load_xor_byte; // Old "encryption" byte. diff --git a/src/status/shape-changer.c b/src/status/shape-changer.c index f51c2cb94..d8a169fdf 100644 --- a/src/status/shape-changer.c +++ b/src/status/shape-changer.c @@ -9,10 +9,6 @@ #include "core/window-redrawer.h" #include "game-option/disturbance-options.h" #include "grid/grid.h" -#ifdef JP -#else -#include "locale/vowel-checker.h" -#endif #include "mutation/mutation.h" #include "player/avatar.h" #include "player/player-class.h" @@ -26,6 +22,10 @@ #include "status/base-status.h" #include "status/element-resistance.h" #include "view/display-messages.h" +#ifdef JP +#else +#include "locale/english.h" +#endif void do_poly_wounds(player_type *creature_ptr) { diff --git a/src/store/store.c b/src/store/store.c index 17da1ad39..c497e8ba6 100644 --- a/src/store/store.c +++ b/src/store/store.c @@ -53,7 +53,6 @@ #include "io/command-repeater.h" #include "io/input-key-requester.h" #include "io/write-diary.h" -#include "locale/japanese.h" #include "main/music-definitions-table.h" #include "main/sound-definitions-table.h" #include "main/sound-of-music.h" @@ -94,6 +93,9 @@ #include "view/display-sub-windows.h" #include "view/object-describer.h" #include "world/world.h" +#ifdef JP +#include "locale/japanese.h" +#endif #define MIN_STOCK 12 diff --git a/src/util/angband-files.c b/src/util/angband-files.c index ecff74d89..bd22eb430 100644 --- a/src/util/angband-files.c +++ b/src/util/angband-files.c @@ -1,6 +1,8 @@ #include "util/angband-files.h" #include "util/string-processor.h" +#ifdef JP #include "locale/japanese.h" +#endif #ifdef SET_UID diff --git a/src/view/display-lore-attacks.c b/src/view/display-lore-attacks.c index 40e63b0f0..926812319 100644 --- a/src/view/display-lore-attacks.c +++ b/src/view/display-lore-attacks.c @@ -1,8 +1,10 @@ #include "view/display-lore-attacks.h" -#include "locale/japanese.h" #include "lore/combat-types-setter.h" #include "lore/lore-calculator.h" #include "monster-race/race-flags1.h" +#ifdef JP +#include "locale/japanese.h" +#endif #ifdef JP static void display_monster_blows_jp(lore_type *lore_ptr, int attack_numbers, int d1, int d2, int m) diff --git a/src/view/display-lore-status.c b/src/view/display-lore-status.c index d7ff56ef3..e7a38f086 100644 --- a/src/view/display-lore-status.c +++ b/src/view/display-lore-status.c @@ -1,5 +1,4 @@ #include "view/display-lore-status.h" -#include "locale/japanese.h" #include "lore/lore-calculator.h" #include "monster-race/monster-race.h" #include "monster-race/race-flags-resistance.h" @@ -8,6 +7,9 @@ #include "monster-race/race-flags3.h" #include "monster-race/race-flags7.h" #include "term/term-color-types.h" +#ifdef JP +#include "locale/japanese.h" +#endif void display_monster_hp_ac(lore_type *lore_ptr) { diff --git a/src/view/display-lore.c b/src/view/display-lore.c index 7d0e12e8b..53703b83b 100644 --- a/src/view/display-lore.c +++ b/src/view/display-lore.c @@ -6,8 +6,6 @@ #include "view/display-lore.h" #include "game-option/text-display-options.h" -#include "locale/english.h" -#include "locale/japanese.h" #include "lore/lore-calculator.h" #include "lore/monster-lore.h" #include "monster-race/monster-race.h" @@ -22,6 +20,11 @@ #include "term/term-color-types.h" #include "view/display-messages.h" #include "world/world.h" +#ifdef JP +#include "locale/japanese.h" +#else +#include "locale/english.h" +#endif /*! * 英語の複数系記述用マクロ / Pluralizer. Args(count, singular, plural) -- 2.11.0