mutter/cogl/test-fixtures
Simon McVittie a3cc62c285 cogl tests: Force defined behaviour for 24-bit left-shifts
When r is 128 or more, running tests compiled with the undefined behaviour
sanitizer (ubsan) reports:

test-utils.c:312:45: runtime error: left shift of 128 by 24 places cannot be represented in type 'int'

which indeed it cannot. Force the type to be unsigned 32-bit so that we
get defined behaviour.

Similarly, in test-atlas-migration, the left-shifted guint8 is promoted
to int, which again does not have enough non-sign bits available to
left-shift a value >= 128 by 24 bits. Again, force the shift to be done
in unsigned 32-bit space.

This was originally cogl!22, but applies equally to mutter's fork of cogl.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1271

Signed-off-by: Simon McVittie <smcv@debian.org>
2020-05-27 21:26:49 +00:00
..
meson.build Add meson build support 2018-11-06 18:51:44 +01:00
test-unit.h cogl: Mark exported cogl symbols using COGL_EXPORT 2020-03-26 09:05:38 +01:00
test-utils.c cogl tests: Force defined behaviour for 24-bit left-shifts 2020-05-27 21:26:49 +00:00
test-utils.h cogl: Remove unused cogl-gles2 API 2019-08-16 06:35:35 +00:00