mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
replace all endless for loops by while
This commit is contained in:
parent
c668189e8c
commit
38529e3296
@ -417,7 +417,7 @@ static int send_cmd(unsigned int idx, unsigned long arg, unsigned int rt, unsign
|
|||||||
//Timer[1] = 100;
|
//Timer[1] = 100;
|
||||||
uint32_t timerstart = hwtimer_now();
|
uint32_t timerstart = hwtimer_now();
|
||||||
|
|
||||||
for (;;) { /* Wait for end of the cmd/resp transaction */
|
while (1) { /* Wait for end of the cmd/resp transaction */
|
||||||
|
|
||||||
//if (!Timer[1]) return 0;
|
//if (!Timer[1]) return 0;
|
||||||
if (hwtimer_now() - timerstart > 10000) {
|
if (hwtimer_now() - timerstart > 10000) {
|
||||||
|
@ -68,7 +68,7 @@ void init_udp_server(void)
|
|||||||
destiny_socket_close(sock);
|
destiny_socket_close(sock);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (;;) {
|
while (1) {
|
||||||
recsize = destiny_socket_recvfrom(sock, (void *)buffer_main, UDP_BUFFER_SIZE, 0,
|
recsize = destiny_socket_recvfrom(sock, (void *)buffer_main, UDP_BUFFER_SIZE, 0,
|
||||||
&sa, &fromlen);
|
&sa, &fromlen);
|
||||||
|
|
||||||
|
@ -1104,7 +1104,7 @@ int aes_encrypt(cipher_context_t *context, uint8_t *plainBlock,
|
|||||||
*/
|
*/
|
||||||
r = key->rounds >> 1;
|
r = key->rounds >> 1;
|
||||||
|
|
||||||
for (;;) {
|
while (1) {
|
||||||
t0 =
|
t0 =
|
||||||
Te0[(s0 >> 24) ] ^
|
Te0[(s0 >> 24) ] ^
|
||||||
Te1[(s1 >> 16) & 0xff] ^
|
Te1[(s1 >> 16) & 0xff] ^
|
||||||
@ -1365,7 +1365,7 @@ int aes_decrypt(cipher_context_t *context, uint8_t *cipherBlock,
|
|||||||
*/
|
*/
|
||||||
r = key->rounds >> 1;
|
r = key->rounds >> 1;
|
||||||
|
|
||||||
for (;;) {
|
while (1) {
|
||||||
t0 =
|
t0 =
|
||||||
Td0[(s0 >> 24) ] ^
|
Td0[(s0 >> 24) ] ^
|
||||||
Td1[(s3 >> 16) & 0xff] ^
|
Td1[(s3 >> 16) & 0xff] ^
|
||||||
|
@ -243,7 +243,7 @@ ccnl_extract_prefix_nonce_ppkd(unsigned char **data, int *datalen, int *scope,
|
|||||||
|
|
||||||
if (typ == CCN_TT_DTAG) {
|
if (typ == CCN_TT_DTAG) {
|
||||||
if (num == CCN_DTAG_NAME) {
|
if (num == CCN_DTAG_NAME) {
|
||||||
for (;;) {
|
while (1) {
|
||||||
if (dehead(data, datalen, &num, &typ) != 0) {
|
if (dehead(data, datalen, &num, &typ) != 0) {
|
||||||
goto Bail;
|
goto Bail;
|
||||||
}
|
}
|
||||||
|
@ -430,7 +430,7 @@ ccnl_mgmt_prefixreg(struct ccnl_relay_s *ccnl, struct ccnl_buf_s *orig,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (typ == CCN_TT_DTAG && num == CCN_DTAG_NAME) {
|
if (typ == CCN_TT_DTAG && num == CCN_DTAG_NAME) {
|
||||||
for (;;) {
|
while (1) {
|
||||||
if (dehead(&buf, &buflen, &num, &typ) != 0) {
|
if (dehead(&buf, &buflen, &num, &typ) != 0) {
|
||||||
goto Bail;
|
goto Bail;
|
||||||
}
|
}
|
||||||
|
@ -95,7 +95,7 @@ static void sem_thread_blocked(sem_t *sem)
|
|||||||
int sem_wait(sem_t *sem)
|
int sem_wait(sem_t *sem)
|
||||||
{
|
{
|
||||||
int old_state = disableIRQ();
|
int old_state = disableIRQ();
|
||||||
for (;;) {
|
while (1) {
|
||||||
unsigned value = sem->value;
|
unsigned value = sem->value;
|
||||||
if (value == 0) {
|
if (value == 0) {
|
||||||
sem_thread_blocked(sem);
|
sem_thread_blocked(sem);
|
||||||
|
Loading…
Reference in New Issue
Block a user