9
0
Fork 0

Changing NuttX fixed size type names to C99 standard names -- things will be broken for awhile

git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@2351 7fd9a85b-ad96-42d3-883c-3090e2eb8679
This commit is contained in:
patacongo 2009-12-15 19:00:40 +00:00
parent 7d475527aa
commit 38a5f26e41
52 changed files with 348 additions and 349 deletions

View File

@ -38,7 +38,8 @@
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdint.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <net/if.h>
@ -104,7 +105,7 @@ int user_start(int argc, char *argv[])
{
struct in_addr addr;
#if defined(CONFIG_EXAMPLE_DHCPD_NOMAC)
uint8 mac[IFHWADDRLEN];
uint8_t mac[IFHWADDRLEN];
#endif
/* Many embedded network interfaces must have a software assigned MAC */

View File

@ -1,7 +1,7 @@
/****************************************************************************
* mount_main.c
*
* Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
* Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@ -38,7 +38,6 @@
****************************************************************************/
#include <sys/mount.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/statfs.h>

View File

@ -1,7 +1,7 @@
/****************************************************************************
* examples/mount/ramdisk.c
*
* Copyright (C) 2008 Gregory Nutt. All rights reserved.
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@ -39,7 +39,7 @@
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@ -116,7 +116,7 @@ int create_ramdisk(void)
pbuffer,
CONFIG_EXAMPLES_MOUNT_NSECTORS,
CONFIG_EXAMPLES_MOUNT_SECTORSIZE,
TRUE);
true);
if (ret < 0)
{
printf("create_ramdisk: Failed to register ramdisk at %s: %d\n",

View File

@ -38,6 +38,8 @@
****************************************************************************/
#include <nuttx/config.h>
#include <stdint.h>
#include <stdio.h>
#include <debug.h>
@ -80,7 +82,7 @@ int user_start(int argc, char *argv[])
{
struct in_addr addr;
#if defined(CONFIG_EXAMPLE_NETTEST_NOMAC)
uint8 mac[IFHWADDRLEN];
uint8_t mac[IFHWADDRLEN];
#endif
/* Many embedded network interfaces must have a software assigned MAC */

View File

@ -37,7 +37,6 @@
* Included Files
****************************************************************************/
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>

View File

@ -1,7 +1,7 @@
/****************************************************************************
* examples/nsh/nsh.h
*
* Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
* Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@ -41,6 +41,11 @@
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdint.h>
#include <stdbool.h>
#ifdef CONFIG_EXAMPLES_NSH_CONSOLE
# include <stdio.h>
#endif
@ -179,7 +184,7 @@
/* Size of info to be saved in call to nsh_redirect */
#define SAVE_SIZE (sizeof(int) + sizeof(FILE*) + sizeof(boolean))
#define SAVE_SIZE (sizeof(int) + sizeof(FILE*) + sizeof(bool))
/* Stubs used when working directory is not supported */
@ -202,24 +207,24 @@ enum nsh_parser_e
struct nsh_state_s
{
ubyte ns_ifcond : 1; /* Value of command in 'if' statement */
ubyte ns_disabled : 1; /* TRUE: Unconditionally disabled */
ubyte ns_unused : 4;
ubyte ns_state : 2; /* Parser state (see enum nsh_parser_e) */
uint8_t ns_ifcond : 1; /* Value of command in 'if' statement */
uint8_t ns_disabled : 1; /* TRUE: Unconditionally disabled */
uint8_t ns_unused : 4;
uint8_t ns_state : 2; /* Parser state (see enum nsh_parser_e) */
};
struct nsh_parser_s
{
#ifndef CONFIG_EXAMPLES_NSH_DISABLEBG
boolean np_bg; /* TRUE: The last command executed in background */
bool np_bg; /* true: The last command executed in background */
#endif
boolean np_redirect; /* TRUE: Output from the last command was re-directed */
boolean np_fail; /* TRUE: The last command failed */
bool np_redirect; /* true: Output from the last command was re-directed */
bool np_fail; /* true: The last command failed */
#ifndef CONFIG_EXAMPLES_NSH_DISABLESCRIPT
ubyte np_ndx; /* Current index into np_st[] */
uint8_t np_ndx; /* Current index into np_st[] */
#endif
#ifndef CONFIG_EXAMPLES_NSH_DISABLEBG
int np_nice; /* "nice" value applied to last background cmd */
int np_nice; /* "nice" value applied to last background cmd */
#endif
/* This is a stack of parser state information. It supports nested
@ -246,8 +251,8 @@ struct nsh_vtbl_s
#endif
int (*output)(FAR struct nsh_vtbl_s *vtbl, const char *fmt, ...);
FAR char *(*linebuffer)(FAR struct nsh_vtbl_s *vtbl);
void (*redirect)(FAR struct nsh_vtbl_s *vtbl, int fd, FAR ubyte *save);
void (*undirect)(FAR struct nsh_vtbl_s *vtbl, FAR ubyte *save);
void (*redirect)(FAR struct nsh_vtbl_s *vtbl, int fd, FAR uint8_t *save);
void (*undirect)(FAR struct nsh_vtbl_s *vtbl, FAR uint8_t *save);
void (*exit)(FAR struct nsh_vtbl_s *vtbl);
/* Parser state data */
@ -325,7 +330,7 @@ extern void nsh_freefullpath(char *relpath);
/* Debug */
extern void nsh_dumpbuffer(FAR struct nsh_vtbl_s *vtbl, const char *msg,
const ubyte *buffer, ssize_t nbytes);
const uint8_t *buffer, ssize_t nbytes);
/* Shell command handlers */

View File

@ -1,7 +1,7 @@
/****************************************************************************
* examples/nsh/dbg_proccmds.c
*
* Copyright (C) 2008 Gregory Nutt. All rights reserved.
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@ -38,8 +38,10 @@
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <sys/types.h>
#include <stdint.h>
#include <stdbool.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
@ -57,9 +59,9 @@
struct dbgmem_s
{
boolean dm_write; /* TRUE: perfrom write operation */
bool dm_write; /* true: perfrom write operation */
void *dm_addr; /* Address to access */
uint32 dm_value; /* Value to write */
uint32_t dm_value; /* Value to write */
unsigned int dm_count; /* The number of bytes to access */
};
@ -102,12 +104,12 @@ int mem_parse(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv,
return -EINVAL;
}
mem->dm_write = TRUE;
mem->dm_value = (uint32)lvalue;
mem->dm_write = true;
mem->dm_value = (uint32_t)lvalue;
}
else
{
mem->dm_write = FALSE;
mem->dm_write = false;
mem->dm_value = 0;
}
@ -140,7 +142,7 @@ int mem_parse(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv,
int cmd_mb(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
{
struct dbgmem_s mem;
volatile ubyte *ptr;
volatile uint8_t *ptr;
int ret;
int i;
@ -149,7 +151,7 @@ int cmd_mb(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
{
/* Loop for the number of requested bytes */
for (i = 0, ptr = (volatile ubyte*)mem.dm_addr; i < mem.dm_count; i++, ptr++)
for (i = 0, ptr = (volatile uint8_t*)mem.dm_addr; i < mem.dm_count; i++, ptr++)
{
/* Print the value at the address */
@ -172,7 +174,7 @@ int cmd_mb(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
* value read might not necessarily be the value written).
*/
*ptr = (ubyte)mem.dm_value;
*ptr = (uint8_t)mem.dm_value;
nsh_output(vtbl, " -> 0x%02x", *ptr);
}
@ -193,7 +195,7 @@ int cmd_mb(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
int cmd_mh(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
{
struct dbgmem_s mem;
volatile uint16 *ptr;
volatile uint16_t *ptr;
int ret;
int i;
@ -202,7 +204,7 @@ int cmd_mh(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
{
/* Loop for the number of requested bytes */
for (i = 0, ptr = (volatile uint16*)mem.dm_addr; i < mem.dm_count; i += 2, ptr++)
for (i = 0, ptr = (volatile uint16_t*)mem.dm_addr; i < mem.dm_count; i += 2, ptr++)
{
/* Print the value at the address */
@ -225,7 +227,7 @@ int cmd_mh(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
* value read might not necessarily be the value written).
*/
*ptr = (uint16)mem.dm_value;
*ptr = (uint16_t)mem.dm_value;
nsh_output(vtbl, " -> 0x%04x", *ptr);
}
@ -246,7 +248,7 @@ int cmd_mh(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
int cmd_mw(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
{
struct dbgmem_s mem;
volatile uint32 *ptr;
volatile uint32_t *ptr;
int ret;
int i;
@ -255,7 +257,7 @@ int cmd_mw(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
{
/* Loop for the number of requested bytes */
for (i = 0, ptr = (volatile uint32*)mem.dm_addr; i < mem.dm_count; i += 4, ptr++)
for (i = 0, ptr = (volatile uint32_t*)mem.dm_addr; i < mem.dm_count; i += 4, ptr++)
{
/* Print the value at the address */
@ -312,7 +314,7 @@ int cmd_mem(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
****************************************************************************/
void nsh_dumpbuffer(FAR struct nsh_vtbl_s *vtbl, const char *msg,
const ubyte *buffer, ssize_t nbytes)
const uint8_t *buffer, ssize_t nbytes)
{
char line[128];
int ch;
@ -371,7 +373,7 @@ int cmd_xd(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
return ERROR;
}
nsh_dumpbuffer(vtbl, "Hex dump", (ubyte*)addr, nbytes);
nsh_dumpbuffer(vtbl, "Hex dump", (uint8_t*)addr, nbytes);
return OK;
}
#endif

View File

@ -1,7 +1,7 @@
/****************************************************************************
* examples/nsh/nsh_ddcmd.c
*
* Copyright (C) 2008, 2009 Gregory Nutt. All rights reserved.
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@ -41,7 +41,8 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <stdint.h>
#include <stdbool.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
@ -119,16 +120,16 @@ struct dd_s
int fd; /* File descriptor of the character device */
} outf;
#else
int outfd; /* File descriptor of the output device */
int outfd; /* File descriptor of the output device */
#endif
uint32 nsectors; /* Number of sectors to transfer */
uint32 sector; /* The current sector number */
uint32 skip; /* The number of sectors skipped on input */
boolean eof; /* TRUE: The of the input or output file has been hit */
uint16 sectsize; /* Size of one sector */
uint16 nbytes; /* Number of valid bytes in the buffer */
ubyte *buffer; /* Buffer of data to write to the output file */
uint32_t nsectors; /* Number of sectors to transfer */
uint32_t sector; /* The current sector number */
uint32_t skip; /* The number of sectors skipped on input */
bool eof; /* true: The of the input or output file has been hit */
uint16_t sectsize; /* Size of one sector */
uint16_t nbytes; /* Number of valid bytes in the buffer */
uint8_t *buffer; /* Buffer of data to write to the output file */
/* Function pointers to handle differences between block and character devices */
@ -220,7 +221,7 @@ static int dd_writeblk(struct dd_s *dd)
if (nbytes == -EFBIG)
{
dd->eof = TRUE; /* Set end-of-file */
dd->eof = true; /* Set end-of-file */
}
else
{
@ -240,8 +241,8 @@ static int dd_writeblk(struct dd_s *dd)
static int dd_writech(struct dd_s *dd)
{
ubyte *buffer = dd->buffer;
uint16 written ;
uint8_t *buffer = dd->buffer;
uint16_t written ;
ssize_t nbytes;
/* Is the out buffer full (or is this the last one)? */
@ -297,7 +298,7 @@ static int dd_readblk(struct dd_s *dd)
static int dd_readch(struct dd_s *dd)
{
ubyte *buffer = dd->buffer;
uint8_t *buffer = dd->buffer;
ssize_t nbytes;
dd->nbytes = 0;
@ -338,7 +339,7 @@ static int dd_filetype(const char *filename)
return ERROR; /* Return -1 on failure */
}
return S_ISBLK(sb.st_mode); /* Return TRUE(1) if block, FALSE(0) if char */
return S_ISBLK(sb.st_mode); /* Return true(1) if block, false(0) if char */
}
#endif
@ -378,7 +379,7 @@ static inline int dd_infopen(const char *name, struct dd_s *dd)
}
else
{
ret = bchlib_setup(name, TRUE, &DD_INHANDLE);
ret = bchlib_setup(name, true, &DD_INHANDLE);
if (ret < 0)
{
return ERROR;
@ -419,9 +420,9 @@ static inline int dd_outfopen(const char *name, struct dd_s *dd)
/* Open the block driver for input */
if (type == TRUE)
if (type == true)
{
ret = bchlib_setup(name, TRUE, &DD_OUTHANDLE);
ret = bchlib_setup(name, true, &DD_OUTHANDLE);
if (ret < 0)
{
return ERROR;

View File

@ -1,7 +1,7 @@
/****************************************************************************
* nsh_envcmds.c
*
* Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
* Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@ -38,7 +38,6 @@
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>

View File

@ -38,7 +38,10 @@
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdint.h>
#include <stdbool.h>
#if CONFIG_NFILE_DESCRIPTORS > 0
# include <sys/stat.h>
@ -655,13 +658,13 @@ errout:
#ifndef CONFIG_EXAMPLES_NSH_DISABLE_LOSETUP
int cmd_losetup(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
{
char *loopdev = NULL;
char *filepath = NULL;
boolean teardown = FALSE;
boolean readonly = FALSE;
off_t offset = 0;
int ret = ERROR;
int option;
char *loopdev = NULL;
char *filepath = NULL;
bool teardown = false;
bool readonly = false;
off_t offset = 0;
int ret = ERROR;
int option;
/* Get the losetup options: Two forms are supported:
*
@ -678,7 +681,7 @@ int cmd_losetup(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
{
case 'd':
loopdev = nsh_getfullpath(vtbl, optarg);
teardown = TRUE;
teardown = true;
break;
case 'o':
@ -686,7 +689,7 @@ int cmd_losetup(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
break;
case 'r':
readonly = TRUE;
readonly = true;
break;
case '?':
@ -938,8 +941,8 @@ int cmd_mkfifo(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
int cmd_mkrd(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
{
const char *fmt;
ubyte *buffer;
uint32 nsectors;
uint8_t *buffer;
uint32_t nsectors;
int sectsize = 512;
int minor = 0;
int ret;
@ -984,7 +987,7 @@ int cmd_mkrd(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
if (optind == argc-1)
{
nsectors = (uint32)atoi(argv[optind]);
nsectors = (uint32_t)atoi(argv[optind]);
}
else if (optind >= argc)
{
@ -999,7 +1002,7 @@ int cmd_mkrd(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
/* Allocate the memory backing up the ramdisk */
buffer = (ubyte*)malloc(sectsize * nsectors);
buffer = (uint8_t*)malloc(sectsize * nsectors);
if (!buffer)
{
fmt = g_fmtcmdoutofmemory;
@ -1013,7 +1016,7 @@ int cmd_mkrd(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
/* Then register the ramdisk */
ret = ramdisk_register(minor, buffer, nsectors, sectsize, TRUE);
ret = ramdisk_register(minor, buffer, nsectors, sectsize, true);
if (ret < 0)
{
nsh_output(vtbl, g_fmtcmdfailed, argv[0], "ramdisk_register", NSH_ERRNO_OF(-ret));

View File

@ -1,7 +1,7 @@
/****************************************************************************
* examples/nsh/nsh_main.c
*
* Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
* Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@ -38,9 +38,10 @@
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/stat.h>
#include <stdint.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
@ -92,8 +93,8 @@ struct cmdmap_s
{
const char *cmd; /* Name of the command */
cmd_t handler; /* Function that handles the command */
ubyte minargs; /* Minimum number of arguments (including command) */
ubyte maxargs; /* Maximum number of arguments (including command) */
uint8_t minargs; /* Minimum number of arguments (including command) */
uint8_t maxargs; /* Maximum number of arguments (including command) */
const char *usage; /* Usage instructions for 'help' command */
};
@ -574,7 +575,7 @@ char *nsh_argument(FAR struct nsh_vtbl_s *vtbl, char **saveptr)
char *pend = NULL;
const char *term;
#ifndef CONFIG_DISABLE_ENVIRON
boolean quoted = FALSE;
bool quoted = false;
#endif
/* Find the beginning of the next token */
@ -632,7 +633,7 @@ char *nsh_argument(FAR struct nsh_vtbl_s *vtbl, char **saveptr)
pbegin++;
term = "\"";
#ifndef CONFIG_DISABLE_ENVIRON
quoted = TRUE;
quoted = true;
#endif
}
else
@ -710,10 +711,10 @@ char *nsh_argument(FAR struct nsh_vtbl_s *vtbl, char **saveptr)
****************************************************************************/
#ifndef CONFIG_EXAMPLES_NSH_DISABLESCRIPT
static inline boolean nsh_cmdenabled(FAR struct nsh_vtbl_s *vtbl)
static inline bool nsh_cmdenabled(FAR struct nsh_vtbl_s *vtbl)
{
struct nsh_parser_s *np = &vtbl->np;
boolean ret = !np->np_st[np->np_ndx].ns_disabled;
bool ret = !np->np_st[np->np_ndx].ns_disabled;
if (ret)
{
switch (np->np_st[np->np_ndx].ns_state)
@ -745,7 +746,7 @@ static inline int nsh_ifthenelse(FAR struct nsh_vtbl_s *vtbl, FAR char **ppcmd,
{
struct nsh_parser_s *np = &vtbl->np;
FAR char *cmd = *ppcmd;
boolean disabled;
bool disabled;
if (cmd)
{
@ -786,7 +787,7 @@ static inline int nsh_ifthenelse(FAR struct nsh_vtbl_s *vtbl, FAR char **ppcmd,
np->np_ndx++;
np->np_st[np->np_ndx].ns_state = NSH_PARSER_IF;
np->np_st[np->np_ndx].ns_disabled = disabled;
np->np_st[np->np_ndx].ns_ifcond = FALSE;
np->np_st[np->np_ndx].ns_ifcond = false;
}
else if (strcmp(cmd, "then") == 0)
{
@ -869,8 +870,8 @@ static inline int nsh_ifthenelse(FAR struct nsh_vtbl_s *vtbl, FAR char **ppcmd,
errout:
np->np_ndx = 0;
np->np_st[0].ns_state = NSH_PARSER_NORMAL;
np->np_st[0].ns_disabled = FALSE;
np->np_st[0].ns_ifcond = FALSE;
np->np_st[0].ns_disabled = false;
np->np_st[0].ns_ifcond = false;
return ERROR;
}
#endif
@ -879,14 +880,14 @@ errout:
* Name: nsh_saveresult
****************************************************************************/
static inline int nsh_saveresult(FAR struct nsh_vtbl_s *vtbl, boolean result)
static inline int nsh_saveresult(FAR struct nsh_vtbl_s *vtbl, bool result)
{
struct nsh_parser_s *np = &vtbl->np;
#ifndef CONFIG_EXAMPLES_NSH_DISABLESCRIPT
if (np->np_st[np->np_ndx].ns_state == NSH_PARSER_IF)
{
np->np_fail = FALSE;
np->np_fail = false;
np->np_st[np->np_ndx].ns_ifcond = result;
return OK;
}
@ -1041,9 +1042,9 @@ int nsh_parse(FAR struct nsh_vtbl_s *vtbl, char *cmdline)
memset(argv, 0, MAX_ARGV_ENTRIES*sizeof(FAR char *));
#ifndef CONFIG_EXAMPLES_NSH_DISABLEBG
vtbl->np.np_bg = FALSE;
vtbl->np.np_bg = false;
#endif
vtbl->np.np_redirect = FALSE;
vtbl->np.np_redirect = false;
/* Parse out the command at the beginning of the line */
@ -1115,7 +1116,7 @@ int nsh_parse(FAR struct nsh_vtbl_s *vtbl, char *cmdline)
#ifndef CONFIG_EXAMPLES_NSH_DISABLEBG
if (argc > 1 && strcmp(argv[argc-1], "&") == 0)
{
vtbl->np.np_bg = TRUE;
vtbl->np.np_bg = true;
argv[argc-1] = NULL;
argc--;
}
@ -1129,7 +1130,7 @@ int nsh_parse(FAR struct nsh_vtbl_s *vtbl, char *cmdline)
if (strcmp(argv[argc-2], g_redirect1) == 0)
{
vtbl->np.np_redirect = TRUE;
vtbl->np.np_redirect = true;
oflags = O_WRONLY|O_CREAT|O_TRUNC;
redirfile = nsh_getfullpath(vtbl, argv[argc-1]);
argc -= 2;
@ -1139,7 +1140,7 @@ int nsh_parse(FAR struct nsh_vtbl_s *vtbl, char *cmdline)
else if (strcmp(argv[argc-2], g_redirect2) == 0)
{
vtbl->np.np_redirect = TRUE;
vtbl->np.np_redirect = true;
oflags = O_WRONLY|O_CREAT|O_APPEND;
redirfile = nsh_getfullpath(vtbl, argv[argc-1]);
argc -= 2;
@ -1268,7 +1269,7 @@ int nsh_parse(FAR struct nsh_vtbl_s *vtbl, char *cmdline)
else
#endif
{
ubyte save[SAVE_SIZE];
uint8_t save[SAVE_SIZE];
/* Handle redirection of output via a file descriptor */
@ -1302,7 +1303,7 @@ int nsh_parse(FAR struct nsh_vtbl_s *vtbl, char *cmdline)
* command task succeeded).
*/
return nsh_saveresult(vtbl, FALSE);
return nsh_saveresult(vtbl, false);
#ifndef CONFIG_EXAMPLES_NSH_DISABLEBG
errout_with_redirect:
@ -1312,5 +1313,5 @@ errout_with_redirect:
}
#endif
errout:
return nsh_saveresult(vtbl, TRUE);
return nsh_saveresult(vtbl, true);
}

View File

@ -40,8 +40,9 @@
#include <nuttx/config.h>
#ifdef CONFIG_NET
#include <sys/types.h>
#include <sys/stat.h> /* Needed for open */
#include <stdint.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
@ -94,8 +95,8 @@
#if defined(CONFIG_NET_UDP) && CONFIG_NFILE_DESCRIPTORS > 0
struct tftpc_args_s
{
boolean binary; /* TRUE:binary ("octect") FALSE:text ("netascii") */
boolean allocated; /* TRUE: destpath is allocated */
bool binary; /* true:binary ("octect") false:text ("netascii") */
bool allocated; /* true: destpath is allocated */
char *destpath; /* Path at destination */
const char *srcpath; /* Path at src */
in_addr_t ipaddr; /* Host IP address */
@ -112,7 +113,7 @@ struct tftpc_args_s
#if defined(CONFIG_NET_ICMP) && defined(CONFIG_NET_ICMP_PING) && \
!defined(CONFIG_DISABLE_CLOCK) && !defined(CONFIG_DISABLE_SIGNALS)
static uint16 g_pingid = 0;
static uint16_t g_pingid = 0;
#endif
/****************************************************************************
@ -129,10 +130,10 @@ static uint16 g_pingid = 0;
#if defined(CONFIG_NET_ICMP) && defined(CONFIG_NET_ICMP_PING) && \
!defined(CONFIG_DISABLE_CLOCK) && !defined(CONFIG_DISABLE_SIGNALS)
static inline uint16 ping_newid(void)
static inline uint16_t ping_newid(void)
{
irqstate_t save = irqsave();
uint16 ret = ++g_pingid;
uint16_t ret = ++g_pingid;
irqrestore(save);
return ret;
}
@ -290,11 +291,11 @@ int tftpc_parseargs(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv,
switch (option)
{
case 'b':
args->binary = TRUE;
args->binary = true;
break;
case 'n':
args->binary = FALSE;
args->binary = false;
break;
case 'f':
@ -378,7 +379,7 @@ int tftpc_parseargs(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv,
{
goto errout;
}
args->allocated = TRUE;
args->allocated = true;
}
return OK;
@ -473,14 +474,14 @@ int cmd_ping(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
FAR const char *fmt = g_fmtarginvalid;
const char *staddr;
uip_ipaddr_t ipaddr;
uint32 start;
uint32 next;
uint32 dsec = 10;
uint16 id;
int count = 10;
uint32_t start;
uint32_t next;
uint32_t dsec = 10;
uint16_t id;
int count = 10;
int option;
int seqno;
int replies = 0;
int replies = 0;
int elapsed;
int tmp;
int i;

View File

@ -1,7 +1,7 @@
/****************************************************************************
* examples/nsh/nsh_proccmds.c
*
* Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
* Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@ -38,7 +38,6 @@
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>

View File

@ -1,7 +1,7 @@
/****************************************************************************
* examples/nsh/nsh_romfsetc.c
*
* Copyright (C) 2008 Gregory Nutt. All rights reserved.
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@ -39,7 +39,6 @@
#include <nuttx/config.h>
#include <sys/types.h>
#include <sys/mount.h>
#include <debug.h>
#include <errno.h>

View File

@ -1,7 +1,7 @@
/****************************************************************************
* examples/nsh/nsh_serial.c
*
* Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
* Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@ -38,8 +38,8 @@
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
@ -49,7 +49,7 @@
#include "nsh.h"
/****************************************************************************
* Definitions
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
@ -80,8 +80,8 @@ static void nsh_consolerelease(FAR struct nsh_vtbl_s *vtbl);
#endif
static int nsh_consoleoutput(FAR struct nsh_vtbl_s *vtbl, const char *fmt, ...);
static FAR char *nsh_consolelinebuffer(FAR struct nsh_vtbl_s *vtbl);
static void nsh_consoleredirect(FAR struct nsh_vtbl_s *vtbl, int fd, FAR ubyte *save);
static void nsh_consoleundirect(FAR struct nsh_vtbl_s *vtbl, FAR ubyte *save);
static void nsh_consoleredirect(FAR struct nsh_vtbl_s *vtbl, int fd, FAR uint8_t *save);
static void nsh_consoleundirect(FAR struct nsh_vtbl_s *vtbl, FAR uint8_t *save);
static void nsh_consoleexit(FAR struct nsh_vtbl_s *vtbl);
/****************************************************************************
@ -269,7 +269,7 @@ static void nsh_consolerelease(FAR struct nsh_vtbl_s *vtbl)
*
****************************************************************************/
static void nsh_consoleredirect(FAR struct nsh_vtbl_s *vtbl, int fd, FAR ubyte *save)
static void nsh_consoleredirect(FAR struct nsh_vtbl_s *vtbl, int fd, FAR uint8_t *save)
{
FAR struct serial_s *pstate = (FAR struct serial_s *)vtbl;
FAR struct serialsave_s *ssave = (FAR struct serialsave_s *)save;
@ -298,7 +298,7 @@ static void nsh_consoleredirect(FAR struct nsh_vtbl_s *vtbl, int fd, FAR ubyte *
*
****************************************************************************/
static void nsh_consoleundirect(FAR struct nsh_vtbl_s *vtbl, FAR ubyte *save)
static void nsh_consoleundirect(FAR struct nsh_vtbl_s *vtbl, FAR uint8_t *save)
{
FAR struct serial_s *pstate = (FAR struct serial_s *)vtbl;
FAR struct serialsave_s *ssave = (FAR struct serialsave_s *)save;

View File

@ -44,7 +44,8 @@
#include <sys/types.h>
#include <sys/socket.h>
#include <stdint.h>
#include <stdbool.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
@ -96,11 +97,11 @@
struct telnetio_s
{
sem_t tio_sem;
int tio_sockfd;
uint8 tio_bufndx;
uint8 tio_state;
char tio_inbuffer[CONFIG_EXAMPLES_NSH_IOBUFFER_SIZE];
sem_t tio_sem;
int tio_sockfd;
uint8_t tio_bufndx;
uint8_t tio_state;
char tio_inbuffer[CONFIG_EXAMPLES_NSH_IOBUFFER_SIZE];
};
struct redirect_s
@ -111,7 +112,7 @@ struct redirect_s
struct telnetsave_s
{
boolean ts_redirected;
bool ts_redirected;
union
{
struct telnetio_s *tn;
@ -122,8 +123,8 @@ struct telnetsave_s
struct telnetd_s
{
struct nsh_vtbl_s tn_vtbl;
uint16 tn_sndlen;
boolean tn_redirected;
uint16_t tn_sndlen;
bool tn_redirected;
union
{
struct telnetio_s *tn;
@ -145,8 +146,8 @@ static void nsh_telnetrelease(FAR struct nsh_vtbl_s *vtbl);
static int nsh_telnetoutput(FAR struct nsh_vtbl_s *vtbl, const char *fmt, ...);
static int nsh_redirectoutput(FAR struct nsh_vtbl_s *vtbl, const char *fmt, ...);
static FAR char *nsh_telnetlinebuffer(FAR struct nsh_vtbl_s *vtbl);
static void nsh_telnetredirect(FAR struct nsh_vtbl_s *vtbl, int fd, FAR ubyte *save);
static void nsh_telnetundirect(FAR struct nsh_vtbl_s *vtbl, FAR ubyte *save);
static void nsh_telnetredirect(FAR struct nsh_vtbl_s *vtbl, int fd, FAR uint8_t *save);
static void nsh_telnetundirect(FAR struct nsh_vtbl_s *vtbl, FAR uint8_t *save);
static void nsh_telnetexit(FAR struct nsh_vtbl_s *vtbl);
/****************************************************************************
@ -263,7 +264,7 @@ static void nsh_closeifnotclosed(struct telnetd_s *pstate)
*
****************************************************************************/
static void nsh_putchar(struct telnetd_s *pstate, uint8 ch)
static void nsh_putchar(struct telnetd_s *pstate, uint8_t ch)
{
struct telnetio_s *tio = pstate->u.tn;
@ -284,7 +285,7 @@ static void nsh_putchar(struct telnetd_s *pstate, uint8 ch)
{
pstate->tn_cmd[tio->tio_bufndx] = '\0';
nsh_telnetdump(&pstate->tn_vtbl, "TELNET CMD",
(ubyte*)pstate->tn_cmd, strlen(pstate->tn_cmd));
(uint8_t*)pstate->tn_cmd, strlen(pstate->tn_cmd));
nsh_parse(&pstate->tn_vtbl, pstate->tn_cmd);
tio->tio_bufndx = 0;
}
@ -302,10 +303,10 @@ static void nsh_putchar(struct telnetd_s *pstate, uint8 ch)
*
****************************************************************************/
static void nsh_sendopt(struct telnetd_s *pstate, uint8 option, uint8 value)
static void nsh_sendopt(struct telnetd_s *pstate, uint8_t option, uint8_t value)
{
struct telnetio_s *tio = pstate->u.tn;
uint8 optbuf[4];
uint8_t optbuf[4];
optbuf[0] = TELNET_IAC;
optbuf[1] = option;
optbuf[2] = value;
@ -335,7 +336,7 @@ static void nsh_flush(FAR struct telnetd_s *pstate)
if (pstate->tn_sndlen > 0)
{
nsh_telnetdump(&pstate->tn_vtbl, "Shell output",
(ubyte*)pstate->tn_outbuffer, pstate->tn_sndlen);
(uint8_t*)pstate->tn_outbuffer, pstate->tn_sndlen);
tio_semtake(tio); /* Only one call to send at a time */
if (send(tio->tio_sockfd, pstate->tn_outbuffer, pstate->tn_sndlen, 0) < 0)
{
@ -358,7 +359,7 @@ static int nsh_receive(struct telnetd_s *pstate, size_t len)
{
struct telnetio_s *tio = pstate->u.tn;
char *ptr = tio->tio_inbuffer;
uint8 ch;
uint8_t ch;
while (len > 0)
{
@ -504,7 +505,7 @@ static void *nsh_connection(void *arg)
/* Process the received TELNET data */
nsh_telnetdump(vtbl, "Received buffer",
(ubyte*)tio->tio_inbuffer, ret);
(uint8_t*)tio->tio_inbuffer, ret);
ret = nsh_receive(pstate, ret);
}
}
@ -655,7 +656,7 @@ static FAR struct nsh_vtbl_s *nsh_telnetclone(FAR struct nsh_vtbl_s *vtbl)
{
if (pstate->tn_redirected)
{
pclone->tn_redirected = TRUE;
pclone->tn_redirected = true;
pclone->tn_vtbl.output = nsh_redirectoutput;
pclone->u.rd.rd_fd = pstate->u.rd.rd_fd;
pclone->u.rd.rd_stream = NULL;
@ -703,7 +704,7 @@ static void nsh_telnetrelease(FAR struct nsh_vtbl_s *vtbl)
*
****************************************************************************/
static void nsh_telnetredirect(FAR struct nsh_vtbl_s *vtbl, int fd, FAR ubyte *save)
static void nsh_telnetredirect(FAR struct nsh_vtbl_s *vtbl, int fd, FAR uint8_t *save)
{
FAR struct telnetd_s *pstate = (FAR struct telnetd_s *)vtbl;
FAR struct telnetsave_s *ssave = (FAR struct telnetsave_s *)save;
@ -724,7 +725,7 @@ static void nsh_telnetredirect(FAR struct nsh_vtbl_s *vtbl, int fd, FAR ubyte *s
memcpy(&ssave->u.rd, &pstate->u.rd, sizeof(struct redirect_s));
}
pstate->tn_redirected = TRUE;
pstate->tn_redirected = true;
pstate->u.rd.rd_fd = fd;
pstate->u.rd.rd_stream = NULL;
}
@ -737,7 +738,7 @@ static void nsh_telnetredirect(FAR struct nsh_vtbl_s *vtbl, int fd, FAR ubyte *s
*
****************************************************************************/
static void nsh_telnetundirect(FAR struct nsh_vtbl_s *vtbl, FAR ubyte *save)
static void nsh_telnetundirect(FAR struct nsh_vtbl_s *vtbl, FAR uint8_t *save)
{
FAR struct telnetd_s *pstate = (FAR struct telnetd_s *)vtbl;
FAR struct telnetsave_s *ssave = (FAR struct telnetsave_s *)save;
@ -782,7 +783,7 @@ int nsh_telnetmain(int argc, char *argv[])
{
struct in_addr addr;
#if defined(CONFIG_EXAMPLES_NSH_DHCPC) || defined(CONFIG_EXAMPLES_NSH_NOMAC)
uint8 mac[IFHWADDRLEN];
uint8_t mac[IFHWADDRLEN];
#endif
/* Many embedded network interfaces must have a software assigned MAC */

View File

@ -1,7 +1,7 @@
/****************************************************************************
* examples/nx/nx_events.c
*
* Copyright (C) 2008 Gregory Nutt. All rights reserved.
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@ -39,7 +39,8 @@
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdint.h>
#include <stdbool.h>
#include <stdlib.h>
#include <semaphore.h>
#include <debug.h>
@ -62,26 +63,26 @@
****************************************************************************/
static void nxeg_redraw(NXEGWINDOW hwnd, FAR const struct nxgl_rect_s *rect,
boolean morem, FAR void *arg);
bool morem, FAR void *arg);
static void nxeg_position(NXEGWINDOW hwnd, FAR const struct nxgl_size_s *size,
FAR const struct nxgl_point_s *pos,
FAR const struct nxgl_rect_s *bounds,
FAR void *arg);
#ifdef CONFIG_NX_MOUSE
static void nxeg_mousein(NXEGWINDOW hwnd, FAR const struct nxgl_point_s *pos,
ubyte buttons, FAR void *arg);
uint8_t buttons, FAR void *arg);
#endif
#ifndef CONFIG_EXAMPLES_NX_RAWWINDOWS
static void nxeg_tbredraw(NXEGWINDOW hwnd, FAR const struct nxgl_rect_s *rect,
boolean morem, FAR void *arg);
bool morem, FAR void *arg);
static void nxeg_tbposition(NXEGWINDOW hwnd, FAR const struct nxgl_size_s *size,
FAR const struct nxgl_point_s *pos,
FAR const struct nxgl_rect_s *bounds,
FAR void *arg);
#ifdef CONFIG_NX_MOUSE
static void nxeg_tbmousein(NXEGWINDOW hwnd, FAR const struct nxgl_point_s *pos,
ubyte buttons, FAR void *arg);
uint8_t buttons, FAR void *arg);
#endif
#endif
@ -175,13 +176,13 @@ static inline void nxeg_filltoolbar(NXTKWINDOW htb,
****************************************************************************/
static void nxeg_redraw(NXEGWINDOW hwnd, FAR const struct nxgl_rect_s *rect,
boolean more, FAR void *arg)
bool more, FAR void *arg)
{
FAR struct nxeg_state_s *st = (FAR struct nxeg_state_s *)arg;
message("nxeg_redraw%d: hwnd=%p rect={(%d,%d),(%d,%d)} more=%s\n",
st->wnum, hwnd,
rect->pt1.x, rect->pt1.y, rect->pt2.x, rect->pt2.y,
more ? "TRUE" : "FALSE");
more ? "true" : "false");
nxeg_fillwindow(hwnd, rect, st);
}
@ -212,7 +213,7 @@ static void nxeg_position(NXEGWINDOW hwnd, FAR const struct nxgl_size_s *size,
g_xres = bounds->pt2.x;
g_yres = bounds->pt2.y;
b_haveresolution = TRUE;
b_haveresolution = true;
sem_post(&g_semevent);
message("nxeg_position2: Have xres=%d yres=%d\n", g_xres, g_yres);
}
@ -224,7 +225,7 @@ static void nxeg_position(NXEGWINDOW hwnd, FAR const struct nxgl_size_s *size,
#ifdef CONFIG_NX_MOUSE
static void nxeg_mousein(NXEGWINDOW hwnd, FAR const struct nxgl_point_s *pos,
ubyte buttons, FAR void *arg)
uint8_t buttons, FAR void *arg)
{
FAR struct nxeg_state_s *st = (FAR struct nxeg_state_s *)arg;
message("nxeg_mousein%d: hwnd=%p pos=(%d,%d) button=%02x\n",
@ -238,13 +239,13 @@ static void nxeg_mousein(NXEGWINDOW hwnd, FAR const struct nxgl_point_s *pos,
#ifndef CONFIG_EXAMPLES_NX_RAWWINDOWS
static void nxeg_tbredraw(NXEGWINDOW hwnd, FAR const struct nxgl_rect_s *rect,
boolean more, FAR void *arg)
bool more, FAR void *arg)
{
FAR struct nxeg_state_s *st = (FAR struct nxeg_state_s *)arg;
message("nxeg_tbredraw%d: hwnd=%p rect={(%d,%d),(%d,%d)} more=%s\n",
st->wnum, hwnd,
rect->pt1.x, rect->pt1.y, rect->pt2.x, rect->pt2.y,
more ? "TRUE" : "FALSE");
more ? "true" : "false");
nxeg_filltoolbar(hwnd, rect, g_tbcolor);
}
#endif
@ -276,7 +277,7 @@ static void nxeg_tbposition(NXEGWINDOW hwnd, FAR const struct nxgl_size_s *size,
#ifndef CONFIG_EXAMPLES_NX_RAWWINDOWS
#ifdef CONFIG_NX_MOUSE
static void nxeg_tbmousein(NXEGWINDOW hwnd, FAR const struct nxgl_point_s *pos,
ubyte buttons, FAR void *arg)
uint8_t buttons, FAR void *arg)
{
FAR struct nxeg_state_s *st = (FAR struct nxeg_state_s *)arg;
@ -326,7 +327,7 @@ FAR void *nx_listenerthread(FAR void *arg)
if (!g_connected)
{
g_connected = TRUE;
g_connected = true;
sem_post(&g_semevent);
message("nx_listenerthread: Connected\n");
}

View File

@ -1,7 +1,7 @@
/****************************************************************************
* examples/nx/nx_internal.h
*
* Copyright (C) 2008 Gregory Nutt. All rights reserved.
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@ -41,7 +41,9 @@
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdint.h>
#include <stdbool.h>
#include <semaphore.h>
#include <nuttx/nx.h>
#include <nuttx/nxtk.h>
@ -207,11 +209,11 @@ enum exitcode_e
struct nxeg_glyph_s
{
ubyte code; /* Character code */
ubyte height; /* Height of this glyph (in rows) */
ubyte width; /* Width of this glyph (in pixels) */
ubyte stride; /* Width of the glyph row (in bytes) */
FAR ubyte *bitmap; /* Allocated bitmap memory */
uint8_t code; /* Character code */
uint8_t height; /* Height of this glyph (in rows) */
uint8_t width; /* Width of this glyph (in pixels) */
uint8_t stride; /* Width of the glyph row (in bytes) */
FAR uint8_t *bitmap; /* Allocated bitmap memory */
};
/* Describes on character on the display */
@ -226,16 +228,16 @@ struct nxeg_bitmap_s
struct nxeg_state_s
{
ubyte wnum; /* Window number */
uint8_t wnum; /* Window number */
nxgl_mxpixel_t color[CONFIG_NX_NPLANES]; /* Window color */
#ifdef CONFIG_NX_KBD
ubyte height; /* Max height of a font in pixels */
ubyte width; /* Max width of a font in pixels */
ubyte spwidth; /* The width of a space */
uint8_t height; /* Max height of a font in pixels */
uint8_t width; /* Max width of a font in pixels */
uint8_t spwidth; /* The width of a space */
ubyte nchars; /* Number of KBD chars received */
ubyte nglyphs; /* Number of glyphs cached */
uint8_t nchars; /* Number of KBD chars received */
uint8_t nglyphs; /* Number of glyphs cached */
struct nxeg_bitmap_s bm[NXTK_MAXKBDCHARS];
struct nxeg_glyph_s glyph[NXTK_MAXKBDCHARS];
@ -262,9 +264,9 @@ extern const struct nx_callback_s g_tbcb;
nxgl_coord_t g_xres;
nxgl_coord_t g_yres;
extern boolean b_haveresolution;
extern bool b_haveresolution;
#ifdef CONFIG_NX_MULTIUSER
extern boolean g_connected;
extern bool g_connected;
#endif
extern sem_t g_semevent;
@ -286,9 +288,9 @@ extern FAR void *nx_listenerthread(FAR void *arg);
#endif
#ifdef CONFIG_NX_KBD
extern void nxeg_kbdin(NXWINDOW hwnd, ubyte nch, const ubyte *ch, FAR void *arg);
extern void nxeg_kbdin(NXWINDOW hwnd, uint8_t nch, const uint8_t *ch, FAR void *arg);
#ifndef CONFIG_EXAMPLES_NX_RAWWINDOWS
extern void nxeg_tbkbdin(NXWINDOW hwnd, ubyte nch, const ubyte *ch, FAR void *arg);
extern void nxeg_tbkbdin(NXWINDOW hwnd, uint8_t nch, const uint8_t *ch, FAR void *arg);
#endif
extern void nxeg_filltext(NXWINDOW hwnd, FAR const struct nxgl_rect_s *rect,
FAR struct nxeg_state_s *st);

View File

@ -39,7 +39,7 @@
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
@ -138,7 +138,8 @@ static void nxeg_fillchar(NXWINDOW hwnd, FAR const struct nxgl_rect_s *rect,
****************************************************************************/
static inline FAR const struct nxeg_glyph_s *
nxeg_renderglyph(FAR struct nxeg_state_s *st, FAR const struct nx_fontbitmap_s *bm, ubyte ch)
nxeg_renderglyph(FAR struct nxeg_state_s *st,
FAR const struct nx_fontbitmap_s *bm, uint8_t ch)
{
FAR struct nxeg_glyph_s *glyph = NULL;
FAR nxgl_mxpixel_t *ptr;
@ -166,7 +167,7 @@ nxeg_renderglyph(FAR struct nxeg_state_s *st, FAR const struct nx_fontbitmap_s *
glyph->stride = (glyph->width * CONFIG_EXAMPLES_NX_BPP + 7) / 8;
bmsize = glyph->stride * glyph->height;
glyph->bitmap = (FAR ubyte *)malloc(bmsize);
glyph->bitmap = (FAR uint8_t *)malloc(bmsize);
if (glyph->bitmap)
{
@ -215,7 +216,7 @@ nxeg_renderglyph(FAR struct nxeg_state_s *st, FAR const struct nx_fontbitmap_s *
****************************************************************************/
static inline FAR const struct nxeg_glyph_s *
nxeg_addspace(FAR struct nxeg_state_s *st, ubyte ch)
nxeg_addspace(FAR struct nxeg_state_s *st, uint8_t ch)
{
FAR struct nxeg_glyph_s *glyph = NULL;
@ -241,7 +242,7 @@ nxeg_addspace(FAR struct nxeg_state_s *st, ubyte ch)
****************************************************************************/
static FAR const struct nxeg_glyph_s *
nxeg_findglyph(FAR struct nxeg_state_s *st, ubyte ch)
nxeg_findglyph(FAR struct nxeg_state_s *st, uint8_t ch)
{
int i;
@ -262,7 +263,7 @@ nxeg_findglyph(FAR struct nxeg_state_s *st, ubyte ch)
****************************************************************************/
static FAR const struct nxeg_glyph_s *
nxeg_getglyph(FAR struct nxeg_state_s *st, ubyte ch)
nxeg_getglyph(FAR struct nxeg_state_s *st, uint8_t ch)
{
FAR const struct nxeg_glyph_s *glyph;
FAR const struct nx_fontbitmap_s *bm;
@ -300,7 +301,7 @@ nxeg_getglyph(FAR struct nxeg_state_s *st, ubyte ch)
****************************************************************************/
static FAR const struct nxeg_bitmap_s *
nxeg_addchar(FAR struct nxeg_state_s *st, ubyte ch)
nxeg_addchar(FAR struct nxeg_state_s *st, uint8_t ch)
{
FAR struct nxeg_bitmap_s *bm = NULL;
FAR struct nxeg_bitmap_s *bmleft;
@ -353,7 +354,7 @@ nxeg_addchar(FAR struct nxeg_state_s *st, ubyte ch)
****************************************************************************/
static inline void nxeg_addchars(NXWINDOW hwnd, FAR struct nxeg_state_s *st,
ubyte nch, FAR const ubyte *ch)
uint8_t nch, FAR const uint8_t *ch)
{
FAR const struct nxeg_bitmap_s *bm;
@ -375,7 +376,8 @@ static inline void nxeg_addchars(NXWINDOW hwnd, FAR struct nxeg_state_s *st,
* Name: nxeg_kbdin
****************************************************************************/
void nxeg_kbdin(NXWINDOW hwnd, ubyte nch, FAR const ubyte *ch, FAR void *arg)
void nxeg_kbdin(NXWINDOW hwnd, uint8_t nch, FAR const uint8_t *ch,
FAR void *arg)
{
FAR struct nxeg_state_s *st = (FAR struct nxeg_state_s *)arg;
message("nxeg_kbdin%d: hwnd=%p nch=%d\n", st->wnum, hwnd, nch);
@ -387,7 +389,7 @@ void nxeg_kbdin(NXWINDOW hwnd, ubyte nch, FAR const ubyte *ch, FAR void *arg)
****************************************************************************/
#ifndef CONFIG_EXAMPLES_NX_RAWWINDOWS
void nxeg_tbkbdin(NXWINDOW hwnd, ubyte nch, const ubyte *ch, FAR void *arg)
void nxeg_tbkbdin(NXWINDOW hwnd, uint8_t nch, const uint8_t *ch, FAR void *arg)
{
FAR struct nxeg_state_s *st = (FAR struct nxeg_state_s *)arg;
message("nxeg_tbkbdin: ERROR -- toolbar should not received keyboard input\n");

View File

@ -1,7 +1,7 @@
/****************************************************************************
* examples/nx/nx_main.c
*
* Copyright (C) 2008 Gregory Nutt. All rights reserved.
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@ -40,6 +40,8 @@
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdint.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
@ -78,8 +80,8 @@ static int g_exitcode = NXEXIT_SUCCESS;
static struct nxeg_state_s g_wstate[2];
#ifdef CONFIG_NX_KBD
static const ubyte g_kbdmsg1[] = "NuttX is cool!";
static const ubyte g_kbdmsg2[] = "NuttX is fun!";
static const uint8_t g_kbdmsg1[] = "NuttX is cool!";
static const uint8_t g_kbdmsg2[] = "NuttX is fun!";
#endif
/****************************************************************************
@ -95,9 +97,9 @@ NXHANDLE g_hnx = NULL;
nxgl_coord_t g_xres;
nxgl_coord_t g_yres;
boolean b_haveresolution = FALSE;
bool b_haveresolution = false;
#ifdef CONFIG_NX_MULTIUSER
boolean g_connected = FALSE;
bool g_connected = false;
#endif
sem_t g_semevent = {0};

View File

@ -1,7 +1,7 @@
/****************************************************************************
* examples/nx/nx_server.c
*
* Copyright (C) 2008 Gregory Nutt. All rights reserved.
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@ -38,7 +38,6 @@
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>

View File

@ -39,9 +39,8 @@
#include <nuttx/config.h>
#include <nuttx/compiler.h>
#include <sys/types.h>
#include <sys/mount.h>
#include <sys/mount.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

View File

@ -37,6 +37,7 @@
* Included Files
****************************************************************************/
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
@ -50,7 +51,7 @@ static pthread_mutex_t mut;
static volatile int my_mutex = 0;
static unsigned long nloops[2] = {0, 0};
static unsigned long nerrors[2] = {0, 0};
static volatile boolean bendoftest;
static volatile bool bendoftest;
/****************************************************************************
* Private Functions
@ -116,7 +117,7 @@ int main(int argc, char **argv)
/* Start two thread instances */
printf("Starting thread 1\n");
bendoftest = FALSE;
bendoftest = false;
if ((pthread_create(&thread1, NULL, (void*)thread_func, (void*)1)) != 0)
{
fprintf(stderr, "Error in thread#1 creation\n");
@ -135,7 +136,7 @@ int main(int argc, char **argv)
/* Then ask them politely to stop running */
printf("Stopping threads\n");
bendoftest = TRUE;
bendoftest = true;
pthread_join(thread1, NULL);
pthread_join(thread2, NULL);

View File

@ -37,7 +37,6 @@
* Included Files
****************************************************************************/
#include <sys/types.h>
#include <stdio.h>
#include <unistd.h>
#include <pthread.h>

View File

@ -38,6 +38,8 @@
****************************************************************************/
#include <nuttx/config.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
@ -166,11 +168,11 @@ static void check_test_memory_usage(void)
#endif
/****************************************************************************
* Name: show_environment
* Name: show_variable
****************************************************************************/
#ifndef CONFIG_DISABLE_ENVIRON
static void show_variable(const char *var_name, const char *exptd_value, boolean var_valid)
static void show_variable(const char *var_name, const char *exptd_value, bool var_valid)
{
char *actual_value = getenv(var_name);
if (actual_value)
@ -204,11 +206,11 @@ static void show_variable(const char *var_name, const char *exptd_value, boolean
}
}
static void show_environment(boolean var1_valid, boolean var2_valid, boolean var3_valid)
static void show_environment(bool var1_valid, bool var2_valid, bool var3_valid)
{
show_variable( g_var1_name, g_var1_value, var1_valid);
show_variable( g_var2_name, g_var2_value, var2_valid);
show_variable( g_var3_name, g_var3_value, var3_valid);
show_variable(g_var1_name, g_var1_value, var1_valid);
show_variable(g_var2_name, g_var2_value, var2_valid);
show_variable(g_var3_name, g_var3_value, var3_valid);
}
#else
# define show_environment()
@ -264,14 +266,14 @@ static int user_main(int argc, char *argv[])
/* Check environment variables */
#ifndef CONFIG_DISABLE_ENVIRON
show_environment(TRUE, TRUE, TRUE);
show_environment(true, true, true);
unsetenv(g_var1_name);
show_environment(FALSE, TRUE, TRUE);
show_environment(false, true, true);
check_test_memory_usage();
clearenv();
show_environment(FALSE, FALSE, FALSE);
show_environment(false, false, false);
check_test_memory_usage();
#endif
@ -497,7 +499,7 @@ int user_start(int argc, char *argv[])
setenv(g_var3_name, g_var3_value, FALSE); /* Variable3=GoodValue3 */
printf("user_start: setenv(%s, %s, FALSE)\n", g_var3_name, g_var3_name);
setenv(g_var3_name, g_bad_value2, FALSE); /* Variable3=GoodValue3 */
show_environment(TRUE, TRUE, TRUE);
show_environment(true, true, true);
#endif
/* Verify that we can spawn a new task */

View File

@ -1,7 +1,7 @@
/***********************************************************************
* examples/ostest/posixtimer.c
*
* Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
* Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@ -37,7 +37,6 @@
* Included Files
**************************************************************************/
#include <sys/types.h>
#include <stdio.h>
#include <unistd.h>
#include <semaphore.h>

View File

@ -37,7 +37,6 @@
* Included Files
****************************************************************************/
#include <sys/types.h>
#include <stdio.h>
#include <unistd.h>
#include <semaphore.h>

View File

@ -1,7 +1,7 @@
/***********************************************************************
* sem.c
*
* Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
* Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@ -33,7 +33,6 @@
*
***********************************************************************/
#include <sys/types.h>
#include <stdio.h>
#include <pthread.h>
#include <semaphore.h>

View File

@ -34,6 +34,7 @@
***********************************************************************/
#include <sys/types.h>
#include <stdbool.h>
#include <stdio.h>
#include <unistd.h>
#include <semaphore.h>
@ -50,8 +51,8 @@
#define SIGVALUE_INT 42
static sem_t sem;
static boolean sigreceived = FALSE;
static boolean threadexited = FALSE;
static bool sigreceived = false;
static bool threadexited = false;
static void wakeup_action(int signo, siginfo_t *info, void *ucontext)
{
@ -61,7 +62,7 @@ static void wakeup_action(int signo, siginfo_t *info, void *ucontext)
printf("wakeup_action: Received signal %d\n" , signo);
sigreceived = TRUE;
sigreceived = true;
/* Check signo */
@ -185,7 +186,7 @@ static int waiter_main(int argc, char *argv[])
fflush(stdout);
#endif
threadexited = TRUE;
threadexited = true;
return 0;
}

View File

@ -1,7 +1,7 @@
/****************************************************************************
* examples/pashello/pashello.c
*
* Copyright (C) 2008 Gregory Nutt. All rights reserved.
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@ -39,7 +39,6 @@
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <debug.h>

View File

@ -1,7 +1,7 @@
/****************************************************************************
* examples/pipe/pipe_main.c
*
* Copyright (C) 2008 Gregory Nutt. All rights reserved.
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@ -38,10 +38,8 @@
****************************************************************************/
#include <nuttx/config.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <stdio.h>
#include <unistd.h>
#include <sched.h>

View File

@ -1,7 +1,7 @@
/****************************************************************************
* examples/pipe/redirect_test.c
*
* Copyright (C) 2008 Gregory Nutt. All rights reserved.
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@ -38,7 +38,6 @@
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>

View File

@ -1,7 +1,7 @@
/****************************************************************************
* examples/pipe/transfer_test.c
*
* Copyright (C) 2008 Gregory Nutt. All rights reserved.
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@ -38,7 +38,6 @@
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdio.h>
#include <unistd.h>
@ -47,7 +46,7 @@
#include "pipe.h"
/****************************************************************************
* Definitions
* Pre-proecessor Definitions
****************************************************************************/
#define MAX_BYTE 13

View File

@ -1,7 +1,7 @@
/****************************************************************************
* examples/poll/host.c
*
* Copyright (C) 2008 Gregory Nutt. All rights reserved.
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@ -37,9 +37,7 @@
* Included Files
****************************************************************************/
#include <sys/types.h>
#include <sys/socket.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

View File

@ -1,7 +1,7 @@
/****************************************************************************
* examples/poll/net_listener.c
*
* Copyright (C) 2008, 2009 Gregory Nutt. All rights reserved.
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@ -39,12 +39,13 @@
#include <nuttx/config.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/select.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <stdint.h>
#include <stdbool.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>
@ -89,7 +90,7 @@ struct net_listener_s
* Name: net_closeclient
****************************************************************************/
static boolean net_closeclient(struct net_listener_s *nls, int sd)
static bool net_closeclient(struct net_listener_s *nls, int sd)
{
message("net_listener: Closing host side connection sd=%d\n", sd);
close(sd);
@ -97,18 +98,18 @@ static boolean net_closeclient(struct net_listener_s *nls, int sd)
/* If we just closed the max SD, then search downward for the next biggest SD. */
while (FD_ISSET(nls->mxsd, &nls->master) == FALSE)
while (FD_ISSET(nls->mxsd, &nls->master) == false)
{
nls->mxsd -= 1;
}
return TRUE;
return true;
}
/****************************************************************************
* Name: net_incomingdata
****************************************************************************/
static inline boolean net_incomingdata(struct net_listener_s *nls, int sd)
static inline bool net_incomingdata(struct net_listener_s *nls, int sd)
{
char *ptr;
int nbytes;
@ -130,7 +131,7 @@ static inline boolean net_incomingdata(struct net_listener_s *nls, int sd)
if (errno != EAGAIN)
{
net_closeclient(nls, sd);
return FALSE;
return false;
}
}
}
@ -138,7 +139,7 @@ static inline boolean net_incomingdata(struct net_listener_s *nls, int sd)
{
message("net_listener: Client connection lost sd=%d\n", sd);
net_closeclient(nls, sd);
return FALSE;
return false;
}
else
{
@ -156,7 +157,7 @@ static inline boolean net_incomingdata(struct net_listener_s *nls, int sd)
{
message("net_listener: Send failed sd=%d: \n", sd, errno);
net_closeclient(nls, sd);
return FALSE;
return false;
}
}
else
@ -174,7 +175,7 @@ static inline boolean net_incomingdata(struct net_listener_s *nls, int sd)
* Name: net_connection
****************************************************************************/
static inline boolean net_connection(struct net_listener_s *nls)
static inline bool net_connection(struct net_listener_s *nls)
{
int sd;
@ -193,7 +194,7 @@ static inline boolean net_connection(struct net_listener_s *nls)
if (errno != EINTR)
{
return FALSE;
return false;
}
}
else
@ -207,17 +208,17 @@ static inline boolean net_connection(struct net_listener_s *nls)
{
nls->mxsd = sd;
}
return TRUE;
return true;
}
}
return FALSE;
return false;
}
/****************************************************************************
* Name: net_mksocket
****************************************************************************/
static inline boolean net_mksocket(struct net_listener_s *nls)
static inline bool net_mksocket(struct net_listener_s *nls)
{
int value;
int ret;
@ -229,7 +230,7 @@ static inline boolean net_mksocket(struct net_listener_s *nls)
if (nls->listensd < 0)
{
message("net_listener: socket failed: %d\n", errno);
return FALSE;
return false;
}
/* Configure the socket */
@ -240,7 +241,7 @@ static inline boolean net_mksocket(struct net_listener_s *nls)
{
message("net_listener: setsockopt failed: %d\n", errno);
close(nls->listensd);
return FALSE;
return false;
}
/* Set the socket to non-blocking */
@ -251,7 +252,7 @@ static inline boolean net_mksocket(struct net_listener_s *nls)
{
message("net_listener: ioctl failed: %d\n", errno);
close(nls->listensd);
return FALSE;
return false;
}
#endif
@ -266,7 +267,7 @@ static inline boolean net_mksocket(struct net_listener_s *nls)
{
message("net_listener: bind failed: %d\n", errno);
close(nls->listensd);
return FALSE;
return false;
}
/* Mark the socket as a listener */
@ -276,10 +277,10 @@ static inline boolean net_mksocket(struct net_listener_s *nls)
{
message("net_listener: bind failed: %d\n", errno);
close(nls->listensd);
return FALSE;
return false;
}
return TRUE;
return true;
}
/****************************************************************************
@ -290,7 +291,7 @@ static void net_configure(void)
{
struct in_addr addr;
#if defined(CONFIG_EXAMPLE_POLL_NOMAC)
ubyte mac[IFHWADDRLEN];
uint8_t mac[IFHWADDRLEN];
#endif
/* Configure uIP */

View File

@ -1,7 +1,7 @@
/****************************************************************************
* examples/poll/net_reader.c
*
* Copyright (C) 2008, 2009 Gregory Nutt. All rights reserved.
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@ -44,6 +44,7 @@
#include <sys/select.h>
#include <sys/socket.h>
#include <stdint.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>
@ -83,7 +84,7 @@ static void net_configure(void)
{
struct in_addr addr;
#if defined(CONFIG_EXAMPLE_POLL_NOMAC)
ubyte mac[IFHWADDRLEN];
uint8_t mac[IFHWADDRLEN];
#endif
/* Configure uIP */

View File

@ -41,7 +41,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <stdbool.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>
@ -93,8 +93,8 @@ void *poll_listener(pthread_addr_t pvarg)
struct pollfd fds[NPOLLFDS];
char buffer[64];
ssize_t nbytes;
boolean timeout;
boolean pollin;
bool timeout;
bool pollin;
int nevents;
int fd;
int ret;
@ -128,8 +128,8 @@ void *poll_listener(pthread_addr_t pvarg)
fds[FIFONDX].events = POLLIN;
fds[FIFONDX].revents = 0;
timeout = FALSE;
pollin = FALSE;
timeout = false;
pollin = false;
ret = poll(fds, NPOLLFDS, POLL_LISTENER_DELAY);
@ -141,7 +141,7 @@ void *poll_listener(pthread_addr_t pvarg)
else if (ret == 0)
{
message("poll_listener: Timeout\n");
timeout = TRUE;
timeout = true;
}
else if (ret > NPOLLFDS)
{
@ -149,7 +149,7 @@ void *poll_listener(pthread_addr_t pvarg)
}
else
{
pollin = TRUE;
pollin = true;
}
nevents = 0;

View File

@ -42,7 +42,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/select.h>
#include <stdbool.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>
@ -83,8 +83,8 @@ void *select_listener(pthread_addr_t pvarg)
struct timeval tv;
char buffer[64];
ssize_t nbytes;
boolean timeout;
boolean ready;
bool timeout;
bool ready;
int fd;
int ret;
@ -112,8 +112,8 @@ void *select_listener(pthread_addr_t pvarg)
tv.tv_sec = SELECT_LISTENER_DELAY;
tv.tv_usec = 0;
timeout = FALSE;
ready = FALSE;
timeout = false;
ready = false;
ret = select(fd+1, (FAR fd_set*)&rfds, (FAR fd_set*)NULL, (FAR fd_set*)NULL, &tv);
message("\nselect_listener: select returned: %d\n", ret);
@ -125,7 +125,7 @@ void *select_listener(pthread_addr_t pvarg)
else if (ret == 0)
{
message("select_listener: Timeout\n");
timeout = TRUE;
timeout = true;
}
else
{
@ -135,7 +135,7 @@ void *select_listener(pthread_addr_t pvarg)
}
else
{
ready = TRUE;
ready = true;
}
if (!FD_ISSET(fd, rfds))
@ -176,8 +176,8 @@ void *select_listener(pthread_addr_t pvarg)
message("select_listener: Read '%s' (%d bytes)\n", buffer, nbytes);
}
timeout = FALSE;
ready = FALSE;
timeout = false;
ready = false;
}
while (nbytes > 0);

View File

@ -1,7 +1,7 @@
/****************************************************************************
* examples/romfs/romfs_main.c
*
* Copyright (C) 2008 Gregory Nutt. All rights reserved.
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@ -60,7 +60,7 @@
#include <sys/mount.h>
#include <sys/stat.h>
#include <sys/mman.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
@ -126,8 +126,8 @@
struct node_s
{
struct node_s *peer; /* Next node in this directory */
boolean directory; /* True: directory */
boolean found; /* True: found and verified */
bool directory; /* True: directory */
bool found; /* True: found and verified */
const char *name; /* Node name */
mode_t mode; /* Expected permissions */
size_t size; /* Expected size */
@ -174,56 +174,56 @@ static char g_scratchbuffer[SCRATCHBUFFER_SIZE];
static void connectem(void)
{
g_adir.peer = &g_afile;
g_adir.directory = TRUE;
g_adir.found = FALSE;
g_adir.directory = true;
g_adir.found = false;
g_adir.name = "adir";
g_adir.mode = DIRECTORY_MODE;
g_adir.size = 0;
g_adir.u.child = &g_anotherfile;
g_afile.peer = &g_hfile;
g_afile.directory = FALSE;
g_afile.found = FALSE;
g_afile.directory = false;
g_afile.found = false;
g_afile.name = "afile.txt";
g_afile.mode = FILE_MODE;
g_afile.size = strlen(g_afilecontent);
g_afile.u.filecontent = g_afilecontent;
g_hfile.peer = NULL;
g_hfile.directory = FALSE; /* Actually a hard link */
g_hfile.found = FALSE;
g_hfile.directory = false; /* Actually a hard link */
g_hfile.found = false;
g_hfile.name = "hfile";
g_hfile.mode = FILE_MODE;
g_hfile.size = strlen(g_hfilecontent);
g_hfile.u.filecontent = g_hfilecontent;
g_anotherfile.peer = &g_yafile;
g_anotherfile.directory = FALSE;
g_anotherfile.found = FALSE;
g_anotherfile.directory = false;
g_anotherfile.found = false;
g_anotherfile.name = "anotherfile.txt";
g_anotherfile.mode = FILE_MODE;
g_anotherfile.size = strlen(g_anotherfilecontent);
g_anotherfile.u.filecontent = g_anotherfilecontent;
g_yafile.peer = &g_subdir;
g_yafile.directory = FALSE;
g_yafile.found = FALSE;
g_yafile.directory = false;
g_yafile.found = false;
g_yafile.name = "yafile.txt";
g_yafile.mode = FILE_MODE;
g_yafile.size = strlen(g_yafilecontent);
g_yafile.u.filecontent = g_yafilecontent;
g_subdir.peer = NULL;
g_subdir.directory = TRUE;
g_subdir.found = FALSE;
g_subdir.directory = true;
g_subdir.found = false;
g_subdir.name = "subdir";
g_subdir.mode = DIRECTORY_MODE;
g_subdir.size = 0;
g_subdir.u.child = &g_subdirfile;
g_subdirfile.peer = NULL;
g_subdirfile.directory = FALSE;
g_subdirfile.found = FALSE;
g_subdirfile.directory = false;
g_subdirfile.found = false;
g_subdirfile.name = "subdirfile.txt";
g_subdirfile.mode = FILE_MODE;
g_subdirfile.size = strlen(g_subdirfilecontent);
@ -240,7 +240,7 @@ static struct node_s *findindirectory(struct node_s *entry, const char *name)
{
if (!entry->found && strcmp(entry->name, name) == 0)
{
entry->found = TRUE;
entry->found = true;
return entry;
}
}

View File

@ -40,36 +40,30 @@
* Included Files
*****************************************************************************/
# include <stdio.h>
#include <stdint.h>
#include <stdbool.h>
#include <stdio.h>
/****************************************************************************
* Preprocessor Defintiions
*****************************************************************************/
# define HTONS(a) htons(a)
# define HTONL(a) htonl(a)
# define CONFIG_CPP_HAVE_WARNING 1
# define CONFIG_HAVE_GETHOSTBYNAME 1
# define FAR
#define HTONS(a) htons(a)
#define HTONL(a) htonl(a)
#define CONFIG_CPP_HAVE_WARNING 1
#define CONFIG_HAVE_GETHOSTBYNAME 1
#define FAR
# define ndbg(...) printf(__VA_ARGS__)
# define nvdbg(...) printf(__VA_ARGS__)
#define ndbg(...) printf(__VA_ARGS__)
#define nvdbg(...) printf(__VA_ARGS__)
# define TRUE (1)
# define FALSE (0)
# define ERROR (-1)
# define OK (0)
#define ERROR (-1)
#define OK (0)
/****************************************************************************
* Type Definitions
*****************************************************************************/
typedef unsigned char uint8;
typedef unsigned char ubyte;
typedef unsigned short uint16;
typedef unsigned int uint32;
typedef unsigned char boolean;
typedef void *(*pthread_startroutine_t)(void *);
#endif /* __HOSTDEFS_H */

View File

@ -37,6 +37,7 @@
* Included Files
****************************************************************************/
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
@ -117,7 +118,7 @@ int user_start(int argc, char *argv[])
{
struct in_addr addr;
#if defined(CONFIG_EXAMPLE_SENDMAIL_NOMAC)
uint8 mac[IFHWADDRLEN];
uint8_t mac[IFHWADDRLEN];
#endif
void *handle;

View File

@ -1,7 +1,7 @@
/****************************************************************************
* examples/serloop/main.c
*
* Copyright (C) 2008 Gregory Nutt. All rights reserved.
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@ -39,6 +39,7 @@
#include <nuttx/config.h>
#include <stdint.h>
#include <stdio.h>
#include <unistd.h>
@ -90,7 +91,7 @@ int user_start(int argc, char *argv[])
putchar(ch);
}
#else
ubyte ch;
uint8_t ch;
int ret;
for (;;)

View File

@ -39,7 +39,6 @@
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>

View File

@ -38,7 +38,6 @@
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
@ -48,7 +47,7 @@
#include <net/uip/uip-arch.h>
/****************************************************************************
* Definitions
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************

View File

@ -38,7 +38,6 @@
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>

View File

@ -38,10 +38,10 @@
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/mount.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
@ -155,7 +155,7 @@ int user_start(int argc, char *argv[])
{
struct in_addr addr;
#ifdef CONFIG_EXAMPLE_UIP_NOMAC
uint8 mac[IFHWADDRLEN];
uint8_t mac[IFHWADDRLEN];
#endif
char *thttpd_argv = "thttpd";
int ret;
@ -203,7 +203,7 @@ int user_start(int argc, char *argv[])
/* Create a ROM disk for the ROMFS filesystem */
message("Registering romdisk\n");
ret = romdisk_register(0, (ubyte*)romfs_img, NSECTORS(romfs_img_len), SECTORSIZE);
ret = romdisk_register(0, (uint8_t*)romfs_img, NSECTORS(romfs_img_len), SECTORSIZE);
if (ret < 0)
{
message("ERROR: romdisk_register failed: %d\n", ret);

View File

@ -1,7 +1,7 @@
/****************************************************************************
* examples/udp/udp-server.c
*
* Copyright (C) 2007 Gregory Nutt. All rights reserved.
* Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@ -37,7 +37,6 @@
* Included Files
****************************************************************************/
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>

View File

@ -44,7 +44,9 @@
****************************************************************************/
#include <nuttx/config.h>
#include <sys/ioctl.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
@ -118,7 +120,7 @@ int user_start(int argc, char *argv[])
{
struct in_addr addr;
#if defined(CONFIG_EXAMPLE_UIP_DHCPC) || defined(CONFIG_EXAMPLE_UIP_NOMAC)
uint8 mac[IFHWADDRLEN];
uint8_t mac[IFHWADDRLEN];
#endif
#ifdef CONFIG_EXAMPLE_UIP_DHCPC
void *handle;

View File

@ -41,7 +41,6 @@
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
/****************************************************************************
* Pre-Processor Definitions

View File

@ -155,11 +155,11 @@ static int usbstrg_enumerate(struct usbtrace_s *trace, void *arg)
break;
case TRACE_EPSTALL:
message("Endpoint stall(TRUE): %04x\n", trace->value);
message("Endpoint stall(true): %04x\n", trace->value);
break;
case TRACE_EPRESUME:
message("Endpoint stall(FALSE): %04x\n", trace->value);
message("Endpoint stall(false): %04x\n", trace->value);
break;
case TRACE_DEVALLOCEP:
@ -332,7 +332,7 @@ int user_start(int argc, char *argv[])
message("user_start: handle=%p\n", handle);
message("user_start: Bind LUN=0 to %s\n", CONFIG_EXAMPLES_USBSTRG_DEVPATH1);
ret = usbstrg_bindlun(handle, CONFIG_EXAMPLES_USBSTRG_DEVPATH1, 0, 0, 0, FALSE);
ret = usbstrg_bindlun(handle, CONFIG_EXAMPLES_USBSTRG_DEVPATH1, 0, 0, 0, false);
if (ret < 0)
{
message("user_start: usbstrg_bindlun failed for LUN 1 using %s: %d\n",
@ -344,7 +344,7 @@ int user_start(int argc, char *argv[])
#if CONFIG_EXAMPLES_USBSTRG_NLUNS > 1
message("user_start: Bind LUN=1 to %s\n", CONFIG_EXAMPLES_USBSTRG_DEVPATH2);
ret = usbstrg_bindlun(handle, CONFIG_EXAMPLES_USBSTRG_DEVPATH2, 1, 0, 0, FALSE);
ret = usbstrg_bindlun(handle, CONFIG_EXAMPLES_USBSTRG_DEVPATH2, 1, 0, 0, false);
if (ret < 0)
{
message("user_start: usbstrg_bindlun failed for LUN 2 using %s: %d\n",
@ -356,7 +356,7 @@ int user_start(int argc, char *argv[])
#if CONFIG_EXAMPLES_USBSTRG_NLUNS > 2
message("user_start: Bind LUN=2 to %s\n", CONFIG_EXAMPLES_USBSTRG_DEVPATH3);
ret = usbstrg_bindlun(handle, CONFIG_EXAMPLES_USBSTRG_DEVPATH3, 2, 0, 0, FALSE);
ret = usbstrg_bindlun(handle, CONFIG_EXAMPLES_USBSTRG_DEVPATH3, 2, 0, 0, false);
if (ret < 0)
{
message("user_start: usbstrg_bindlun failed for LUN 3 using %s: %d\n",

View File

@ -40,36 +40,30 @@
* Included Files
*****************************************************************************/
# include <stdio.h>
#include <stdint.h>
#include <stdbool.h>
#include <stdio.h>
/****************************************************************************
* Preprocessor Defintiions
*****************************************************************************/
# define HTONS(a) htons(a)
# define HTONL(a) htonl(a)
# define CONFIG_CPP_HAVE_WARNING 1
# define CONFIG_HAVE_GETHOSTBYNAME 1
# define FAR
#define HTONS(a) htons(a)
#define HTONL(a) htonl(a)
#define CONFIG_CPP_HAVE_WARNING 1
#define CONFIG_HAVE_GETHOSTBYNAME 1
#define FAR
# define ndbg(...) printf(__VA_ARGS__)
# define nvdbg(...) printf(__VA_ARGS__)
#define ndbg(...) printf(__VA_ARGS__)
#define nvdbg(...) printf(__VA_ARGS__)
# define TRUE (1)
# define FALSE (0)
# define ERROR (-1)
# define OK (0)
#define ERROR (-1)
#define OK (0)
/****************************************************************************
* Type Definitions
*****************************************************************************/
typedef unsigned char uint8;
typedef unsigned char ubyte;
typedef unsigned short uint16;
typedef unsigned int uint32;
typedef unsigned char boolean;
typedef void *(*pthread_startroutine_t)(void *);
#endif /* __HOSTDEFS_H */

View File

@ -39,7 +39,7 @@
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdint.h>
#include <unistd.h>
#include <netinet/in.h>
@ -124,7 +124,7 @@ int user_start(int argc, char *argv[])
{
struct in_addr addr;
#if defined(CONFIG_EXAMPLE_WGET_NOMAC)
uint8 mac[IFHWADDRLEN];
uint8_t mac[IFHWADDRLEN];
#endif
/* Many embedded network interfaces must have a software assigned MAC */