diff --git a/src/tool/csv2yaml.cpp b/src/tool/csv2yaml.cpp index 50e6224f73..f75c8adfc1 100644 --- a/src/tool/csv2yaml.cpp +++ b/src/tool/csv2yaml.cpp @@ -161,9 +161,9 @@ static void produce_txt_data(const std::string &modePath, const std::string &fix skill_produce.clear(); if (fileExists(modePath + "/produce_db.txt")) - sv_readdb(modePath.c_str(), "produce_db.txt", ',', 5, 5+2*MAX_PRODUCE_RESOURCE, MAX_SKILL_PRODUCE_DB, skill_parse_row_producedb, false); + sv_readdb(modePath.c_str(), "produce_db.txt", ',', 5, 5 + 2 * MAX_PRODUCE_RESOURCE, MAX_SKILL_PRODUCE_DB, skill_parse_row_producedb, false); if (fileExists(fixedPath + "/skill_changematerial_db.txt")) - sv_readdb(fixedPath.c_str(), "skill_changematerial_db.txt", ',', 5, 5+2*MAX_SKILL_CHANGEMATERIAL_SET, MAX_SKILL_CHANGEMATERIAL_DB, skill_parse_row_changematerialdb, false); + sv_readdb(fixedPath.c_str(), "skill_changematerial_db.txt", ',', 5, 5 + 2 * MAX_SKILL_CHANGEMATERIAL_SET, MAX_SKILL_CHANGEMATERIAL_DB, skill_parse_row_changematerialdb, false); } template @@ -5296,12 +5296,8 @@ static bool read_homunculusdb( char* str[], size_t columns, size_t current ){ return true; } -int main( int argc, char *argv[] ){ - return main_core( argc, argv ); -} - // Copied and adjusted from skill.cpp -static bool skill_parse_row_producedb(char* split[], int columns, int current) { +static bool skill_parse_row_producedb(char* split[], size_t columns, size_t current) { t_itemid nameid = static_cast(strtoul(split[1], nullptr, 10)); if (nameid == 0) { @@ -5335,7 +5331,7 @@ static bool skill_parse_row_producedb(char* split[], int columns, int current) { entry.req_skill_lv = skill_lv; } - for (uint8 x = 5; x+1 < columns && split[x] && split[x+1]; x += 2) { + for (size_t x = 5; x+1 < columns && split[x] && split[x+1]; x += 2) { nameid = static_cast(strtoul(split[x], nullptr, 10)); item_name = util::umap_find(aegis_itemnames, nameid); @@ -5366,7 +5362,7 @@ static bool skill_parse_row_producedb(char* split[], int columns, int current) { } // Copied and adjusted from skill.cpp -static bool skill_parse_row_changematerialdb(char* split[], int columns, int current) +static bool skill_parse_row_changematerialdb(char* split[], size_t columns, size_t current) { t_itemid nameid = static_cast(strtoul(split[1], nullptr, 10)); @@ -5387,7 +5383,7 @@ static bool skill_parse_row_changematerialdb(char* split[], int columns, int cur s_skill_changematerial_db_csv item = {}; item.baserate = static_cast(strtoul(split[2], nullptr, 10)); - for (uint16 x = 3; x+1 < columns && split[x] && split[x+1]; x += 2) { + for (size_t x = 3; x+1 < columns && split[x] && split[x+1]; x += 2) { item.qty.insert({ static_cast(strtoul(split[x], nullptr, 10)), static_cast(strtoul(split[x+1], nullptr, 10)) }); } @@ -5462,3 +5458,7 @@ static bool skill_producedb_yaml(void) { } return true; } + +int main( int argc, char *argv[] ){ + return main_core( argc, argv ); +} diff --git a/src/tool/csv2yaml.hpp b/src/tool/csv2yaml.hpp index 9757785423..f537aaf691 100644 --- a/src/tool/csv2yaml.hpp +++ b/src/tool/csv2yaml.hpp @@ -557,9 +557,9 @@ static bool itemdb_read_combos(const char* file); static bool cashshop_parse_dbrow( char* fields[], size_t columns, size_t current ); static bool read_homunculus_skilldb( char* split[], size_t columns, size_t current ); static bool read_homunculusdb( char* str[], size_t columns, size_t current ); -static bool skill_parse_row_producedb(char* fields[], int columns, int current); +static bool skill_parse_row_producedb(char* fields[], size_t columns, size_t current); static bool skill_producedb_yaml(); -static bool skill_parse_row_changematerialdb(char* fields[], int columns, int current); -static bool skill_parse_row_createarrowdb(char* fields[], int columns, int current); +static bool skill_parse_row_producedb(char *split[], size_t columns, size_t current); +static bool skill_parse_row_changematerialdb(char* fields[], size_t columns, size_t current); #endif /* CSV2YAML_HPP */