-
Notifications
You must be signed in to change notification settings - Fork 7.1k
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
Compilation fix #17209
Compilation fix #17209
Conversation
Mostly errors on field initialization order but also missing files in CMakeLists and missing include directives.
How to reproduce the compiling error? |
About commit b81f2bf, the fields initialization order warning messages occur for me when compiling on Linux without
The missing files in About commit f54660a, GCC 6 introduces the
About commit f4313ca, I cannot reproduce the error, for an unknown reason. About commit 994f728, some |
, _glProgramState(nullptr) | ||
, _blend(BlendFunc::ALPHA_NON_PREMULTIPLIED) | ||
, _visibleChanged(nullptr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_visibleChanged is missed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_visibleChanged
is an std::function
and initializing an std::function
with nullptr
is equivalent to using its default constructor. Thus there is no need to keep this line.
@@ -350,7 +350,8 @@ __Array* __Array::clone() const | |||
Ref* obj = nullptr; | |||
Ref* tmpObj = nullptr; | |||
Clonable* clonable = nullptr; | |||
CCARRAY_FOREACH(this, obj) | |||
const __Array* self( this ); | |||
CCARRAY_FOREACH(self, obj) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't quite understand it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The expansion of CCARRAY_FOREACH
will begin with if (this)
but since GCC 6 this
is expected not to be null. Here is a quote from GCC's release notes:
Value range propagation now assumes that the this pointer of C++ member functions is non-null.
Thus this test triggers the -Wnonnull-compare
warning of GCC. Using another pointer (self
) in the test prevents the warning.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good to know, thanks
@@ -986,9 +986,6 @@ CC_DEPRECATED_ATTRIBUTE const TransitionScene::Orientation kCCTransitionOrientat | |||
|
|||
CC_DEPRECATED_ATTRIBUTE typedef TransitionScene::Orientation tOrientation; | |||
|
|||
CC_DEPRECATED_ATTRIBUTE const int kCCPrioritySystem = Scheduler::PRIORITY_SYSTEM; | |||
CC_DEPRECATED_ATTRIBUTE const int kCCPriorityNonSystemMin = Scheduler::PRIORITY_NON_SYSTEM_MIN; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why remove these codes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These lines can be kept, I will revert the commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please revert it, then i will merge this pr, thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
commit removed from the branch :)
994f728
to
117fdb4
Compare
* v3: fix the bug that ect1 texture lost on android (cocos2d#17278) Included the directories such that the extension classes work out of the box in Linux (cocos2d#17259) Prevent removal of unknown touch in CCScrollView::onTouchCancelled. (cocos2d#17208) Fix implicit conversion warnings (cocos2d#17254) Avoid variable shadowing (cocos2d#17264) Fix typo in function name (cocos2d#17253) [ci skip][AUTO]: updating luabinding & jsbinding & cocos_file.json automatically (cocos2d#17276) Fix typo in AudioState (cocos2d#17258) Fixed variable order in initializer lists (cocos2d#17274) Compilation fix (cocos2d#17209) Allow to unbind asynchronous texture loading callback with a custom key. (cocos2d#17206) # Conflicts: # cocos/2d/CCParticleBatchNode.cpp # cocos/3d/CCMeshSkin.cpp # cocos/3d/CCSkeleton3D.cpp # cocos/network/SocketIO.cpp # cocos/ui/UIEditBox/Mac/CCUIEditBoxMac.h
Please review this pull request. These commits fix various compilation errors on Android, Linux, Mac and iOS.