size_t should be 64-bits on a 64-bit machine. mmsize_t should be 32-bits (unless CONFIG_MM_SMALL is selected). This commit backs out the last change to stddef.h

This commit is contained in:
Gregory Nutt
2015-11-23 12:03:36 -06:00
parent 5f7dac8076
commit 6230e6e199
6 changed files with 17 additions and 7 deletions
+6
View File
@@ -11140,3 +11140,9 @@
of the block driver (2015-11-21).
* libc/stdio/lib_freopen.c and include/stdio.h: Add support for
freopen() (2015-11-22).
* include/sys/types.h and include/nuttx/mm.h: When building on a 64-bit
machine, the size of size_t should be 64-bits. In general, I believe
that sizeof(size_t) should be the same as sizeof(uinptr_t). mmsize_t
should always be 32-bits in any event. The last change to stddef has
been backed out. With these changes, the simulator builds without
warnings on a 64-bit machine (2015-11-23).
+1 -1
Submodule arch updated: b417eaa97e...ffcd26aff9
+1 -1
Submodule configs updated: 48b7ae421b...82d56af701
+1 -1
View File
@@ -186,7 +186,7 @@
typedef uint16_t mmsize_t;
# define MMSIZE_MAX 0xffff
#else
typedef size_t mmsize_t;
typedef uint32_t mmsize_t;
# define MMSIZE_MAX SIZE_MAX
#endif
+1 -1
View File
@@ -65,7 +65,7 @@
* Reference: Opengroup.org
*/
#define offsetof(type, member) ((size_t)(uintptr_t)&(((type *)0)->member))
#define offsetof(a, b) ((size_t)(&(((a *)(0))->b)))
/****************************************************************************
* Type Definitions
+7 -3
View File
@@ -142,10 +142,14 @@ typedef int16_t ssize_t;
typedef uint16_t rsize_t;
#else /* CONFIG_SMALL_MEMORY */
/* As a general rule, the size of size_t should be the same as the size of
* uintptr_t: 32-bits on a machine with 32-bit addressing but 64-bits on a
* machine with 64-bit addressing.
*/
typedef uint32_t size_t;
typedef int32_t ssize_t;
typedef uint32_t rsize_t;
typedef uintptr_t size_t;
typedef intptr_t ssize_t;
typedef uintptr_t rsize_t;
#endif /* CONFIG_SMALL_MEMORY */