Skip to content

Commit

Permalink
Refine the preprocess conditional guard style
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoxiang781216 authored and gregory-nutt committed Jan 31, 2020
1 parent e0dcfa0 commit 1154735
Show file tree
Hide file tree
Showing 48 changed files with 73 additions and 73 deletions.
2 changes: 1 addition & 1 deletion examples/fb/fb_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ struct fb_state_s
int fd;
struct fb_videoinfo_s vinfo;
struct fb_planeinfo_s pinfo;
#ifdef CONFIG_FB_OVERLAY
#ifdef CONFIG_FB_OVERLAY
struct fb_overlayinfo_s oinfo;
#endif
FAR void *fbmem;
Expand Down
2 changes: 1 addition & 1 deletion examples/lvgldemo/fbdev.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,4 @@ void fbdev_map(int32_t x1, int32_t y1, int32_t x2, int32_t y2,
} /* extern "C" */
#endif

#endif /*__APPS_EXAMPLES_LVGLDEMO_FBDEV_H*/
#endif /*__APPS_EXAMPLES_LVGLDEMO_FBDEV_H */
4 changes: 2 additions & 2 deletions examples/module/module_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ int main(int argc, FAR char *argv[])
}

#endif /* CONFIG_EXAMPLES_MODULE_ROMFS */
#else /* CONFIG_EXAMPLES_MODULE_BUILTINFS */
#else /* CONFIG_EXAMPLES_MODULE_BUILTINFS */
/* An external file system is being used */

#if defined(CONFIG_EXAMPLES_MODULE_FSMOUNT)
Expand Down Expand Up @@ -263,7 +263,7 @@ int main(int argc, FAR char *argv[])
}
}
while (ret < 0);
#endif /* CONFIG_EXAMPLES_MODULE_FSREMOVEABLE */
#endif /* CONFIG_EXAMPLES_MODULE_FSREMOVEABLE */

/* Mount the external file system */

Expand Down
2 changes: 1 addition & 1 deletion fsutils/passwd/passwd.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
****************************************************************************/

#ifndef __APPS_FSUTILS_PASSWD_PASSWD_H
#define __APPS_FSUTILS_PASSWD_PASSWD_H 1
#define __APPS_FSUTILS_PASSWD_PASSWD_H

/****************************************************************************
* Included Files
Expand Down
2 changes: 1 addition & 1 deletion graphics/pdcurs34/include/curspriv.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
****************************************************************************/

#ifndef __APPS_GRAPHICS_PDCURS34_INCLUDE_CURSPRIV_H
#define __APPS_GRAPHICS_PDCURS34_INCLUDE_CURSPRIV_H 1
#define __APPS_GRAPHICS_PDCURS34_INCLUDE_CURSPRIV_H

/****************************************************************************
* Included Files
Expand Down
2 changes: 1 addition & 1 deletion graphics/pdcurs34/include/term.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
****************************************************************************/

#ifndef __APPS_GRAPHICS_PDCURS34_INCLUDE_TERM_H
#define __APPS_GRAPHICS_PDCURS34_INCLUDE_TERM_H 1
#define __APPS_GRAPHICS_PDCURS34_INCLUDE_TERM_H

/****************************************************************************
* Included Files
Expand Down
2 changes: 1 addition & 1 deletion graphics/pdcurs34/nuttx/pdcgetsc.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ int PDC_get_columns_term(FAR SCREEN *sp)

return ret;
}
#endif /* CONFIG_SYSTEM_TERMCURSES */
#endif /* CONFIG_SYSTEM_TERMCURSES */

/****************************************************************************
* Name: PDC_get_rows
Expand Down
2 changes: 1 addition & 1 deletion graphics/pdcurs34/nuttx/pdcnuttx.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
****************************************************************************/

#ifndef __APPS_GRAPHICS_PDCURS34_NUTTX_PDCNUTTX_H
#define __APPS_GRAPHICS_PDCURS34_NUTTX_PDCNUTTX_H 1
#define __APPS_GRAPHICS_PDCURS34_NUTTX_PDCNUTTX_H

