From 10e37ac9d9b043c37f5086cfd0ebb18afc2ed1fc Mon Sep 17 00:00:00 2001 From: patacongo Date: Wed, 16 Dec 2009 20:30:06 +0000 Subject: [PATCH] Changing NuttX fixed size type names to C99 standard names -- things will be broken for awhile git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2360 42af7a65-404d-4744-a932-0658087f49c3 --- Documentation/NXGraphicsSubsystem.html | 100 ++++++++++++------------- Documentation/NuttX.html | 6 +- Documentation/NuttxPortingGuide.html | 95 ++++++++++++----------- Documentation/NuttxUserGuide.html | 46 ++++++------ 4 files changed, 129 insertions(+), 118 deletions(-) diff --git a/Documentation/NXGraphicsSubsystem.html b/Documentation/NXGraphicsSubsystem.html index 6d4597acfb..22aa5f9625 100644 --- a/Documentation/NXGraphicsSubsystem.html +++ b/Documentation/NXGraphicsSubsystem.html @@ -12,7 +12,7 @@

NX Graphics Subsystem

-

Last Updated: December 5, 2008

+

Last Updated: December 16, 2008

@@ -422,8 +422,8 @@ Holds one device pixel. NXGLIB will select the smallest size for the nxgl_mxpixel_t that just contains the pixel: byte if 16, 24, and 32 resolution - support is disabled, uint16 if 24, and 32 resolution - support is disabled, or uint32. + support is disabled, uint16_t if 24, and 32 resolution + support is disabled, or uint32_t.

@@ -433,7 +433,7 @@ to change:

@@ -501,7 +501,7 @@ struct nxgl_trapezoid_s

Function Prototype:

Description: @@ -512,7 +512,7 @@ void nxgl_rgb2yuv(ubyte r, ubyte g, ubyte b, ubyte *y, ubyte *u, ubyte *v);

Function Prototype:

