9
0
Fork 0

Make sure that there is one space between while and condition

This commit is contained in:
Gregory Nutt 2014-04-12 13:09:48 -06:00
parent 5fbbc21f13
commit 5d99549aca
44 changed files with 77 additions and 67 deletions

View File

@ -969,7 +969,7 @@ int c3b_main(int argc, char *argv[])
ch = getchar();
}
while(execute(ch) == 0);
while (execute(ch) == 0);
return 0;
}

View File

@ -47,7 +47,7 @@
#define NTEST_ALLOCS 32
/* #define STOP_ON_ERRORS do{}while(0) */
/* #define STOP_ON_ERRORS do {} while (0) */
#define STOP_ON_ERRORS exit(1)
/* All other definitions derive from these two */

View File

@ -246,7 +246,7 @@ static int tcpecho_server(void)
maxi = 0; /* max index into client[] array */
while(!stop)
while (!stop)
{
nready = poll(client, maxi+1, TCPECHO_POLLTIMEOUT);

View File

@ -174,18 +174,22 @@ int uip_main(int argc, char *argv[])
struct dhcpc_state ds;
(void)dhcpc_request(handle, &ds);
uip_sethostaddr("eth1", &ds.ipaddr);
if (ds.netmask.s_addr != 0)
{
uip_setnetmask("eth0", &ds.netmask);
}
if (ds.default_router.s_addr != 0)
{
uip_setdraddr("eth0", &ds.default_router);
}
if (ds.dnsaddr.s_addr != 0)
{
dns_setserver(&ds.dnsaddr);
}
dhcpc_close(handle);
printf("IP: %s\n", inet_ntoa(ds.ipaddr));
}
@ -198,7 +202,7 @@ int uip_main(int argc, char *argv[])
httpd_listen();
#endif
while(1)
while (1)
{
sleep(3);
printf("uip_main: Still running\n");
@ -206,5 +210,6 @@ int uip_main(int argc, char *argv[])
fflush(stdout);
#endif
}
return 0;
}

View File

@ -188,13 +188,13 @@ static FAR unsigned char *dns_parse_name(FAR unsigned char *query)
{
n = *query++;
while(n > 0)
while (n > 0)
{
++query;
--n;
}
}
while(*query != 0);
while (*query != 0);
return query + 1;
}
@ -247,7 +247,7 @@ static int dns_send_query(int sockfd, FAR const char *name,
*nptr = n;
}
while(*nameptr != 0);
while (*nameptr != 0);
memcpy(query, endquery, 5);

View File

@ -426,7 +426,6 @@ int ftpc_xfrabort(FAR struct ftpc_session_s *session, FAR FILE *stream)
/* Read remaining bytes from connection */
while (stream && fread(session->buffer, 1, CONFIG_FTP_BUFSIZE, stream) > 0);
while(stream && fread(session->buffer, 1, CONFIG_FTP_BUFSIZE, stream) > 0)
/* Get the ABORt reply */

View File

@ -92,8 +92,9 @@ bool uiplib_ipaddrconv(const char *addrstr, uint8_t *ipaddr)
}
++addrstr;
}
while(c != '.' && c != 0);
while (c != '.' && c != 0);
}
return true;
}
@ -149,7 +150,7 @@ bool uiplib_hwmacconv(const char *hwstr, uint8_t *hw)
++hwstr;
}
while(c != ':' && c != 0);
while (c != ':' && c != 0);
}
return true;

View File

