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
1=== modified file 'src/graphic/gl/initialize.cc'
2--- src/graphic/gl/initialize.cc 2018-10-16 19:18:11 +0000
3+++ src/graphic/gl/initialize.cc 2019-02-23 14:01:57 +0000
4@@ -200,7 +200,7 @@
5 SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "OpenGL Error",
6 "Widelands won’t work because your graphics driver is too old.\n"
7 "The shading language needs to be version 1.20 or newer.",
8- NULL);
9+ nullptr);
10 exit(1);
11 }
12 } else {
13@@ -215,7 +215,7 @@
14 SDL_MESSAGEBOX_ERROR, "OpenGL Error",
15 "Widelands won’t work because your graphics driver is too old.\n"
16 "The shading language needs to be version 1.20 or newer.",
17- NULL);
18+ nullptr);
19 exit(1);
20 }
21 } else {
22@@ -227,7 +227,7 @@
23 "Widelands won't work because we were unable to detect the shading "
24 "language version.\nThere is an unknown problem with reading the "
25 "information from the graphics driver.",
26- NULL);
27+ nullptr);
28 exit(1);
29 }
30 }
31
32=== modified file 'src/logic/generic_save_handler.cc'
33--- src/logic/generic_save_handler.cc 2019-02-23 08:39:11 +0000
34+++ src/logic/generic_save_handler.cc 2019-02-23 14:01:57 +0000
35@@ -91,8 +91,8 @@
36 error_ |= Error::kBackupFailed;
37 uint32_t index = get_index(Error::kBackupFailed);
38 error_msg_[index] = (boost::format("GenericSaveHandler::make_backup: file %s "
39- "could not be renamed: %s\n") %
40- complete_filename_.c_str() % backup_filename_)
41+ "could not be renamed to %s: %s\n") %
42+ complete_filename_.c_str() % backup_filename_ % e.what())
43 .str();
44 log("%s", error_msg_[index].c_str());
45 return;
46
47=== modified file 'src/logic/generic_save_handler.h'
48--- src/logic/generic_save_handler.h 2019-02-23 08:39:11 +0000
49+++ src/logic/generic_save_handler.h 2019-02-23 14:01:57 +0000
50@@ -63,8 +63,7 @@
51 dir_(FileSystem::fs_dirname(complete_filename.c_str())),
52 filename_(FileSystem::fs_filename(complete_filename.c_str())),
53 type_(type),
54- // error_(Error::kSuccess) {};
55- error_(static_cast<Error>(1132)){};
56+ error_(static_cast<Error>(1132)) {}
57
58 /**
59 * Tries to save a file.
60@@ -82,7 +81,7 @@
61 // returns the stored error code (of the last saving operation)
62 Error error() {
63 return error_;
64- };
65+ }
66
67 // Returns the combination of error_messages (of occurred errors)
68 // specified by a bit mask.
69
70=== modified file 'src/website/json/json.h'
71--- src/website/json/json.h 2019-02-09 11:20:38 +0000
72+++ src/website/json/json.h 2019-02-23 14:01:57 +0000
73@@ -43,6 +43,7 @@
74 // Constructor for root node
75 explicit Element() : JSON::Element("", 0) {
76 }
77+ virtual ~Element() = default;
78
79 JSON::Object* add_object(const std::string& key = "");
80 JSON::Array* add_array(const std::string& key);
81
82=== modified file 'src/website/json/value.h'
83--- src/website/json/value.h 2019-02-09 11:20:38 +0000
84+++ src/website/json/value.h 2019-02-23 14:01:57 +0000
85@@ -27,7 +27,9 @@
86 /// Value types for JSON
87 struct Value {
88 Value() = default;
89+ virtual ~Value() = default;
90 virtual std::string as_string() const = 0;
91+
92 };
93
94 struct Boolean : Value {
95
96=== modified file 'src/wlapplication.cc'
97--- src/wlapplication.cc 2019-02-23 08:39:11 +0000
98+++ src/wlapplication.cc 2019-02-23 14:01:57 +0000
99@@ -1494,7 +1494,7 @@
100 g_fs->fs_unlink(filename);
101 } catch (const FileError& e) {
102 log(
103- "WLApplication::cleanup_ai_files: File %s couldn't be deleted.\n", filename.c_str());
104+ "WLApplication::cleanup_ai_files: File %s couldn't be deleted: %s\n", filename.c_str(), e.what());
105 }
106 }
107 }
108@@ -1512,8 +1512,8 @@
109 try {
110 g_fs->fs_unlink(filename);
111 } catch (const FileError& e) {
112- log("WLApplication::cleanup_temp_files: File %s couldn't be deleted.\n",
113- filename.c_str());
114+ log("WLApplication::cleanup_temp_files: File %s couldn't be deleted: %s\n",
115+ filename.c_str(), e.what());
116 }
117 }
118 }
119@@ -1531,8 +1531,8 @@
120 try {
121 g_fs->fs_unlink(filename);
122 } catch (const FileError& e) {
123- log("WLApplication::cleanup_temp_backups: File %s couldn't be deleted.\n",
124- filename.c_str());
125+ log("WLApplication::cleanup_temp_backups: File %s couldn't be deleted: %s\n",
126+ filename.c_str(), e.what());
127 }
128 }
129 }

Subscribers

People subscribed via source and target branches

to status/vote changes: