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 2011/02/18 18:58:18 UTC

[lucy-commits] svn commit: r1072089 - /incubator/lucy/trunk/clownfish/typemap

Author: marvin
Date: Fri Feb 18 17:58:18 2011
New Revision: 1072089

URL: http://svn.apache.org/viewvc?rev=1072089&view=rev
Log:
Allow undef to be supplied as a CFC object from Perl-space -- it will be
converted to NULL.  This puts the burden on the C code to perform NULL
checking (TODO).

Modified:
    incubator/lucy/trunk/clownfish/typemap

Modified: incubator/lucy/trunk/clownfish/typemap
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/clownfish/typemap?rev=1072089&r1=1072088&r2=1072089&view=diff
==============================================================================
--- incubator/lucy/trunk/clownfish/typemap (original)
+++ incubator/lucy/trunk/clownfish/typemap Fri Feb 18 17:58:18 2011
@@ -29,11 +29,14 @@ CFCVariable*	CLOWNFISH_TYPE
 INPUT
 
 CLOWNFISH_TYPE
-	if (sv_derived_from($arg, \"${(my $t = $type) =~ s/CFC(\w+).*/Clownfish::$1/;\$t}\")) {
+	if (!SvOK($arg)) {
+        $var = NULL;
+    }
+	else if (sv_derived_from($arg, \"${(my $t = $type) =~ s/CFC(\w+).*/Clownfish::$1/;\$t}\")) {
 		IV objint = SvIV((SV*)SvRV($arg));
 		$var = INT2PTR($type, objint);
 	}
-	else {
+    else {
 		croak(\"Not a ${(my $t = $type) =~ s/CFC(\w+).*/Clownfish::$1/;\$t}\");
 	}