{"action":"created","issue":{"url":"https://api.github.com/repos/cocos2d/cocos2d-spritebuilder/issues/1314","labels_url":"https://api.github.com/repos/cocos2d/cocos2d-spritebuilder/issues/1314/labels{/name}","comments_url":"https://api.github.com/repos/cocos2d/cocos2d-spritebuilder/issues/1314/comments","events_url":"https://api.github.com/repos/cocos2d/cocos2d-spritebuilder/issues/1314/events","html_url":"https://github.com/cocos2d/cocos2d-spritebuilder/issues/1314","id":71133880,"number":1314,"title":"Cast from pointer to smaller type loses information","user":{"login":"borogove","id":313173,"avatar_url":"https://avatars.githubusercontent.com/u/313173?v=3","gravatar_id":"","url":"https://api.github.com/users/borogove","html_url":"https://github.com/borogove","followers_url":"https://api.github.com/users/borogove/followers","following_url":"https://api.github.com/users/borogove/following{/other_user}","gists_url":"https://api.github.com/users/borogove/gists{/gist_id}","starred_url":"https://api.github.com/users/borogove/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/borogove/subscriptions","organizations_url":"https://api.github.com/users/borogove/orgs","repos_url":"https://api.github.com/users/borogove/repos","events_url":"https://api.github.com/users/borogove/events{/privacy}","received_events_url":"https://api.github.com/users/borogove/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-04-26T23:16:11Z","updated_at":"2015-04-26T23:35:52Z","closed_at":null,"body":"Cocos2d-spritebuilder 3.4.3.\r\n\r\nIn CCTMXXMLParser.m, line 500:\r\n\r\n   inflatedLen = (int)&inflatedLen; // XXX: to avoid warings in compiler \r\n\r\nThis looks like a pretty shady suppression of an unused variable warning (casting to void is preferable). \r\n\r\nI'm building an Objective-C++ project, which seems to have different casting rules, so this is a fatal compilation error:\r\n Cast from pointer to smaller type 'int' loses information\r\n\r\nThere are a number of other casting errors across the codebase in Objective-C++ mode. This thread from October 2014 toyed with the idea of adding Objective-C++ source to the tests: http://forum.cocos2d-spritebuilder.org/t/cocos3d-c-mm-files-compiler-issue/15570/3\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/cocos2d/cocos2d-spritebuilder/issues/comments/96448325","html_url":"https://github.com/cocos2d/cocos2d-spritebuilder/issues/1314#issuecomment-96448325","issue_url":"https://api.github.com/repos/cocos2d/cocos2d-spritebuilder/issues/1314","id":96448325,"user":{"login":"slembcke","id":153633,"avatar_url":"https://avatars.githubusercontent.com/u/153633?v=3","gravatar_id":"","url":"https://api.github.com/users/slembcke","html_url":"https://github.com/slembcke","followers_url":"https://api.github.com/users/slembcke/followers","following_url":"https://api.github.com/users/slembcke/following{/other_user}","gists_url":"https://api.github.com/users/slembcke/gists{/gist_id}","starred_url":"https://api.github.com/users/slembcke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slembcke/subscriptions","organizations_url":"https://api.github.com/users/slembcke/orgs","repos_url":"https://api.github.com/users/slembcke/repos","events_url":"https://api.github.com/users/slembcke/events{/privacy}","received_events_url":"https://api.github.com/users/slembcke/received_events","type":"User","site_admin":false},"created_at":"2015-04-26T23:35:52Z","updated_at":"2015-04-26T23:35:52Z","body":"O_o Yeah, that is pretty bad. To be honest, I touch the tile map code as little as possible. It's really fragile with lots of unsafe implementation details exposed in the public headers and a lot of problems with content scales lurking around in it. In v3, the only thing I did was update the rendering routines so it didn't try to keep all of the vertex data in memory and render it all every frame.\r\n\r\nI cleaned it up a bunch in the v4 development branch. Removing a few of the dangerous or questionable public APIs. I know that line you posted has to do with the old zlib decompression code. That was actually completely replaced by streaming decompression in the new CCFile class. Less code, simpler API, and much more flexible.\r\n\r\nThough... now that I think about it. Why are you compiling the existing .m files as Objective-C++? I'm surprised you don't find a lot more issues."}}