Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Xcode warnings #6793

Merged
merged 3 commits into from Jun 23, 2022
Merged

Fix Xcode warnings #6793

merged 3 commits into from Jun 23, 2022

Conversation

mattsc
Copy link
Member

@mattsc mattsc commented Jun 23, 2022

Trying to fix the Xcode warnings. I'm putting this up here to see what the CI run says, and also because in some cases I do not know if what I did is the preferred solution. So let me know what needs to be changed.

@github-actions github-actions bot added Add-ons Issues with the add-ons client and/or server. Building Build-time issues. Lua API Issues with the Lua engine and API. macOS OS-specific issues that apply to Apple macOS. MP Issues with multiplayer support or bundled multiplayer content. UI User interface issues, including both back-end and front-end issues. labels Jun 23, 2022
@mattsc
Copy link
Member Author

mattsc commented Jun 23, 2022

I should have added that this is currently for the debug build only, and that another step will be to make the flags the same for debug and release builds.

@@ -363,7 +363,7 @@ namespace { // Private helpers for move_unit()
, real_end_(begin_)
// Unit information:
, move_it_(resources::gameboard->units().find(*begin_))
, orig_side_(( assert(move_it_ != resources::gameboard->units().end()), move_it_->side() ))
, orig_side_(( static_cast<void>(assert(move_it_ != resources::gameboard->units().end())), move_it_->side() ))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is actually just wrong both ways. The correct fix here is probably to move it (and any other line referencing move_it_, like the following three) into the constructor body as assignments.

Basically, delete these four lines and add something like the following just above if(!is_ai_move()):

assert(move_it_ != resources::gameboard->units().end());
orig_side_ = move_it_->side();
orig_moves_ = move_it_->movement_left();
orig_dir_ = move_it_->facing();
goto_ = is_ai_move() ? move_it_->get_goto() : route.back();

@@ -6429,7 +6429,9 @@
460F21CA2858F72100EE2131 /* SignedRelease */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm kinda surprised this didn't just break everything...

@mattsc mattsc merged commit 28831fe into wesnoth:master Jun 23, 2022
@mattsc mattsc deleted the Xcode_warnings branch June 23, 2022 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Add-ons Issues with the add-ons client and/or server. Building Build-time issues. Lua API Issues with the Lua engine and API. macOS OS-specific issues that apply to Apple macOS. MP Issues with multiplayer support or bundled multiplayer content. UI User interface issues, including both back-end and front-end issues.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants