fix shifts possibly larger than type in major() macro