1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-17 05:12:57 +01:00

pkg/ucglib/src/csrc/ucg_riotos.c: fix cpp.check shiftTooManyBitsSigned

This commit is contained in:
Francisco Molina 2019-11-21 09:09:39 +01:00
parent cf3d584678
commit cc2c3a0163
2 changed files with 2 additions and 2 deletions

View File

@ -53,7 +53,7 @@ static void ucg_enable_pins(gpio_t *pins, uint32_t pins_enabled)
uint8_t i;
for (i = 0; i < 32; i++) {
if (pins_enabled & (1 << i)) {
if (pins_enabled & ((uint32_t)1 << i)) {
if (pins[i] != GPIO_UNDEF) {
if (i < UCG_PIN_COUNT) {
gpio_init(pins[i], GPIO_OUT);

View File

@ -184,7 +184,7 @@ int fortuna_random_data(fortuna_state_t *state, uint8_t *out, size_t bytes)
size_t len = 0;
for (int i = 0; i < (int) FORTUNA_POOLS; i++) {
if (state->reseeds | (1 << i)) {
if (state->reseeds | ((uint32_t)1 << i)) {
sha256_final(&state->pools[i].ctx, &buf[len]);
sha256_init(&state->pools[i].ctx);
state->pools[i].len = 0;