Merge lp:~widelands-dev/widelands/compiler_warnings_clang_201902 into lp:widelands

Proposed by GunChleoc
Status: Merged
Merged at revision: 8990
Proposed branch: lp:~widelands-dev/widelands/compiler_warnings_clang_201902
Merge into: lp:widelands
Diff against target: 129 lines (+15/-13)
6 files modified
src/graphic/gl/initialize.cc (+3/-3)
src/logic/generic_save_handler.cc (+2/-2)
src/logic/generic_save_handler.h (+2/-3)
src/website/json/json.h (+1/-0)
src/website/json/value.h (+2/-0)
src/wlapplication.cc (+5/-5)
To merge this branch: bzr merge lp:~widelands-dev/widelands/compiler_warnings_clang_201902
Reviewer Review Type Date Requested Status
Klaus Halfmann review. Approve
Review via email: mp+363580@code.launchpad.net

Commit message

Fix clang compiler warnings

To post a comment you must log in.
Revision history for this message
GunChleoc (gunchleoc) wrote :

Codecheck error is from trunk

@bunnybot merge force

Revision history for this message
GunChleoc (gunchleoc) wrote :

Oops, wrong branch... now it will go in.

Revision history for this message
Klaus Halfmann (klaus-halfmann) wrote :

Thanks for catching these warings.

Will fetch and buid this even though you alreaday want to merge this.

review: Approve (review.)
Revision history for this message
Klaus Halfmann (klaus-halfmann) wrote :

compiled found no warnings we an care for

Revision history for this message
bunnybot (widelandsofficial) wrote :

Continuous integration builds have changed state:

