lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject git commit: Force some bool values to true/false.
Date Sun, 20 Jul 2014 00:50:27 GMT
Repository: lucy-clownfish
Updated Branches:
  refs/heads/windows_fixes_for_0.4 c49617d98 -> 2493f9006


Force some bool values to true/false.


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

Branch: refs/heads/windows_fixes_for_0.4
Commit: 2493f9006ea65893ed8dbb6d45d56e5e55adc1ac
Parents: c49617d
Author: Marvin Humphrey <marvin@rectangular.com>
Authored: Sun Jul 20 01:49:14 2014 +0100
Committer: Marvin Humphrey <marvin@rectangular.com>
Committed: Sun Jul 20 01:49:14 2014 +0100

----------------------------------------------------------------------
 compiler/src/CFCPerlMethod.c | 7 ++++++-
 runtime/perl/xs/XSBind.h     | 2 +-
 2 files changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/2493f900/compiler/src/CFCPerlMethod.c
----------------------------------------------------------------------
diff --git a/compiler/src/CFCPerlMethod.c b/compiler/src/CFCPerlMethod.c
index d9d8255..1abbb9a 100644
--- a/compiler/src/CFCPerlMethod.c
+++ b/compiler/src/CFCPerlMethod.c
@@ -615,7 +615,12 @@ S_primitive_callback_def(CFCMethod *method, const char *callback_start,
     char callback_func[50];
 
     if (CFCType_is_integer(return_type)) {
-        strcpy(callback_func, "S_finish_callback_i64");
+	if (strcmp(ret_type_str, "bool") == 0) {
+             strcpy(callback_func, "!!S_finish_callback_i64");
+	}
+	else {
+             strcpy(callback_func, "S_finish_callback_i64");
+	}
     }
     else if (CFCType_is_floating(return_type)) {
         strcpy(callback_func, "S_finish_callback_f64");

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/2493f900/runtime/perl/xs/XSBind.h
----------------------------------------------------------------------
diff --git a/runtime/perl/xs/XSBind.h b/runtime/perl/xs/XSBind.h
index 73b5ebb..22189f9 100644
--- a/runtime/perl/xs/XSBind.h
+++ b/runtime/perl/xs/XSBind.h
@@ -55,7 +55,7 @@ static CFISH_INLINE bool
 cfish_XSBind_sv_defined(SV *sv) {
     if (!sv || !SvANY(sv)) { return false; }
     if (SvGMAGICAL(sv)) { mg_get(sv); }
-    return SvOK(sv);
+    return !!SvOK(sv);
 }
 
 /** If the SV contains a Clownfish object which passes an "isa" test against the


Mime
View raw message