[trunk] Fix a warning about type conversion. Use a trick where unsigned wrapping is legal