Skip to content

Fix warnings about conversion to UInt8

Now that UInt8 has become part of the list of default types compiled, there have been numerous warnings that have popped up about converting ints to unsigned char. The reason for these is when you do arithmetic (+, -, *, or /) on a char or short, it is automatically upconverted to a 32-bit integer. When you then try to set that back to a smaller integer, you get a conversion warning.

This change gets around this problem by explicitly telling the compiler we expect this type with static_cast. We have also talked about disabling conversion warnings, but this has not happened on all dashboards, and it is not that hard to work around the warning.

Merge request reports