Stronger types for >= 16 bits shifts

This commit is contained in:
Frank Denis 2016-04-02 01:06:04 +02:00
parent ca71815db3
commit 531c51e7a3
3 changed files with 3 additions and 3 deletions

View File

@ -180,7 +180,7 @@ static const char *from_base64(void *dst, size_t *dst_len, const char *src) {
* otherwise, only 0, 2 or 4 bits are buffered. The buffered
* bits must also all be zero.
*/
if (acc_len > 4 || (acc & (((unsigned)1 << acc_len) - 1)) != 0) {
if (acc_len > 4 || (acc & ((1U << acc_len) - 1)) != 0) {
return NULL;
}
*dst_len = len;

View File

@ -275,7 +275,7 @@ escrypt_kdf_nosse(escrypt_local_t * local,
return -1;
}
#endif
if ((uint64_t)(r) * (uint64_t)(p) >= (1 << 30)) {
if ((uint64_t)(r) * (uint64_t)(p) >= ((uint64_t) 1 << 30)) {
errno = EFBIG;
return -1;
}

View File

@ -324,7 +324,7 @@ escrypt_kdf_sse(escrypt_local_t * local,
return -1;
}
#endif
if ((uint64_t)(r) * (uint64_t)(p) >= (1 << 30)) {
if ((uint64_t)(r) * (uint64_t)(p) >= ((uint64_t) 1 << 30)) {
errno = EFBIG;
return -1;
}