/****************************************************************************
* Included Files
Expand Down
4 changes: 2 additions & 2 deletions graphics/pdcurs34/nuttx/pdcthread.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ static FAR struct pdc_context_s *PDC_ctx_new(void)
ctx->next = g_pdc_ctx_head;
g_pdc_ctx_head = ctx;
}
#endif /* CONFIG_PDCURSES_MULTITHREAD_HASH */
#endif /* CONFIG_PDCURSES_MULTITHREAD_HASH */

return ctx;
}
Expand Down Expand Up @@ -347,5 +347,5 @@ void PDC_ctx_free(void)
free(ctx->panel_ctx);
free(ctx->term_ctx);
free(ctx);
#endif /* CONFIG_PDCURSES_MULTITHREAD_HASH */
#endif /* CONFIG_PDCURSES_MULTITHREAD_HASH */
}
2 changes: 1 addition & 1 deletion graphics/slcd/slcd.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
/////////////////////////////////////////////////////////////////////////////

#ifndef __APPS_GRAPHICS_SLCD_SLCD_H
#define __APPS_GRAPHICS_SLCD_SLCD_H 1
#define __APPS_GRAPHICS_SLCD_SLCD_H

/////////////////////////////////////////////////////////////////////////////
// Included Files
Expand Down
2 changes: 1 addition & 1 deletion graphics/tiff/tiff_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -208,4 +208,4 @@ ssize_t tiff_wordalign(int fd, size_t size);
}
#endif

#endif /* __APPS_GRAPHICS_TIFF_TIFF_INTERNAL_H */
#endif /* __APPS_GRAPHICS_TIFF_TIFF_INTERNAL_H */
2 changes: 1 addition & 1 deletion include/canutils/obd.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
****************************************************************************/

#ifndef __APPS_INCLUDE_CANUTILS_OBD_H
#define __APPS_INCLUDE_CANUTILS_OBD_H 1
#define __APPS_INCLUDE_CANUTILS_OBD_H

/****************************************************************************
* Included Files
Expand Down
2 changes: 1 addition & 1 deletion include/canutils/obd_frame.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
****************************************************************************/

#ifndef __APPS_INCLUDE_CANUTILS_OBD_FRAME_H
#define __APPS_INCLUDE_CANUTILS_OBD_FRAME_H 1
#define __APPS_INCLUDE_CANUTILS_OBD_FRAME_H

/****************************************************************************
* Pre-processor Definitions
Expand Down
2 changes: 1 addition & 1 deletion include/canutils/obd_pid.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
****************************************************************************/

#ifndef __APPS_INCLUDE_CANUTILS_OBD_PID_H
#define __APPS_INCLUDE_CANUTILS_OBD_PID_H 1
#define __APPS_INCLUDE_CANUTILS_OBD_PID_H

/****************************************************************************
* Pre-processor Definitions
Expand Down
2 changes: 1 addition & 1 deletion include/fsutils/flash_eraseall.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
****************************************************************************/

#ifndef __APPS_INCLUDE_FSUTILS_FLASH_ERASEALL_H
#define __APPS_INCLUDE_FSUTILS_FLASH_ERASEALL_H 1
#define __APPS_INCLUDE_FSUTILS_FLASH_ERASEALL_H

/****************************************************************************
* Included Files
Expand Down
2 changes: 1 addition & 1 deletion include/fsutils/passwd.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
****************************************************************************/

#ifndef __APPS_INCLUDE_FSUTILS_PASSWD_H
#define __APPS_INCLUDE_FSUTILS_PASSWD_H 1
#define __APPS_INCLUDE_FSUTILS_PASSWD_H

/****************************************************************************
* Included Files
Expand Down
4 changes: 2 additions & 2 deletions include/graphics/curses.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
****************************************************************************/

