lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nwelln...@apache.org
Subject [lucy-commits] [06/10] git commit: refs/heads/charmonizer-decoupling - Switch to new CFISH macros in Clownfish .cfh files
Date Sun, 21 Jul 2013 13:35:15 GMT
Switch to new CFISH macros in Clownfish .cfh files

The C headers generated from .cfh files don't depend on charmony.h now.


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/2731ed4b
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/2731ed4b
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/2731ed4b

Branch: refs/heads/charmonizer-decoupling
Commit: 2731ed4b78f821fcd6f93d5d458d7008bed4c288
Parents: c24ce01
Author: Nick Wellnhofer <wellnhofer@aevum.de>
Authored: Sun Jul 21 14:52:46 2013 +0200
Committer: Nick Wellnhofer <wellnhofer@aevum.de>
Committed: Sun Jul 21 15:31:34 2013 +0200

----------------------------------------------------------------------
 clownfish/runtime/core/Clownfish/CharBuf.cfh    |  6 +++---
 clownfish/runtime/core/Clownfish/Err.cfh        | 10 +++++-----
 .../runtime/core/Clownfish/Util/Atomic.cfh      |  8 ++++----
 .../runtime/core/Clownfish/Util/NumberUtils.cfh | 20 ++++++++++----------
 core/Lucy/Util/Debug.cfh                        |  2 +-
 5 files changed, 23 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/2731ed4b/clownfish/runtime/core/Clownfish/CharBuf.cfh
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/CharBuf.cfh b/clownfish/runtime/core/Clownfish/CharBuf.cfh
index 57f2aa5..01a10b3 100644
--- a/clownfish/runtime/core/Clownfish/CharBuf.cfh
+++ b/clownfish/runtime/core/Clownfish/CharBuf.cfh
@@ -388,13 +388,13 @@ class Clownfish::ZombieCharBuf cnick ZCB
 
 __C__
 
-#define CFISH_ZCB_BLANK() cfish_ZCB_new(alloca(cfish_ZCB_size()))
+#define CFISH_ZCB_BLANK() cfish_ZCB_new(cfish_alloca(cfish_ZCB_size()))
 
 #define CFISH_ZCB_WRAP(source) \
-    cfish_ZCB_wrap(alloca(cfish_ZCB_size()), source)
+    cfish_ZCB_wrap(cfish_alloca(cfish_ZCB_size()), source)
 
 #define CFISH_ZCB_WRAP_STR(ptr, size) \
-    cfish_ZCB_wrap_str(alloca(cfish_ZCB_size()), ptr, size)
+    cfish_ZCB_wrap_str(cfish_alloca(cfish_ZCB_size()), ptr, size)
 
 #ifdef CFISH_USE_SHORT_NAMES
   #define ZCB_BLANK             CFISH_ZCB_BLANK

http://git-wip-us.apache.org/repos/asf/lucy/blob/2731ed4b/clownfish/runtime/core/Clownfish/Err.cfh
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Err.cfh b/clownfish/runtime/core/Clownfish/Err.cfh
index 7bc4f86..00c53d4 100644
--- a/clownfish/runtime/core/Clownfish/Err.cfh
+++ b/clownfish/runtime/core/Clownfish/Err.cfh
@@ -173,8 +173,8 @@ public class Clownfish::Err inherits Clownfish::Obj {
 }
 
 __C__
-#ifdef CHY_HAS_FUNC_MACRO
- #define CFISH_ERR_FUNC_MACRO CHY_FUNC_MACRO
+#ifdef CFISH_HAS_FUNC_MACRO
+ #define CFISH_ERR_FUNC_MACRO CFISH_FUNC_MACRO
 #else
  #define CFISH_ERR_FUNC_MACRO NULL
 #endif
@@ -190,8 +190,8 @@ __C__
 /** Macro version of cfish_Err_throw_at which inserts contextual information
  * automatically, provided that the compiler supports the necessary features.
  */
-#ifdef CHY_HAS_VARIADIC_MACROS
- #ifdef CHY_HAS_ISO_VARIADIC_MACROS
+#ifdef CFISH_HAS_VARIADIC_MACROS
+ #ifdef CFISH_HAS_ISO_VARIADIC_MACROS
   #define CFISH_THROW(_vtable, ...) \
     cfish_Err_throw_at(_vtable, __FILE__, __LINE__, CFISH_ERR_FUNC_MACRO, \
                        __VA_ARGS__)
