lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nwelln...@apache.org
Subject [lucy-commits] [05/10] git commit: refs/heads/charmonizer-decoupling - Remove Charmony macros from XSBind.h
Date Sun, 21 Jul 2013 13:35:14 GMT
Remove Charmony macros from XSBind.h

Choose platform-specific ALLOT macros in CFCPerlSub.


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

Branch: refs/heads/charmonizer-decoupling
Commit: c2ff0a87846f54d32c5928a4775470a167b74bf5
Parents: 9c3a2a1
Author: Nick Wellnhofer <wellnhofer@aevum.de>
Authored: Sun Jul 21 14:49:14 2013 +0200
Committer: Nick Wellnhofer <wellnhofer@aevum.de>
Committed: Sun Jul 21 15:31:34 2013 +0200

----------------------------------------------------------------------
 clownfish/compiler/src/CFCPerlSub.c | 27 ++++++++++++++---
 clownfish/runtime/perl/xs/XSBind.c  |  1 +
 clownfish/runtime/perl/xs/XSBind.h  | 51 --------------------------------
 perl/xs/Lucy/Document/Doc.c         |  1 +
 4 files changed, 25 insertions(+), 55 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/c2ff0a87/clownfish/compiler/src/CFCPerlSub.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCPerlSub.c b/clownfish/compiler/src/CFCPerlSub.c
index 2b35ac5..1f6a7c1 100644
--- a/clownfish/compiler/src/CFCPerlSub.c
+++ b/clownfish/compiler/src/CFCPerlSub.c
@@ -14,8 +14,11 @@
  * limitations under the License.
  */
 
+#include "charmony.h"
+
 #include <string.h>
 #include <stdio.h>
+
 #define CFC_NEED_BASE_STRUCT_DEF
 #define CFC_NEED_PERLSUB_STRUCT_DEF
 #include "CFCPerlSub.h"