#ifndef __APPS_INCLUDE_GRAPHICS_CURSES_H
#define __APPS_INCLUDE_GRAPHICS_CURSES_H 1
#define __APPS_INCLUDE_GRAPHICS_CURSES_H

/* PDCurses definitions list: (Only define those needed)
*
Expand Down Expand Up @@ -1525,4 +1525,4 @@ int PDC_save_key_modifiers(bool);
}
#endif

#endif /* __APPS_INCLUDE_GRAPHICS_CURSES_H */
#endif /* __APPS_INCLUDE_GRAPHICS_CURSES_H */
2 changes: 1 addition & 1 deletion include/graphics/panel.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
****************************************************************************/

#ifndef __APPS_INCLUDE_GRAPHICS_PANEL_H
#define __APPS_INCLUDE_GRAPHICS_PANEL_H 1
#define __APPS_INCLUDE_GRAPHICS_PANEL_H

/****************************************************************************
* Included Files
Expand Down
2 changes: 1 addition & 1 deletion include/graphics/slcd.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
/////////////////////////////////////////////////////////////////////////////

#ifndef __APPS_INCLUDE_GRAPHICS_SLCD_H
#define __APPS_INCLUDE_GRAPHICS_SLCD_H 1
#define __APPS_INCLUDE_GRAPHICS_SLCD_H

/////////////////////////////////////////////////////////////////////////////
// Included Files
Expand Down
2 changes: 1 addition & 1 deletion include/graphics/twm4nx/ciconmgr.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -336,4 +336,4 @@ namespace Twm4Nx
// Public Function Prototypes
/////////////////////////////////////////////////////////////////////////////

#endif // __APPS_INCLUDE_GRAPHICS_TWM4NX_CICONMGR_HXX
#endif // __APPS_INCLUDE_GRAPHICS_TWM4NX_CICONMGR_HXX
2 changes: 1 addition & 1 deletion include/graphics/twm4nx/cmenus.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -355,4 +355,4 @@ namespace Twm4Nx
};
}

#endif // __APPS_INCLUDE_GRAPHICS_TWM4NX_CMENUS_HXX
#endif // __APPS_INCLUDE_GRAPHICS_TWM4NX_CMENUS_HXX
2 changes: 1 addition & 1 deletion include/graphics/twm4nx/cresize.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -295,4 +295,4 @@ namespace Twm4Nx
};
}

#endif // __APPS_INCLUDE_GRAPHICS_TWM4NX_CRESIZE_HXX
#endif // __APPS_INCLUDE_GRAPHICS_TWM4NX_CRESIZE_HXX
2 changes: 1 addition & 1 deletion include/graphics/twm4nx/cwindow.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -943,4 +943,4 @@ namespace Twm4Nx
uint8_t flags);
}

#endif // __APPS_INCLUDE_GRAPHICS_TWM4NX_CWINDOW_HXX
#endif // __APPS_INCLUDE_GRAPHICS_TWM4NX_CWINDOW_HXX
2 changes: 1 addition & 1 deletion include/graphics/twm4nx/cwindowfactory.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -309,4 +309,4 @@ namespace Twm4Nx
};
}

#endif // __APPS_INCLUDE_GRAPHICS_TWM4NX_CWINDOWFACTORY_HXX
#endif // __APPS_INCLUDE_GRAPHICS_TWM4NX_CWINDOWFACTORY_HXX
4 changes: 2 additions & 2 deletions include/graphics/twm4nx/twm4nx_cursor.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,5 @@ namespace Twm4Nx
// Public Function Prototypes
/////////////////////////////////////////////////////////////////////////////

#endif // CONFIG_NX_SWCURSOR
#endif // __APPS_INCLUDE_GRAPHICS_TWM4NX_TWM4NX_CURSOR_HXX
#endif // CONFIG_NX_SWCURSOR
#endif // __APPS_INCLUDE_GRAPHICS_TWM4NX_TWM4NX_CURSOR_HXX
2 changes: 1 addition & 1 deletion include/netutils/httpd.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
* for the thread. Use a default if the user provided no stacksize.
*/

