Adds more 64-bit fixes

Replaces more `int` with `long` where it makes sense.

Also , it repalces some `unsigned long` with `long` for "lenght"
values as described in our c++ guideline
Merge commit 'refs/pull/4099/head' of https://github.com/cocos2d/cocos2d-x into 64bit-fix
[Linux] compilation fix for PR #4099
Merge pull request #4108 from dumganhar/64bit-fix

[Linux] compilation fix for PR #4099[ci skip]