diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2014-04-12 12:53:19 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2014-04-12 12:53:19 -0600 |
commit | 5fbbc21f13770cc35c3e61e3109c125d03f172eb (patch) | |
tree | 1c1278108c7fe21ea7534a274a6994ae4ed2b6cc | |
parent | 387c4ace106479e457033b1717051ec55b8d673e (diff) | |
download | nuttx-5fbbc21f13770cc35c3e61e3109c125d03f172eb.tar.gz nuttx-5fbbc21f13770cc35c3e61e3109c125d03f172eb.tar.bz2 nuttx-5fbbc21f13770cc35c3e61e3109c125d03f172eb.zip |
Make sure that there is one space between if and condition
23 files changed, 105 insertions, 89 deletions
diff --git a/apps/netutils/uiplib/uiplib.c b/apps/netutils/uiplib/uiplib.c index 50182efe1..8106789c7 100644 --- a/apps/netutils/uiplib/uiplib.c +++ b/apps/netutils/uiplib/uiplib.c @@ -82,7 +82,7 @@ bool uiplib_ipaddrconv(const char *addrstr, uint8_t *ipaddr) ++ipaddr; tmp = 0; } - else if(c >= '0' && c <= '9') + else if (c >= '0' && c <= '9') { tmp = (tmp * 10) + (c - '0'); } @@ -130,15 +130,15 @@ bool uiplib_hwmacconv(const char *hwstr, uint8_t *hw) ++hw; tmp = 0; } - else if(c >= '0' && c <= '9') + else if (c >= '0' && c <= '9') { tmp = (tmp << 4) + (c - '0'); } - else if(c >= 'a' && c <= 'f') + else if (c >= 'a' && c <= 'f') { tmp = (tmp << 4) + (c - 'a' + 10); } - else if(c >= 'A' && c <= 'F') + else if (c >= 'A' && c <= 'F') { tmp = (tmp << 4) + (c - 'A' + 10); } @@ -151,5 +151,6 @@ bool uiplib_hwmacconv(const char *hwstr, uint8_t *hw) } while(c != ':' && c != 0); } + return true; } diff --git a/apps/nshlib/nsh_codeccmd.c b/apps/nshlib/nsh_codeccmd.c index 779fc5ecd..8947edd67 100644 --- a/apps/nshlib/nsh_codeccmd.c +++ b/apps/nshlib/nsh_codeccmd.c @@ -348,7 +348,7 @@ static int cmd_codecs_proc(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv, ret = ERROR; goto exit; } - else if(ret==0) + else if (ret==0) { break; } diff --git a/apps/nshlib/nsh_netcmds.c b/apps/nshlib/nsh_netcmds.c index 62c1d012a..ef43fe0f6 100644 --- a/apps/nshlib/nsh_netcmds.c +++ b/apps/nshlib/nsh_netcmds.c @@ -644,7 +644,7 @@ int cmd_ifconfig(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) badarg = true; } } - else if(!strcmp(tmp, "netmask")) + else if (!strcmp(tmp, "netmask")) { if (argc-1 >= i+1) { diff --git a/apps/system/install/install.c b/apps/system/install/install.c index fd14b7a6f..cc60df7c3 100644 --- a/apps/system/install/install.c +++ b/apps/system/install/install.c @@ -118,7 +118,7 @@ static int install_getstartpage(int startpage, int pagemargin, int desiredsize) maxlen = 0; } - if(stpage < startpage) + if (stpage < startpage) { stpage = startpage; } diff --git a/nuttx/arch/arm/src/calypso/calypso_irq.c b/nuttx/arch/arm/src/calypso/calypso_irq.c index e307dd38c..6b1af5623 100644 --- a/nuttx/arch/arm/src/calypso/calypso_irq.c +++ b/nuttx/arch/arm/src/calypso/calypso_irq.c @@ -252,7 +252,7 @@ void up_disable_irq(int irq) void up_enable_irq(int irq) { - if((unsigned)irq < NR_IRQS) + if ((unsigned)irq < NR_IRQS) { _irq_enable(irq, 1); } diff --git a/nuttx/arch/arm/src/kinetis/kinetis_enet.c b/nuttx/arch/arm/src/kinetis/kinetis_enet.c index 3e0a36779..eb277f162 100644 --- a/nuttx/arch/arm/src/kinetis/kinetis_enet.c +++ b/nuttx/arch/arm/src/kinetis/kinetis_enet.c @@ -619,7 +619,7 @@ static void kinetis_txdone(FAR struct kinetis_driver_s *priv) * Three interrupt sources will vector this this function: * 1. Ethernet MAC transmit interrupt handler * 2. Ethernet MAC receive interrupt handler - * 3. + * 3. * * Parameters: * irq - Number of the IRQ that generated the interrupt @@ -677,7 +677,7 @@ static int kinetis_interrupt(int irq, FAR void *context) /* Reinitialize all buffers. */ kinetis_initbuffers(priv); - + /* Indicate that there have been empty receive buffers produced */ putreg32(ENET_RDAR, KINETIS_ENET_RDAR); @@ -771,7 +771,7 @@ static void kinetis_polltimer(int argc, uint32_t arg, ...) * * Description: * NuttX Callback: Bring up the Ethernet interface when an IP address is - * provided + * provided * * Parameters: * dev - Reference to the NuttX driver state structure @@ -933,7 +933,7 @@ static int kinetis_ifdown(struct uip_driver_s *dev) * Function: kinetis_txavail * * Description: - * Driver callback invoked when new TX data is available. This is a + * Driver callback invoked when new TX data is available. This is a * stimulus perform an out-of-cycle poll and, thereby, reduce the TX * latency. * @@ -990,7 +990,7 @@ static int kinetis_txavail(struct uip_driver_s *dev) * * Parameters: * dev - Reference to the NuttX driver state structure - * mac - The MAC address to be added + * mac - The MAC address to be added * * Returned Value: * None @@ -1019,7 +1019,7 @@ static int kinetis_addmac(struct uip_driver_s *dev, FAR const uint8_t *mac) * * Parameters: * dev - Reference to the NuttX driver state structure - * mac - The MAC address to be removed + * mac - The MAC address to be removed * * Returned Value: * None @@ -1070,7 +1070,7 @@ static void kinetis_initmii(struct kinetis_driver_s *priv) * Function: kinetis_writemii * * Description: - * Write a 16-bit value to a PHY register. + * Write a 16-bit value to a PHY register. * * Parameters: * priv - Reference to the private ENET driver state structure @@ -1114,7 +1114,7 @@ static int kinetis_writemii(struct kinetis_driver_s *priv, uint8_t phyaddr, /* Check for a timeout */ - if(timeout == MII_MAXPOLLS) + if (timeout == MII_MAXPOLLS) { return -ETIMEDOUT; } @@ -1129,7 +1129,7 @@ static int kinetis_writemii(struct kinetis_driver_s *priv, uint8_t phyaddr, * Function: kinetis_writemii * * Description: - * Read a 16-bit value from a PHY register. + * Read a 16-bit value from a PHY register. * * Parameters: * priv - Reference to the private ENET driver state structure @@ -1152,7 +1152,7 @@ static int kinetis_readmii(struct kinetis_driver_s *priv, uint8_t phyaddr, putreg32(ENET_INT_MII, KINETIS_ENET_EIR); /* Initiatate the MII Management read */ - + putreg32(2 << ENET_MMFR_TA_SHIFT | (uint32_t)regaddr << ENET_MMFR_PA_SHIFT | (uint32_t)phyaddr << ENET_MMFR_PA_SHIFT | @@ -1172,7 +1172,7 @@ static int kinetis_readmii(struct kinetis_driver_s *priv, uint8_t phyaddr, /* Check for a timeout */ - if (timeout >= MII_MAXPOLLS) + if (timeout >= MII_MAXPOLLS) { return -ETIMEDOUT; } @@ -1241,7 +1241,7 @@ static inline void kinetis_initphy(struct kinetis_driver_s *priv) phydata = 0; kinetis_readmii(priv, CONFIG_ENET_PHYADDR, PHY_STATUS, &phydata); - /* Set up the transmit and receive contrel registers based on the + /* Set up the transmit and receive contrel registers based on the * configuration and the auto negotiation results. */ @@ -1256,7 +1256,7 @@ static inline void kinetis_initphy(struct kinetis_driver_s *priv) putreg32(rcr, KINETIS_ENET_RCR); putreg32(tcr, KINETIS_ENET_TCR); - + /* Setup half or full duplex */ if ((phydata & PHY_DUPLEX_STATUS) != 0) @@ -1271,7 +1271,7 @@ static inline void kinetis_initphy(struct kinetis_driver_s *priv) rcr |= ENET_RCR_DRT; } - + if ((phydata & PHY_SPEED_STATUS) != 0) { /* 10Mbps */ @@ -1463,7 +1463,7 @@ int kinetis_netinitialize(int intf) kinetis_pinconfig(PIN_RMII0_TXD0); kinetis_pinconfig(PIN_RMII0_TXD1); kinetis_pinconfig(PIN_RMII0_TXEN); -#endif +#endif /* Set interrupt priority levels */ diff --git a/nuttx/arch/arm/src/lpc2378/lpc23xx_i2c.c b/nuttx/arch/arm/src/lpc2378/lpc23xx_i2c.c index 7d401a9fd..33c66a8a2 100644 --- a/nuttx/arch/arm/src/lpc2378/lpc23xx_i2c.c +++ b/nuttx/arch/arm/src/lpc2378/lpc23xx_i2c.c @@ -289,11 +289,11 @@ static int i2c_start (struct lpc23xx_i2cdev_s *priv) wd_cancel(priv->timeout); sem_post(&priv->mutex); - if( priv-> state == 0x18 || priv->state == 0x28) + if (priv-> state == 0x18 || priv->state == 0x28) { ret=priv->wrcnt; } - else if( priv-> state == 0x50 || priv->state == 0x58) + else if (priv-> state == 0x50 || priv->state == 0x58) { ret=priv->rdcnt; } @@ -404,7 +404,7 @@ static int i2c_interrupt (int irq, FAR void *context) case 0x28: priv->wrcnt++; - if(priv->wrcnt<priv->msg.length) + if (priv->wrcnt<priv->msg.length) { putreg32(priv->msg.buffer[priv->wrcnt],priv->base+I2C_DAT_OFFSET); } diff --git a/nuttx/arch/arm/src/lpc43xx/lpc43_adc.c b/nuttx/arch/arm/src/lpc43xx/lpc43_adc.c index d9165ba75..d03abb162 100644 --- a/nuttx/arch/arm/src/lpc43xx/lpc43_adc.c +++ b/nuttx/arch/arm/src/lpc43xx/lpc43_adc.c @@ -165,21 +165,21 @@ static void adc_reset(FAR struct adc_dev_s *dev) clkdiv&=0xff00; putreg32(ADC_CR_PDN|ADC_CR_BURST|clkdiv|priv->mask,LPC43_ADC_CR); - if(priv->mask&0x01) + if (priv->mask&0x01) lpc43_configgpio(GPIO_AD0p0); - else if(priv->mask&0x02) + else if (priv->mask&0x02) lpc43_configgpio(GPIO_AD0p1); - else if(priv->mask&0x04) + else if (priv->mask&0x04) lpc43_configgpio(GPIO_AD0p2); - else if(priv->mask&0x08) + else if (priv->mask&0x08) lpc43_configgpio(GPIO_AD0p3); - else if(priv->mask&0x10) + else if (priv->mask&0x10) lpc43_configgpio(GPIO_AD0p4); - else if(priv->mask&0x20) + else if (priv->mask&0x20) lpc43_configgpio(GPIO_AD0p5); - else if(priv->mask&0x40) + else if (priv->mask&0x40) lpc43_configgpio(GPIO_AD0p6); - else if(priv->mask&0x80) + else if (priv->mask&0x80) lpc43_configgpio(GPIO_AD0p7); irqrestore(flags); diff --git a/nuttx/arch/arm/src/stm32/stm32_can.c b/nuttx/arch/arm/src/stm32/stm32_can.c index 809b50ddf..6c88c6b33 100644 --- a/nuttx/arch/arm/src/stm32/stm32_can.c +++ b/nuttx/arch/arm/src/stm32/stm32_can.c @@ -1626,7 +1626,7 @@ FAR struct can_dev_s *stm32_caninitialize(int port) */ #ifdef CONFIG_STM32_CAN1 - if( port == 1 ) + if (port == 1) { /* Select the CAN1 device structure */ @@ -1642,7 +1642,7 @@ FAR struct can_dev_s *stm32_caninitialize(int port) else #endif #ifdef CONFIG_STM32_CAN2 - if ( port ==2 ) + if (port == 2) { /* Select the CAN2 device structure */ diff --git a/nuttx/arch/sim/src/up_tapdev.c b/nuttx/arch/sim/src/up_tapdev.c index 197049a34..253c9744d 100644 --- a/nuttx/arch/sim/src/up_tapdev.c +++ b/nuttx/arch/sim/src/up_tapdev.c @@ -227,7 +227,7 @@ unsigned int tapdev_read(unsigned char *buf, unsigned int buflen) FD_SET(gtapdevfd, &fdset); ret = select(gtapdevfd + 1, &fdset, NULL, NULL, &tv); - if(ret == 0) + if (ret == 0) { return 0; } @@ -250,7 +250,7 @@ void tapdev_send(unsigned char *buf, unsigned int buflen) syslog("tapdev_send: sending %d bytes\n", buflen); gdrop++; - if(gdrop % 8 == 7) + if (gdrop % 8 == 7) { syslog("Dropped a packet!\n"); return; diff --git a/nuttx/arch/x86/src/qemu/qemu_vga.c b/nuttx/arch/x86/src/qemu/qemu_vga.c index f7b459bc1..fe34382fb 100644 --- a/nuttx/arch/x86/src/qemu/qemu_vga.c +++ b/nuttx/arch/x86/src/qemu/qemu_vga.c @@ -287,7 +287,7 @@ static int init_graph_vga(int width, int height,int chain4) /* chain4 not available if mode takes over 64k */ - /* if(chain4 && (long)width*(long)height>65536L) return -3; */ + /* if (chain4 && (long)width*(long)height>65536L) return -3; */ /* here goes the actual modeswitch */ @@ -306,7 +306,7 @@ static int init_graph_vga(int width, int height,int chain4) outw(0x0008, 0x3d4); /* vert.panning = 0 */ - if(chain4) + if (chain4) { outw(0x4014, 0x3d4); outw(0xa317, 0x3d4); diff --git a/nuttx/binfmt/libelf/libelf_sections.c b/nuttx/binfmt/libelf/libelf_sections.c index 236d7e9c8..c6b9de286 100644 --- a/nuttx/binfmt/libelf/libelf_sections.c +++ b/nuttx/binfmt/libelf/libelf_sections.c @@ -203,7 +203,7 @@ int elf_loadshdrs(FAR struct elf_loadinfo_s *loadinfo) /* Get the total size of the section header table */ shdrsize = (size_t)loadinfo->ehdr.e_shentsize * (size_t)loadinfo->ehdr.e_shnum; - if(loadinfo->ehdr.e_shoff + shdrsize > loadinfo->filelen) + if (loadinfo->ehdr.e_shoff + shdrsize > loadinfo->filelen) { bdbg("Insufficent space in file for section header table\n"); return -ESPIPE; diff --git a/nuttx/configs/compal_e99/src/ssd1783.c b/nuttx/configs/compal_e99/src/ssd1783.c index f5029caa1..70155ce24 100644 --- a/nuttx/configs/compal_e99/src/ssd1783.c +++ b/nuttx/configs/compal_e99/src/ssd1783.c @@ -206,8 +206,11 @@ static void fb_ssd1783_send_cmdlist(const struct ssd1783_cmdlist *p) while(p->is_cmd != END) { uint16_t sendcmd = p->data; - if(p->is_cmd == DATA) - sendcmd |= 0x0100; /* 9th bit is cmd/data flag */ + if (p->is_cmd == DATA) + { + sendcmd |= 0x0100; /* 9th bit is cmd/data flag */ + } + uwire_xfer(SSD1783_DEV_ID, SSD1783_UWIRE_BITLEN, &sendcmd, NULL); p++; i++; diff --git a/nuttx/configs/us7032evb1/shterm/shterm.c b/nuttx/configs/us7032evb1/shterm/shterm.c index 361f134ff..9eaa88c34 100644 --- a/nuttx/configs/us7032evb1/shterm/shterm.c +++ b/nuttx/configs/us7032evb1/shterm/shterm.c @@ -380,9 +380,9 @@ static int readbyte(int fd, char *ch) /* Read characters from the console, and echo them to the target tty */ ret = read(fd, ch, 1); - if(ret < 0) + if (ret < 0) { - if(errno != EAGAIN) + if (errno != EAGAIN) { printconsole("ERROR: Failed to read from fd=%d: %s\n", fd, strerror(errno)); close_tty(); @@ -390,7 +390,7 @@ static int readbyte(int fd, char *ch) } return -EAGAIN; } - else if(ret > 1) + else if (ret > 1) { printconsole("ERROR: Unexpected number of bytes read(%d) from fd=%d\n", ret, fd); close_tty(); @@ -406,7 +406,7 @@ static int readbyte(int fd, char *ch) static void writebyte(int fd, char byte) { int ret = write(fd, &byte, 1); - if(ret < 0) + if (ret < 0) { printconsole("ERROR: Failed to write to fd=%d: %s\n", fd, strerror(errno)); close_tty(); @@ -520,13 +520,13 @@ int main(int argc, char **argv, char **envp) } } - if(optind < argc) + if (optind < argc) { fprintf(stderr, "ERROR: Unexpected arguments at end of line\n"); show_usage(argv[0], 3); } - switch(g_baud) + switch (g_baud) { case 0: speed = B0; break; case 50: speed = B50; break; @@ -568,14 +568,14 @@ int main(int argc, char **argv, char **envp) /* Set the host stdin to O_NONBLOCK */ oflags = fcntl(0, F_GETFL, 0); - if(oflags == -1) + if (oflags == -1) { fprintf(stderr, "ERROR: fnctl(F_GETFL) failed: %s\n", strerror(errno)); return 6; } ret = fcntl(0, F_SETFL, oflags | O_NONBLOCK); - if(ret < 0) + if (ret < 0) { fprintf(stderr, "ERROR: fnctl(F_SETFL) failed: %s\n", strerror(errno)); return 7; @@ -584,7 +584,7 @@ int main(int argc, char **argv, char **envp) /* Open the selected serial port (blocking)*/ g_fd = open(g_ttydev, O_RDWR); - if(g_fd < 0) + if (g_fd < 0) { printconsole("ERROR: Failed to open %s: %s\n", g_ttydev, strerror(errno)); return 8; @@ -595,7 +595,7 @@ int main(int argc, char **argv, char **envp) */ ret = tcgetattr(g_fd, &g_termios); - if(ret < 0) + if (ret < 0) { printconsole("ERROR: Failed to get termios for %s: %s\n", g_ttydev, strerror(errno)); close(g_fd); @@ -613,7 +613,7 @@ int main(int argc, char **argv, char **envp) (void)cfsetospeed(&tty, speed); ret = tcsetattr(g_fd, TCSANOW, &tty); - if(ret < 0) + if (ret < 0) { printconsole("ERROR: Failed to set termios for %s: %s\n", g_ttydev, strerror(errno)); close(g_fd); @@ -624,7 +624,7 @@ int main(int argc, char **argv, char **envp) /* Open the selected serial port (non-blocking)*/ g_fdnb = open(g_ttydev, O_RDONLY | O_NONBLOCK); - if(g_fdnb < 0) + if (g_fdnb < 0) { printconsole("ERROR: Failed to open %s: %s\n", g_ttydev, strerror(errno)); return 11; @@ -641,7 +641,7 @@ int main(int argc, char **argv, char **envp) } oflags = fcntl(g_fdnb, F_GETFL, 0); - if(oflags == -1) + if (oflags == -1) { fprintf(stderr, "ERROR: fnctl(F_GETFL) failed: %s\n", strerror(errno)); close_tty(); @@ -649,7 +649,7 @@ int main(int argc, char **argv, char **envp) } ret = fcntl(g_fdnb, F_SETFL, oflags | O_NONBLOCK); - if(ret < 0) + if (ret < 0) { fprintf(stderr, "ERROR: fnctl(F_SETFL) failed: %s\n", strerror(errno)); close_tty(); diff --git a/nuttx/drivers/analog/dac.c b/nuttx/drivers/analog/dac.c index 31d1242e7..2714f2135 100644 --- a/nuttx/drivers/analog/dac.c +++ b/nuttx/drivers/analog/dac.c @@ -398,19 +398,19 @@ static ssize_t dac_write(FAR struct file *filep, FAR const char *buffer, size_t fifo->af_buffer[fifo->af_tail].am_data=*(uint32_t *)&buffer[nsent]; fifo->af_buffer[fifo->af_tail].am_data&=0xffffff00; } - else if(msglen == 3) + else if (msglen == 3) { fifo->af_buffer[fifo->af_tail].am_channel=buffer[nsent]; fifo->af_buffer[fifo->af_tail].am_data=(*(uint16_t *)&buffer[nsent+1]); fifo->af_buffer[fifo->af_tail].am_data<<=16; } - else if(msglen == 2) + else if (msglen == 2) { fifo->af_buffer[fifo->af_tail].am_channel=0; fifo->af_buffer[fifo->af_tail].am_data=(*(uint16_t *)&buffer[nsent]); fifo->af_buffer[fifo->af_tail].am_data<<=16; } - else if(msglen == 1) + else if (msglen == 1) { fifo->af_buffer[fifo->af_tail].am_channel=0; fifo->af_buffer[fifo->af_tail].am_data=buffer[nsent]; diff --git a/nuttx/drivers/mmcsd/mmcsd_spi.c b/nuttx/drivers/mmcsd/mmcsd_spi.c index 1512ef085..fe3f34e15 100644 --- a/nuttx/drivers/mmcsd/mmcsd_spi.c +++ b/nuttx/drivers/mmcsd/mmcsd_spi.c @@ -1351,6 +1351,8 @@ static ssize_t mmcsd_write(FAR struct inode *inode, const unsigned char *buffer, /* Convert sector and nsectors to nbytes and byte offset */ nbytes = nsectors * SECTORSIZE(slot); + UNUSED(nbytes); + if (IS_BLOCK(slot->type)) { offset = start_sector; diff --git a/nuttx/drivers/sercomm/uart.c b/nuttx/drivers/sercomm/uart.c index d64314e25..3cf52f7db 100644 --- a/nuttx/drivers/sercomm/uart.c +++ b/nuttx/drivers/sercomm/uart.c @@ -399,7 +399,7 @@ void uart_init(uint8_t uart, uint8_t interrupts) if (uart == CONS_UART_NR) { cons_init(); - if(interrupts) + if (interrupts) { irq_register_handler(irq, &uart_irq_handler_cons); irq_config(irq, 0, 0, 0xff); @@ -409,7 +409,7 @@ void uart_init(uint8_t uart, uint8_t interrupts) else { sercomm_init(); - if(interrupts) + if (interrupts) { irq_register_handler(irq, &uart_irq_handler_sercomm); irq_config(irq, 0, 0, 0xff); diff --git a/nuttx/fs/nxffs/nxffs_pack.c b/nuttx/fs/nxffs/nxffs_pack.c index 2f3461aad..7577aa66c 100644 --- a/nuttx/fs/nxffs/nxffs_pack.c +++ b/nuttx/fs/nxffs/nxffs_pack.c @@ -471,7 +471,7 @@ static int nxffs_destsetup(FAR struct nxffs_volume_s *volume, { /* Is there room for an inode structure in this block? */ - if(pack->iooffset + SIZEOF_NXFFS_INODE_HDR > volume->geo.blocksize) + if (pack->iooffset + SIZEOF_NXFFS_INODE_HDR > volume->geo.blocksize) { /* No.. that inode name will not fit in this block. Return an * indication that we are at the end of the block and try again diff --git a/nuttx/graphics/nxbe/nxbe_clipper.c b/nuttx/graphics/nxbe/nxbe_clipper.c index 4b7293ae6..14e66ef4f 100644 --- a/nuttx/graphics/nxbe/nxbe_clipper.c +++ b/nuttx/graphics/nxbe/nxbe_clipper.c @@ -141,13 +141,14 @@ static inline bool nxbe_poprectangle(struct nxbe_clipstack_s *stack, FAR struct nxbe_window_s **wnd, struct nxgl_rect_s *rect) { - if(stack->npushed > 0) + if (stack->npushed > 0) { stack->npushed--; *wnd = stack->stack[stack->npushed].wnd; nxgl_rectcopy(rect, &stack->stack[stack->npushed].rect); return true; } + return false; } diff --git a/nuttx/include/nuttx/net/uip/uip-arch.h b/nuttx/include/nuttx/net/uip/uip-arch.h index 65c86db27..9dffdcede 100644 --- a/nuttx/include/nuttx/net/uip/uip-arch.h +++ b/nuttx/include/nuttx/net/uip/uip-arch.h @@ -222,12 +222,14 @@ struct uip_driver_s * code below. * * dev->d_len = devicedriver_poll(); - * if(dev->d_len > 0) { - * uip_input(dev); - * if(dev->d_len > 0) { - * devicedriver_send(); + * if (dev->d_len > 0) + * { + * uip_input(dev); + * if (dev->d_len > 0) + * { + * devicedriver_send(); + * } * } - * } * * Note: If you are writing a uIP device driver that needs ARP * (Address Resolution Protocol), e.g., when running uIP over @@ -236,20 +238,26 @@ struct uip_driver_s * * #define BUF ((struct uip_eth_hdr *)&dev->d_buf[0]) * dev->d_len = ethernet_devicedrver_poll(); - * if(dev->d_len > 0) { - * if(BUF->type == HTONS(UIP_ETHTYPE_IP)) { - * uip_arp_ipin(); - * uip_input(dev); - * if(dev->d_len > 0) { - * uip_arp_out(); - * devicedriver_send(); - * } - * } else if(BUF->type == HTONS(UIP_ETHTYPE_ARP)) { - * uip_arp_arpin(); - * if(dev->d_len > 0) { - * devicedriver_send(); - * } - * } + * if (dev->d_len > 0) + * { + * if (BUF->type == HTONS(UIP_ETHTYPE_IP)) + * { + * uip_arp_ipin(); + * uip_input(dev); + * if (dev->d_len > 0) + * { + * uip_arp_out(); + * devicedriver_send(); + * } + * } + * else if (BUF->type == HTONS(UIP_ETHTYPE_ARP)) + * { + * uip_arp_arpin(); + * if (dev->d_len > 0) + * { + * devicedriver_send(); + * } + * } */ int uip_input(struct uip_driver_s *dev); diff --git a/nuttx/include/nuttx/net/uip/uip.h b/nuttx/include/nuttx/net/uip/uip.h index bcd5a1c13..624bfae4a 100644 --- a/nuttx/include/nuttx/net/uip/uip.h +++ b/nuttx/include/nuttx/net/uip/uip.h @@ -493,9 +493,10 @@ extern void uip_send(struct uip_driver_s *dev, const void *buf, int len); * uip_ipaddr_t ipaddr1, ipaddr2; * * uip_ipaddr(&ipaddr1, 192,16,1,2); - * if(uip_ipaddr_cmp(ipaddr2, ipaddr1)) { - * printf("They are the same"); - * } + * if (uip_ipaddr_cmp(ipaddr2, ipaddr1)) + * { + * printf("They are the same"); + * } * * addr1 The first IP address. * addr2 The second IP address. @@ -521,7 +522,7 @@ extern void uip_send(struct uip_driver_s *dev, const void *buf, int len); * uip_ipaddr(&mask, 255,255,255,0); * uip_ipaddr(&ipaddr1, 192,16,1,2); * uip_ipaddr(&ipaddr2, 192,16,1,3); - * if(uip_ipaddr_maskcmp(ipaddr1, ipaddr2, &mask)) + * if (uip_ipaddr_maskcmp(ipaddr1, ipaddr2, &mask)) * { * printf("They are the same"); * } diff --git a/nuttx/libc/stdlib/lib_qsort.c b/nuttx/libc/stdlib/lib_qsort.c index 021e782d4..0579b1510 100644 --- a/nuttx/libc/stdlib/lib_qsort.c +++ b/nuttx/libc/stdlib/lib_qsort.c @@ -99,7 +99,7 @@ static inline char *med3(char *a, char *b, char *c, static inline void swapfunc(char *a, char *b, int n, int swaptype) { - if(swaptype <= 1) + if (swaptype <= 1) { swapcode(long, a, b, n) } diff --git a/nuttx/net/uip/uip_icmpinput.c b/nuttx/net/uip/uip_icmpinput.c index d6b79e176..c66aece61 100644 --- a/nuttx/net/uip/uip_icmpinput.c +++ b/nuttx/net/uip/uip_icmpinput.c @@ -156,7 +156,7 @@ void uip_icmpinput(struct uip_driver_s *dev) * checksum for the change of type */ - if( picmp->icmpchksum >= HTONS(0xffff - (ICMP_ECHO_REQUEST << 8))) + if (picmp->icmpchksum >= HTONS(0xffff - (ICMP_ECHO_REQUEST << 8))) { picmp->icmpchksum += HTONS(ICMP_ECHO_REQUEST << 8) + 1; } |