frameworks/base: Fix aliasing violations

Fix violations of strict aliasing rules