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)
{
uint16_t val16;
#if CONFIG_DEBUG_TIFFOFFSETS
#ifdef CONFIG_DEBUG_TIFFOFFSETS
off_t offset = 0;
#endif
char timbuf[TIFF_DATETIME_STRLEN + 8];

View File

@ -411,7 +411,7 @@ static const struct cmdmap_s g_cmdmap[] =
#endif
#ifndef CONFIG_NSH_DISABLE_UNAME
#if CONFIG_NET
#ifdef CONFIG_NET
{ "uname", cmd_uname, 1, 7, "[-a | -imnoprsv]" },
#else
{ "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;
break;
#if CONFIG_NET
#ifdef CONFIG_NET
case 'n':
set |= UNAME_NODE;
break;
@ -332,7 +332,7 @@ int cmd_uname(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
str = info.sysname;
break;
#if CONFIG_NET
#ifdef CONFIG_NET
case 1: /* Print noname */
str = info.nodename;
break;

View File

@ -111,7 +111,7 @@ int platform_setconfig(enum config_data_e id, int instance,
#ifdef CONFIG_MIKROE_STM32F4_CONFIGDATA_FS
FILE* fd;
#endif
#if CONFIG_MIKROE_STM32F4_CONFIGDATA_PART
#ifdef CONFIG_MIKROE_STM32F4_CONFIGDATA_PART
struct config_data_s config;
int ret;
int fd;
@ -166,7 +166,7 @@ int platform_setconfig(enum config_data_e id, int instance,
fclose(fd);
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. */
@ -224,13 +224,13 @@ int platform_getconfig(enum config_data_e id, int instance,
size_t bytes;
enum config_data_e saved_id;
int saved_instance;
#elif CONFIG_MIKROE_STM32F4_CONFIGDATA_ROM
#elif defined(CONFIG_MIKROE_STM32F4_CONFIGDATA_ROM)
static const uint8_t touch_cal_data[] = {
0x9a, 0x2f, 0x00, 0x00,
0x40, 0xbc, 0x69, 0xfe, 0x70, 0x2e, 0x00,
0x00, 0xb8, 0x2d, 0xdb, 0xff };
#endif
#if CONFIG_MIKROE_STM32F4_CONFIGDATA_PART
#ifdef CONFIG_MIKROE_STM32F4_CONFIGDATA_PART
struct config_data_s config;
int ret;
int fd;
@ -298,7 +298,7 @@ int platform_getconfig(enum config_data_e id, int instance,
return OK;
#elif CONFIG_MIKROE_STM32F4_CONFIGDATA_ROM
#elif defined(CONFIG_MIKROE_STM32F4_CONFIGDATA_ROM)
memcpy(configdata, touch_cal_data, datalen);
return OK;

View File

@ -751,7 +751,7 @@ int conn_main(int argc, char *argv[])
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,
* 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';
return nbytes;
}
#elif CONFIG_EOL_IS_EITHER_CRLF
#elif defined(CONFIG_EOL_IS_EITHER_CRLF)
if (ch == '\n' || ch == '\r')
{
*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')
#elif defined(CONFIG_EOL_IS_CR)
else if (ch == '\r')
#elif CONFIG_EOL_IS_EITHER_CRLF
#elif defined(CONFIG_EOL_IS_EITHER_CRLF)
else if (ch == '\n' || ch == '\r')
#endif
{