CircuitOS icon indicating copy to clipboard operation
CircuitOS copied to clipboard

Update Sprite.cpp

Open G-o-T-o opened this issue 4 years ago • 4 comments

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

G-o-T-o avatar Aug 24 '21 05:08 G-o-T-o

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

G-o-T-o avatar Aug 24 '21 06:08 G-o-T-o

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

filipbudisa avatar Aug 24 '21 08:08 filipbudisa

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*) ?

G-o-T-o avatar Aug 24 '21 14:08 G-o-T-o

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

G-o-T-o avatar Aug 30 '21 03:08 G-o-T-o