mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-01-01 12:46:12 +00:00
u_bitwise: Switch from static const int to defines.
Sadly MSVC didn't believe those were constant, and this is a C file so no constexpr.
This commit is contained in:
parent
1750bb672f
commit
48eb00f1c8
|
@ -33,8 +33,8 @@ get_bits(const unsigned char *b, int start, int num)
|
|||
int
|
||||
sign_extend_13(uint32_t i)
|
||||
{
|
||||
static const size_t incoming_int_width = 13;
|
||||
static const size_t adjustment =
|
||||
(sizeof(i) * CHAR_BIT) - incoming_int_width;
|
||||
return ((int)(i << adjustment)) >> adjustment;
|
||||
|
||||
#define INCOMING_INT_WIDTH (13)
|
||||
#define ADJUSTMENT ((sizeof(i) * CHAR_BIT) - INCOMING_INT_WIDTH)
|
||||
return ((int)(i << ADJUSTMENT)) >> ADJUSTMENT;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue