Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compiler warnings, bump deps etc. #489

Merged
merged 3 commits into from
Jan 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ set(LCF_SOURCES
src/generated/rpg_encounter.cpp
src/generated/rpg_enemy.cpp
src/generated/rpg_enemyaction.cpp
src/generated/rpg_enums.cpp
src/generated/rpg_equipment.cpp
src/generated/rpg_event.cpp
src/generated/rpg_eventcommand.cpp
Expand Down
1 change: 0 additions & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ liblcf_la_SOURCES = \
src/generated/rpg_encounter.cpp \
src/generated/rpg_enemy.cpp \
src/generated/rpg_enemyaction.cpp \
src/generated/rpg_enums.cpp \
src/generated/rpg_equipment.cpp \
src/generated/rpg_event.cpp \
src/generated/rpg_eventcommand.cpp \
Expand Down
6 changes: 0 additions & 6 deletions generator/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,11 +467,6 @@ def generate():
type=filetype
))

filepath = os.path.join(tmp_dir, 'rpg_enums.cpp')

with openToRender(filepath) as f:
f.write(enums_tmpl.render())

for dirname, subdirlist, filelist in os.walk(tmp_dir, topdown=False):
subdir = os.path.relpath(dirname, tmp_dir)

Expand Down Expand Up @@ -534,7 +529,6 @@ def main(argv):
rpg_header_tmpl = env.get_template('rpg_header.tmpl', globals=globals)
rpg_source_tmpl = env.get_template('rpg_source.tmpl', globals=globals)
flags_tmpl = env.get_template('flag_reader.tmpl', globals=globals)
enums_tmpl = env.get_template('rpg_enums.tmpl', globals=globals)
fwd_tmpl = env.get_template('fwd.tmpl', globals=globals)
fwd_struct_tmpl = env.get_template('fwd_struct.tmpl', globals=globals)

Expand Down
26 changes: 0 additions & 26 deletions generator/templates/rpg_enums.tmpl

This file was deleted.

6 changes: 1 addition & 5 deletions generator/templates/rpg_source.tmpl
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
{% include "copyright.tmpl" %}
// Headers
#include "lcf/rpg/{{ filename }}.h"
{% if struct_name in constants -%}
{%- for name, type, value, comment in constants[struct_name] %}
constexpr {{ type }} lcf::rpg::{{ struct_name }}::{{ name }};
{%- endfor %}
{%- endif %}

namespace lcf {
namespace rpg {
{%- for field in fields[struct_name]|field_is_used %}
Expand Down
1 change: 0 additions & 1 deletion src/dbarray.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
namespace lcf {

const DBArrayAlloc::size_type DBArrayAlloc::_empty_buf[2] = { 0, 0 };
constexpr DBString::size_type DBString::npos;

static ptrdiff_t HeaderSize(size_t align) {
return std::max(sizeof(DBArrayAlloc::size_type), align);
Expand Down
113 changes: 0 additions & 113 deletions src/generated/rpg_enums.cpp

This file was deleted.

1 change: 0 additions & 1 deletion src/generated/rpg_item.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// Headers
#include "lcf/rpg/item.h"

constexpr const char* lcf::rpg::Item::kDefaultMessage;
namespace lcf {
namespace rpg {

Expand Down
1 change: 0 additions & 1 deletion src/generated/rpg_saveactor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// Headers
#include "lcf/rpg/saveactor.h"

constexpr const char* lcf::rpg::SaveActor::kEmptyName;
namespace lcf {
namespace rpg {

Expand Down
3 changes: 0 additions & 3 deletions src/generated/rpg_savepartylocation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
// Headers
#include "lcf/rpg/savepartylocation.h"

constexpr int lcf::rpg::SavePartyLocation::kPanXDefault;
constexpr int lcf::rpg::SavePartyLocation::kPanYDefault;
constexpr int lcf::rpg::SavePartyLocation::kPanSpeedDefault;
namespace lcf {
namespace rpg {

Expand Down
1 change: 0 additions & 1 deletion src/generated/rpg_skill.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// Headers
#include "lcf/rpg/skill.h"

constexpr const char* lcf::rpg::Skill::kDefaultMessage;
namespace lcf {
namespace rpg {

Expand Down
1 change: 0 additions & 1 deletion src/generated/rpg_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// Headers
#include "lcf/rpg/state.h"

constexpr int lcf::rpg::State::kDeathID;
namespace lcf {
namespace rpg {

Expand Down
1 change: 0 additions & 1 deletion src/generated/rpg_terms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// Headers
#include "lcf/rpg/terms.h"

constexpr const char* lcf::rpg::Terms::kDefaultTerm;
namespace lcf {
namespace rpg {

Expand Down
5 changes: 2 additions & 3 deletions src/lcf/dbbitarray.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ class DBBitProxy {

constexpr DBBitProxy() = default;

DBBitProxy& operator=(const DBBitProxy& x) noexcept = default;
DBBitProxy& operator=(bool x) noexcept {
auto& byte = _base[_idx / CHAR_BIT];
auto bit = _idx % CHAR_BIT;
Expand Down Expand Up @@ -92,8 +91,8 @@ class DBBitProxyIterator {
DBBitProxyIterator operator--(int) { auto iter = *this; --(*this); return iter; }

void swap(DBBitProxyIterator& o) {
std::swap(_proxy._base, o._base);
std::swap(_proxy._idx, o._idx);
std::swap(_proxy._base, o._proxy._base);
std::swap(_proxy._idx, o._proxy._idx);
}

friend bool operator==(DBBitProxyIterator l, DBBitProxyIterator r) { return l->index() == r->index(); }
Expand Down
2 changes: 1 addition & 1 deletion src/lcf/enum_tags.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ inline constexpr const char* EnumTags<E, N>::tag(E etag) const {
template <typename E, size_t N>
inline constexpr const char* EnumTags<E, N>::tag(int_type value) const {
if (monotonic_from_zero) {
if (value < 0 || value >= N) {
if (value < 0 || static_cast<size_t>(value) >= N) {
return nullptr;
} else {
return _tags[value].name;
Expand Down
Loading
Loading