Skip to content

Commit fc0b05b

Browse files
committed
Fix warnings and remove unused code
1 parent 8d711d5 commit fc0b05b

File tree

6 files changed

+9
-25
lines changed

6 files changed

+9
-25
lines changed

lcftrans/src/main.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,8 @@ void DumpLdb(const std::string& filename) {
249249
}
250250

251251
void DumpLmuLmtInner(const std::string& filename, Translation& t, const std::string& poname) {
252+
(void)filename;
253+
252254
Translation pot;
253255

254256
if (t.getEntries().empty()) {

lcftrans/src/translation.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,7 @@ static void parseEvents(Translation& t, Root& root, const F& make_info) {
356356
ParseEvent<decltype(make_info)> p { t, make_info };
357357

358358
lcf::rpg::ForEachString(root, [&](const auto& val, const auto& ctx) {
359+
(void)val;
359360
if (!ctx.parent ||
360361
!std::is_same<decltype(ctx.parent->obj), std::add_pointer_t<ParentType>>::value ||
361362
!isEventCommandString(ctx)) {
@@ -524,7 +525,7 @@ Translation Translation::fromPO(const std::string& filename) {
524525
};
525526

526527
auto extract_string = [&](int offset) -> std::string {
527-
if (offset >= line_view.size()) {
528+
if (offset >= static_cast<int>(line_view.size())) {
528529
std::cerr << "Parse error (Line " << line_number << ") is empty\n";
529530
return "";
530531
}

lcfviz/src/main.cpp

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
#include <fstream>
1414
#include <functional>
1515
#include <iostream>
16-
#include <unordered_map>
1716
#include <argparse.hpp>
1817
#include <lcf/encoder.h>
1918
#include <lcf/reader_util.h>
@@ -42,25 +41,6 @@ Creates an overlap-free, directed graph (for huge graphs use sfdp, not dot)
4241
4342
)" "Homepage " PACKAGE_URL " - Report bugs at: " PACKAGE_BUGREPORT;
4443

45-
static int print_help(char** argv) {
46-
std::cerr << "lcfviz - Creates a dot file from a map tree by scanning the map for teleports.\n";
47-
std::cerr << "Usage: " << argv[0] << " [OPTION...] DIRECTORY [ENCODING]\n";
48-
std::cerr << "Options:\n";
49-
std::cerr << " -d, --depth DEPTH Maximal depth from the start node (default: no limit)\n";
50-
std::cerr << " Enables unreachable node detection (-r)\n";
51-
std::cerr << " -h, --help This usage message\n";
52-
std::cerr << " -o, --output FILE Output file (default: stdout)\n";
53-
std::cerr << " -r, --remove Remove nodes that are unreachable from the start node\n";
54-
std::cerr << " -s, --start ID Initial node of the graph (default: start party position)\n";
55-
std::cerr << "\n";
56-
std::cerr << "When not specified the encoding is read from RPG_RT.ini or auto-detected.\n";
57-
std::cerr << "\n";
58-
std::cerr << "Example usage:\n";
59-
std::cerr << " lcfviz YOURGAME | dot -Goverlap=false -Gsplines=true -Tpng -o graph.png\n";
60-
std::cerr << "Creates an overlap-free, directed graph (for huge graphs use sfdp, not dot)\n";
61-
return 2;
62-
}
63-
6444
namespace {
6545
/* config */
6646
std::string encoding, indir;
@@ -380,6 +360,7 @@ void ParseLmt(const std::string& filename) {
380360
}
381361

382362
lcf::rpg::ForEachString(*tree, [&](const auto& val, const auto& ctx) {
363+
(void)val;
383364
if (ctx.name == "name") {
384365
parse_map(ctx);
385366
}

lmu2png/src/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ static BitmapPtr process(L2IConfig conf, ErrorCallbackFunc error_cb, ErrorCallba
237237
return output_img;
238238
}
239239

240-
static void cliErrorCallback(const std::string& error, ErrorCallbackParam param) {
240+
static void cliErrorCallback(const std::string& error, ErrorCallbackParam) {
241241
// Simply tell about the error
242242
std::cerr << error << "\n";
243243
}

lmu2png/src/utils.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ bool Exists(const std::string& filename) {
4949
void CollectResourcePaths(std::string& main_path) {
5050
auto split_path = [](std::string path) {
5151
int start = 0;
52-
for (int i = 0; i <= path.size(); i++) {
53-
if (path[i] == ';' || path[i] == ':' || i == path.size()) {
52+
for (int i = 0; i <= static_cast<int>(path.size()); i++) {
53+
if (path[i] == ';' || path[i] == ':' || i == static_cast<int>(path.size())) {
5454
std::string temp;
5555
temp.append(path, start, i - start);
5656
resource_dirs.emplace_back(temp);

png2xyz/src/png2xyz.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ int main(int argc, char* argv[]) {
207207
memset(xyz_data, 0, 768);
208208

209209
// Create XYZ palette
210-
for (size_t i = 0; i < num_palette; i++) {
210+
for (int i = 0; i < num_palette; i++) {
211211
xyz_data[i * 3] = palette[i].red;
212212
xyz_data[i * 3 + 1] = palette[i].green;
213213
xyz_data[i * 3 + 2] = palette[i].blue;

0 commit comments

Comments
 (0)