Replace define with static const
Replace define with static const and removed unused defines
Replace macro
Fix gcc warnings