Vari fix per documentazione e commenti
authorrasky <rasky@38d2e660-2303-0410-9eaa-f027e97ec537>
Fri, 30 Jul 2004 14:34:10 +0000 (14:34 +0000)
committerrasky <rasky@38d2e660-2303-0410-9eaa-f027e97ec537>
Fri, 30 Jul 2004 14:34:10 +0000 (14:34 +0000)
Aggiunte PP_CATn e STATIC_ASSERT

git-svn-id: https://src.develer.com/svnoss/bertos/trunk@95 38d2e660-2303-0410-9eaa-f027e97ec537

compiler.h
drv/timer.h
mware/formatwr.c
mware/list.h

index 863fbbe40266c92375c02dd1076f0ccfcdfef1e9..62331972442a4e226e7363a08fadbd8fcdbe1145 100755 (executable)
 
 /*
  * $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
  *
 
 
 /* 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 */
        ((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
index 12f74b3fd9cb6f8ddfa77a37490bfe5c695f7a5b..07147416e1eaaf9f831b702aa737b1dd18abc0d4 100755 (executable)
 
 /*
  * $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 <config.h>
 #include <mware/list.h>
 
 /*! 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.
index 1f368913f1b2b85d19f2e06c298b2981acd3b5cd..d83faba32885829471aedaed8cad361b970f3508 100755 (executable)
  *   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
 
 /*
  * $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.
  *
index e05acfb0291bdd73b7e5e9ba77b2db3a5ed2a731..2e5da8907702462c7770b051da92b79c73f4dfb1 100755 (executable)
 
 /*
  * $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)