Travis build 4512. State: passed. Details: https://travis-ci.org/widelands/widelands/builds/497490064.
Appveyor build 4299. State: success. Details: https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_compiler_warnings_clang_201902-4299.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/graphic/gl/initialize.cc'
--- src/graphic/gl/initialize.cc 2018-10-16 19:18:11 +0000
+++ src/graphic/gl/initialize.cc 2019-02-23 14:01:57 +0000
@@ -200,7 +200,7 @@
200 SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "OpenGL Error",200 SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "OpenGL Error",
201 "Widelands won’t work because your graphics driver is too old.\n"201 "Widelands won’t work because your graphics driver is too old.\n"
202 "The shading language needs to be version 1.20 or newer.",202 "The shading language needs to be version 1.20 or newer.",
203 NULL);203 nullptr);
204 exit(1);204 exit(1);
205 }205 }
206 } else {206 } else {
@@ -215,7 +215,7 @@
215 SDL_MESSAGEBOX_ERROR, "OpenGL Error",215 SDL_MESSAGEBOX_ERROR, "OpenGL Error",
216 "Widelands won’t work because your graphics driver is too old.\n"216 "Widelands won’t work because your graphics driver is too old.\n"
217 "The shading language needs to be version 1.20 or newer.",217 "The shading language needs to be version 1.20 or newer.",
218 NULL);218 nullptr);
219 exit(1);219 exit(1);
220 }220 }
221 } else {221 } else {
@@ -227,7 +227,7 @@
227 "Widelands won't work because we were unable to detect the shading "227 "Widelands won't work because we were unable to detect the shading "
228 "language version.\nThere is an unknown problem with reading the "228 "language version.\nThere is an unknown problem with reading the "
229 "information from the graphics driver.",229 "information from the graphics driver.",
230 NULL);230 nullptr);
231 exit(1);231 exit(1);
232 }232 }
233 }233 }
234234
=== modified file 'src/logic/generic_save_handler.cc'
--- src/logic/generic_save_handler.cc 2019-02-23 08:39:11 +0000
+++ src/logic/generic_save_handler.cc 2019-02-23 14:01:57 +0000
@@ -91,8 +91,8 @@
91 error_ |= Error::kBackupFailed;91 error_ |= Error::kBackupFailed;
92 uint32_t index = get_index(Error::kBackupFailed);92 uint32_t index = get_index(Error::kBackupFailed);
93 error_msg_[index] = (boost::format("GenericSaveHandler::make_backup: file %s "93 error_msg_[index] = (boost::format("GenericSaveHandler::make_backup: file %s "
94 "could not be renamed: %s\n") %94 "could not be renamed to %s: %s\n") %
95 complete_filename_.c_str() % backup_filename_)95 complete_filename_.c_str() % backup_filename_ % e.what())
96 .str();96 .str();
97 log("%s", error_msg_[index].c_str());97 log("%s", error_msg_[index].c_str());
98 return;98 return;
9999
=== modified file 'src/logic/generic_save_handler.h'
--- src/logic/generic_save_handler.h 2019-02-23 08:39:11 +0000
+++ src/logic/generic_save_handler.h 2019-02-23 14:01:57 +0000
@@ -63,8 +63,7 @@
63 dir_(FileSystem::fs_dirname(complete_filename.c_str())),63 dir_(FileSystem::fs_dirname(complete_filename.c_str())),
64 filename_(FileSystem::fs_filename(complete_filename.c_str())),64 filename_(FileSystem::fs_filename(complete_filename.c_str())),
65 type_(type),65 type_(type),
66 // error_(Error::kSuccess) {};66 error_(static_cast<Error>(1132)) {}
67 error_(static_cast<Error>(1132)){};
6867
69 /**68 /**
70 * Tries to save a file.69 * Tries to save a file.
@@ -82,7 +81,7 @@
82 // returns the stored error code (of the last saving operation)81 // returns the stored error code (of the last saving operation)
83 Error error() {82 Error error() {
84 return error_;83 return error_;
85 };84 }
8685
87 // Returns the combination of error_messages (of occurred errors)86 // Returns the combination of error_messages (of occurred errors)
88 // specified by a bit mask.87 // specified by a bit mask.
8988
=== modified file 'src/website/json/json.h'
--- src/website/json/json.h 2019-02-09 11:20:38 +0000
+++ src/website/json/json.h 2019-02-23 14:01:57 +0000
@@ -43,6 +43,7 @@
43 // Constructor for root node43 // Constructor for root node
44 explicit Element() : JSON::Element("", 0) {44 explicit Element() : JSON::Element("", 0) {
45 }45 }
46 virtual ~Element() = default;
4647
47 JSON::Object* add_object(const std::string& key = "");48 JSON::Object* add_object(const std::string& key = "");
48 JSON::Array* add_array(const std::string& key);49 JSON::Array* add_array(const std::string& key);
4950
=== modified file 'src/website/json/value.h'
--- src/website/json/value.h 2019-02-09 11:20:38 +0000
+++ src/website/json/value.h 2019-02-23 14:01:57 +0000
@@ -27,7 +27,9 @@
27/// Value types for JSON27/// Value types for JSON
28struct Value {28struct Value {
29 Value() = default;29 Value() = default;
30 virtual ~Value() = default;
30 virtual std::string as_string() const = 0;31 virtual std::string as_string() const = 0;
32
31};33};
3234
33struct Boolean : Value {35struct Boolean : Value {
3436
=== modified file 'src/wlapplication.cc'
--- src/wlapplication.cc 2019-02-23 08:39:11 +0000
+++ src/wlapplication.cc 2019-02-23 14:01:57 +0000
@@ -1494,7 +1494,7 @@
1494 g_fs->fs_unlink(filename);1494 g_fs->fs_unlink(filename);
1495 } catch (const FileError& e) {1495 } catch (const FileError& e) {
1496 log(1496 log(
1497 "WLApplication::cleanup_ai_files: File %s couldn't be deleted.\n", filename.c_str());1497 "WLApplication::cleanup_ai_files: File %s couldn't be deleted: %s\n", filename.c_str(), e.what());
1498 }1498 }
1499 }1499 }
1500 }1500 }
@@ -1512,8 +1512,8 @@
1512 try {1512 try {
1513 g_fs->fs_unlink(filename);1513 g_fs->fs_unlink(filename);
1514 } catch (const FileError& e) {1514 } catch (const FileError& e) {
1515 log("WLApplication::cleanup_temp_files: File %s couldn't be deleted.\n",1515 log("WLApplication::cleanup_temp_files: File %s couldn't be deleted: %s\n",
1516 filename.c_str());1516 filename.c_str(), e.what());
1517 }1517 }
1518 }1518 }
1519 }1519 }
@@ -1531,8 +1531,8 @@
1531 try {1531 try {
1532 g_fs->fs_unlink(filename);1532 g_fs->fs_unlink(filename);
1533 } catch (const FileError& e) {1533 } catch (const FileError& e) {
1534 log("WLApplication::cleanup_temp_backups: File %s couldn't be deleted.\n",1534 log("WLApplication::cleanup_temp_backups: File %s couldn't be deleted: %s\n",
1535 filename.c_str());1535 filename.c_str(), e.what());
1536 }1536 }
1537 }1537 }
1538 }1538 }

Subscribers

People subscribed via source and target branches

to status/vote changes: