[vbox-dev] [PATCH 3/8] Fixes out-of-range values
michal.necasek at oracle.com
Mon Mar 16 12:08:17 UTC 2015
Unfortunately this patch not only doesn't fix anything, it actively breaks the code. If you look at the comments at the top of the file, you'll see that the X/Y movement deltas (dX/dY) are 9-bit values, not 8-bit. So yes, -255 and 255 *will* fit and are not out of range.
You are welcome to suggest a different patch that makes clang happy and doesn't break the code. But clearly reducing the range from 9 to 8 bits is not it -- in other words, the assumption that the code is attempting to express the -255/255 range as int8_t is incorrect.
----- Original Message -----
From: jkim at FreeBSD.org
To: vbox-dev at virtualbox.org
Sent: Friday, March 13, 2015 9:57:26 PM GMT +01:00 Amsterdam / Berlin / Bern / Rome / Stockholm / Vienna
Subject: [vbox-dev] [PATCH 3/8] Fixes out-of-range values
-----BEGIN PGP SIGNED MESSAGE-----
- -255* and 255 can never be expressed in int8_t. Thus, the macros
never worked properly. Fix them to fit in signed 8-bit integer.
* Note: It was -256 until r54271.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
-----END PGP SIGNATURE-----
vbox-dev mailing list
vbox-dev at virtualbox.org
More information about the vbox-dev