From 8228514e099f97bf2cb601beb9149e9c4ccdd732 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sun, 23 Apr 2023 14:24:03 +0300 Subject: [PATCH 38/38] AI: Rename aitools.[ch] as daitools.[ch] See osdn #47917 Signed-off-by: Marko Lindqvist --- ai/classic/classicai.c | 3 ++- ai/default/Makefile.am | 4 ++-- ai/default/aiair.c | 3 ++- ai/default/aidiplomat.c | 3 ++- ai/default/aiferry.c | 3 ++- ai/default/aiguard.c | 2 +- ai/default/aihand.c | 2 +- ai/default/aihunt.c | 3 ++- ai/default/aiparatrooper.c | 3 ++- ai/default/aitech.c | 2 +- ai/default/daicity.c | 2 +- ai/default/daidiplomacy.c | 2 +- ai/default/daidomestic.c | 2 +- ai/default/daimilitary.c | 2 +- ai/default/daisettler.c | 2 +- ai/default/{aitools.c => daitools.c} | 2 +- ai/default/{aitools.h => daitools.h} | 6 +++--- ai/default/daiunit.c | 2 +- ai/tex/texai.c | 3 ++- doc/CodingStyle | 4 ++-- meson.build | 2 +- 21 files changed, 32 insertions(+), 25 deletions(-) rename ai/default/{aitools.c => daitools.c} (99%) rename ai/default/{aitools.h => daitools.h} (98%) diff --git a/ai/classic/classicai.c b/ai/classic/classicai.c index 7f1e859d6f..21c65ac8e5 100644 --- a/ai/classic/classicai.c +++ b/ai/classic/classicai.c @@ -26,7 +26,6 @@ /* ai/default */ #include "aiferry.h" #include "aihand.h" -#include "aitools.h" #include "daicity.h" #include "daidata.h" #include "daidiplomacy.h" @@ -35,6 +34,8 @@ #include "daimilitary.h" #include "daiplayer.h" #include "daisettler.h" +#include "daitools.h" +#include "daiunit.h" #include "classicai.h" diff --git a/ai/default/Makefile.am b/ai/default/Makefile.am index f0413f6c10..833733774c 100644 --- a/ai/default/Makefile.am +++ b/ai/default/Makefile.am @@ -30,8 +30,6 @@ libdefaultai_la_SOURCES = \ aiparatrooper.h \ aitech.c \ aitech.h \ - aitools.c \ - aitools.h \ daiactions.c \ daiactions.h \ daicity.c \ @@ -52,6 +50,8 @@ libdefaultai_la_SOURCES = \ daiplayer.h \ daisettler.c \ daisettler.h \ + daitools.c \ + daitools.h \ daiunit.c \ daiunit.h diff --git a/ai/default/aiair.c b/ai/default/aiair.c index a950e9e447..391a0b6cf1 100644 --- a/ai/default/aiair.c +++ b/ai/default/aiair.c @@ -42,9 +42,10 @@ #include "handicaps.h" /* ai/default */ -#include "aitools.h" #include "daicity.h" #include "daiplayer.h" +#include "daitools.h" +#include "daiunit.h" #include "aiair.h" diff --git a/ai/default/aidiplomat.c b/ai/default/aidiplomat.c index a93b635a2a..0af4f906d4 100644 --- a/ai/default/aidiplomat.c +++ b/ai/default/aidiplomat.c @@ -62,13 +62,14 @@ /* ai/default */ #include "aiguard.h" #include "aihand.h" -#include "aitools.h" #include "daiactions.h" #include "daicity.h" #include "daidata.h" #include "dailog.h" #include "daimilitary.h" #include "daiplayer.h" +#include "daitools.h" +#include "daiunit.h" #include "aidiplomat.h" diff --git a/ai/default/aiferry.c b/ai/default/aiferry.c index 3eff252c92..4b15086a5f 100644 --- a/ai/default/aiferry.c +++ b/ai/default/aiferry.c @@ -46,10 +46,11 @@ /* ai/default */ #include "aiguard.h" -#include "aitools.h" #include "daicity.h" #include "daidata.h" #include "daiplayer.h" +#include "daitools.h" +#include "daiunit.h" #include "aiferry.h" diff --git a/ai/default/aiguard.c b/ai/default/aiguard.c index e13a4704c0..66e4246716 100644 --- a/ai/default/aiguard.c +++ b/ai/default/aiguard.c @@ -26,9 +26,9 @@ #include "srv_log.h" /* ai/default */ -#include "aitools.h" #include "dailog.h" #include "daiplayer.h" +#include "daiunit.h" #include "aiguard.h" diff --git a/ai/default/aihand.c b/ai/default/aihand.c index 76ea513b9c..f7003a8f8b 100644 --- a/ai/default/aihand.c +++ b/ai/default/aihand.c @@ -55,13 +55,13 @@ /* ai/default */ #include "aitech.h" -#include "aitools.h" #include "daicity.h" #include "daidata.h" #include "daidiplomacy.h" #include "dailog.h" #include "daimilitary.h" #include "daiplayer.h" +#include "daitools.h" #include "aihand.h" diff --git a/ai/default/aihunt.c b/ai/default/aihunt.c index 96809d383b..fdd2df7f1d 100644 --- a/ai/default/aihunt.c +++ b/ai/default/aihunt.c @@ -48,9 +48,10 @@ #include "handicaps.h" /* ai/default */ -#include "aitools.h" #include "daicity.h" #include "daiplayer.h" +#include "daitools.h" +#include "daiunit.h" #include "aihunt.h" diff --git a/ai/default/aiparatrooper.c b/ai/default/aiparatrooper.c index 95488d1f51..f5b9e3b339 100644 --- a/ai/default/aiparatrooper.c +++ b/ai/default/aiparatrooper.c @@ -46,10 +46,11 @@ #include "handicaps.h" /* ai/default */ -#include "aitools.h" #include "daicity.h" #include "daidata.h" #include "daiplayer.h" +#include "daitools.h" +#include "daiunit.h" #include "aiparatrooper.h" diff --git a/ai/default/aitech.c b/ai/default/aitech.c index 8d548286b1..7dd2fca2df 100644 --- a/ai/default/aitech.c +++ b/ai/default/aitech.c @@ -36,12 +36,12 @@ #include "advdata.h" /* ai/default */ -#include "aitools.h" #include "daicity.h" #include "daidata.h" #include "daieffects.h" #include "dailog.h" #include "daiplayer.h" +#include "daiunit.h" #include "aitech.h" diff --git a/ai/default/daicity.c b/ai/default/daicity.c index f77ba7f930..a7befd8b72 100644 --- a/ai/default/daicity.c +++ b/ai/default/daicity.c @@ -54,7 +54,6 @@ /* ai/default */ #include "aihand.h" -#include "aitools.h" #include "daidata.h" #include "daidiplomacy.h" #include "daidomestic.h" @@ -62,6 +61,7 @@ #include "daieffects.h" #include "daiplayer.h" #include "daisettler.h" +#include "daitools.h" #include "daicity.h" diff --git a/ai/default/daidiplomacy.c b/ai/default/daidiplomacy.c index 3fb69a783d..1bfbb766af 100644 --- a/ai/default/daidiplomacy.c +++ b/ai/default/daidiplomacy.c @@ -56,12 +56,12 @@ #include "handicaps.h" /* ai/default */ -#include "aitools.h" #include "daicity.h" #include "daidata.h" #include "dailog.h" #include "daimilitary.h" #include "daiplayer.h" +#include "daiunit.h" #include "daidiplomacy.h" diff --git a/ai/default/daidomestic.c b/ai/default/daidomestic.c index 563017917e..28a10d5db5 100644 --- a/ai/default/daidomestic.c +++ b/ai/default/daidomestic.c @@ -53,11 +53,11 @@ /* ai/default */ #include "aitech.h" -#include "aitools.h" #include "daicity.h" #include "daidata.h" #include "daimilitary.h" #include "daiplayer.h" +#include "daitools.h" #include "daidomestic.h" diff --git a/ai/default/daimilitary.c b/ai/default/daimilitary.c index f5dc7b2d48..9fdc3f24be 100644 --- a/ai/default/daimilitary.c +++ b/ai/default/daimilitary.c @@ -60,12 +60,12 @@ #include "aihunt.h" #include "aiparatrooper.h" #include "aitech.h" -#include "aitools.h" #include "daicity.h" #include "daidata.h" #include "daieffects.h" #include "dailog.h" #include "daiplayer.h" +#include "daitools.h" #include "daimilitary.h" diff --git a/ai/default/daisettler.c b/ai/default/daisettler.c index 39b85cc339..44d2c4f88b 100644 --- a/ai/default/daisettler.c +++ b/ai/default/daisettler.c @@ -56,11 +56,11 @@ /* ai/default */ #include "aiferry.h" -#include "aitools.h" #include "daicity.h" #include "daidata.h" #include "dailog.h" #include "daiplayer.h" +#include "daitools.h" #include "daisettler.h" diff --git a/ai/default/aitools.c b/ai/default/daitools.c similarity index 99% rename from ai/default/aitools.c rename to ai/default/daitools.c index 82d7d6a8c1..c481facd54 100644 --- a/ai/default/aitools.c +++ b/ai/default/daitools.c @@ -67,7 +67,7 @@ #include "daimilitary.h" #include "daiplayer.h" -#include "aitools.h" +#include "daitools.h" /**********************************************************************//** Return the (untranslated) rule name of the ai_unit_task. diff --git a/ai/default/aitools.h b/ai/default/daitools.h similarity index 98% rename from ai/default/aitools.h rename to ai/default/daitools.h index 4a5d7ad2bc..13e892ea44 100644 --- a/ai/default/aitools.h +++ b/ai/default/daitools.h @@ -10,8 +10,8 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. ***********************************************************************/ -#ifndef FC__AITOOLS_H -#define FC__AITOOLS_H +#ifndef FC__DAITOOLS_H +#define FC__DAITOOLS_H /* utility */ #include "support.h" /* bool type */ @@ -80,4 +80,4 @@ void dai_consider_plr_dangerous(struct ai_type *ait, struct player *plr1, struct player *plr2, enum override_bool *result); -#endif /* FC__AITOOLS_H */ +#endif /* FC__DAITOOLS_H */ diff --git a/ai/default/daiunit.c b/ai/default/daiunit.c index 0600488476..dae9f14297 100644 --- a/ai/default/daiunit.c +++ b/ai/default/daiunit.c @@ -73,13 +73,13 @@ #include "aihand.h" #include "aihunt.h" #include "aiparatrooper.h" -#include "aitools.h" #include "daicity.h" #include "daidata.h" #include "daieffects.h" #include "dailog.h" #include "daimilitary.h" #include "daiplayer.h" +#include "daitools.h" #include "daiunit.h" diff --git a/ai/tex/texai.c b/ai/tex/texai.c index 85d6a8cf1a..635409a1fa 100644 --- a/ai/tex/texai.c +++ b/ai/tex/texai.c @@ -22,7 +22,6 @@ /* ai/default */ #include "aiferry.h" #include "aihand.h" -#include "aitools.h" #include "daicity.h" #include "daidiplomacy.h" #include "daidomestic.h" @@ -30,6 +29,8 @@ #include "daimilitary.h" #include "daiplayer.h" #include "daisettler.h" +#include "daitools.h" +#include "daiunit.h" /* tex ai */ #include "texaicity.h" diff --git a/doc/CodingStyle b/doc/CodingStyle index a7b2a96660..de974a0796 100644 --- a/doc/CodingStyle +++ b/doc/CodingStyle @@ -447,7 +447,7 @@ int the_function_starts_here(int base) directory, the order should be: /* ai */ - #include "aitools.h" + #include "daitools.h" /* server */ #include "srv_main.h" @@ -458,7 +458,7 @@ int the_function_starts_here(int base) #include "srv_main.h" /* ai */ - #include "aitools.h" + #include "daitools.h" - Do not include headers in other headers if at all possible. Use forward declarations for pointers to structs: diff --git a/meson.build b/meson.build index 5392a59d8f..be2698bb17 100644 --- a/meson.build +++ b/meson.build @@ -1103,7 +1103,6 @@ ais = static_library('fc_ai', 'ai/default/aihunt.c', 'ai/default/aiparatrooper.c', 'ai/default/aitech.c', - 'ai/default/aitools.c', 'ai/default/daiactions.c', 'ai/default/daicity.c', 'ai/default/daidata.c', @@ -1114,6 +1113,7 @@ ais = static_library('fc_ai', 'ai/default/daimilitary.c', 'ai/default/daiplayer.c', 'ai/default/daisettler.c', + 'ai/default/daitools.c', 'ai/default/daiunit.c', sources: [verhdr], include_directories: [server_inc, include_directories('ai/default')] -- 2.39.2