1
0
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:
Christian Mehlis 2014-02-14 17:47:33 +01:00
parent c668189e8c
commit 38529e3296
6 changed files with 7 additions and 7 deletions

View File

@ -417,7 +417,7 @@ static int send_cmd(unsigned int idx, unsigned long arg, unsigned int rt, unsign
//Timer[1] = 100;
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 (hwtimer_now() - timerstart > 10000) {

View File

@ -68,7 +68,7 @@ void init_udp_server(void)
destiny_socket_close(sock);
}
for (;;) {
while (1) {
recsize = destiny_socket_recvfrom(sock, (void *)buffer_main, UDP_BUFFER_SIZE, 0,
&sa, &fromlen);

View File

@ -1104,7 +1104,7 @@ int aes_encrypt(cipher_context_t *context, uint8_t *plainBlock,
*/
r = key->rounds >> 1;
for (;;) {
while (1) {
t0 =
Te0[(s0 >> 24) ] ^
Te1[(s1 >> 16) & 0xff] ^
@ -1365,7 +1365,7 @@ int aes_decrypt(cipher_context_t *context, uint8_t *cipherBlock,
*/
r = key->rounds >> 1;
for (;;) {
while (1) {
t0 =
Td0[(s0 >> 24) ] ^
Td1[(s3 >> 16) & 0xff] ^

View File

@ -243,7 +243,7 @@ ccnl_extract_prefix_nonce_ppkd(unsigned char **data, int *datalen, int *scope,
if (typ == CCN_TT_DTAG) {
if (num == CCN_DTAG_NAME) {
for (;;) {
while (1) {
if (dehead(data, datalen, &num, &typ) != 0) {
goto Bail;
}

View File

@ -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) {
for (;;) {
while (1) {
if (dehead(&buf, &buflen, &num, &typ) != 0) {
goto Bail;
}

View File

@ -95,7 +95,7 @@ static void sem_thread_blocked(sem_t *sem)
int sem_wait(sem_t *sem)
{
int old_state = disableIRQ();
for (;;) {
while (1) {
unsigned value = sem->value;
if (value == 0) {
sem_thread_blocked(sem);