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

Update Sprite.cpp #97

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Update Sprite.cpp #97

wants to merge 4 commits into from

Conversation

G-o-T-o
Copy link

@G-o-T-o G-o-T-o commented Aug 24, 2021

TODO's added regarding errors when compiling without 'build_flags = -w' option

TODO's added regarding errors when compiling without 'build_flags = -w' option
@G-o-T-o
Copy link
Author

G-o-T-o commented Aug 24, 2021

Option 'build_flags = -w' in platformio.ini file resolves the issue, but nevertheless the errors should be fixed at the source.

@filipbudisa
Copy link
Member

filipbudisa commented Aug 24, 2021

Thanks for pointing this out! A return *this; at the end of each of those functions will remove the warnings. Add those changes and I'll merge the PR
Filip

Added missing return values to:
1) Sprite& Sprite::resize(uint width, uint height)
2) Sprite& Sprite::setTransparent(bool transparent)
3) Sprite& Sprite::setChroma(Color color)
Missing return values in two methods:
1) UI\LowRamScreen.impl: virtual Screen& Screen::addChild(Element*)
2) UI\ScrollLayout.cpp: virtual ElementContainer& ScrollLayout::addChild(Element*)
@G-o-T-o
Copy link
Author

G-o-T-o commented Aug 24, 2021

NOTE:
a) the fist two commits deal with no-return-value errors regarding Sprite.cpp file and they should be resolved by the second commit (as suggested by @filipbudisa in the previous comment).
b) the third commit is about a new issue: additionally found no-return-value errors in other two files (LowRamScreen.impl and ScrollLayout.cpp); I guess this commit had to belong to a new PR (but obviously it does not). So I suggest that in the next commit the newly found errors are fixed and then the PR is merged as a "package" and closed.

In order to resolve the newly found no-return-value errors, please confirm/answer to the following assumption/question:

In case of

  1. UI\LowRamScreen.impl: virtual Screen& Screen::addChild(Element*)

probably return *this; will do.

But what to return from

  1. UI\ScrollLayout.cpp: virtual ElementContainer& ScrollLayout::addChild(Element*) ?

Added missing return values to:
1) src/UI/ScrollLayout.cpp: ElementContainer& ScrollLayout::addChild(Element* element)
2) src/UI/LowRamScreen.impl: Screen& Screen::addChild(Element* element)
@G-o-T-o
Copy link
Author

G-o-T-o commented Aug 30, 2021

For ElementContainer& ScrollLayout::addChild(Element*) I returned also *this as ScrollLayout class is derived from ElementContainer class.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants