Merged in paulpatience/nuttx-apps (pull request #5)

Correct #if to #ifdef when the macro can be undefined
This commit is contained in:
Gregory Nutt 2015-09-01 12:31:59 -06:00
commit 1f7a8d2f8d
7 changed files with 12 additions and 12 deletions

View File

@ -450,7 +450,7 @@ static int tiff_datetime(FAR char *timbuf, unsigned int buflen)
int tiff_initialize(FAR struct tiff_info_s *info) int tiff_initialize(FAR struct tiff_info_s *info)
{ {
uint16_t val16; uint16_t val16;
#if CONFIG_DEBUG_TIFFOFFSETS #ifdef CONFIG_DEBUG_TIFFOFFSETS
off_t offset = 0; off_t offset = 0;
#endif #endif
char timbuf[TIFF_DATETIME_STRLEN + 8]; char timbuf[TIFF_DATETIME_STRLEN + 8];

View File

@ -411,7 +411,7 @@ static const struct cmdmap_s g_cmdmap[] =
#endif #endif
#ifndef CONFIG_NSH_DISABLE_UNAME #ifndef CONFIG_NSH_DISABLE_UNAME
#if CONFIG_NET #ifdef CONFIG_NET
{ "uname", cmd_uname, 1, 7, "[-a | -imnoprsv]" }, { "uname", cmd_uname, 1, 7, "[-a | -imnoprsv]" },
#else #else
{ "uname", cmd_uname, 1, 7, "[-a | -imoprsv]" }, { "uname", cmd_uname, 1, 7, "[-a | -imoprsv]" },

View File

@ -255,7 +255,7 @@ int cmd_uname(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
set |= UNAME_KERNEL; set |= UNAME_KERNEL;
break; break;
#if CONFIG_NET #ifdef CONFIG_NET
case 'n': case 'n':
set |= UNAME_NODE; set |= UNAME_NODE;
break; break;
@ -332,7 +332,7 @@ int cmd_uname(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
str = info.sysname; str = info.sysname;
break; break;
#if CONFIG_NET #ifdef CONFIG_NET
case 1: /* Print noname */ case 1: /* Print noname */
str = info.nodename; str = info.nodename;
break; break;

View File

@ -111,7 +111,7 @@ int platform_setconfig(enum config_data_e id, int instance,
#ifdef CONFIG_MIKROE_STM32F4_CONFIGDATA_FS #ifdef CONFIG_MIKROE_STM32F4_CONFIGDATA_FS
FILE* fd; FILE* fd;
#endif #endif
#if CONFIG_MIKROE_STM32F4_CONFIGDATA_PART #ifdef CONFIG_MIKROE_STM32F4_CONFIGDATA_PART
struct config_data_s config; struct config_data_s config;
int ret; int ret;
int fd; int fd;
@ -166,7 +166,7 @@ int platform_setconfig(enum config_data_e id, int instance,
fclose(fd); fclose(fd);
return OK; return OK;
#elif CONFIG_MIKROE_STM32F4_CONFIGDATA_ROM #elif defined(CONFIG_MIKROE_STM32F4_CONFIGDATA_ROM)
/* We are reading from a read-only system, so nothing to do. */ /* We are reading from a read-only system, so nothing to do. */
@ -224,13 +224,13 @@ int platform_getconfig(enum config_data_e id, int instance,
size_t bytes; size_t bytes;
enum config_data_e saved_id; enum config_data_e saved_id;
int saved_instance; int saved_instance;
#elif CONFIG_MIKROE_STM32F4_CONFIGDATA_ROM #elif defined(CONFIG_MIKROE_STM32F4_CONFIGDATA_ROM)
static const uint8_t touch_cal_data[] = { static const uint8_t touch_cal_data[] = {
0x9a, 0x2f, 0x00, 0x00, 0x9a, 0x2f, 0x00, 0x00,
0x40, 0xbc, 0x69, 0xfe, 0x70, 0x2e, 0x00, 0x40, 0xbc, 0x69, 0xfe, 0x70, 0x2e, 0x00,
0x00, 0xb8, 0x2d, 0xdb, 0xff }; 0x00, 0xb8, 0x2d, 0xdb, 0xff };
#endif #endif
#if CONFIG_MIKROE_STM32F4_CONFIGDATA_PART #ifdef CONFIG_MIKROE_STM32F4_CONFIGDATA_PART
struct config_data_s config; struct config_data_s config;
int ret; int ret;
int fd; int fd;
@ -298,7 +298,7 @@ int platform_getconfig(enum config_data_e id, int instance,
return OK; return OK;
#elif CONFIG_MIKROE_STM32F4_CONFIGDATA_ROM #elif defined(CONFIG_MIKROE_STM32F4_CONFIGDATA_ROM)
memcpy(configdata, touch_cal_data, datalen); memcpy(configdata, touch_cal_data, datalen);
return OK; return OK;

View File

@ -751,7 +751,7 @@ int conn_main(int argc, char *argv[])
check_test_memory_usage("After composite_initialize()"); check_test_memory_usage("After composite_initialize()");
#if CONFIG_USBDEV_TRACE && CONFIG_USBDEV_TRACE_INITIALIDSET != 0 #if defined(CONFIG_USBDEV_TRACE) && CONFIG_USBDEV_TRACE_INITIALIDSET != 0
/* If USB tracing is enabled and tracing of initial USB events is specified, /* If USB tracing is enabled and tracing of initial USB events is specified,
* then dump all collected trace data to stdout * then dump all collected trace data to stdout
*/ */

View File

@ -299,7 +299,7 @@ static int readstream(FAR struct lib_instream_s *instream,
*line = '\0'; *line = '\0';
return nbytes; return nbytes;
} }
#elif CONFIG_EOL_IS_EITHER_CRLF #elif defined(CONFIG_EOL_IS_EITHER_CRLF)
if (ch == '\n' || ch == '\r') if (ch == '\n' || ch == '\r')
{ {
*line = '\0'; *line = '\0';

View File

@ -598,7 +598,7 @@ ssize_t readline_common(FAR struct rl_common_s *vtbl, FAR char *buf, int buflen)
else if (ch == '\n') else if (ch == '\n')
#elif defined(CONFIG_EOL_IS_CR) #elif defined(CONFIG_EOL_IS_CR)
else if (ch == '\r') else if (ch == '\r')
#elif CONFIG_EOL_IS_EITHER_CRLF #elif defined(CONFIG_EOL_IS_EITHER_CRLF)
else if (ch == '\n' || ch == '\r') else if (ch == '\n' || ch == '\r')
#endif #endif
{ {