@@ -200,7 +200,7 @@ __C__
   #define CFISH_MAKE_MESS(...) \
     cfish_Err_make_mess(__FILE__, __LINE__, CFISH_ERR_FUNC_MACRO, \
                         __VA_ARGS__)
- #elif defined(CHY_HAS_GNUC_VARIADIC_MACROS)
+ #elif defined(CFISH_HAS_GNUC_VARIADIC_MACROS)
   #define CFISH_THROW(_vtable, args...) \
     cfish_Err_throw_at(_vtable, __FILE__, __LINE__, \
                        CFISH_ERR_FUNC_MACRO, ##args)

http://git-wip-us.apache.org/repos/asf/lucy/blob/2731ed4b/clownfish/runtime/core/Clownfish/Util/Atomic.cfh
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Util/Atomic.cfh b/clownfish/runtime/core/Clownfish/Util/Atomic.cfh
index 98429c7..2d3bf64 100644
--- a/clownfish/runtime/core/Clownfish/Util/Atomic.cfh
+++ b/clownfish/runtime/core/Clownfish/Util/Atomic.cfh
@@ -44,7 +44,7 @@ cfish_Atomic_cas_ptr(void *volatile *target, void *old_value, void *new_value)
{
 }
 
 /************************** Mac OS X 10.4 and later ***********************/
-#elif defined(CHY_HAS_OSATOMIC_CAS_PTR)
+#elif defined(CFISH_HAS_OSATOMIC_CAS_PTR)
 #include <libkern/OSAtomic.h>
 
 static CFISH_INLINE bool
@@ -53,7 +53,7 @@ cfish_Atomic_cas_ptr(void *volatile *target, void *old_value, void *new_value)
{
 }
 
 /********************************** Windows *******************************/
-#elif defined(CHY_HAS_WINDOWS_H)
+#elif defined(CFISH_HAS_WINDOWS_H)
 
 bool
 cfish_Atomic_wrapped_cas_ptr(void *volatile *target, void *old_value,
@@ -65,7 +65,7 @@ cfish_Atomic_cas_ptr(void *volatile *target, void *old_value, void *new_value)
{
 }
 
 /**************************** Solaris 10 and later ************************/
-#elif defined(CHY_HAS_SYS_ATOMIC_H)
+#elif defined(CFISH_HAS_SYS_ATOMIC_H)
 #include <sys/atomic.h>
 
 static CFISH_INLINE bool
@@ -74,7 +74,7 @@ cfish_Atomic_cas_ptr(void *volatile *target, void *old_value, void *new_value)
{
 }
 
 /************************ Fall back to pthread.h. **************************/
-#elif defined(CHY_HAS_PTHREAD_H)
+#elif defined(CFISH_HAS_PTHREAD_H)
 #include <pthread.h>
 
 extern pthread_mutex_t cfish_Atomic_mutex;

http://git-wip-us.apache.org/repos/asf/lucy/blob/2731ed4b/clownfish/runtime/core/Clownfish/Util/NumberUtils.cfh
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Util/NumberUtils.cfh b/clownfish/runtime/core/Clownfish/Util/NumberUtils.cfh
index cd6c750..7c91df1 100644
--- a/clownfish/runtime/core/Clownfish/Util/NumberUtils.cfh
+++ b/clownfish/runtime/core/Clownfish/Util/NumberUtils.cfh
@@ -183,19 +183,19 @@ __C__
 static CFISH_INLINE void
 cfish_NumUtil_encode_bigend_u16(uint16_t value, void *dest_ptr) {
     uint8_t *dest = *(uint8_t**)dest_ptr;
-#ifdef CHY_BIG_END
+#ifdef CFISH_BIG_END
     memcpy(dest, &value, sizeof(uint16_t));
 #else // little endian
     uint8_t *source = (uint8_t*)&value;
     dest[0] = source[1];
     dest[1] = source[0];
-#endif // CHY_BIG_END (and little endian)
+#endif // CFISH_BIG_END (and little endian)
 }
 
 static CFISH_INLINE void
 cfish_NumUtil_encode_bigend_u32(uint32_t value, void *dest_ptr) {
     uint8_t *dest = *(uint8_t**)dest_ptr;
-#ifdef CHY_BIG_END
+#ifdef CFISH_BIG_END
     memcpy(dest, &value, sizeof(uint32_t));
 #else // little endian
     uint8_t *source = (uint8_t*)&value;
@@ -203,13 +203,13 @@ cfish_NumUtil_encode_bigend_u32(uint32_t value, void *dest_ptr) {
     dest[1] = source[2];
     dest[2] = source[1];
     dest[3] = source[0];
-#endif // CHY_BIG_END (and little endian)
+#endif // CFISH_BIG_END (and little endian)
 }
 
 static CFISH_INLINE void
 cfish_NumUtil_encode_bigend_u64(uint64_t value, void *dest_ptr) {
     uint8_t *dest = *(uint8_t**)dest_ptr;
-#ifdef CHY_BIG_END
+#ifdef CFISH_BIG_END
     memcpy(dest, &value, sizeof(uint64_t));
 #else // little endian
     uint8_t *source = (uint8_t*)&value;
@@ -221,7 +221,7 @@ cfish_NumUtil_encode_bigend_u64(uint64_t value, void *dest_ptr) {
     dest[5] = source[2];
     dest[6] = source[1];
     dest[7] = source[0];
-#endif // CHY_BIG_END (and little endian)
+#endif // CFISH_BIG_END (and little endian)
 }
 
 static CFISH_INLINE uint16_t
@@ -259,7 +259,7 @@ cfish_NumUtil_decode_bigend_u64(void *source) {
 static CFISH_INLINE void
 cfish_NumUtil_encode_bigend_f32(float value, void *dest_ptr) {
     uint8_t *dest = *(uint8_t**)dest_ptr;
-#ifdef CHY_BIG_END
+#ifdef CFISH_BIG_END
     memcpy(dest, &value, sizeof(float));
 #else
     union { float f; uint32_t u32; } duo;
@@ -271,7 +271,7 @@ cfish_NumUtil_encode_bigend_f32(float value, void *dest_ptr) {
 static CFISH_INLINE void
 cfish_NumUtil_encode_bigend_f64(double value, void *dest_ptr) {
     uint8_t *dest = *(uint8_t**)dest_ptr;
-#ifdef CHY_BIG_END
+#ifdef CFISH_BIG_END
     memcpy(dest, &value, sizeof(double));
 #else
     union { double d; uint64_t u64; } duo;
@@ -284,7 +284,7 @@ static CFISH_INLINE float
 cfish_NumUtil_decode_bigend_f32(void *source) {
     union { float f; uint32_t u32; } duo;
     memcpy(&duo, source, sizeof(float));
-#ifdef CHY_LITTLE_END
+#ifdef CFISH_LITTLE_END
     duo.u32 = cfish_NumUtil_decode_bigend_u32(&duo.u32);
 #endif
     return duo.f;
@@ -294,7 +294,7 @@ static CFISH_INLINE double
 cfish_NumUtil_decode_bigend_f64(void *source) {
     union { double d; uint64_t u64; } duo;
     memcpy(&duo, source, sizeof(double));
-#ifdef CHY_LITTLE_END
+#ifdef CFISH_LITTLE_END
     duo.u64 = cfish_NumUtil_decode_bigend_u64(&duo.u64);
 #endif
     return duo.d;

http://git-wip-us.apache.org/repos/asf/lucy/blob/2731ed4b/core/Lucy/Util/Debug.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Util/Debug.cfh b/core/Lucy/Util/Debug.cfh
index 05e1df8..9e81d04 100644
--- a/core/Lucy/Util/Debug.cfh
+++ b/core/Lucy/Util/Debug.cfh
@@ -108,7 +108,7 @@ __C__
         }                                                              \
     } while (0)
 
-#elif defined(CHY_HAS_GNUC_VARIADIC_MACROS) // not LUCY_DEBUG
+#elif defined(CFISH_HAS_GNUC_VARIADIC_MACROS) // not LUCY_DEBUG
 
 #undef LUCY_DEBUG
 #define LUCY_DEBUG_ENABLED 0


Mime
View raw message