replaced C-style casts with C++-style casts
simplified the C++-style casts added in the previous commit (originally, the casts were added to eliminate "warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]" message)
fixed most issues from https://review.openbloomberg.com/D19 review
fixed the code according to https://review.openbloomberg.com/D20 review
moved definition of ZU macro into a separate section
fixed remaining issues from https://review.openbloomberg.com/D21
fixed issues from https://review.openbloomberg.com/D22