summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2012-11-07 10:54:49 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2012-11-13 09:20:57 +0100
commit9ed2befb6bfefe760272aa33d00af45a92240333 (patch)
tree6babd1b1fe05c1f80c4bff8f121f3cdb215da89f
parentrtems-message_queue.adb: Formatting (diff)
downloadrtems-9ed2befb6bfefe760272aa33d00af45a92240333.tar.bz2
score: Add and use RTEMS_ARRAY_SIZE()
-rw-r--r--cpukit/sapi/include/confdefs.h10
-rw-r--r--cpukit/score/include/rtems/score/basedefs.h2
2 files changed, 6 insertions, 6 deletions
diff --git a/cpukit/sapi/include/confdefs.h b/cpukit/sapi/include/confdefs.h
index e32942b58b..5afac3acf4 100644
--- a/cpukit/sapi/include/confdefs.h
+++ b/cpukit/sapi/include/confdefs.h
@@ -1022,7 +1022,7 @@ rtems_fs_init_functions_t rtems_fs_init_helper =
#define CONFIGURE_INIT_TASK_TABLE Initialization_tasks
#define CONFIGURE_INIT_TASK_TABLE_SIZE \
- sizeof(CONFIGURE_INIT_TASK_TABLE) / sizeof(rtems_initialization_tasks_table)
+ RTEMS_ARRAY_SIZE(CONFIGURE_INIT_TASK_TABLE)
#endif /* CONFIGURE_HAS_OWN_INIT_TASK_TABLE */
@@ -1150,7 +1150,7 @@ rtems_fs_init_functions_t rtems_fs_init_helper =
*/
#define CONFIGURE_NUMBER_OF_DRIVERS \
- ((sizeof(Device_drivers) / sizeof(rtems_driver_address_table)))
+ RTEMS_ARRAY_SIZE(Device_drivers)
/**
* This specifies the maximum number of device drivers that
@@ -1622,8 +1622,7 @@ rtems_fs_init_functions_t rtems_fs_init_helper =
#define CONFIGURE_INITIAL_EXTENSION_TABLE Configuration_Initial_Extensions
#define CONFIGURE_NUMBER_OF_INITIAL_EXTENSIONS \
- ((sizeof(Configuration_Initial_Extensions) / \
- sizeof(rtems_extensions_table)))
+ RTEMS_ARRAY_SIZE(Configuration_Initial_Extensions)
#else
#define CONFIGURE_INITIAL_EXTENSION_TABLE NULL
#define CONFIGURE_NUMBER_OF_INITIAL_EXTENSIONS 0
@@ -1797,8 +1796,7 @@ rtems_fs_init_functions_t rtems_fs_init_helper =
POSIX_Initialization_threads
#define CONFIGURE_POSIX_INIT_THREAD_TABLE_SIZE \
- sizeof(CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME) / \
- sizeof(posix_initialization_threads_table)
+ RTEMS_ARRAY_SIZE(CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME)
#endif /* CONFIGURE_POSIX_HAS_OWN_INIT_TASK_TABLE */
diff --git a/cpukit/score/include/rtems/score/basedefs.h b/cpukit/score/include/rtems/score/basedefs.h
index 8239994c03..e91467d84d 100644
--- a/cpukit/score/include/rtems/score/basedefs.h
+++ b/cpukit/score/include/rtems/score/basedefs.h
@@ -174,6 +174,8 @@
typedef int rtems_static_assert_ ## msg [(cond) ? 1 : -1]
#endif
+#define RTEMS_ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0]))
+
#ifndef ASM
#ifdef RTEMS_DEPRECATED_TYPES
typedef bool boolean;