#ifndef CONFIG_NETUTILS_HTTPDSTACKSIZE
#ifndef CONFIG_NETUTILS_HTTPDSTACKSIZE
# define CONFIG_NETUTILS_HTTPDSTACKSIZE 4096
#endif

Expand Down
2 changes: 1 addition & 1 deletion include/netutils/ntpclient.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
****************************************************************************/

#ifndef __APPS_INCLUDE_NETUTILS_NTPCLIENT_H
#define __APPS_INCLUDE_NETUTILS_NTPCLIENT_H 1
#define __APPS_INCLUDE_NETUTILS_NTPCLIENT_H

/****************************************************************************
* Included Files
Expand Down
2 changes: 1 addition & 1 deletion include/netutils/telnetc.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
*/

#ifndef __APPS_INCLUDE_NETUTILS_TELNETC_H
#define __APPS_INCLUDE_NETUTILS_TELNETC_H 1
#define __APPS_INCLUDE_NETUTILS_TELNETC_H

/****************************************************************************
* Included Files
Expand Down
2 changes: 1 addition & 1 deletion include/system/nxplayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
****************************************************************************/

#ifndef __APPS_INCLUDE_SYSTEM_NXPLAYER_H
#define __APPS_INCLUDE_SYSTEM_NXPLAYER_H 1
#define __APPS_INCLUDE_SYSTEM_NXPLAYER_H

/****************************************************************************
* Included Files
Expand Down
2 changes: 1 addition & 1 deletion include/system/nxrecorder.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
****************************************************************************/

#ifndef __APPS_INCLUDE_SYSTEM_NXRECORDER_H
#define __APPS_INCLUDE_SYSTEM_NXRECORDER_H 1
#define __APPS_INCLUDE_SYSTEM_NXRECORDER_H

/****************************************************************************
* Included Files
Expand Down
2 changes: 1 addition & 1 deletion include/testing/unity_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
/* Exclude setjmp */

#ifdef CONFIG_TESTING_UNITY_EXCLUDE_SETJMP
# define UNITY_EXCLUDE_SETJMP_H 1
# define UNITY_EXCLUDE_SETJMP_H
#endif

/* Enable output coloring */
Expand Down
6 changes: 3 additions & 3 deletions interpreters/bas/bas_token.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ typedef unsigned int flex_uint32_t;

#define YY_USE_CONST

#endif /* defined (__STDC__) */
#endif /* ! __cplusplus */
#endif /* defined (__STDC__) */
#endif /* ! __cplusplus */

#ifdef YY_USE_CONST
#define yyconst const
Expand Down Expand Up @@ -4110,7 +4110,7 @@ static int yy_get_next_buffer (void)

return c;
}
#endif /* ifndef YY_NO_INPUT */
#endif /* ifndef YY_NO_INPUT */

/** Immediately switch to a different input stream.
* @param input_file A readable stream.
Expand Down
2 changes: 1 addition & 1 deletion modbus/nuttx/portevent_m.c
Original file line number Diff line number Diff line change
Expand Up @@ -309,4 +309,4 @@ eMBMasterReqErrCode eMBMasterWaitRequestFinish(void)
return eErrStatus;
}

#endif /* defined(CONFIG_MB_RTU_MASTER) || defined(CONFIG_MB_ASCII_MASTER) */
#endif /* defined(CONFIG_MB_RTU_MASTER) || defined(CONFIG_MB_ASCII_MASTER) */
2 changes: 1 addition & 1 deletion netutils/ntpclient/ntpv3.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
****************************************************************************/

#ifndef __APPS_NETUTILS_NTPCLIENT_NTPV3_H
#define __APPS_NETUTILS_NTPCLIENT_NTPV3_H 1
#define __APPS_NETUTILS_NTPCLIENT_NTPV3_H

