Storable::{last_op_in_netorder,is_storing,is_retrieving} are all boolean.
authorNicholas Clark <nick@ccl4.org>
Sun, 31 Oct 2010 20:52:25 +0000 (20:52 +0000)
committerNicholas Clark <nick@ccl4.org>
Sun, 31 Oct 2010 20:52:25 +0000 (20:52 +0000)
Hence they can have return type bool, which allows xsubpp to generate slightly
simpler (and smaller) code, and at run time avoids using a temporary for the
return value.

dist/Storable/Storable.xs

index 7ede03a..846a650 100644 (file)
@@ -6417,23 +6417,23 @@ SV *    sv
  OUTPUT:
   RETVAL
 
-int
+bool
 last_op_in_netorder()
  CODE:
-  RETVAL = last_op_in_netorder(aTHX);
+  RETVAL = !!last_op_in_netorder(aTHX);
  OUTPUT:
   RETVAL
 
-int
+bool
 is_storing()
  CODE:
-  RETVAL = is_storing(aTHX);
+  RETVAL = !!is_storing(aTHX);
  OUTPUT:
   RETVAL
 
-int
+bool
 is_retrieving()
  CODE:
-  RETVAL = is_retrieving(aTHX);
+  RETVAL = !!is_retrieving(aTHX);
  OUTPUT:
   RETVAL