From 75afc1af2ed7408319fef569d1e3b63a56e769c3 Mon Sep 17 00:00:00 2001 From: rasky Date: Fri, 30 Jul 2004 14:34:10 +0000 Subject: [PATCH] Vari fix per documentazione e commenti Aggiunte PP_CATn e STATIC_ASSERT git-svn-id: https://src.develer.com/svnoss/bertos/trunk@95 38d2e660-2303-0410-9eaa-f027e97ec537 --- compiler.h | 26 ++++++++++++++++++++------ drv/timer.h | 9 +++++++-- mware/formatwr.c | 10 ++++++++++ mware/list.h | 8 ++++++-- 4 files changed, 43 insertions(+), 10 deletions(-) diff --git a/compiler.h b/compiler.h index 863fbbe4..62331972 100755 --- a/compiler.h +++ b/compiler.h @@ -15,6 +15,10 @@ /* * $Log$ + * Revision 1.11 2004/07/30 14:34:10 rasky + * Vari fix per documentazione e commenti + * Aggiunte PP_CATn e STATIC_ASSERT + * * Revision 1.10 2004/07/30 14:15:53 rasky * Nuovo supporto unificato per detect della CPU * @@ -241,9 +245,9 @@ /* Simple macros */ -#define ABS(a) (((a) < 0) ? -(a) : (a)) -#define MIN(a,b) (((a) < (b)) ? (a) : (b)) -#define MAX(a,b) (((a) > (b)) ? (a) : (b)) +#define ABS(a) (((a) < 0) ? -(a) : (a)) +#define MIN(a,b) (((a) < (b)) ? (a) : (b)) +#define MAX(a,b) (((a) > (b)) ? (a) : (b)) #ifndef BV /*! Convert a bit value to a binary flag */ @@ -272,9 +276,19 @@ ((x < 65536UL) ? UINT16_LOG2(x) : UINT16_LOG2((x) >> 16) + 16) /*! Concatenate two different preprocessor tokens (allowing macros to expand) */ -#define PP_CAT(x,y) PP_CAT__(x,y) -#define PP_CAT__(x,y) x ## y - +#define PP_CAT(x,y) PP_CAT__(x,y) +#define PP_CAT__(x,y) x ## y +#define PP_CAT3(x,y,z) PP_CAT(PP_CAT(x,y),z) +#define PP_CAT4(x,y,z,w) PP_CAT(PP_CAT3(x,y,z),w) +#define PP_CAT5(x,y,z,w,j) PP_CAT(PP_CAT4(x,y,z,w),j) + +/*! String-ize a token (allowing macros to expand) */ +#define PP_STRINGIZE(x) PP_STRINGIZE__(x) +#define PP_STRINGIZE__(x) #x + +/*! Issue a compilation error if the \a condition is false */ +#define STATIC_ASSERT(condition) \ + extern char CT_ASSERT___[(condition) ? 1 : -1] /* * Standard type definitions diff --git a/drv/timer.h b/drv/timer.h index 12f74b3f..07147416 100755 --- a/drv/timer.h +++ b/drv/timer.h @@ -15,6 +15,10 @@ /* * $Log$ + * Revision 1.12 2004/07/30 14:34:10 rasky + * Vari fix per documentazione e commenti + * Aggiunte PP_CATn e STATIC_ASSERT + * * Revision 1.11 2004/07/29 22:40:12 bernie * Spelling fix. * @@ -54,6 +58,7 @@ #include "cpu.h" #include "compiler.h" +#include #include /*! Number of timer ticks per second. */ @@ -128,14 +133,14 @@ extern volatile time_t _clock; * * The following code is safe: * - * \example + * \code * time_t tea_start_time = get_tick(); * * boil_water(); * * if (get_tick() - tea_start_time > TEAPOT_DELAY) * printf("Your tea, Sir.\n"); - * \endexample + * \endcode * * When the tick counter increments every millisecond and time_t * is 32bit wide, the tick count will overflow every 49.7 days. diff --git a/mware/formatwr.c b/mware/formatwr.c index 1f368913..d83faba3 100755 --- a/mware/formatwr.c +++ b/mware/formatwr.c @@ -31,6 +31,12 @@ * PRINTF_REDUCED 924byte (0x39C) * PRINTF_NOMODIFIERS 416byte (0x1A0) * + * Code/data size in words on DSP56K with CodeWarrior 6.0: + * PRINTF_FULL 1493/45 + * PRINTF_NOFLOAT 795/45 + * PRINTF_REDUCED 482/0 + * PRINTF_NOMODIFIERS 301/0 + * * The reduced version of formatter is suitable when program size is critical * rather than formatting power. This routine uses less than 20 bytes of * stack space which makes it practical even in systems with less than 256 @@ -47,6 +53,10 @@ /* * $Log$ + * Revision 1.6 2004/07/30 14:34:10 rasky + * Vari fix per documentazione e commenti + * Aggiunte PP_CATn e STATIC_ASSERT + * * Revision 1.5 2004/07/29 22:57:09 bernie * Switch to new-style config handling. * diff --git a/mware/list.h b/mware/list.h index e05acfb0..2e5da890 100755 --- a/mware/list.h +++ b/mware/list.h @@ -13,6 +13,10 @@ /* * $Log$ + * Revision 1.6 2004/07/30 14:34:10 rasky + * Vari fix per documentazione e commenti + * Aggiunte PP_CATn e STATIC_ASSERT + * * Revision 1.5 2004/07/20 23:45:01 bernie * Finally remove redundant protos. * @@ -121,7 +125,7 @@ typedef struct _List #define ISLISTEMPTY(l) ( (l)->head == (Node *)(&(l)->null) ) /*! - * \name Unlink a node from the head of the list \a l. + * Unlink a node from the head of the list \a l. * \return Pointer to node, or NULL if the list was empty. */ INLINE Node *REMHEAD(List *l) @@ -138,7 +142,7 @@ INLINE Node *REMHEAD(List *l) } /*! - * \name Unlink a node from the tail of the list \a l. + * Unlink a node from the tail of the list \a l. * \return Pointer to node, or NULL if the list was empty. */ INLINE Node *REMTAIL(List *l) -- 2.25.1