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

Avoid variable shadowing #17264

Merged
merged 1 commit into from
Feb 4, 2017
Merged

Avoid variable shadowing #17264

merged 1 commit into from
Feb 4, 2017

Conversation

mogemimi
Copy link
Contributor

@mogemimi mogemimi commented Feb 1, 2017

I get the following warning message when compiling libcocos2d Mac/iOS with Xcode 8.2.1:

cocos/3d/CCSprite3D.cpp:219:29: warning: declaration shadows a local variable [-Wshadow]
        for (ssize_t i = 0, size = _meshes.size(); i < size; ++i) {
                            ^
cocos/3d/CCSprite3D.cpp:202:14: note: previous declaration is here
        auto size = spritedata->nodedatas->nodes.size();
             ^

This patch replaces the variable size with singleSprite at line 202 and 207 to avoid the variable shadowing.

@minggo minggo merged commit ccf6b99 into cocos2d:v3 Feb 4, 2017
@mogemimi mogemimi deleted the avoid-variable-shadowing branch February 4, 2017 10:52
stevetranby added a commit to stevetranby/cocos2d-x that referenced this pull request Feb 13, 2017
* 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
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