Fixed Semantic Issue in Latest Source Code

Hi. Today I grab a latest copy of the source code from GitHub and I tried to compile it… failed.
It says:

CCLabelBMFont.cpp
Semantic Issue
‘&&’ within ‘||’

Then I realize there is a careless mistake in CCLabelBMFont.cpp, on line 201

return ch >= 0x0009 && ch <= 0x000D

should be

return (ch >= 0x0009 && ch <= 0x000D)

Thanks.

Now I’m seeing another Semantic Issue, in HelloWorldScene.cpp

on line 198,

>CCPoint location = touch->locationInView(touch->view());

the error says

>No member named ‘view’ in ‘cocos2d::CCTouch’

hmm how is this possible?

  1. && and ||
    We should make the meaning clearly, but it will not cause building error.
  2. HelloWorldScene only has 81 lines, then what’s line 198?
    May be you should refer http://www.cocos2d-x.org/boards/6/topics/9875?r=9876#message-9876.

Thank you.

Hi, thanks for reply.

  1. I’m using the latest XCode and somehow it stopped me from compiling and warned me about the “return ch >= 0x0009 && ch <= 0x000D” issue. Now I think probably it stops me due to the second issue instead of this one.

  2. I should have mentioned it’s the HelloWorldScene.cpp in xcode4 template. “cocos2d-x/template/xcode4/cocos2dx_box2d.xctemplate/Classes/HelloWorldScene.cpp”

I will check out that link. Thanks again.

I fixed it yesterday.
Please update your codes.

Thank you.