issue 2387: Using static_cast instead of C style cast while iterating CCDictionary and CCArray.