@@ -118,10 +121,26 @@ struct allot_macro_map {
 struct allot_macro_map prim_type_to_allot_macro[] = {
     { "double",     "ALLOT_F64"    },
     { "float",      "ALLOT_F32"    },
-    { "int",        "ALLOT_INT"    },
-    { "short",      "ALLOT_SHORT"  },
-    { "long",       "ALLOT_LONG"   },
-    { "size_t",     "ALLOT_SIZE_T" },
+#if (CHY_SIZEOF_INT == 4)
+    { "int",        "ALLOT_I32"    },
+#else // sizeof(int) == 8
+    { "int",        "ALLOT_I64"    },
+#endif
+#if (CHY_SIZEOF_SHORT == 2)
+    { "short",      "ALLOT_I16"    },
+#else
+  #error "Can't build unless sizeof(short) == 2"
+#endif
+#if (CHY_SIZEOF_LONG == 4)
+    { "long",       "ALLOT_I32"    },
+#else // sizeof(long) == 8
+    { "long",       "ALLOT_I64"    },
+#endif
+#if (CHY_SIZEOF_SIZE_T == 4)
+    { "size_t",     "ALLOT_U32"    },
+#else // sizeof(size_t) == 8
+    { "size_t",     "ALLOT_U64"    },
+#endif
     { "uint64_t",   "ALLOT_U64"    },
     { "uint32_t",   "ALLOT_U32"    },
     { "uint16_t",   "ALLOT_U16"    },

http://git-wip-us.apache.org/repos/asf/lucy/blob/c2ff0a87/clownfish/runtime/perl/xs/XSBind.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/perl/xs/XSBind.c b/clownfish/runtime/perl/xs/XSBind.c
index 092b5e9..ac75d6b 100644
--- a/clownfish/runtime/perl/xs/XSBind.c
+++ b/clownfish/runtime/perl/xs/XSBind.c
@@ -18,6 +18,7 @@
 #define C_CFISH_VTABLE
 #define C_CFISH_LOCKFREEREGISTRY
 #define NEED_newRV_noinc
+#include "charmony.h"
 #include "XSBind.h"
 #include "Clownfish/LockFreeRegistry.h"
 #include "Clownfish/Util/StringHelper.h"

http://git-wip-us.apache.org/repos/asf/lucy/blob/c2ff0a87/clownfish/runtime/perl/xs/XSBind.h
----------------------------------------------------------------------
diff --git a/clownfish/runtime/perl/xs/XSBind.h b/clownfish/runtime/perl/xs/XSBind.h
index c5a5453..b8568af 100644
--- a/clownfish/runtime/perl/xs/XSBind.h
+++ b/clownfish/runtime/perl/xs/XSBind.h
@@ -20,7 +20,6 @@
 #ifndef H_CFISH_XSBIND
 #define H_CFISH_XSBIND 1
 
-#include "charmony.h"
 #include "Clownfish/Obj.h"
 #include "Clownfish/ByteBuf.h"
 #include "Clownfish/CharBuf.h"
@@ -166,11 +165,6 @@ cfish_XSBind_enable_overload(void *pobj);
  *     ALLOT_U32(ptr, key, keylen, required)
  *     ALLOT_U64(ptr, key, keylen, required)
  *     ALLOT_BOOL(ptr, key, keylen, required)
- *     ALLOT_CHAR(ptr, key, keylen, required)
- *     ALLOT_SHORT(ptr, key, keylen, required)
- *     ALLOT_INT(ptr, key, keylen, required)
- *     ALLOT_LONG(ptr, key, keylen, required)
- *     ALLOT_SIZE_T(ptr, key, keylen, required)
  *     ALLOT_F32(ptr, key, keylen, required)
  *     ALLOT_F64(ptr, key, keylen, required)
  *
@@ -226,36 +220,6 @@ cfish_XSBind_allot_params(SV** stack, int32_t start,
 #define XSBIND_WANT_OBJ      0xC
 #define XSBIND_WANT_SV       0xD
 
-#if (CHY_SIZEOF_CHAR == 1)
-  #define XSBIND_WANT_CHAR XSBIND_WANT_I8
-#else
-  #error "Can't build unless sizeof(char) == 1"
-#endif
-
-#if (CHY_SIZEOF_SHORT == 2)
-  #define XSBIND_WANT_SHORT XSBIND_WANT_I16
-#else
-  #error "Can't build unless sizeof(short) == 2"
-#endif
-
-#if (CHY_SIZEOF_INT == 4)
-  #define XSBIND_WANT_INT XSBIND_WANT_I32
-#else // sizeof(int) == 8
-  #define XSBIND_WANT_INT XSBIND_WANT_I64
-#endif
-
-#if (CHY_SIZEOF_LONG == 4)
-  #define XSBIND_WANT_LONG XSBIND_WANT_I32
-#else // sizeof(long) == 8
-  #define XSBIND_WANT_LONG XSBIND_WANT_I64
-#endif
-
-#if (CHY_SIZEOF_SIZE_T == 4)
-  #define XSBIND_WANT_SIZE_T XSBIND_WANT_U32
-#else // sizeof(long) == 8
-  #define XSBIND_WANT_SIZE_T XSBIND_WANT_U64
-#endif
-
 #define XSBIND_ALLOT_I8(ptr, key, keylen, required) \
     ptr, key, keylen, required, XSBIND_WANT_I8, NULL, NULL
 #define XSBIND_ALLOT_I16(ptr, key, keylen, required) \
@@ -274,16 +238,6 @@ cfish_XSBind_allot_params(SV** stack, int32_t start,
     ptr, key, keylen, required, XSBIND_WANT_U64, NULL, NULL
 #define XSBIND_ALLOT_BOOL(ptr, key, keylen, required) \
     ptr, key, keylen, required, XSBIND_WANT_BOOL, NULL, NULL
-#define XSBIND_ALLOT_CHAR(ptr, key, keylen, required) \
-    ptr, key, keylen, required, XSBIND_WANT_CHAR, NULL, NULL
-#define XSBIND_ALLOT_SHORT(ptr, key, keylen, required) \
-    ptr, key, keylen, required, XSBIND_WANT_SHORT, NULL, NULL
-#define XSBIND_ALLOT_INT(ptr, key, keylen, required) \
-    ptr, key, keylen, required, XSBIND_WANT_INT, NULL, NULL
-#define XSBIND_ALLOT_LONG(ptr, key, keylen, required) \
-    ptr, key, keylen, required, XSBIND_WANT_LONG, NULL, NULL
-#define XSBIND_ALLOT_SIZE_T(ptr, key, keylen, required) \
-    ptr, key, keylen, required, XSBIND_WANT_SIZE_T, NULL, NULL
 #define XSBIND_ALLOT_F32(ptr, key, keylen, required) \
     ptr, key, keylen, required, XSBIND_WANT_F32, NULL, NULL
 #define XSBIND_ALLOT_F64(ptr, key, keylen, required) \
@@ -321,11 +275,6 @@ cfish_XSBind_allot_params(SV** stack, int32_t start,
 #define ALLOT_U32                      XSBIND_ALLOT_U32
 #define ALLOT_U64                      XSBIND_ALLOT_U64
 #define ALLOT_BOOL                     XSBIND_ALLOT_BOOL
-#define ALLOT_CHAR                     XSBIND_ALLOT_CHAR
-#define ALLOT_SHORT                    XSBIND_ALLOT_SHORT
-#define ALLOT_INT                      XSBIND_ALLOT_INT
-#define ALLOT_LONG                     XSBIND_ALLOT_LONG
-#define ALLOT_SIZE_T                   XSBIND_ALLOT_SIZE_T
 #define ALLOT_F32                      XSBIND_ALLOT_F32
 #define ALLOT_F64                      XSBIND_ALLOT_F64
 #define ALLOT_OBJ                      XSBIND_ALLOT_OBJ

http://git-wip-us.apache.org/repos/asf/lucy/blob/c2ff0a87/perl/xs/Lucy/Document/Doc.c
----------------------------------------------------------------------
diff --git a/perl/xs/Lucy/Document/Doc.c b/perl/xs/Lucy/Document/Doc.c
index 220a7bf..6dd58b4 100644
--- a/perl/xs/Lucy/Document/Doc.c
+++ b/perl/xs/Lucy/Document/Doc.c
@@ -15,6 +15,7 @@
  */
 
 #define C_LUCY_DOC
+#include "charmony.h"
 #include "XSBind.h"
 #include "Lucy/Document/Doc.h"
 #include "Lucy/Store/InStream.h"


Mime
View raw message