1
mirror of https://github.com/jedisct1/libsodium.git synced 2024-12-19 18:15:18 -07:00

Explicit cast

This commit is contained in:
Frank Denis 2019-02-20 01:02:54 +01:00
parent d287ef763b
commit eeb1f26924

View File

@ -529,7 +529,7 @@ equal(signed char b, signed char c)
unsigned char ub = b;
unsigned char uc = c;
unsigned char x = ub ^ uc; /* 0: yes; 1..255: no */
uint32_t y = x; /* 0: yes; 1..255: no */
uint32_t y = (uint32_t) x; /* 0: yes; 1..255: no */
y -= 1; /* 4294967295: yes; 0..254: no */
y >>= 31; /* 1: yes; 0: no */