Flags: Fix clang warnings by refactoring build
MODIFY
CMakeLists.txt
CMakeLists.txt
@@ -78,12 +78,10 @@ add_library(lcf
src/generated/ldb_system.cpp
src/generated/ldb_terms.cpp
src/generated/ldb_terrain.cpp
- src/generated/ldb_terrain_flags.cpp
src/generated/ldb_testbattler.cpp
src/generated/ldb_troop.cpp
src/generated/ldb_troopmember.cpp
src/generated/ldb_trooppagecondition.cpp
- src/generated/ldb_trooppagecondition_flags.cpp
src/generated/ldb_trooppage.cpp
src/generated/ldb_variable.cpp
src/generated/lmt_encounter.cpp
@@ -91,7 +89,6 @@ add_library(lcf
src/generated/lmt_start.cpp
src/generated/lmu_event.cpp
src/generated/lmu_eventpagecondition.cpp
- src/generated/lmu_eventpagecondition_flags.cpp
src/generated/lmu_eventpage.cpp
src/generated/lmu_map.cpp
src/generated/lmu_moveroute.cpp
@@ -105,7 +102,6 @@ add_library(lcf
src/generated/lsd_savemapinfo.cpp
src/generated/lsd_savepartylocation.cpp
src/generated/lsd_savepicture.cpp
- src/generated/lsd_savepicture_flags.cpp
src/generated/lsd_savescreen.cpp
src/generated/lsd_savesystem.cpp
src/generated/lsd_savetarget.cpp

MODIFY
Makefile.am
Makefile.am
@@ -74,12 +74,10 @@ liblcf_la_SOURCES = \
src/generated/ldb_system.cpp \
src/generated/ldb_terms.cpp \
src/generated/ldb_terrain.cpp \
- src/generated/ldb_terrain_flags.cpp \
src/generated/ldb_testbattler.cpp \
src/generated/ldb_troop.cpp \
src/generated/ldb_troopmember.cpp \
src/generated/ldb_trooppagecondition.cpp \
- src/generated/ldb_trooppagecondition_flags.cpp \
src/generated/ldb_trooppage.cpp \
src/generated/ldb_variable.cpp \
src/generated/lmt_encounter.cpp \
@@ -87,7 +85,6 @@ liblcf_la_SOURCES = \
src/generated/lmt_start.cpp \
src/generated/lmu_event.cpp \
src/generated/lmu_eventpagecondition.cpp \
- src/generated/lmu_eventpagecondition_flags.cpp \
src/generated/lmu_eventpage.cpp \
src/generated/lmu_map.cpp \
src/generated/lmu_moveroute.cpp \
@@ -101,7 +98,6 @@ liblcf_la_SOURCES = \
src/generated/lsd_savemapinfo.cpp \
src/generated/lsd_savepartylocation.cpp \
src/generated/lsd_savepicture.cpp \
- src/generated/lsd_savepicture_flags.cpp \
src/generated/lsd_savescreen.cpp \
src/generated/lsd_savesystem.cpp \
src/generated/lsd_savetarget.cpp \
@@ -154,6 +150,7 @@ pkginclude_HEADERS = \
src/generated/rpg_eventcommand.h \
src/generated/rpg_event.h \
src/generated/rpg_eventpagecondition.h \
+ src/generated/lmu_eventpagecondition_flags.h \
src/generated/rpg_eventpage.h \
src/generated/rpg_itemanimation.h \
src/generated/rpg_item.h \
@@ -175,6 +172,7 @@ pkginclude_HEADERS = \
src/generated/rpg_savemapinfo.h \
src/generated/rpg_savepartylocation.h \
src/generated/rpg_savepicture.h \
+ src/generated/lsd_savepicture_flags.h \
src/generated/rpg_savescreen.h \
src/generated/rpg_savesystem.h \
src/generated/rpg_savetarget.h \
@@ -188,11 +186,13 @@ pkginclude_HEADERS = \
src/generated/rpg_system.h \
src/generated/rpg_terms.h \
src/generated/rpg_terrain.h \
+ src/generated/ldb_terrain_flags.h \
src/generated/rpg_testbattler.h \
src/generated/rpg_treemap.h \
src/generated/rpg_troop.h \
src/generated/rpg_troopmember.h \
src/generated/rpg_trooppagecondition.h \
+ src/generated/ldb_trooppagecondition_flags.h \
src/generated/rpg_trooppage.h \
src/generated/rpg_variable.h

MODIFY
builds/vs2015/liblcf.vcxproj
builds/vs2015/liblcf.vcxproj
<ClCompile Include="..\..\src\generated\ldb_system.cpp" />
<ClCompile Include="..\..\src\generated\ldb_terms.cpp" />
<ClCompile Include="..\..\src\generated\ldb_terrain.cpp" />
- <ClCompile Include="..\..\src\generated\ldb_terrain_flags.cpp" />
<ClCompile Include="..\..\src\generated\ldb_testbattler.cpp" />
<ClCompile Include="..\..\src\generated\ldb_troop.cpp" />
<ClCompile Include="..\..\src\generated\ldb_troopmember.cpp" />
<ClCompile Include="..\..\src\generated\ldb_trooppage.cpp" />
<ClCompile Include="..\..\src\generated\ldb_trooppagecondition.cpp" />
- <ClCompile Include="..\..\src\generated\ldb_trooppagecondition_flags.cpp" />
<ClCompile Include="..\..\src\generated\ldb_variable.cpp" />
<ClCompile Include="..\..\src\generated\lmt_encounter.cpp" />
<ClCompile Include="..\..\src\generated\lmt_mapinfo.cpp" />
<ClCompile Include="..\..\src\generated\lmu_event.cpp" />
<ClCompile Include="..\..\src\generated\lmu_eventpage.cpp" />
<ClCompile Include="..\..\src\generated\lmu_eventpagecondition.cpp" />
- <ClCompile Include="..\..\src\generated\lmu_eventpagecondition_flags.cpp" />
<ClCompile Include="..\..\src\generated\lmu_map.cpp" />
<ClCompile Include="..\..\src\generated\lmu_moveroute.cpp" />
<ClCompile Include="..\..\src\generated\lsd_save.cpp" />
<ClCompile Include="..\..\src\generated\lsd_savemapinfo.cpp" />
<ClCompile Include="..\..\src\generated\lsd_savepartylocation.cpp" />
<ClCompile Include="..\..\src\generated\lsd_savepicture.cpp" />
- <ClCompile Include="..\..\src\generated\lsd_savepicture_flags.cpp" />
<ClCompile Include="..\..\src\generated\lsd_savescreen.cpp" />
<ClCompile Include="..\..\src\generated\lsd_savesystem.cpp" />
<ClCompile Include="..\..\src\generated\lsd_savetarget.cpp" />
<ClInclude Include="..\..\src\writer_lcf.h" />
<ClInclude Include="..\..\src\writer_xml.h" />
<ClInclude Include="..\..\src\generated\ldb_chunks.h" />
+ <ClCompile Include="..\..\src\generated\ldb_terrain_flags.h" />
+ <ClCompile Include="..\..\src\generated\ldb_trooppagecondition_flags.h" />
<ClInclude Include="..\..\src\generated\lmt_chunks.h" />
+ <ClCompile Include="..\..\src\generated\lmu_eventpagecondition_flags.h" />
<ClInclude Include="..\..\src\generated\lmu_chunks.h" />
<ClInclude Include="..\..\src\generated\lsd_chunks.h" />
+ <ClCompile Include="..\..\src\generated\lsd_savepicture_flags.h" />
<ClInclude Include="..\..\src\generated\rpg_actor.h" />
<ClInclude Include="..\..\src\generated\rpg_animation.h" />
<ClInclude Include="..\..\src\generated\rpg_animationcelldata.h" />

MODIFY
generator/generate.py
generator/generate.py
@@ -313,7 +313,7 @@ def generate():
))
if struct.name in flags:
- filepath = os.path.join(tmp_dir, '%s_%s_flags.cpp' % (filetype, filename))
+ filepath = os.path.join(tmp_dir, '%s_%s_flags.h' % (filetype, filename))
with open(filepath, 'w') as f:
f.write(flags_tmpl.render(
struct_name=struct.name,

MODIFY
generator/templates/flag_reader.tmpl
generator/templates/flag_reader.tmpl
// Read {{ struct_name }}.
-using flags_type = RPG::{{ struct_name }}::Flags;
-
template <>
-char const* const Flags<flags_type>::name = "{{ struct_name }}_Flags";
+char const* const Flags<RPG::{{ struct_name }}::Flags>::name = "{{ struct_name }}_Flags";
template <>
-decltype(Flags<flags_type>::flag_names) Flags<flags_type>::flag_names = {
+decltype(Flags<RPG::{{ struct_name }}::Flags>::flag_names) Flags<RPG::{{ struct_name }}::Flags>::flag_names = {
{%- for flag in flags[struct_name] %}
"{{ flag.field }}"{%- if not loop.last %}, {%- endif %}
{%- endfor %}
};
template <>
-decltype(Flags<flags_type>::flags_is2k3) Flags<flags_type>::flags_is2k3 = {
+decltype(Flags<RPG::{{ struct_name }}::Flags>::flags_is2k3) Flags<RPG::{{ struct_name }}::Flags>::flags_is2k3 = {
{%- for flag in flags[struct_name] %}
{{ flag.is2k3 }}{%- if not loop.last %}, {%- endif %}
{%- endfor %}

RENAME
src/generated/ldb_terrain_flags.cpp
src/generated/ldb_terrain_flags.h
Binary files a/src/generated/ldb_terrain_flags.cpp and b/src/generated/ldb_terrain_flags.h differ

RENAME
src/generated/ldb_trooppagecondition_flags.cpp
src/generated/ldb_trooppagecondition_flags.h
Binary files a/src/generated/ldb_trooppagecondition_flags.cpp and b/src/generated/ldb_trooppagecondition_flags.h differ

RENAME
src/generated/lmu_eventpagecondition_flags.cpp
src/generated/lmu_eventpagecondition_flags.h
Binary files a/src/generated/lmu_eventpagecondition_flags.cpp and b/src/generated/lmu_eventpagecondition_flags.h differ

RENAME
src/generated/lsd_savepicture_flags.cpp
src/generated/lsd_savepicture_flags.h
Binary files a/src/generated/lsd_savepicture_flags.cpp and b/src/generated/lsd_savepicture_flags.h differ

MODIFY
src/reader_flags.cpp
src/reader_flags.cpp
#include "rpg_savepicture.h"
#include "data.h"
+#include "ldb_trooppagecondition_flags.h"
+#include "ldb_terrain_flags.h"
+#include "lmu_eventpagecondition_flags.h"
+#include "lsd_savepicture_flags.h"
+
// Templates
template <class S>

Flags: Fix clang warnings by refactoring build