You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by ma...@apache.org on 2014/07/20 02:50:27 UTC

git commit: Force some bool values to true/false.

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 <ma...@rectangular.com>
Authored: Sun Jul 20 01:49:14 2014 +0100
Committer: Marvin Humphrey <ma...@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