Description: @@ -617,24 +617,24 @@ nxgl_nonintersecting(FAR struct nxgl_rect_s result[4],

Function Prototype:

Description: - Return TRUE if the two rectangles overlap. + Return true if the two rectangles overlap.

2.2.11 nxgl_rectinside()

Function Prototype:

Description: - Return TRUE if the point pt lies within rect. + Return true if the point pt lies within rect.

2.2.12 nxgl_rectsize()

@@ -653,11 +653,11 @@ void nxgl_rectsize(FAR struct nxgl_size_s *size,

Function Prototype:

Description: - Return TRUE if the area of the retangle is <= 0. + Return true if the area of the retangle is <= 0.

2.2.14 nxgl_runoffset()

@@ -775,17 +775,17 @@ typedef FAR void *NXWINDOW; struct nx_callback_s { void (*redraw)(NXWINDOW hwnd, FAR const struct nxgl_rect_s *rect, - boolean more, FAR void *arg); + bool more, FAR void *arg); void (*position)(NXWINDOW 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 void (*mousein)(NXWINDOW hwnd, FAR const struct nxgl_point_s *pos, - ubyte buttons, FAR void *arg); + uint8_t buttons, FAR void *arg); #endif #ifdef CONFIG_NX_KBD - void (*kbdin)(NXWINDOW hwnd, ubyte nch, FAR const ubyte *ch, FAR void *arg); + void (*kbdin)(NXWINDOW hwnd, uint8_t nch, FAR const uint8_t *ch, FAR void *arg); #endif }; @@ -796,7 +796,7 @@ struct nx_callback_s

Callback Function Prototype:

Description: @@ -812,7 +812,7 @@ void redraw(NXWINDOW hwnd, FAR const struct nxgl_rect_s *rect,

rect
The rectangle that needs to be re-drawn (in window relative coordinates)
more -
TRUE: More re-draw requests will follow +
true: More re-draw requests will follow
arg
User provided argument (see nx_openwindow()) @@ -860,7 +860,7 @@ void position(NXWINDOW hwnd, FAR const struct nxgl_size_s *size,

@@ -889,7 +889,7 @@ void mousein(NXWINDOW hwnd, FAR const struct nxgl_point_s *pos,

Callback Function Prototype:

@@ -1677,8 +1677,8 @@ int nx_bitmap(NXWINDOW hwnd, FAR const struct nxgl_rect_s *dest, #include <nuttx/nx.h> #ifdef CONFIG_NX_KBD -int nx_kbdchin(NXHANDLE handle, ubyte ch); -int nx_kbdin(NXHANDLE handle, ubyte nch, FAR const ubyte *ch); +int nx_kbdchin(NXHANDLE handle, uint8_t ch); +int nx_kbdin(NXHANDLE handle, uint8_t nch, FAR const uint8_t *ch); #endif

@@ -1700,7 +1700,7 @@ int nx_kbdin(NXHANDLE handle, ubyte nch, FAR const ubyte *ch); #include <nuttx/nx.h> #ifdef CONFIG_NX_MOUSE -int nx_mousein(NXHANDLE handle, nxgl_coord_t x, nxgl_coord_t y, ubyte buttons); +int nx_mousein(NXHANDLE handle, nxgl_coord_t x, nxgl_coord_t y, uint8_t buttons); #endif

@@ -2341,12 +2341,12 @@ int nxtk_bitmaptoolbar(NXTKWINDOW hfwnd,

@@ -2357,7 +2357,7 @@ struct nx_fontmetic_s struct nx_fontbitmap_s { struct nx_fontmetic_s metric; /* Character metrics */ - FAR const ubyte *bitmap; /* Pointer to the character bitmap */ + FAR const uint8_t *bitmap; /* Pointer to the character bitmap */ }; @@ -2369,8 +2369,8 @@ struct nx_fontbitmap_s @@ -2381,10 +2381,10 @@ struct nx_fontset_s @@ -2414,7 +2414,7 @@ FAR const struct nx_font_s *nxf_getfontset(void); #include <nuttx/nxglib.h> #include <nuttx/nxfonts.h> -FAR const struct nx_fontbitmap_s *nxf_getbitmap(uint16 ch); +FAR const struct nx_fontbitmap_s *nxf_getbitmap(uint16_t ch);

Description: @@ -2438,28 +2438,28 @@ FAR const struct nx_fontbitmap_s *nxf_getbitmap(uint16 ch); #include <nuttx/nxglib.h> #include <nuttx/nxfonts.h> -int nxf_convert_2bpp(FAR ubyte *dest, uint16 height, - uint16 width, uint16 stride, +int nxf_convert_2bpp(FAR uint8_t *dest, uint16_t height, + uint16_t width, uint16_t stride, FAR const struct nx_fontbitmap_s *bm, nxgl_mxpixel_t color); -int nxf_convert_4bpp(FAR ubyte *dest, uint16 height, - uint16 width, uint16 stride, +int nxf_convert_4bpp(FAR uint8_t *dest, uint16_t height, + uint16_t width, uint16_t stride, FAR const struct nx_fontbitmap_s *bm, nxgl_mxpixel_t color); -int nxf_convert_8bpp(FAR ubyte *dest, uint16 height, - uint16 width, uint16 stride, +int nxf_convert_8bpp(FAR uint8_t *dest, uint16_t height, + uint16_t width, uint16_t stride, FAR const struct nx_fontbitmap_s *bm, nxgl_mxpixel_t color); -int nxf_convert_16bpp(FAR uint16 *dest, uint16 height, - uint16 width, uint16 stride, +int nxf_convert_16bpp(FAR uint16_t *dest, uint16_t height, + uint16_t width, uint16_t stride, FAR const struct nx_fontbitmap_s *bm, nxgl_mxpixel_t color); -int nxf_convert_24bpp(FAR uint32 *dest, uint16 height, - uint16 width, uint16 stride, +int nxf_convert_24bpp(FAR uint32_t *dest, uint16_t height, + uint16_t width, uint16_t stride, FAR const struct nx_fontbitmap_s *bm, nxgl_mxpixel_t color); -int nxf_convert_32bpp(FAR uint32 *dest, uint16 height, - uint16 width, uint16 stride, +int nxf_convert_32bpp(FAR uint32_t *dest, uint16_t height, + uint16_t width, uint16_t stride, FAR const struct nx_fontbitmap_s *bm, nxgl_mxpixel_t color); diff --git a/Documentation/NuttX.html b/Documentation/NuttX.html index 6774545144..f655d0da06 100644 --- a/Documentation/NuttX.html +++ b/Documentation/NuttX.html @@ -8,7 +8,7 @@

NuttX RTOS

-

Last Updated: December 13, 2009

+

Last Updated: December 16, 2009

@@ -1623,6 +1623,10 @@ nuttx-2010.1 2010-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr> int in the architecture; Removed non-standard type STATUS * include/ - Added header files stdint.h, stdbool.h, cxx/cstdint, and cxx/cstdbool + * Changed ALL references to non-standard fixed-size types (like uint32, + ubyte, etc.) to standard types (like uint32_t, uint8_t, etc.) from + stdint.h. Use type bool and {true, false} from stdbool. This effected + most of the files in the system! pascal-2010.1 2010-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr> diff --git a/Documentation/NuttxPortingGuide.html b/Documentation/NuttxPortingGuide.html index a7880d8f8d..6770709efb 100644 --- a/Documentation/NuttxPortingGuide.html +++ b/Documentation/NuttxPortingGuide.html @@ -12,7 +12,7 @@

NuttX RTOS Porting Guide

-

Last Updated: December 12, 2009

+

Last Updated: December 16, 2009

@@ -330,14 +330,22 @@ This provides architecture/toolchain-specific definitions for standard types. This file should typedef: -

and if the architecture supports 64-bit integers

+

and if the architecture supports 24- or 64-bit integers

- and finally + NOTE that these type names have a leading underscore character. This + file will be included(indirectly) by include/stdint.h and typedef'ed to + the final name without the underscore character. This roundabout way of + doings things allows the stdint.h to be removed from the include/ + directory in the event that the user prefers to use the definitions + provided by their toolchain header files +

+

+ And finally

  • @@ -1818,12 +1825,12 @@ extern void up_ledoff(int led); That structure defines a call table with the following methods:

      void lock(FAR struct spi_dev_s *dev);

      -

      void select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, boolean selected);
      - uint32 setfrequency(FAR struct spi_dev_s *dev, uint32 frequency);
      +

      void select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected);
      + uint32_t setfrequency(FAR struct spi_dev_s *dev, uint32_t frequency);
      void setmode(FAR struct spi_dev_s *dev, enum spi_mode_e mode);
      void setbits(FAR struct spi_dev_s *dev, int nbits);
      - ubyte status(FAR struct spi_dev_s *dev, enum spi_dev_e devid);
      - uint16 send(FAR struct spi_dev_s *dev, uint16 wd);
      + uint8_t status(FAR struct spi_dev_s *dev, enum spi_dev_e devid);
      + uint16_t send(FAR struct spi_dev_s *dev, uint16_t wd);
      void exchange(FAR struct spi_dev_s *dev, FAR const void *txbuffer, FAR void *rxbuffer, size_t nwords);

      int registercallback(FAR struct spi_dev_s *dev, mediachange_t callback, void *arg);

    @@ -1856,10 +1863,10 @@ extern void up_ledoff(int led); Each I2C device driver must implement an instance of struct i2c_ops_s. That structure defines a call table with the following methods:
      -

      uint32 setfrequency(FAR struct i2c_dev_s *dev, uint32 frequency);
      +

      uint32_t setfrequency(FAR struct i2c_dev_s *dev, uint32_t frequency);
      int setaddress(FAR struct i2c_dev_s *dev, int addr, int nbits);
      - int write(FAR struct i2c_dev_s *dev, const ubyte *buffer, int buflen);
      - int read(FAR struct i2c_dev_s *dev, ubyte *buffer, int buflen);

      + int write(FAR struct i2c_dev_s *dev, const uint8_t *buffer, int buflen);
      + int read(FAR struct i2c_dev_s *dev, uint8_t *buffer, int buflen);

  • Binding I2C Drivers. @@ -1895,12 +1902,12 @@ extern void up_ledoff(int led); void detach(FAR struct uart_dev_s *dev);
    int ioctl(FAR struct file *filep, int cmd, unsigned long arg);
    int receive(FAR struct uart_dev_s *dev, unsigned int *status);
    - void rxint(FAR struct uart_dev_s *dev, boolean enable);
    - boolean rxavailable(FAR struct uart_dev_s *dev);
    + void rxint(FAR struct uart_dev_s *dev, bool enable);
    + bool rxavailable(FAR struct uart_dev_s *dev);
    void send(FAR struct uart_dev_s *dev, int ch);
    - void txint(FAR struct uart_dev_s *dev, boolean enable);
    - boolean txready(FAR struct uart_dev_s *dev);
    - boolean txempty(FAR struct uart_dev_s *dev);

    + void txint(FAR struct uart_dev_s *dev, bool enable);
    + bool txready(FAR struct uart_dev_s *dev);
    + bool txempty(FAR struct uart_dev_s *dev);

  • @@ -1992,8 +1999,8 @@ extern void up_ledoff(int led); Read/write from the specified read/write blocks: -

    ssize_t (*bread)(FAR struct mtd_dev_s *dev, off_t startblock, size_t nblocks, FAR ubyte *buffer);
    - ssize_t (*bwrite)(FAR struct mtd_dev_s *dev, off_t startblock, size_t nblocks, FAR const ubyte *buffer);

    +

    ssize_t (*bread)(FAR struct mtd_dev_s *dev, off_t startblock, size_t nblocks, FAR uint8_t *buffer);
    + ssize_t (*bwrite)(FAR struct mtd_dev_s *dev, off_t startblock, size_t nblocks, FAR const uint8_t *buffer);

    Some devices may support byte oriented reads (optional). @@ -2001,7 +2008,7 @@ extern void up_ledoff(int led); It is recommended that low-level drivers not support read() if it requires buffering.

      -

      ssize_t (*read)(FAR struct mtd_dev_s *dev, off_t offset, size_t nbytes, FAR ubyte *buffer);

      +

      ssize_t (*read)(FAR struct mtd_dev_s *dev, off_t offset, size_t nbytes, FAR uint8_t *buffer);

    Support other, less frequently used commands: @@ -2050,8 +2057,8 @@ extern void up_ledoff(int led);

      void (*reset)(FAR struct sdio_dev_s *dev);
      - ubyte (*status)(FAR struct sdio_dev_s *dev);
      - void (*widebus)(FAR struct sdio_dev_s *dev, boolean enable);
      + uint8_t (*status)(FAR struct sdio_dev_s *dev);
      + void (*widebus)(FAR struct sdio_dev_s *dev, bool enable);
      void (*clock)(FAR struct sdio_dev_s *dev, enum sdio_clock_e rate);
      int (*attach)(FAR struct sdio_dev_s *dev);

    @@ -2059,25 +2066,25 @@ extern void up_ledoff(int led); Command/Status/Data Transfer: -

    void (*sendcmd)(FAR struct sdio_dev_s *dev, uint32 cmd, uint32 arg);
    - int (*recvsetup)(FAR struct sdio_dev_s *dev, FAR ubyte *buffer, size_t nbytes);
    - int (*sendsetup)(FAR struct sdio_dev_s *dev, FAR const ubyte *buffer, size_t nbytes);
    +

    void (*sendcmd)(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t arg);
    + int (*recvsetup)(FAR struct sdio_dev_s *dev, FAR uint8_t *buffer, size_t nbytes);
    + int (*sendsetup)(FAR struct sdio_dev_s *dev, FAR const uint8_t *buffer, size_t nbytes);
    int (*cancel)(FAR struct sdio_dev_s *dev);
    - int (*waitresponse)(FAR struct sdio_dev_s *dev, uint32 cmd);
    - int (*recvR1)(FAR struct sdio_dev_s *dev, uint32 cmd, uint32 *R1);
    - int (*recvR2)(FAR struct sdio_dev_s *dev, uint32 cmd, uint32 R2[4]);
    - int (*recvR3)(FAR struct sdio_dev_s *dev, uint32 cmd, uint32 *R3);
    - int (*recvR4)(FAR struct sdio_dev_s *dev, uint32 cmd, uint32 *R4);
    - int (*recvR5)(FAR struct sdio_dev_s *dev, uint32 cmd, uint32 *R5);
    - int (*recvR6)(FAR struct sdio_dev_s *dev, uint32 cmd, uint32 *R6);
    - int (*recvR7)(FAR struct sdio_dev_s *dev, uint32 cmd, uint32 *R7);

    + int (*waitresponse)(FAR struct sdio_dev_s *dev, uint32_t cmd);
    + int (*recvR1)(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t *R1);
    + int (*recvR2)(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t R2[4]);
    + int (*recvR3)(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t *R3);
    + int (*recvR4)(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t *R4);
    + int (*recvR5)(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t *R5);
    + int (*recvR6)(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t *R6);
    + int (*recvR7)(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t *R7);

    Event/Callback support:

      void (*waitenable)(FAR struct sdio_dev_s *dev, sdio_eventset_t eventset);
      - sdio_eventset_t (*eventwait)(FAR struct sdio_dev_s *dev, uint32 timeout);
      + sdio_eventset_t (*eventwait)(FAR struct sdio_dev_s *dev, uint32_t timeout);
      void (*callbackenable)(FAR struct sdio_dev_s *dev, sdio_eventset_t eventset);
      int (*registercallback)(FAR struct sdio_dev_s *dev, worker_t callback, void *arg);

    @@ -2085,9 +2092,9 @@ extern void up_ledoff(int led); DMA support:

      -

      boolean (*dmasupported)(FAR struct sdio_dev_s *dev);
      - int (*dmarecvsetup)(FAR struct sdio_dev_s *dev, FAR ubyte *buffer, size_t buflen);
      - int (*dmasendsetup)(FAR struct sdio_dev_s *dev, FAR const ubyte *buffer, size_t buflen);

      +

      bool (*dmasupported)(FAR struct sdio_dev_s *dev);
      + int (*dmarecvsetup)(FAR struct sdio_dev_s *dev, FAR uint8_t *buffer, size_t buflen);
      + int (*dmasendsetup)(FAR struct sdio_dev_s *dev, FAR const uint8_t *buffer, size_t buflen);

  • diff --git a/Documentation/NuttxUserGuide.html b/Documentation/NuttxUserGuide.html index 5d477c8cfc..024e0392de 100644 --- a/Documentation/NuttxUserGuide.html +++ b/Documentation/NuttxUserGuide.html @@ -296,7 +296,7 @@ VxWorks provides the following similar interface: Function Prototype:
        #include <sched.h>
    -   int task_init(_TCB *tcb, char *name, int priority, uint32 *stack, uint32 stack_size,
    +   int task_init(_TCB *tcb, char *name, int priority, uint32_t *stack, uint32_t stack_size,
                      maint_t entry, const char *argv[]);
     
    @@ -346,7 +346,7 @@ mechanism to initialize and start a new task. POSIX Compatibility: This is a NON-POSIX interface. VxWorks provides the following similar interface:
    -   STATUS taskInit(WIND_TCB *pTcb, char *name, int priority, int options, uint32 *pStackBase, int stackSize,
    +   STATUS taskInit(WIND_TCB *pTcb, char *name, int priority, int options, uint32_t *pStackBase, int stackSize,
                        FUNCPTR entryPt, int arg1, int arg2, int arg3, int arg4, int arg5,
                        int arg6, int arg7, int arg8, int arg9, int arg10);
     
    @@ -1039,7 +1039,7 @@ VxWorks provides the comparable interface: Function Prototype:
         #include <sched.h>
    -    sint32 sched_lockcount( void )
    +    int32_t sched_lockcount( void )
     

    @@ -2363,8 +2363,8 @@ wd_start() on a given watchdog ID has any effect.

  • wdog. Watchdog ID
  • delay. Delay count in clock ticks
  • wdentry. Function to call on timeout -
  • argc. The number of uint32 parameters to pass to wdentry. -
  • .... uint32 size parameters to pass to wdentry +
  • argc. The number of uint32_t parameters to pass to wdentry. +
  • .... uint32_t size parameters to pass to wdentry

    @@ -6555,16 +6555,16 @@ int mkfatfs(FAR const char *pathname, FAR struct fat_format_s *fmt);

     struct fat_format_s
     {
    -   ubyte   ff_nfats;           /* Number of FATs */
    -   ubyte   ff_fattype;         /* FAT size: 0 (autoselect), 12, 16, or 32 */
    -   ubyte   ff_clustshift;      /* Log2 of sectors per cluster: 0-5, 0xff (autoselect) */
    -   ubyte   ff_volumelabel[11]; /* Volume label */
    -   uint16  ff_backupboot;      /* Sector number of the backup boot sector (0=use default)*/
    -   uint16  ff_rootdirentries;  /* Number of root directory entries */
    -   uint16  ff_rsvdseccount;    /* Reserved sectors */
    -   uint32  ff_hidsec;          /* Count of hidden sectors preceding fat */
    -   uint32  ff_volumeid;        /* FAT volume id */
    -   uint32  ff_nsectors;        /* Number of sectors from device to use: 0: Use all */
    +   uint8_t  ff_nfats;           /* Number of FATs */
    +   uint8_t  ff_fattype;         /* FAT size: 0 (autoselect), 12, 16, or 32 */
    +   uint8_t  ff_clustshift;      /* Log2 of sectors per cluster: 0-5, 0xff (autoselect) */
    +   uint8_t  ff_volumelabel[11]; /* Volume label */
    +   uint16_t ff_backupboot;      /* Sector number of the backup boot sector (0=use default)*/
    +   uint16_t ff_rootdirentries;  /* Number of root directory entries */
    +   uint16_t ff_rsvdseccount;    /* Reserved sectors */
    +   uint32_t ff_hidsec;          /* Count of hidden sectors preceding fat */
    +   uint32_t ff_volumeid;        /* FAT volume id */
    +   uint32_t ff_nsectors;        /* Number of sectors from device to use: 0: Use all */
     };
     
  • @@ -7588,25 +7588,25 @@ notify a task when a message is available on a queue. typedef void (*wdentry_t)(int argc, ...);

    - Where argc is the number of uint32 type arguments that follow. + Where argc is the number of uint32_t type arguments that follow.

    - The arguments are passed as uint32 values. - For systems where the sizeof(pointer) < sizeof(uint32), the + The arguments are passed as uint32_t values. + For systems where the sizeof(pointer) < sizeof(uint32_t), the following union defines the alignment of the pointer within the - uint32. For example, the SDCC MCS51 general pointer is - 24-bits, but uint32 is 32-bits (of course). + uint32_t. For example, the SDCC MCS51 general pointer is + 24-bits, but uint32_t is 32-bits (of course).

         union wdparm_u
         {
           void   *pvarg;
    -      uint32 *dwarg;
    +      uint32_t *dwarg;
         };
         typedef union wdparm_u wdparm_t;
     

    - For most 32-bit systems, pointers and uint32 are the same size - For systems where sizeof(pointer) > sizeof(uint32), we will + For most 32-bit systems, pointers and uint32_t are the same size + For systems where sizeof(pointer) > sizeof(uint32_t), we will have to do some redesign.