lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nwelln...@apache.org
Subject [lucy-commits] [1/6] git commit: refs/heads/charmonizer-decoupling - Revert "Remove Charmony macros from XSBind.h"
Date Mon, 22 Jul 2013 20:13:30 GMT
Updated Branches:
  refs/heads/charmonizer-decoupling c2ff0a878 -> 7406b6c2d


Revert "Remove Charmony macros from XSBind.h"

This reverts commit c2ff0a87846f54d32c5928a4775470a167b74bf5.


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

Branch: refs/heads/charmonizer-decoupling
Commit: b039a39969f9e031a6a35cf8f35fed104a96a824
Parents: c2ff0a8
Author: Nick Wellnhofer <wellnhofer@aevum.de>
Authored: Mon Jul 22 21:30:39 2013 +0200
Committer: Nick Wellnhofer <wellnhofer@aevum.de>
Committed: Mon Jul 22 21:30:39 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, 55 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/b039a399/clownfish/compiler/src/CFCPerlSub.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCPerlSub.c b/clownfish/compiler/src/CFCPerlSub.c
index 1f6a7c1..2b35ac5 100644
--- a/clownfish/compiler/src/CFCPerlSub.c
+++ b/clownfish/compiler/src/CFCPerlSub.c
@@ -14,11 +14,8 @@
  * 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"
@@ -121,26 +118,10 @@ struct allot_macro_map {
 struct allot_macro_map prim_type_to_allot_macro[] = {
     { "double",     "ALLOT_F64"    },
     { "float",      "ALLOT_F32"    },
-#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
+    { "int",        "ALLOT_INT"    },
+    { "short",      "ALLOT_SHORT"  },
+    { "long",       "ALLOT_LONG"   },
+    { "size_t",     "ALLOT_SIZE_T" },
     { "uint64_t",   "ALLOT_U64"    },
     { "uint32_t",   "ALLOT_U32"    },
     { "uint16_t",   "ALLOT_U16"    },

http://git-wip-us.apache.org/repos/asf/lucy/blob/b039a399/clownfish/runtime/perl/xs/XSBind.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/perl/xs/XSBind.c b/clownfish/runtime/perl/xs/XSBind.c
index ac75d6b..092b5e9 100644
--- a/clownfish/runtime/perl/xs/XSBind.c
+++ b/clownfish/runtime/perl/xs/XSBind.c
@@ -18,7 +18,6 @@
 #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/b039a399/clownfish/runtime/perl/xs/XSBind.h
----------------------------------------------------------------------
diff --git a/clownfish/runtime/perl/xs/XSBind.h b/clownfish/runtime/perl/xs/XSBind.h
index b8568af..c5a5453 100644
--- a/clownfish/runtime/perl/xs/XSBind.h
+++ b/clownfish/runtime/perl/xs/XSBind.h
@@ -20,6 +20,7 @@
 #ifndef H_CFISH_XSBIND
 #define H_CFISH_XSBIND 1
 
+#include "charmony.h"
 #include "Clownfish/Obj.h"
 #include "Clownfish/ByteBuf.h"
 #include "Clownfish/CharBuf.h"
@@ -165,6 +166,11 @@ 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)
  *
@@ -220,6 +226,36 @@ 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) \
@@ -238,6 +274,16 @@ 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) \
@@ -275,6 +321,11 @@ 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/b039a399/perl/xs/Lucy/Document/Doc.c
----------------------------------------------------------------------
diff --git a/perl/xs/Lucy/Document/Doc.c b/perl/xs/Lucy/Document/Doc.c
index 6dd58b4..220a7bf 100644
--- a/perl/xs/Lucy/Document/Doc.c
+++ b/perl/xs/Lucy/Document/Doc.c
@@ -15,7 +15,6 @@
  */
 
 #define C_LUCY_DOC
-#include "charmony.h"
 #include "XSBind.h"
 #include "Lucy/Document/Doc.h"
 #include "Lucy/Store/InStream.h"


Mime
View raw message