/****************************************************************************
* Included Files
Expand Down
2 changes: 1 addition & 1 deletion netutils/thttpd/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,6 @@
# ifdef CONFIG_CPP_HAVE_WARNING
# warning "THTTPD not built because dependencies not selected in configuration"
# endif
#endif /* Dependencies not provided */
#endif /* Dependencies not provided */

#endif /* __NETUTILS_THTTPD_CONFIG_H */
6 changes: 3 additions & 3 deletions netutils/thttpd/libhttpd.c
Original file line number Diff line number Diff line change
Expand Up @@ -2049,7 +2049,7 @@ static int sockaddr_check(httpd_sockaddr *saP)
case AF_INET:
return 1;

#ifdef CONFIG_NET_IPv6
#ifdef CONFIG_NET_IPv6
case AF_INET6:
return 1;
#endif
Expand All @@ -2067,7 +2067,7 @@ static size_t sockaddr_len(httpd_sockaddr *saP)
case AF_INET:
return sizeof(struct sockaddr_in);

#ifdef CONFIG_NET_IPv6
#ifdef CONFIG_NET_IPv6
case AF_INET6:
return sizeof(struct sockaddr_in6);
#endif
Expand Down Expand Up @@ -3424,7 +3424,7 @@ int httpd_start_request(httpd_conn *hc, struct timeval *nowP)

char *httpd_ntoa(httpd_sockaddr *saP)
{
#ifdef CONFIG_NET_IPv6
#ifdef CONFIG_NET_IPv6
static char str[200];

if (getnameinfo
Expand Down
2 changes: 1 addition & 1 deletion netutils/thttpd/libhttpd.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@

/* A multi-family sockaddr. */

#ifdef CONFIG_NET_IPv6
#ifdef CONFIG_NET_IPv6
typedef struct sockaddr_in6 httpd_sockaddr;
#else
typedef struct sockaddr_in httpd_sockaddr;
Expand Down
2 changes: 1 addition & 1 deletion netutils/thttpd/tdate_parse.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@

extern time_t tdate_parse(char *str);

#endif /* __NETUTILS_TDATE_PARSE_H */
#endif /* __NETUTILS_TDATE_PARSE_H */
2 changes: 1 addition & 1 deletion netutils/thttpd/thttpd.c
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@ int thttpd_main(int argc, char **argv)

/* Setup host address */

#ifdef CONFIG_NET_IPv6
#ifdef CONFIG_NET_IPv6
# error "IPv6 support not yet implemented"
#else
sa.sin_family = AF_INET;
Expand Down
2 changes: 1 addition & 1 deletion nshlib/nsh.h
Original file line number Diff line number Diff line change
Expand Up @@ -1020,7 +1020,7 @@ int cmd_irqinfo(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv);
# ifndef CONFIG_NSH_DISABLE_SH
int cmd_sh(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv);
# endif
#endif /* CONFIG_NFILE_STREAMS && !CONFIG_NSH_DISABLESCRIPT */
#endif /* CONFIG_NFILE_STREAMS && !CONFIG_NSH_DISABLESCRIPT */

#ifdef NSH_HAVE_DIROPTS
# ifndef CONFIG_NSH_DISABLE_MKDIR
Expand Down
2 changes: 1 addition & 1 deletion nshlib/nsh_timcmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
* Private Data
****************************************************************************/

#ifndef CONFIG_NSH_DISABLE_DATE
#ifndef CONFIG_NSH_DISABLE_DATE
static FAR const char * const g_datemontab[] =
{
"jan", "feb", "mar", "apr", "may", "jun",
Expand Down
2 changes: 1 addition & 1 deletion platform/mikroe-stm32f4/mikroe_configdata.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ int platform_setconfig(enum config_data_e id, int instance,

#else
break;
#endif /* CONFIG_MIKROE_STM32F4_CONFIGDATA_ROM */
#endif /* CONFIG_MIKROE_STM32F4_CONFIGDATA_ROM */

default:
break;
Expand Down
Loading

0 comments on commit 1154735

Please sign in to comment.