From 24bdea23f746984480bd59dd13dd4d631a210320 Mon Sep 17 00:00:00 2001 From: patacongo Date: Mon, 14 Dec 2009 15:46:55 +0000 Subject: 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@2335 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/arch/arm/include/types.h | 36 ++++++++++++-------- nuttx/arch/hc/include/hc12/types.h | 37 ++++++++++++--------- nuttx/arch/hc/include/hcs12/types.h | 38 ++++++++++++--------- nuttx/arch/pjrc-8051/include/types.h | 50 ++++++++++++++++------------ nuttx/arch/sh/include/m16c/types.h | 45 +++++++++++++++---------- nuttx/arch/sh/include/sh1/types.h | 38 +++++++++++++-------- nuttx/arch/sim/include/types.h | 64 +++++++++++++++++++++--------------- nuttx/arch/z16/include/types.h | 36 ++++++++++++-------- nuttx/arch/z80/include/ez80/irq.h | 10 +++--- nuttx/arch/z80/include/ez80/types.h | 46 ++++++++++++++++---------- nuttx/arch/z80/include/irq.h | 10 +++--- nuttx/arch/z80/include/z8/irq.h | 2 +- nuttx/arch/z80/include/z8/types.h | 37 +++++++++++++-------- nuttx/arch/z80/include/z80/irq.h | 8 ++--- nuttx/arch/z80/include/z80/types.h | 37 +++++++++++++-------- 15 files changed, 298 insertions(+), 196 deletions(-) (limited to 'nuttx/arch') diff --git a/nuttx/arch/arm/include/types.h b/nuttx/arch/arm/include/types.h index f2dbc5a06..9a45fcb75 100644 --- a/nuttx/arch/arm/include/types.h +++ b/nuttx/arch/arm/include/types.h @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/include/types.h * - * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -54,22 +54,32 @@ #ifndef __ASSEMBLY__ -/* These are the sizes of the standard GNU types */ +/* These are the sizes of the standard integer types. 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 + */ + +typedef char _int8_t; +typedef unsigned char _uint8_t; + +typedef short _int16_t; +typedef unsigned short _uint16_t; + +typedef int _int32_t; +typedef unsigned int _uint32_t; -typedef char sbyte; -typedef unsigned char ubyte; -typedef unsigned char uint8; -typedef unsigned char boolean; -typedef short sint16; -typedef unsigned short uint16; -typedef int sint32; -typedef unsigned int uint32; -typedef long long sint64; -typedef unsigned long long uint64; +typedef long long _int64_t; +typedef unsigned long long _uint64_t; +#define __INT64_DEFINED /* A pointer is 4 bytes */ -typedef unsigned int uintptr; +typedef int _intptr_t; +typedef unsigned int _uintptr_t; /* This is the size of the interrupt state save returned by irqsave(). For * ARM, a 32 register value is returned, for the thumb2, Cortex-M3, the 16-bit diff --git a/nuttx/arch/hc/include/hc12/types.h b/nuttx/arch/hc/include/hc12/types.h index 4eb006c3c..f29be6394 100755 --- a/nuttx/arch/hc/include/hc12/types.h +++ b/nuttx/arch/hc/include/hc12/types.h @@ -54,14 +54,19 @@ #ifndef __ASSEMBLY__ -/* These are the sizes of the standard GNU types */ +/* These are the sizes of the standard integer types. 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 + */ -typedef char sbyte; -typedef unsigned char ubyte; -typedef unsigned char uint8; -typedef unsigned char boolean; -typedef short sint16; -typedef unsigned short uint16; +typedef char _int8_t; +typedef unsigned char _uint8_t; +typedef short _int16_t; +typedef unsigned short _uint16_t; /* Normally, mc68hc1x code is compiled with the -mshort option * which results in a 16-bit integer. If -mnoshort is defined @@ -69,23 +74,25 @@ typedef unsigned short uint16; */ # if __INT__ == 16 -typedef long sint32; -typedef unsigned long uint32; +typedef long _int32_t; +typedef unsigned long _uint32_t; #else -typedef int sint32; -typedef unsigned int uint32; +typedef int _int32_t; +typedef unsigned int _uint32_t; #endif -typedef long long sint64; -typedef unsigned long long uint64; +typedef long long _int64_t; +typedef unsigned long long _uint64_t; +#define __INT64_DEFINED /* A pointer is two bytes */ -typedef unsigned short uintptr; +typedef short _intptr_t; +typedef unsigned short _uintptr_t; /* This is the size of the interrupt state save returned by irqsave()*/ -typedef unsigned int irqstate_t; +typedef unsigned int irqstate_t; #endif /* __ASSEMBLY__ */ diff --git a/nuttx/arch/hc/include/hcs12/types.h b/nuttx/arch/hc/include/hcs12/types.h index 1341377e4..33008793a 100755 --- a/nuttx/arch/hc/include/hcs12/types.h +++ b/nuttx/arch/hc/include/hcs12/types.h @@ -54,14 +54,20 @@ #ifndef __ASSEMBLY__ -/* These are the sizes of the standard GNU types */ +/* These are the sizes of the standard integer types. 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 + */ + +typedef char _int8_t; +typedef unsigned char _uint8_t; -typedef char sbyte; -typedef unsigned char ubyte; -typedef unsigned char uint8; -typedef unsigned char boolean; -typedef short sint16; -typedef unsigned short uint16; +typedef short _int16_t; +typedef unsigned short _uint16_t; /* Normally, mc68hc1x code is compiled with the -mshort option * which results in a 16-bit integer. If -mnoshort is defined @@ -69,23 +75,25 @@ typedef unsigned short uint16; */ # if __INT__ == 16 -typedef long sint32; -typedef unsigned long uint32; +typedef long _int32_t; +typedef unsigned long _uint32_t; #else -typedef int sint32; -typedef unsigned int uint32; +typedef int _int32_t; +typedef unsigned int _uint32_t; #endif -typedef long long sint64; -typedef unsigned long long uint64; +typedef long long _int64_t; +typedef unsigned long long _uint64_t; +#define __INT64_DEFINED /* A pointer is two bytes */ -typedef unsigned short uintptr; +typedef short _intptr_t; +typedef unsigned short _uintptr_t; /* This is the size of the interrupt state save returned by irqsave()*/ -typedef unsigned int irqstate_t; +typedef unsigned int irqstate_t; #endif /* __ASSEMBLY__ */ diff --git a/nuttx/arch/pjrc-8051/include/types.h b/nuttx/arch/pjrc-8051/include/types.h index e8fa77a39..45141634c 100644 --- a/nuttx/arch/pjrc-8051/include/types.h +++ b/nuttx/arch/pjrc-8051/include/types.h @@ -1,4 +1,4 @@ -/************************************************************ +/************************************************************************ * arch/pjrc-8051/include/types.h * * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. @@ -31,7 +31,7 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************/ + ************************************************************************/ /* This file should never be included directed but, rather, * only indirectly through sys/types.h @@ -40,51 +40,59 @@ #ifndef __ARCH_PJRC8051_INCLUDE_TYPES_H #define __ARCH_PJRC8051_INCLUDE_TYPES_H -/************************************************************ +/************************************************************************ * Included Files - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Definitions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Type Declarations - ************************************************************/ + ************************************************************************/ #ifndef __ASSEMBLY__ -/* These are the sizes of the standard SDCC types +/* These are the sizes of the standard integer types. 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 + * * * For SDCC, sizeof(int) is 16 and sizeof(long) is 32. * long long and double are not supported. */ -typedef char sbyte; -typedef unsigned char ubyte; -typedef unsigned char uint8; -typedef unsigned char boolean; -typedef int sint16; -typedef unsigned int uint16; -typedef long sint32; -typedef unsigned long uint32; +typedef char _int8_t; +typedef unsigned char _uint8_t; + +typedef int _int16_t; +typedef unsigned int _uint16_t; + +typedef long _int32_t; +typedef unsigned long _uint32_t; /* For SDCC, a Generic pointer is 3 bytes in length with the * first byte holding data space information. */ -typedef unsigned long uintptr; +typedef long _intptr_t; +typedef unsigned long _uintptr_t; /* This is the size of the interrupt state save returned by * irqsave() */ -typedef unsigned char irqstate_t; +typedef unsigned char irqstate_t; #endif /* __ASSEMBLY__ */ -/************************************************************ +/************************************************************************ * Global Function Prototypes - ************************************************************/ + ************************************************************************/ #endif /* __ARCH_PJRC8051_INCLUDE_TYPES_H */ diff --git a/nuttx/arch/sh/include/m16c/types.h b/nuttx/arch/sh/include/m16c/types.h index 8037a4617..d14812860 100644 --- a/nuttx/arch/sh/include/m16c/types.h +++ b/nuttx/arch/sh/include/m16c/types.h @@ -37,8 +37,8 @@ * through sys/types.h */ -#ifndef __ARCH_SH_INCLUDE_SH1_TYPES_H -#define __ARCH_SH_INCLUDE_SH1_TYPES_H +#ifndef __ARCH_SH_INCLUDE_M16C_TYPES_H +#define __ARCH_SH_INCLUDE_M16C_TYPES_H /**************************************************************************** * Included Files @@ -54,29 +54,40 @@ #ifndef __ASSEMBLY__ -/* These are the sizes of the standard GNU types. int is 16-bits and - * long is 32-bits */ +/* These are the sizes of the standard integer types. 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 + * + * int is 16-bits and long is 32-bits + */ + +typedef char _int8_t; +typedef unsigned char _uint8_t; + +typedef int _int16_t; +typedef unsigned int _uint16_t; + +typedef long _int32_t; +typedef unsigned long _uint32_t; -typedef char sbyte; -typedef unsigned char ubyte; -typedef unsigned char uint8; -typedef unsigned char boolean; -typedef int sint16; -typedef unsigned int uint16; -typedef long sint32; -typedef unsigned long uint32; -typedef long long sint64; -typedef unsigned long long uint64; +typedef long long _int64_t; +typedef unsigned long long _uint64_t; +#define __INT64_DEFINED /* A pointer is 2 bytes */ -typedef unsigned int uintptr; +typedef unsigned int _intptr_t; +typedef unsigned int _uintptr_t; /* This is the size of the interrupt state save returned by * irqsave() */ -typedef uint16 irqstate_t; +typedef _uint16_t irqstate_t; #endif /* __ASSEMBLY__ */ @@ -84,4 +95,4 @@ typedef uint16 irqstate_t; * Global Function Prototypes ****************************************************************************/ -#endif /* __ARCH_SH_INCLUDE_SH1_TYPES_H */ +#endif /* __ARCH_SH_INCLUDE_M16C_TYPES_H */ diff --git a/nuttx/arch/sh/include/sh1/types.h b/nuttx/arch/sh/include/sh1/types.h index 7b8876c93..79ed1a181 100644 --- a/nuttx/arch/sh/include/sh1/types.h +++ b/nuttx/arch/sh/include/sh1/types.h @@ -54,28 +54,38 @@ #ifndef __ASSEMBLY__ -/* These are the sizes of the standard GNU types */ - -typedef char sbyte; -typedef unsigned char ubyte; -typedef unsigned char uint8; -typedef unsigned char boolean; -typedef short sint16; -typedef unsigned short uint16; -typedef int sint32; -typedef unsigned int uint32; -typedef long long sint64; -typedef unsigned long long uint64; +/* These are the sizes of the standard integer types. 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 + */ + +typedef char _int8_t; +typedef unsigned char _uint8_t; + +typedef short _int16_t; +typedef unsigned short _uint16_t; + +typedef int _int32_t; +typedef unsigned int _uint32_t; + +typedef long long _int64_t; +typedef unsigned long long _uint64_t; +#define __INT64_DEFINED /* A pointer is 4 bytes */ -typedef unsigned int uintptr; +typedef int _intptr_t; +typedef unsigned int _uintptr_t; /* This is the size of the interrupt state save returned by * irqsave() */ -typedef unsigned long irqstate_t; +typedef unsigned long irqstate_t; #endif /* __ASSEMBLY__ */ diff --git a/nuttx/arch/sim/include/types.h b/nuttx/arch/sim/include/types.h index 9648b12ae..9c265bc6d 100644 --- a/nuttx/arch/sim/include/types.h +++ b/nuttx/arch/sim/include/types.h @@ -1,5 +1,5 @@ -/************************************************************ - * types.h +/************************************************************************ + * arch/sim/include/types.h * * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,56 +31,66 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************/ + ************************************************************************/ /* This file should never be included directed but, rather, * only indirectly through sys/types.h */ -#ifndef __ARCH_TYPES_H -#define __ARCH_TYPES_H +#ifndef __ARCH_SIM_INCLUDE_TYPES_H +#define __ARCH_SIM_INCLUDE_TYPES_H -/************************************************************ +/************************************************************************ * Included Files - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Definitions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Type Declarations - ************************************************************/ + ************************************************************************/ #ifndef __ASSEMBLY__ -/* These are the sizes of the standard GNU types */ +/* These are the sizes of the standard integer types. 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 + */ + +typedef char _int8_t; +typedef unsigned char _uint8_t; + +typedef short _int16_t; +typedef unsigned short _uint16_t; + +typedef int _int32_t; +typedef unsigned int _uint32_t; -typedef char sbyte; -typedef unsigned char ubyte; -typedef unsigned char uint8; -typedef unsigned char boolean; -typedef short sint16; -typedef unsigned short uint16; -typedef int sint32; -typedef unsigned int uint32; -typedef long long sint64; -typedef unsigned long long uint64; +typedef long long _int64_t; +typedef unsigned long long _uint64_t; +#define __INT64_DEFINED /* A pointer is 4 bytes */ -typedef unsigned int uintptr; +typedef unsigned int _intptr_t; +typedef unsigned int _uintptr_t; /* This is the size of the interrupt state save returned by * irqsave() */ -typedef unsigned int irqstate_t; +typedef unsigned int irqstate_t; #endif /* __ASSEMBLY__ */ -/************************************************************ +/************************************************************************ * Global Function Prototypes - ************************************************************/ + ************************************************************************/ -#endif /* __ARCH_TYPES_H */ +#endif /* __ARCH_SIM_INCLUDE_TYPES_H */ diff --git a/nuttx/arch/z16/include/types.h b/nuttx/arch/z16/include/types.h index 34a654184..b83a6070d 100644 --- a/nuttx/arch/z16/include/types.h +++ b/nuttx/arch/z16/include/types.h @@ -37,8 +37,8 @@ * only indirectly through sys/types.h */ -#ifndef __ARCH_Z16_INCLUDE_TYPE_H -#define __ARCH_Z16_INCLUDE_TYPE_H +#ifndef __ARCH_Z16_INCLUDE_TYPES_H +#define __ARCH_Z16_INCLUDE_TYPES_H /**************************************************************************** * Included Files @@ -54,26 +54,34 @@ #ifndef __ASSEMBLY__ -/* These are the sizes of the standard GNU types */ +/* These are the sizes of the standard integer types. 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 + */ + +typedef char _int8_t; +typedef unsigned char _uint8_t; + +typedef short _int16_t; +typedef unsigned short _uint16_t; -typedef char sbyte; -typedef unsigned char ubyte; -typedef unsigned char uint8; -typedef unsigned char boolean; -typedef short sint16; -typedef unsigned short uint16; -typedef int sint32; -typedef unsigned int uint32; +typedef int _int32_t; +typedef unsigned int _uint32_t; /* A pointer is 4 bytes */ -typedef unsigned int uintptr; +typedef int _intptr_t; +typedef unsigned int _uintptr_t; /* This is the size of the interrupt state save returned by * irqsave() */ -typedef unsigned short irqstate_t; +typedef unsigned short irqstate_t; #endif /* __ASSEMBLY__ */ @@ -81,4 +89,4 @@ typedef unsigned short irqstate_t; * Global Function Prototypes ****************************************************************************/ -#endif /* __ARCH_Z16_INCLUDE_TYPE_H */ +#endif /* __ARCH_Z16_INCLUDE_TYPES_H */ diff --git a/nuttx/arch/z80/include/ez80/irq.h b/nuttx/arch/z80/include/ez80/irq.h index 2cbd376f0..dd478d503 100644 --- a/nuttx/arch/z80/include/ez80/irq.h +++ b/nuttx/arch/z80/include/ez80/irq.h @@ -38,8 +38,8 @@ * only indirectly through nuttx/irq.h (via arch/irq.h) */ -#ifndef __ARCH_EZ80_IRQ_H -#define __ARCH_EZ80_IRQ_H +#ifndef __ARCH_Z80_INCLUDE_EZ80_IRQ_H +#define __ARCH_Z80_INCLUDE_EZ80_IRQ_H #ifndef _EZ80F91 # error "Only the EZ80F91 is currently supported" @@ -197,9 +197,9 @@ /* This is the type of the register save array */ #ifdef CONFIG_EZ80_Z80MODE -typedef uint16 chipreg_t; +typedef uint16_t chipreg_t; #else -typedef uint24 chipreg_t; +typedef uint24_t chipreg_t; #endif /* This struct defines the way the registers are stored. */ @@ -254,5 +254,5 @@ EXTERN void irqrestore(irqstate_t flags); #endif #endif -#endif /* __ARCH_EZ80_IRQ_H */ +#endif /* __ARCH_Z80_INCLUDE_EZ80_IRQ_H */ diff --git a/nuttx/arch/z80/include/ez80/types.h b/nuttx/arch/z80/include/ez80/types.h index 52c95ac6b..4ca48e697 100644 --- a/nuttx/arch/z80/include/ez80/types.h +++ b/nuttx/arch/z80/include/ez80/types.h @@ -38,8 +38,8 @@ * through sys/types.h */ -#ifndef __ARCH_CHIP_TYPES_H -#define __ARCH_CHIP_TYPES_H +#ifndef __ARCH_Z80_INCLUDE_EZ80_TYPES_H +#define __ARCH_Z80_INCLUDE_EZ80_TYPES_H /**************************************************************************** * Included Files @@ -55,7 +55,15 @@ #ifndef __ASSEMBLY__ -/* These are the sizes of the types supported by the ZiLOG Z8Encore! compiler: +/* These are the sizes of the standard integer types. 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 + * + * These are the sizes of the types supported by the ZiLOG compiler: * * int - 24-bits * short - 16-bits @@ -64,16 +72,18 @@ * float - 32-bits */ -typedef char sbyte; -typedef unsigned char ubyte; -typedef unsigned char uint8; -typedef unsigned char boolean; -typedef short sint16; -typedef unsigned short uint16; -typedef int sint24; -typedef unsigned int uint24; -typedef long sint32; -typedef unsigned long uint32; +typedef char _int8_t; +typedef unsigned char _uint8_t; + +typedef short _int16_t; +typedef unsigned short _uint16_t; + +typedef int _int24_t; +typedef unsigned int _uint24_t; +#define __INT24_DEFINED + +typedef long _int32_t; +typedef unsigned long _uint32_t; /* A pointer is 2 or 3 bytes, depending upon if the ez80 is in z80 * compatibility mode or not @@ -83,16 +93,18 @@ typedef unsigned long uint32; */ #ifdef CONFIG_EZ80_Z80MODE -typedef unsigned short uintptr; +typedef short _intptr_t; +typedef unsigned short _uintptr_t; #else -typedef unsigned int uintptr; +typedef int _intptr_t; +typedef unsigned int _uintptr_t; #endif /* This is the size of the interrupt state save returned by irqsave(). * It holds the AF regiser pair + a zero pad byte */ -typedef uint24 irqstate_t; +typedef _uint24_t irqstate_t; #endif /* __ASSEMBLY__ */ @@ -100,4 +112,4 @@ typedef uint24 irqstate_t; * Global Function Prototypes ****************************************************************************/ -#endif /* __ARCH_CHIP_TYPES_H */ +#endif /* __ARCH_Z80_INCLUDE_EZ80_TYPES_H */ diff --git a/nuttx/arch/z80/include/irq.h b/nuttx/arch/z80/include/irq.h index 6ef0188ac..62957914f 100644 --- a/nuttx/arch/z80/include/irq.h +++ b/nuttx/arch/z80/include/irq.h @@ -1,7 +1,7 @@ /**************************************************************************** - * arch/irq.h + * arch/z80/include/irq.h * - * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -37,8 +37,8 @@ * only indirectly through nuttx/irq.h */ -#ifndef __ARCH_IRQ_H -#define __ARCH_IRQ_H +#ifndef __ARCH_Z80_INCLUDE_IRQ_H +#define __ARCH_Z80_INCLUDE_IRQ_H /**************************************************************************** * Included Files @@ -77,5 +77,5 @@ extern "C" { #endif #endif -#endif /* __ARCH_IRQ_H */ +#endif /* __ARCH_Z80_INCLUDE_IRQ_H */ diff --git a/nuttx/arch/z80/include/z8/irq.h b/nuttx/arch/z80/include/z8/irq.h index 25c80e009..764ace338 100644 --- a/nuttx/arch/z80/include/z8/irq.h +++ b/nuttx/arch/z80/include/z8/irq.h @@ -306,7 +306,7 @@ /* This is the type of the register save array */ -typedef uint16 chipreg_t; +typedef uint16_t chipreg_t; /* This struct defines the way the registers are stored. */ diff --git a/nuttx/arch/z80/include/z8/types.h b/nuttx/arch/z80/include/z8/types.h index 79f2682f6..0e269a5de 100644 --- a/nuttx/arch/z80/include/z8/types.h +++ b/nuttx/arch/z80/include/z8/types.h @@ -38,8 +38,8 @@ * through sys/types.h */ -#ifndef __ARCH_CHIP_TYPES_H -#define __ARCH_CHIP_TYPES_H +#ifndef __ARCH_Z80_INCLUDE_Z8_IRQ_H +#define __ARCH_Z80_INCLUDE_Z8_IRQ_H /**************************************************************************** * Included Files @@ -55,7 +55,15 @@ #ifndef __ASSEMBLY__ -/* These are the sizes of the types supported by the ZiLOG Z8Encore! compiler: +/* These are the sizes of the standard integer types. 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 + * + * These are the sizes of the types supported by the ZiLOG Z8Encore! compiler: * * int - 16-bits * short - 16-bits @@ -71,22 +79,23 @@ * rom pointer - 16-bits */ -typedef char sbyte; -typedef unsigned char ubyte; -typedef unsigned char uint8; -typedef unsigned char boolean; -typedef int sint16; -typedef unsigned int uint16; -typedef long sint32; -typedef unsigned long uint32; +typedef char _int8_t; +typedef unsigned char _uint8_t; + +typedef int _int16_t; +typedef unsigned int _uint16_t; + +typedef long _int32_t; +typedef unsigned long _uint32_t; /* A pointer is 2 bytes */ -typedef unsigned int uintptr; +typedef unsigned int _intptr_t; +typedef unsigned int _uintptr_t; /* This is the size of the interrupt state save returned by irqsave() */ -typedef ubyte irqstate_t; +typedef _uint8_t irqstate_t; #endif /* __ASSEMBLY__ */ @@ -94,4 +103,4 @@ typedef ubyte irqstate_t; * Global Function Prototypes ****************************************************************************/ -#endif /* __ARCH_CHIP_TYPES_H */ +#endif /* __ARCH_Z80_INCLUDE_Z8_IRQ_H */ diff --git a/nuttx/arch/z80/include/z80/irq.h b/nuttx/arch/z80/include/z80/irq.h index 042e44e17..05e62a019 100644 --- a/nuttx/arch/z80/include/z80/irq.h +++ b/nuttx/arch/z80/include/z80/irq.h @@ -38,8 +38,8 @@ * only indirectly through nuttx/irq.h (via arch/irq.h) */ -#ifndef __ARCH_Z80_IRQ_H -#define __ARCH_Z80_IRQ_H +#ifndef __ARCH_Z80_INCLUDE_Z80_IRQ_H +#define __ARCH_Z80_INCLUDE_Z80_IRQ_H /**************************************************************************** * Included Files @@ -90,7 +90,7 @@ /* This is the type of the register save array */ -typedef uint16 chipreg_t; +typedef uint16_t chipreg_t; /* This struct defines the way the registers are stored. */ @@ -144,5 +144,5 @@ EXTERN void irqrestore(irqstate_t flags) __naked; #endif #endif -#endif /* __ARCH_Z80_IRQ_H */ +#endif /* __ARCH_Z80_INCLUDE_Z80_IRQ_H */ diff --git a/nuttx/arch/z80/include/z80/types.h b/nuttx/arch/z80/include/z80/types.h index d482725bc..652ea5adf 100644 --- a/nuttx/arch/z80/include/z80/types.h +++ b/nuttx/arch/z80/include/z80/types.h @@ -38,8 +38,8 @@ * through sys/types.h */ -#ifndef __ARCH_CHIP_TYPES_H -#define __ARCH_CHIP_TYPES_H +#ifndef __ARC_Z80_INCLUDE_Z80_TYPES_H +#define __ARC_Z80_INCLUDE_Z80_TYPES_H /**************************************************************************** * Included Files @@ -55,7 +55,15 @@ #ifndef __ASSEMBLY__ -/* These are the sizes of the standard SDCC types +/* These are the sizes of the standard integer types. 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 + * + * These are the sizes of the standard SDCC types * * For SDCC, sizeof(int) is 16 and sizeof(long) is 32. long long and double * are not supported. @@ -64,22 +72,23 @@ * space information. */ -typedef char sbyte; -typedef unsigned char ubyte; -typedef unsigned char uint8; -typedef unsigned char boolean; -typedef int sint16; -typedef unsigned int uint16; -typedef long sint32; -typedef unsigned long uint32; +typedef char _int8_t; +typedef unsigned char _uint8_t; + +typedef int _int16_t; +typedef unsigned int _uint16_t; + +typedef long _int32_t; +typedef unsigned long _uint32_t; /* A pointer is 2 bytes */ -typedef unsigned int uintptr; +typedef int _intptr_t; +typedef unsigned int _uintptr_t; /* This is the size of the interrupt state save returned by irqsave() */ -typedef uint16 irqstate_t; +typedef _uint16_t irqstate_t; #endif /* __ASSEMBLY__ */ @@ -87,4 +96,4 @@ typedef uint16 irqstate_t; * Global Function Prototypes ****************************************************************************/ -#endif /* __ARCH_CHIP_TYPES_H */ +#endif /* __ARC_Z80_INCLUDE_Z80_TYPES_H */ -- cgit v1.2.3