I think you'll need static_cast<uint16_t> here otherwise lint will complain.