Fix compilation warnings:
- set but unused variables
- type punned casts
Fix compilation warnings: set but unused variables.