From 3140513b8ccfcae1663519128dd565116aa35703 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 28 May 2015 14:25:09 +0300 Subject: Rename file simpledefines.h into booldefines.h --- src/CMakeLists.txt | 2 +- src/Makefile.am | 2 +- src/enums/simpletypes/allowsort.h | 2 +- src/enums/simpletypes/allplayers.h | 2 +- src/enums/simpletypes/booldefines.h | 50 +++++++++++++++++++++++++++++++++ src/enums/simpletypes/damaged.h | 2 +- src/enums/simpletypes/enable.h | 2 +- src/enums/simpletypes/equipm.h | 2 +- src/enums/simpletypes/equipped.h | 2 +- src/enums/simpletypes/favorite.h | 2 +- src/enums/simpletypes/forcedisplay.h | 2 +- src/enums/simpletypes/identified.h | 2 +- src/enums/simpletypes/ignorerecord.h | 2 +- src/enums/simpletypes/keep.h | 2 +- src/enums/simpletypes/modal.h | 2 +- src/enums/simpletypes/modifiable.h | 2 +- src/enums/simpletypes/move.h | 2 +- src/enums/simpletypes/notify.h | 2 +- src/enums/simpletypes/npcnames.h | 2 +- src/enums/simpletypes/online.h | 2 +- src/enums/simpletypes/sfx.h | 2 +- src/enums/simpletypes/showcenter.h | 2 +- src/enums/simpletypes/simpledefines.h | 50 --------------------------------- src/enums/simpletypes/skiperror.h | 2 +- src/enums/simpletypes/speech.h | 2 +- src/enums/simpletypes/trading.h | 2 +- src/enums/simpletypes/tryremovecolors.h | 2 +- src/enums/simpletypes/useargs.h | 2 +- src/enums/simpletypes/useresman.h | 2 +- src/enums/simpletypes/visible.h | 2 +- 30 files changed, 78 insertions(+), 78 deletions(-) create mode 100644 src/enums/simpletypes/booldefines.h delete mode 100644 src/enums/simpletypes/simpledefines.h diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b60871194..c23bcfbc6 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1057,6 +1057,7 @@ SET(SRCS enums/state.h enums/simpletypes/allowsort.h enums/simpletypes/allplayers.h + enums/simpletypes/booldefines.h enums/simpletypes/damaged.h enums/simpletypes/enable.h enums/simpletypes/equipm.h @@ -1074,7 +1075,6 @@ SET(SRCS enums/simpletypes/online.h enums/simpletypes/sfx.h enums/simpletypes/showcenter.h - enums/simpletypes/simpledefines.h enums/simpletypes/skiperror.h enums/simpletypes/speech.h enums/simpletypes/trading.h diff --git a/src/Makefile.am b/src/Makefile.am index 8464b8222..ee4609a92 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1186,6 +1186,7 @@ manaplus_SOURCES += gui/widgets/avatarlistbox.cpp \ enums/state.h \ enums/simpletypes/allowsort.h \ enums/simpletypes/allplayers.h \ + enums/simpletypes/booldefines.h \ enums/simpletypes/damaged.h \ enums/simpletypes/enable.h \ enums/simpletypes/equipm.h \ @@ -1203,7 +1204,6 @@ manaplus_SOURCES += gui/widgets/avatarlistbox.cpp \ enums/simpletypes/online.h \ enums/simpletypes/sfx.h \ enums/simpletypes/showcenter.h \ - enums/simpletypes/simpledefines.h \ enums/simpletypes/skiperror.h \ enums/simpletypes/speech.h \ enums/simpletypes/trading.h \ diff --git a/src/enums/simpletypes/allowsort.h b/src/enums/simpletypes/allowsort.h index 59347ba22..2b68bbb65 100644 --- a/src/enums/simpletypes/allowsort.h +++ b/src/enums/simpletypes/allowsort.h @@ -21,7 +21,7 @@ #ifndef ENUMS_SIMPLETYPES_ALLOWSORT_H #define ENUMS_SIMPLETYPES_ALLOWSORT_H -#include "enums/simpletypes/simpledefines.h" +#include "enums/simpletypes/booldefines.h" defBoolEnum(AllowSort); diff --git a/src/enums/simpletypes/allplayers.h b/src/enums/simpletypes/allplayers.h index 10b746a6f..575fff63c 100644 --- a/src/enums/simpletypes/allplayers.h +++ b/src/enums/simpletypes/allplayers.h @@ -21,7 +21,7 @@ #ifndef ENUMS_SIMPLETYPES_ALLPLAYERS_H #define ENUMS_SIMPLETYPES_ALLPLAYERS_H -#include "enums/simpletypes/simpledefines.h" +#include "enums/simpletypes/booldefines.h" defBoolEnum(AllPlayers); diff --git a/src/enums/simpletypes/booldefines.h b/src/enums/simpletypes/booldefines.h new file mode 100644 index 000000000..199389208 --- /dev/null +++ b/src/enums/simpletypes/booldefines.h @@ -0,0 +1,50 @@ +/* + * The ManaPlus Client + * Copyright (C) 2015 The ManaPlus Developers + * + * This file is part of The ManaPlus Client. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef ENUMS_SIMPLETYPES_BOOLDEFINES_H +#define ENUMS_SIMPLETYPES_BOOLDEFINES_H + +#include "localconsts.h" + +#ifdef ADVGCC + +#define defBoolEnum(name) \ + enum class name : bool \ + { \ + MFalse = false, \ + MTrue = true \ + }; \ + const name name##_true = name::MTrue; \ + const name name##_false = name::MFalse +#define fromBool(val, name) \ + (val) ? name::MTrue : name::MFalse + +#else // ADVGCC + +#define defBoolEnum(name) \ + const bool name##_true = true; \ + const bool name##_false = false; \ + typedef bool name +#define fromBool(val, name) \ + (val) ? true : false + +#endif // ADVGCC + +#endif // ENUMS_SIMPLETYPES_BOOLDEFINES_H diff --git a/src/enums/simpletypes/damaged.h b/src/enums/simpletypes/damaged.h index e4240766d..3b2e15fbc 100644 --- a/src/enums/simpletypes/damaged.h +++ b/src/enums/simpletypes/damaged.h @@ -21,7 +21,7 @@ #ifndef ENUMS_SIMPLETYPES_DAMAGED_H #define ENUMS_SIMPLETYPES_DAMAGED_H -#include "enums/simpletypes/simpledefines.h" +#include "enums/simpletypes/booldefines.h" defBoolEnum(Damaged); diff --git a/src/enums/simpletypes/enable.h b/src/enums/simpletypes/enable.h index 3e7857628..cdf06317e 100644 --- a/src/enums/simpletypes/enable.h +++ b/src/enums/simpletypes/enable.h @@ -21,7 +21,7 @@ #ifndef ENUMS_SIMPLETYPES_ENABLE_H #define ENUMS_SIMPLETYPES_ENABLE_H -#include "enums/simpletypes/simpledefines.h" +#include "enums/simpletypes/booldefines.h" defBoolEnum(Enable); diff --git a/src/enums/simpletypes/equipm.h b/src/enums/simpletypes/equipm.h index 5dd1bbf9e..a1f865457 100644 --- a/src/enums/simpletypes/equipm.h +++ b/src/enums/simpletypes/equipm.h @@ -21,7 +21,7 @@ #ifndef ENUMS_SIMPLETYPES_EQUIPM_H #define ENUMS_SIMPLETYPES_EQUIPM_H -#include "enums/simpletypes/simpledefines.h" +#include "enums/simpletypes/booldefines.h" defBoolEnum(Equipm); diff --git a/src/enums/simpletypes/equipped.h b/src/enums/simpletypes/equipped.h index 569691fc1..eac272c45 100644 --- a/src/enums/simpletypes/equipped.h +++ b/src/enums/simpletypes/equipped.h @@ -21,7 +21,7 @@ #ifndef ENUMS_SIMPLETYPES_EQUIPPED_H #define ENUMS_SIMPLETYPES_EQUIPPED_H -#include "enums/simpletypes/simpledefines.h" +#include "enums/simpletypes/booldefines.h" defBoolEnum(Equipped); diff --git a/src/enums/simpletypes/favorite.h b/src/enums/simpletypes/favorite.h index bb3295afc..cb5e15f38 100644 --- a/src/enums/simpletypes/favorite.h +++ b/src/enums/simpletypes/favorite.h @@ -21,7 +21,7 @@ #ifndef ENUMS_SIMPLETYPES_FAVORITE_H #define ENUMS_SIMPLETYPES_FAVORITE_H -#include "enums/simpletypes/simpledefines.h" +#include "enums/simpletypes/booldefines.h" defBoolEnum(Favorite); diff --git a/src/enums/simpletypes/forcedisplay.h b/src/enums/simpletypes/forcedisplay.h index 84c2d4560..c319704db 100644 --- a/src/enums/simpletypes/forcedisplay.h +++ b/src/enums/simpletypes/forcedisplay.h @@ -21,7 +21,7 @@ #ifndef ENUMS_SIMPLETYPES_FORCEDISPLAY_H #define ENUMS_SIMPLETYPES_FORCEDISPLAY_H -#include "enums/simpletypes/simpledefines.h" +#include "enums/simpletypes/booldefines.h" defBoolEnum(ForceDisplay); diff --git a/src/enums/simpletypes/identified.h b/src/enums/simpletypes/identified.h index ecc8b2d1b..5e15665f6 100644 --- a/src/enums/simpletypes/identified.h +++ b/src/enums/simpletypes/identified.h @@ -21,7 +21,7 @@ #ifndef ENUMS_SIMPLETYPES_IDENTIFIED_H #define ENUMS_SIMPLETYPES_IDENTIFIED_H -#include "enums/simpletypes/simpledefines.h" +#include "enums/simpletypes/booldefines.h" defBoolEnum(Identified); diff --git a/src/enums/simpletypes/ignorerecord.h b/src/enums/simpletypes/ignorerecord.h index 7ed2566e8..0c762dc9d 100644 --- a/src/enums/simpletypes/ignorerecord.h +++ b/src/enums/simpletypes/ignorerecord.h @@ -21,7 +21,7 @@ #ifndef ENUMS_SIMPLETYPES_IGNORERECORD_H #define ENUMS_SIMPLETYPES_IGNORERECORD_H -#include "enums/simpletypes/simpledefines.h" +#include "enums/simpletypes/booldefines.h" defBoolEnum(IgnoreRecord); diff --git a/src/enums/simpletypes/keep.h b/src/enums/simpletypes/keep.h index a172a1242..8b1a9ceae 100644 --- a/src/enums/simpletypes/keep.h +++ b/src/enums/simpletypes/keep.h @@ -21,7 +21,7 @@ #ifndef ENUMS_SIMPLETYPES_KEEP_H #define ENUMS_SIMPLETYPES_KEEP_H -#include "enums/simpletypes/simpledefines.h" +#include "enums/simpletypes/booldefines.h" defBoolEnum(Keep); diff --git a/src/enums/simpletypes/modal.h b/src/enums/simpletypes/modal.h index 660ce8a8a..7c9da01d2 100644 --- a/src/enums/simpletypes/modal.h +++ b/src/enums/simpletypes/modal.h @@ -21,7 +21,7 @@ #ifndef ENUMS_SIMPLETYPES_MODAL_H #define ENUMS_SIMPLETYPES_MODAL_H -#include "enums/simpletypes/simpledefines.h" +#include "enums/simpletypes/booldefines.h" defBoolEnum(Modal); diff --git a/src/enums/simpletypes/modifiable.h b/src/enums/simpletypes/modifiable.h index 8710043f9..37455b2f2 100644 --- a/src/enums/simpletypes/modifiable.h +++ b/src/enums/simpletypes/modifiable.h @@ -21,7 +21,7 @@ #ifndef ENUMS_SIMPLETYPES_MODIFIABLE_H #define ENUMS_SIMPLETYPES_MODIFIABLE_H -#include "enums/simpletypes/simpledefines.h" +#include "enums/simpletypes/booldefines.h" defBoolEnum(Modifiable); diff --git a/src/enums/simpletypes/move.h b/src/enums/simpletypes/move.h index 95c2ff4a0..f13a976c2 100644 --- a/src/enums/simpletypes/move.h +++ b/src/enums/simpletypes/move.h @@ -21,7 +21,7 @@ #ifndef ENUMS_SIMPLETYPES_MOVE_H #define ENUMS_SIMPLETYPES_MOVE_H -#include "enums/simpletypes/simpledefines.h" +#include "enums/simpletypes/booldefines.h" defBoolEnum(Move); diff --git a/src/enums/simpletypes/notify.h b/src/enums/simpletypes/notify.h index c72043b24..e03158801 100644 --- a/src/enums/simpletypes/notify.h +++ b/src/enums/simpletypes/notify.h @@ -21,7 +21,7 @@ #ifndef ENUMS_SIMPLETYPES_NOTIFY_H #define ENUMS_SIMPLETYPES_NOTIFY_H -#include "enums/simpletypes/simpledefines.h" +#include "enums/simpletypes/booldefines.h" defBoolEnum(Notify); diff --git a/src/enums/simpletypes/npcnames.h b/src/enums/simpletypes/npcnames.h index 5a6e8aa57..08af24ce7 100644 --- a/src/enums/simpletypes/npcnames.h +++ b/src/enums/simpletypes/npcnames.h @@ -21,7 +21,7 @@ #ifndef ENUMS_SIMPLETYPES_NPCNAMES_H #define ENUMS_SIMPLETYPES_NPCNAMES_H -#include "enums/simpletypes/simpledefines.h" +#include "enums/simpletypes/booldefines.h" defBoolEnum(NpcNames); diff --git a/src/enums/simpletypes/online.h b/src/enums/simpletypes/online.h index 47ccddd95..7b7af9bf3 100644 --- a/src/enums/simpletypes/online.h +++ b/src/enums/simpletypes/online.h @@ -21,7 +21,7 @@ #ifndef ENUMS_SIMPLETYPES_ONLINE_H #define ENUMS_SIMPLETYPES_ONLINE_H -#include "enums/simpletypes/simpledefines.h" +#include "enums/simpletypes/booldefines.h" defBoolEnum(Online); diff --git a/src/enums/simpletypes/sfx.h b/src/enums/simpletypes/sfx.h index e837d0a9e..a5924639d 100644 --- a/src/enums/simpletypes/sfx.h +++ b/src/enums/simpletypes/sfx.h @@ -21,7 +21,7 @@ #ifndef ENUMS_SIMPLETYPES_SFX_H #define ENUMS_SIMPLETYPES_SFX_H -#include "enums/simpletypes/simpledefines.h" +#include "enums/simpletypes/booldefines.h" defBoolEnum(Sfx); diff --git a/src/enums/simpletypes/showcenter.h b/src/enums/simpletypes/showcenter.h index 86f5d0aac..ce1368cf4 100644 --- a/src/enums/simpletypes/showcenter.h +++ b/src/enums/simpletypes/showcenter.h @@ -21,7 +21,7 @@ #ifndef ENUMS_SIMPLETYPES_SHOWCENTER_H #define ENUMS_SIMPLETYPES_SHOWCENTER_H -#include "enums/simpletypes/simpledefines.h" +#include "enums/simpletypes/booldefines.h" defBoolEnum(ShowCenter); diff --git a/src/enums/simpletypes/simpledefines.h b/src/enums/simpletypes/simpledefines.h deleted file mode 100644 index ea5592b0e..000000000 --- a/src/enums/simpletypes/simpledefines.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2015 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#ifndef ENUMS_SIMPLETYPES_SIMPLDEFINES_H -#define ENUMS_SIMPLETYPES_SIMPLDEFINES_H - -#include "localconsts.h" - -#ifdef ADVGCC - -#define defBoolEnum(name) \ - enum class name : bool \ - { \ - MFalse = false, \ - MTrue = true \ - }; \ - const name name##_true = name::MTrue; \ - const name name##_false = name::MFalse -#define fromBool(val, name) \ - (val) ? name::MTrue : name::MFalse - -#else // ADVGCC - -#define defBoolEnum(name) \ - const bool name##_true = true; \ - const bool name##_false = false; \ - typedef bool name -#define fromBool(val, name) \ - (val) ? true : false - -#endif // ADVGCC - -#endif // ENUMS_SIMPLETYPES_SIMPLDEFINES_H diff --git a/src/enums/simpletypes/skiperror.h b/src/enums/simpletypes/skiperror.h index b76cefdee..b9ca2a8a4 100644 --- a/src/enums/simpletypes/skiperror.h +++ b/src/enums/simpletypes/skiperror.h @@ -21,7 +21,7 @@ #ifndef ENUMS_SIMPLETYPES_SKIPERROR_H #define ENUMS_SIMPLETYPES_SKIPERROR_H -#include "enums/simpletypes/simpledefines.h" +#include "enums/simpletypes/booldefines.h" defBoolEnum(SkipError); diff --git a/src/enums/simpletypes/speech.h b/src/enums/simpletypes/speech.h index 03a962f96..1cc35517d 100644 --- a/src/enums/simpletypes/speech.h +++ b/src/enums/simpletypes/speech.h @@ -21,7 +21,7 @@ #ifndef ENUMS_SIMPLETYPES_SPEECH_H #define ENUMS_SIMPLETYPES_SPEECH_H -#include "enums/simpletypes/simpledefines.h" +#include "enums/simpletypes/booldefines.h" defBoolEnum(Speech); diff --git a/src/enums/simpletypes/trading.h b/src/enums/simpletypes/trading.h index 767553d4e..170b3b4fb 100644 --- a/src/enums/simpletypes/trading.h +++ b/src/enums/simpletypes/trading.h @@ -21,7 +21,7 @@ #ifndef ENUMS_SIMPLETYPES_TRADING_H #define ENUMS_SIMPLETYPES_TRADING_H -#include "enums/simpletypes/simpledefines.h" +#include "enums/simpletypes/booldefines.h" defBoolEnum(Trading); diff --git a/src/enums/simpletypes/tryremovecolors.h b/src/enums/simpletypes/tryremovecolors.h index e4ae07dff..b1759d853 100644 --- a/src/enums/simpletypes/tryremovecolors.h +++ b/src/enums/simpletypes/tryremovecolors.h @@ -21,7 +21,7 @@ #ifndef ENUMS_SIMPLETYPES_TRYREMOVECOLORS_H #define ENUMS_SIMPLETYPES_TRYREMOVECOLORS_H -#include "enums/simpletypes/simpledefines.h" +#include "enums/simpletypes/booldefines.h" defBoolEnum(TryRemoveColors); diff --git a/src/enums/simpletypes/useargs.h b/src/enums/simpletypes/useargs.h index 163f449f4..f3c2bf94e 100644 --- a/src/enums/simpletypes/useargs.h +++ b/src/enums/simpletypes/useargs.h @@ -21,7 +21,7 @@ #ifndef ENUMS_SIMPLETYPES_USEARGS_H #define ENUMS_SIMPLETYPES_USEARGS_H -#include "enums/simpletypes/simpledefines.h" +#include "enums/simpletypes/booldefines.h" #include "localconsts.h" diff --git a/src/enums/simpletypes/useresman.h b/src/enums/simpletypes/useresman.h index 275a0ac0a..27d22b1d8 100644 --- a/src/enums/simpletypes/useresman.h +++ b/src/enums/simpletypes/useresman.h @@ -21,7 +21,7 @@ #ifndef ENUMS_SIMPLETYPES_USERESMAN_H #define ENUMS_SIMPLETYPES_USERESMAN_H -#include "enums/simpletypes/simpledefines.h" +#include "enums/simpletypes/booldefines.h" defBoolEnum(UseResman); diff --git a/src/enums/simpletypes/visible.h b/src/enums/simpletypes/visible.h index 1483b81a0..02e19a35f 100644 --- a/src/enums/simpletypes/visible.h +++ b/src/enums/simpletypes/visible.h @@ -21,7 +21,7 @@ #ifndef ENUMS_SIMPLETYPES_VISIBLE_H #define ENUMS_SIMPLETYPES_VISIBLE_H -#include "enums/simpletypes/simpledefines.h" +#include "enums/simpletypes/booldefines.h" defBoolEnum(Visible); -- cgit v1.2.3-70-g09d2