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

Point in ui and output #33225

Merged
merged 7 commits into from
Aug 14, 2019
Merged

Conversation

jbytheway
Copy link
Contributor

Summary

SUMMARY: Infrastructure "Output functions and uilist now take point arguments"

Purpose of change

My ongoing effort to increase use of point for type safety and code clarity.

Describe the solution

Port the functions from uilist.h and output.h that previously took separate x, y arguments to take point arguments instead.

Update other code accordingly.

Describe alternatives you've considered

Quite a lot of these calls required me to add NOLINTNEXTLINE(cata-use-named-point-constants) markup to prevent point temporaries being rewritten as point_south, etc. This is a little unfortunate.

It might be worth somehow whitelisting these functions so that the cata-use-named-point-constants check doesn't change point arguments to them, but I haven't done that (and don't plan to). I think these should be the bulk of such markup; I think I've now covered most of the UI functions in my API porting, and for other functions the point_north etc. names will be better choices.

Additional context

Inspired by #32017.

Be sure to let the CI run, because this might be breaking Windows or Android builds.

These are lots of UI changes. I have not attempted to test all the UIs which are affected, so I might have broken some, but the changes were largely automated, so hopefully it should be safe.

For most of the text formatting code, it doesn't make sense to use
point_north, etc.  So revert those changes and add NOLINT markup.
Did these manually because the automatic refactoring can't cope with
non-adjacent x, y arguments.
Having ported the callers, now implement the new versions and delete the
old function declarations.
Some further calls needed to change that weren't caught by automatic
refactoring because they aren't part of the tiles build.
Last tweak coming out of the previous manual changes.
@jbytheway jbytheway force-pushed the point_in_ui_and_output branch from 5a00e8f to a85fdae Compare August 14, 2019 15:24
@ZhilkinSerg ZhilkinSerg added [C++] Changes (can be) made in C++. Previously named `Code` Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style Code: Build Issues regarding different builds and build environments labels Aug 14, 2019
@ZhilkinSerg
Copy link
Contributor

Jenkins rebuild.

@ZhilkinSerg ZhilkinSerg merged commit 287184f into CleverRaven:master Aug 14, 2019
@jbytheway jbytheway deleted the point_in_ui_and_output branch August 16, 2019 01:05
misterprimus pushed a commit to misterprimus/Cataclysm-DDA that referenced this pull request Sep 21, 2019
* Add overloads for output.h and ui.h functions

* Refactoring pass

* Manually revert some named point changes

For most of the text formatting code, it doesn't make sense to use
point_north, etc.  So revert those changes and add NOLINT markup.

* Port calls to uilist

Did these manually because the automatic refactoring can't cope with
non-adjacent x, y arguments.

* Implement point versions of ui, output functions

Having ported the callers, now implement the new versions and delete the
old function declarations.

* Port curses calls to changed UIs

Some further calls needed to change that weren't caught by automatic
refactoring because they aren't part of the tiles build.

* Final refactoring pass

Last tweak coming out of the previous manual changes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C++] Changes (can be) made in C++. Previously named `Code` Code: Build Issues regarding different builds and build environments Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants