26 Mar
2020
26 Mar
'20
3:58 p.m.
On Thu, 26 Mar 2020 at 12:33, Chip Davis <cdavis(a)codeweavers.com> wrote:
+static inline unsigned int absdiff(unsigned int a, unsigned int b) +{ + return a > b ? a - b : b - a; +} + You don't need the "inline". For consistency with the other helpers like compare_float(), I'd probably do something like the following:
static BOOL compare_uint(unsigned int x, unsigned int y, unsigned int max_distance) { unsigned int distance = x > y ? x - y : y - x; return distance <= max_distance; } Note that we have one or two places where this particular issue has already been fixed in a different way, like e.g. the d3d9:visual tests. Ideally those would be updated as well.