Cast signed integral types to unsigned to workaround left shifting a negative integral constant