@ -338,7 +338,7 @@ static int cmd_codecs_proc(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv,
buff_len = calc_codec_buffsize(src_buff_len+2, mode);
buffer = malloc(buff_len);
while(true)
while (true)
{
memset(src_buffer, 0, src_buff_len+2);
ret=read(fd, src_buffer, src_buff_len);

View File

@ -174,7 +174,7 @@ static int install_programflash(int startaddr, const char *source)
startaddr += count;
totalsize += count;
}
while(count);
while (count);
}
else
{
@ -308,7 +308,7 @@ static int install_remove(const char *scriptname)
progsize -= up_progmem_pagesize(page);
}
while(progsize > 0);
while (progsize > 0);
if (status < 0)
{

View File

@ -67,7 +67,7 @@
void up_lowputs(const char *str)
{
while(*str)
while (*str)
{
up_lowputc(*str++);
}

View File

@ -1738,7 +1738,7 @@ static int nand_read_pmecc(struct sam_nandcs_s *priv, off_t block,
/* Wait until the kernel of the PMECC is not busy */
while((nand_getreg(SAM_HSMC_PMECCSR) & HSMC_PMECCSR_BUSY) != 0);
while ((nand_getreg(SAM_HSMC_PMECCSR) & HSMC_PMECCSR_BUSY) != 0);
return OK;
}
#endif

View File

@ -148,7 +148,7 @@ int up_progmem_erasepage(uint16_t page)
putreg32(page * STM32_FLASH_PAGESIZE, STM32_FLASH_AR);
modifyreg32(STM32_FLASH_CR, 0, FLASH_CR_STRT);
while(getreg32(STM32_FLASH_SR) & FLASH_SR_BSY) up_waste();
while (getreg32(STM32_FLASH_SR) & FLASH_SR_BSY) up_waste();
modifyreg32(STM32_FLASH_CR, FLASH_CR_PER, 0);
@ -232,7 +232,7 @@ int up_progmem_write(uint32_t addr, const void *buf, size_t count)
putreg16(*hword, addr);
while(getreg32(STM32_FLASH_SR) & FLASH_SR_BSY) up_waste();
while (getreg32(STM32_FLASH_SR) & FLASH_SR_BSY) up_waste();
/* Verify */

View File

@ -129,14 +129,14 @@ void stm32_pwr_setvos(uint16_t vos)
* 4. Poll VOSF bit of in PWR_CSR register. Wait until it is reset to 0.
*/
while((stm32_pwr_getreg(STM32_PWR_CSR_OFFSET) & PWR_CSR_VOSF) != 0);
while ((stm32_pwr_getreg(STM32_PWR_CSR_OFFSET) & PWR_CSR_VOSF) != 0);
regval = stm32_pwr_getreg(STM32_PWR_CR_OFFSET);
regval &= ~PWR_CR_VOS_MASK;
regval |= (vos & PWR_CR_VOS_MASK);
stm32_pwr_putreg(STM32_PWR_CR_OFFSET, regval);
while((stm32_pwr_getreg(STM32_PWR_CSR_OFFSET) & PWR_CSR_VOSF) != 0);
while ((stm32_pwr_getreg(STM32_PWR_CSR_OFFSET) & PWR_CSR_VOSF) != 0);
}
#endif

View File

@ -548,7 +548,7 @@ static void stm32_stdclockconfig(void)
/* Wait for PLL2 ready */
while((getreg32(STM32_RCC_CR) & RCC_CR_PLL2RDY) == 0);
while ((getreg32(STM32_RCC_CR) & RCC_CR_PLL2RDY) == 0);
/* Setup PLL3 for MII/RMII clock on MCO */

View File

@ -457,7 +457,7 @@ static void stm32_stdclockconfig(void)
/* Wait for PLL2 ready */
while((getreg32(STM32_RCC_CR) & RCC_CR_PLL2RDY) == 0);
while ((getreg32(STM32_RCC_CR) & RCC_CR_PLL2RDY) == 0);
/* Setup PLL3 for MII/RMII clock on MCO */

View File

@ -686,14 +686,14 @@ static void stm32_stdclockconfig(void)
regval = getreg32(STM32_PWR_CR);
regval |= PWR_CR_ODEN;
putreg32(regval, STM32_PWR_CR);
while((getreg32(STM32_PWR_CSR) & PWR_CSR_ODRDY) == 0)
while ((getreg32(STM32_PWR_CSR) & PWR_CSR_ODRDY) == 0)
{
}
regval = getreg32(STM32_PWR_CR);
regval |= PWR_CR_ODSWEN;
putreg32(regval, STM32_PWR_CR);
while((getreg32(STM32_PWR_CSR) & PWR_CSR_ODSWRDY) == 0)
while ((getreg32(STM32_PWR_CSR) & PWR_CSR_ODSWRDY) == 0)
{
}

View File

@ -217,7 +217,7 @@ static ssize_t tiva_bwrite(FAR struct mtd_dev_s *dev, off_t startblock, size_t n
/* wait until write has finished */
while(getreg32(TIVA_FLASH_FMC) & FLASH_FMC_WRITE);
while (getreg32(TIVA_FLASH_FMC) & FLASH_FMC_WRITE);
}
return nblocks;

View File

@ -67,7 +67,7 @@
void up_lowputs(const char *str)
{
while(*str)
while (*str)
{
up_lowputc(*str++);
}

View File

@ -68,7 +68,7 @@
void up_puts(const char *str)
{
while(*str)
while (*str)
{
up_putc(*str++);
}

View File

@ -69,7 +69,7 @@
void up_puts(const char *str)
{
while(*str)
while (*str)
{
up_putc(*str++);
}

View File

@ -67,7 +67,7 @@
void up_lowputs(const char *str)
{
while(*str)
while (*str)
{
up_lowputc(*str++);
}

View File

@ -68,7 +68,7 @@
void up_puts(const char *str)
{
while(*str)
while (*str)
{
up_putc(*str++);
}

View File

@ -125,11 +125,12 @@ static inline void pic32mx_waitstates(void)
residual = BOARD_CPU_CLOCK;
nwaits = 0;
while(residual > MAX_FLASH_HZ)
while (residual > MAX_FLASH_HZ)
{
nwaits++;
residual -= MAX_FLASH_HZ;
}
DEBUGASSERT(nwaits < 8);
/* Set the FLASH wait states -- clearing all other bits! */

View File

@ -151,9 +151,10 @@ void rtos_stop_running(void)
nuttx_arch_exit();
while(1) {
arch_hlt();
}
while (1)
{
arch_hlt();
}
}
int rtos_vnet_init(struct rgmp_vnet *vnet)

View File

@ -67,7 +67,7 @@
void up_lowputs(const char *str)
{
while(*str)
while (*str)
{
up_lowputc(*str++);
}

View File

@ -68,7 +68,7 @@
void up_puts(const char *str)
{
while(*str)
while (*str)
{
up_putc(*str++);
}

View File

@ -67,7 +67,7 @@
void up_lowputs(const char *str)
{
while(*str)
while (*str)
{
up_lowputc(*str++);
}

View File

@ -68,7 +68,7 @@
void up_puts(const char *str)
{
while(*str)
while (*str)
{
up_putc(*str++);
}

View File

@ -203,7 +203,7 @@ static void fb_ssd1783_send_cmdlist(const struct ssd1783_cmdlist *p)
{
int i=0;
while(p->is_cmd != END)
while (p->is_cmd != END)
{
uint16_t sendcmd = p->data;
if (p->is_cmd == DATA)

View File

@ -93,7 +93,7 @@ static uint8_t g_line[LCD_NCHARS]; /* The content of lines 2 */
static void up_lcddelay(uint16_t count)
{
uint32_t counter = (uint16_t)count << 8;
while(counter--)
while (counter--)
{
asm("\tnop\n\tnop\n\tnop\n" : :); /* 3 NOPs */
}

View File

@ -357,11 +357,11 @@ static void getfilename(int fd, char *name)
{
ret = readbyte(fd, &ch);
}
while(ch == ' ' && ret == 1);
while (ch == ' ' && ret == 1);
/* Concatenate the filename */
while(ret == 1 && ch > ' ')
while (ret == 1 && ch > ' ')
{
*name++ = ch;
ret = readbyte(fd, &ch);
@ -484,7 +484,7 @@ int main(int argc, char **argv, char **envp)
int oflags;
int ret;
while((opt = getopt(argc, argv, ":dt:b:hl:")) != -1)
while ((opt = getopt(argc, argv, ":dt:b:hl:")) != -1)
{
switch(opt)
{

View File

@ -204,9 +204,10 @@ struct vsn_sif_s vsn_sif;
void sif_sem_wait(void)
{
while( sem_wait( &vsn_sif.exclusive_access ) != 0 ) {
while (sem_wait( &vsn_sif.exclusive_access ) != 0)
{
ASSERT(errno == EINTR);
}
}
}
@ -688,7 +689,7 @@ int sif_main(int argc, char *argv[])
cc1101_setchannel(cc, 0); /* AV Test Hex, receive on that channel */
cc1101_receive(cc); /* Enter RX mode */
while(1)
while (1)
{
fflush(stdout);
sta = cc1101_read(cc, buf, 64);

View File

@ -157,9 +157,11 @@ void stm32_spi2select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool sele
stm32_gpiowrite(GPIO_CC1101_CS, !selected);
/* Wait for MISO to go low, indicates that Quart has stabilized */
if (selected) {
while( stm32_gpioread(GPIO_SPI2_MISO) ) up_waste();
}
if (selected)
{
while (stm32_gpioread(GPIO_SPI2_MISO) ) up_waste();
}
}
}

View File

@ -2909,7 +2909,7 @@ static int mmcsd_cardidentify(FAR struct mmcsd_state_s *priv)
elapsed = clock_systimer() - start;
}
while( elapsed < TICK_PER_SEC ); /* On successful reception while 'breaks', see above. */
while (elapsed < TICK_PER_SEC); /* On successful reception while 'breaks', see above. */
/* We get here when the above loop completes, either (1) we could not
* communicate properly with the card due to errors (and the loop times

View File

@ -111,7 +111,7 @@
#define WRITE_NAND(d,a) \
do { \
*(volatile uint8_t *)((uintptr_t)a) = (uint8_t)d; \
} while(0)
} while (0)
/****************************************************************************
* Private Types

View File

@ -626,7 +626,7 @@ static void * cc3000_worker(FAR void *arg)
/* We have started release our creator*/
sem_post(&priv->readysem);
while(1)
while (1)
{
PROBE(0,1);
CHECK_GUARD(priv);
@ -741,7 +741,7 @@ static void * cc3000_worker(FAR void *arg)
} /* end if */
cc3000_devgive(priv);
} /* while(1) */
} /* while (1) */
return OK;
}

View File

@ -209,7 +209,7 @@ static void *unsoliced_thread_func(void *parameter)
spiconf.done = sem_open(buff,O_RDONLY);
DEBUGASSERT(spiconf.done != (sem_t *)-1);
while(spiconf.run)
while (spiconf.run)
{
memset(&spiconf.rx_buffer,0,sizeof(spiconf.rx_buffer));
nbytes = mq_receive(spiconf.queue, &spiconf.rx_buffer,

View File

@ -938,7 +938,7 @@ void SimpleLinkWaitEvent(uint16_t usOpcode, void *pRetParams)
hci_event_handler(pRetParams, 0, 0);
}
}
while(tSLInformation.usRxEventOpcode != 0);
while (tSLInformation.usRxEventOpcode != 0);
nllvdbg("Done for usOpcode 0x%x\n",usOpcode);
}
@ -996,7 +996,7 @@ void SimpleLinkWaitData(uint8_t *pBuf, uint8_t *from, uint8_t *fromlen)
}
}
}
while(*tSLInformation.pucReceivedData == HCI_TYPE_EVNT);
while (*tSLInformation.pucReceivedData == HCI_TYPE_EVNT);
nllvdbg("Done for Data 0x%x\n",usOpcode);
}

View File

@ -82,7 +82,7 @@
#endif
#ifdef CONFIG_WL_NRF24L01_CHECK_PARAMS
# define CHECK_ARGS(cond) do { if (!(cond)) return -EINVAL; } while(0)
# define CHECK_ARGS(cond) do { if (!(cond)) return -EINVAL; } while (0)
#else
# define CHECK_ARGS(cond)
#endif
@ -1719,7 +1719,7 @@ ssize_t nrf24l01_recv(struct nrf24l01_dev_s *dev, uint8_t *buffer,
static void binarycvt(char *deststr, const uint8_t *srcbin, size_t srclen)
{
int i = 0;
while(i < srclen)
while (i < srclen)
{
sprintf(deststr + i*2, "%02x", srcbin[i]);
++i;

View File

@ -70,7 +70,7 @@
static int inode_namelen(FAR const char *name)
{
const char *tmp = name;
while(*tmp && *tmp != '/') tmp++;
while (*tmp && *tmp != '/') tmp++;
return tmp - name;
}
@ -80,7 +80,7 @@ static int inode_namelen(FAR const char *name)
static void inode_namecpy(char *dest, const char *src)
{
while(*src && *src != '/') *dest++ = *src++;
while (*src && *src != '/') *dest++ = *src++;
*dest='\0';
}

View File

@ -495,7 +495,7 @@ int uip_backlogdelete(FAR struct uip_conn *conn, FAR struct uip_conn *blconn);
do { \
(f) |= UIP_NEWDATA; \
(conn)->tcpstateflags &= ~UIP_STOPPED; \
} while(0)
} while (0)
/* Get the current maximum segment size that can be sent on the current
* connection.

View File

@ -411,7 +411,7 @@ extern void uip_send(struct uip_driver_s *dev, const void *buf, int len);
do { \
addr = HTONL((uint32_t)(addr0) << 24 | (uint32_t)(addr1) << 16 | \
(uint32_t)(addr2) << 8 | (uint32_t)(addr3)); \
} while(0)
} while (0)
/* Convert an IPv4 address of the form uint16_t[2] to an in_addr_t */
@ -454,7 +454,7 @@ extern void uip_send(struct uip_driver_s *dev, const void *buf, int len);
((uint16_t*)(addr))[5] = HTONS((addr5)); \
((uint16_t*)(addr))[6] = HTONS((addr6)); \
((uint16_t*)(addr))[7] = HTONS((addr7)); \
} while(0)
} while (0)
/* Copy an IP address to another IP address.
*
@ -475,12 +475,12 @@ extern void uip_send(struct uip_driver_s *dev, const void *buf, int len);
# define uip_ipaddr_copy(dest, src) \
do { \
(dest) = (in_addr_t)(src); \
} while(0)
} while (0)
# define uiphdr_ipaddr_copy(dest, src) \
do { \
((uint16_t*)(dest))[0] = ((uint16_t*)(src))[0]; \
((uint16_t*)(dest))[1] = ((uint16_t*)(src))[1]; \
} while(0)
} while (0)
#else /* !CONFIG_NET_IPv6 */
# define uip_ipaddr_copy(dest, src) memcpy(&dest, &src, sizeof(uip_ip6addr_t))
# define uiphdr_ipaddr_copy(dest, src) uip_ipaddr_copy(dest, src)
@ -565,6 +565,6 @@ extern bool uip_ipaddr_maskcmp(uip_ipaddr_t addr1, uip_ipaddr_t addr2,
#define uip_ipaddr_mask(dest, src, mask) \
do { \
(in_addr_t)(dest) = (in_addr_t)(src) & (in_addr_t)(mask); \
} while(0)
} while (0)
#endif /* __INCLUDE_NUTTX_NET_UIP_UIP_H */

View File

@ -74,7 +74,7 @@ static uint16_t chksum(uint16_t sum, const uint8_t *data, uint16_t len)
dataptr = data;
last_byte = data + len - 1;
while(dataptr < last_byte)
while (dataptr < last_byte)
{
/* At least two more bytes */

View File

@ -113,7 +113,7 @@ int wd_cancel (WDOG_ID wdid)
prev = NULL;
curr = (wdog_t*)g_wdactivelist.head;
while((curr) && (curr != wdid))
while ((curr) && (curr != wdid))
{
prev = curr;
curr = curr->next;