Fix aliasing violations only and not c++11 mode:

picked code bits from this change:  https://github.com/SaberMod/android_frameworks_base/commit/4ea79c201e537e5490cc459c7438cf2f7f0c53b4