Merge lp:~widelands-dev/widelands/bug-1699852-compiler-warning into lp:widelands

Proposed by GunChleoc
Status: Merged
Merged at revision: 8863
Proposed branch: lp:~widelands-dev/widelands/bug-1699852-compiler-warning
Merge into: lp:widelands
Diff against target: 47 lines (+15/-0)
3 files modified
src/logic/mapfringeregion.h (+4/-0)
src/logic/maphollowregion.h (+4/-0)
src/logic/maptriangleregion.h (+7/-0)
To merge this branch: bzr merge lp:~widelands-dev/widelands/bug-1699852-compiler-warning
Reviewer Review Type Date Requested Status
Klaus Halfmann review, compile Approve
Review via email: mp+355884@code.launchpad.net

Commit message

Fix [-Wundefined-func-template] compiler warnings.

Description of the change

All this one needed in the end was declaring the template variants from the .cc files in the .h files.

To post a comment you must log in.
Revision history for this message
Klaus Halfmann (klaus-halfmann) wrote :

Thanks for fixing this one, syntax and usage of templates in C++ still give me a headache.

I will try to review it,but I am running out of time for this weekend.

Revision history for this message
GunChleoc (gunchleoc) wrote :

No worries - thanks for all the reviews you're doing!

Revision history for this message
bunnybot (widelandsofficial) wrote :

Continuous integration builds have changed state:

Travis build 4078. State: passed. Details: https://travis-ci.org/widelands/widelands/builds/435186354.
Appveyor build 3874. State: success. Details: https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_bug_1699852_compiler_warning-3874.

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

I still get these:

.../src/logic/map_objects/tribes/ship.cc:705:3: warning: fallthrough annotation in
      unreachable code [-Wimplicit-fallthrough]
                FALLS_THROUGH;

../src/ui_basic/fileview_panel.h:50:23: warning: non-static data member 'style_' of
      'FileViewPanel' shadows member inherited from type 'TabPanel' [-Wshadow-field]
        const UI::PanelStyle style_;

../src/wui/watchwindow.h:41:2: warning: '~WatchWindow' overrides a destructor but is not
      marked 'override' [-Winconsistent-missing-destructor-override]
        ~WatchWindow();

../src/wui/seafaring_statistics_menu.cc:422:3: note: insert 'break;' to avoid
      fall-through
                default:

../src/wui/game_client_disconnected.h:29:1: warning: class 'GameHost' was previously
      declared as a struct [-Wmismatched-tags]
class GameHost;

../src/wui/waresdisplay.cc:388:13: warning: no previous extern declaration for
      non-static variable 'unit_suffixes' [-Wmissing-variable-declarations]
const char* unit_suffixes[] = {

Those switch warnigns are difficult, the rest should be easy....
... or shall we address them in a later branch?

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

No real changes, so I wont do any further tests.

@bunnybot merge

review: Approve (review, compile)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/logic/mapfringeregion.h'
2--- src/logic/mapfringeregion.h 2018-04-07 16:59:00 +0000
3+++ src/logic/mapfringeregion.h 2018-09-30 06:27:41 +0000
4@@ -77,6 +77,10 @@
5 typename AreaType::RadiusType remaining_in_phase_;
6 uint8_t phase_;
7 };
8+
9+// Forward declarations of template instantiations
10+template <> bool MapFringeRegion<Area<FCoords>>::advance(const Map& map);
11+template <> bool MapFringeRegion<Area<>>::advance(const Map& map);
12 }
13
14 #endif // end of include guard: WL_LOGIC_MAPFRINGEREGION_H
15
16=== modified file 'src/logic/maphollowregion.h'
17--- src/logic/maphollowregion.h 2018-04-07 16:59:00 +0000
18+++ src/logic/maphollowregion.h 2018-09-30 06:27:41 +0000
19@@ -72,6 +72,10 @@
20 uint32_t rowpos_; // # of fields we have returned in this row
21 typename AreaType::CoordsType left_; // left-most node of current row
22 };
23+
24+// Forward declarations of template instantiations
25+template<> MapHollowRegion<Area<>>::MapHollowRegion(const Map& map, const HollowArea<Area<>>& hollow_area);
26+template <> bool MapHollowRegion<Area<>>::advance(const Map& map);
27 }
28
29 #endif // end of include guard: WL_LOGIC_MAPHOLLOWREGION_H
30
31=== modified file 'src/logic/maptriangleregion.h'
32--- src/logic/maptriangleregion.h 2018-04-07 16:59:00 +0000
33+++ src/logic/maptriangleregion.h 2018-09-30 06:27:41 +0000
34@@ -121,6 +121,13 @@
35 CoordsType left_;
36 TCoords<CoordsType> location_;
37 };
38+
39+// Forward declarations of template instantiations
40+template<> MapTriangleRegion<>::MapTriangleRegion(const Map& map, Area<TCoords<>> area);
41+template<> bool MapTriangleRegion<>::advance(const Map& map);
42+
43+template<> MapTriangleRegion<TCoords<FCoords>>::MapTriangleRegion(const Map& map, Area<TCoords<FCoords>> area);
44+template<> bool MapTriangleRegion<TCoords<FCoords>>::advance(const Map& map);
45 }
46
47 #endif // end of include guard: WL_LOGIC_MAPTRIANGLEREGION_H

Subscribers

People subscribed via source and target branches

to status/vote changes: