Fixes type mismatch between NSUInteger and CC_LONG

With 64-bit architecture NSUInteger is defined as unsigned long but
CC_LONG is defined as unsigned int. Asserting and casting fixes warning.
Converts int to NSInteger for 64-bit compatability

NSInteger is defined as int in 32-bit mode and long in 64-bit mode.
Converts float to CGFloat for 64-bit compatability

CGFloat is defined as float in 32-bit mode and double in 64-bit mode.
Using CGFloat will result in the correct type.