[Orca-checkins] rev 235 - in trunk/orca: . packages/Storable-2.06 packages/Storable-2.07 packages/Storable-2.07/t
Blair Zajac
blair at orcaware.com
Mon May 5 08:30:32 PDT 2003
Author: blair
Date: Mon May 5 08:30:26 2003
New Revision: 235
Added:
trunk/orca/packages/Storable-2.07/
- copied from rev 234, trunk/orca/packages/Storable-2.06/
Removed:
trunk/orca/packages/Storable-2.06/
Modified:
trunk/orca/INSTALL
trunk/orca/configure.in
trunk/orca/packages/Storable-2.07/ChangeLog
trunk/orca/packages/Storable-2.07/MANIFEST
trunk/orca/packages/Storable-2.07/README
trunk/orca/packages/Storable-2.07/Storable.pm
trunk/orca/packages/Storable-2.07/Storable.xs
trunk/orca/packages/Storable-2.07/t/integer.t
trunk/orca/packages/Storable-2.07/t/restrict.t
trunk/orca/packages/Storable-2.07/t/st-dump.pl
trunk/orca/packages/Storable-2.07/t/tied.t
Log:
Upgrade Storable from 2.06 to 2.07 and require the new version for
Orca.
* configure.in:
Bump Storable's version number to 2.07.
* INSTALL (Determine which Perl modules need compiling and installing):
Update all references to Storable's version number from 2.06 to
2.07.
* packages/Storable-2.07:
Renamed from packages/Storable-2.06. Directory contents updated
from Storable-2.07.tar.gz.
Modified: trunk/orca/INSTALL
==============================================================================
--- trunk/orca/INSTALL (original)
+++ trunk/orca/INSTALL Mon May 5 08:30:26 2003
@@ -175,7 +175,7 @@
Digest::MD5 >= 2.24 >= 2.24 2.24
Math::IntervalSearch >= 1.05 >= 1.05 1.05
RRDs >= 1.000421 >= 1.0.42 1.0.42
- Storable >= 2.06 >= 2.06 2.06
+ Storable >= 2.07 >= 2.07 2.07
Time::HiRes Not required by Orca 1.46
All seven of these modules are included with the Orca distribution
@@ -266,10 +266,10 @@
Storable
- http://www.perl.com/CPAN/authors/id/A/AM/AMS/Storable-2.06.tar.gz
+ http://www.perl.com/CPAN/authors/id/A/AM/AMS/Storable-2.07.tar.gz
- % gunzip -c Storable-2.06.tar.gz | tar xvf -
- % cd Storable-2.06
+ % gunzip -c Storable-2.07.tar.gz | tar xvf -
+ % cd Storable-2.07
% perl Makefile.PL
% make
% make test
Modified: trunk/orca/configure.in
==============================================================================
--- trunk/orca/configure.in (original)
+++ trunk/orca/configure.in Mon May 5 08:30:26 2003
@@ -39,8 +39,8 @@
MATH_INTERVALSEARCH_VER=1.05
RRDTOOL_DIR=rrdtool-1.0.42
RRDTOOL_VER=1.000421
-STORABLE_DIR=Storable-2.06
-STORABLE_VER=2.06
+STORABLE_DIR=Storable-2.07
+STORABLE_VER=2.07
TIME_HIRES_DIR=Time-HiRes-1.46
TIME_HIRES_VER=1.46
Modified: trunk/orca/packages/Storable-2.07/ChangeLog
==============================================================================
--- trunk/orca/packages/Storable-2.06/ChangeLog (original)
+++ trunk/orca/packages/Storable-2.07/ChangeLog Mon May 5 08:30:26 2003
@@ -1,3 +1,10 @@
+Mon May 5 10:24:16 IST 2003 Abhijit Menon-Sen <ams at wiw.org>
+
+ Version 2.07
+
+ Minor bugfixes (self-tied objects are now correctly stored, as
+ are the results of additions larger than INT_MAX).
+
Mon Oct 7 21:56:38 BST 2002 Nicholas Clark <nick at ccl4.org>
Version 2.06
Modified: trunk/orca/packages/Storable-2.07/MANIFEST
==============================================================================
--- trunk/orca/packages/Storable-2.06/MANIFEST (original)
+++ trunk/orca/packages/Storable-2.07/MANIFEST Mon May 5 08:30:26 2003
@@ -30,6 +30,3 @@
t/tied_items.t See if Storable works
t/utf8.t See if Storable works
t/utf8hash.t See if Storable works
-t/Test/More.pm
-t/Test/Simple.pm
-t/Test/Builder.pm
Modified: trunk/orca/packages/Storable-2.07/README
==============================================================================
--- trunk/orca/packages/Storable-2.06/README (original)
+++ trunk/orca/packages/Storable-2.07/README Mon May 5 08:30:26 2003
@@ -1,4 +1,4 @@
- Storable 2.06
+ Storable 2.07
Copyright (c) 1995-2000, Raphael Manfredi
Copyright (c) 2001,2002, Larry Wall
Modified: trunk/orca/packages/Storable-2.07/Storable.pm
==============================================================================
--- trunk/orca/packages/Storable-2.06/Storable.pm (original)
+++ trunk/orca/packages/Storable-2.07/Storable.pm Mon May 5 08:30:26 2003
@@ -21,7 +21,7 @@
use AutoLoader;
use vars qw($canonical $forgive_me $VERSION);
-$VERSION = '2.06';
+$VERSION = '2.07';
*AUTOLOAD = \&AutoLoader::AUTOLOAD; # Grrr...
#
Modified: trunk/orca/packages/Storable-2.07/Storable.xs
==============================================================================
--- trunk/orca/packages/Storable-2.06/Storable.xs (original)
+++ trunk/orca/packages/Storable-2.07/Storable.xs Mon May 5 08:30:26 2003
@@ -10,9 +10,15 @@
#include <EXTERN.h>
#include <perl.h>
-#include <patchlevel.h> /* Perl's one, needed since 5.6 */
#include <XSUB.h>
+#ifndef PATCHLEVEL
+# include <patchlevel.h> /* Perl's one, needed since 5.6 */
+# if !(defined(PERL_VERSION) || (SUBVERSION > 0 && defined(PATCHLEVEL)))
+# include <could_not_find_Perl_patchlevel.h>
+# endif
+#endif
+
#ifndef NETWARE
#if 0
#define DEBUGME /* Debug mode, turns assertions on as well */
@@ -1954,7 +1960,7 @@
#else
SvIV_please(sv);
- if (SvIOK(sv)) {
+ if (SvIOK_notUV(sv)) {
iv = SvIV(sv);
goto integer; /* Share code above */
}
@@ -2263,7 +2269,7 @@
/*
* Storing in "random" order (in the order the keys are stored
- * within the the hash). This is the default and will be faster!
+ * within the hash). This is the default and will be faster!
*/
for (i = 0; i < len; i++) {
@@ -2424,14 +2430,14 @@
text = POPs;
len = SvLEN(text);
- reallen = strlen(SvPV(text,PL_na));
+ reallen = strlen(SvPV_nolen(text));
/*
* Empty code references or XS functions are deparsed as
* "(prototype) ;" or ";".
*/
- if (len == 0 || *(SvPV(text,PL_na)+reallen-1) == ';') {
+ if (len == 0 || *(SvPV_nolen(text)+reallen-1) == ';') {
CROAK(("The result of B::Deparse::coderef2text was empty - maybe you're trying to serialize an XS function?\n"));
}
@@ -2441,13 +2447,13 @@
PUTMARK(SX_CODE);
TRACEME(("size = %d", len));
- TRACEME(("code = %s", SvPV(text,PL_na)));
+ TRACEME(("code = %s", SvPV_nolen(text)));
/*
* Now store the source code.
*/
- STORE_SCALAR(SvPV(text,PL_na), len);
+ STORE_SCALAR(SvPV_nolen(text), len);
FREETMPS;
LEAVE;
@@ -2469,6 +2475,7 @@
static int store_tied(stcxt_t *cxt, SV *sv)
{
MAGIC *mg;
+ SV *obj = NULL;
int ret = 0;
int svt = SvTYPE(sv);
char mtype = 'P';
@@ -2514,7 +2521,9 @@
* accesses on the retrieved object will indeed call the magic methods...
*/
- if ((ret = store(cxt, mg->mg_obj))) /* Extra () for -Wall, grr... */
+ /* [#17040] mg_obj is NULL for scalar self-ties. AMS 20030416 */
+ obj = mg->mg_obj ? mg->mg_obj : newSV(0);
+ if ((ret = store(cxt, obj)))
return ret;
TRACEME(("ok (tied)"));
@@ -3366,7 +3375,7 @@
length -= sizeof (magicstr) - 1;
}
- WRITE(header, length);
+ WRITE( (unsigned char*) header, length);
if (!cxt->netorder) {
TRACEME(("ok (magic_write byteorder = 0x%lx [%d], I%d L%d P%d D%d)",
@@ -4257,19 +4266,27 @@
static SV *retrieve_tied_scalar(stcxt_t *cxt, char *cname)
{
SV *tv;
- SV *sv;
+ SV *sv, *obj = NULL;
TRACEME(("retrieve_tied_scalar (#%d)", cxt->tagnum));
tv = NEWSV(10002, 0);
SEEN(tv, cname); /* Will return if rv is null */
sv = retrieve(cxt, 0); /* Retrieve <object> */
- if (!sv)
+ if (!sv) {
return (SV *) 0; /* Failed */
+ }
+ else if (SvTYPE(sv) != SVt_NULL) {
+ obj = sv;
+ }
sv_upgrade(tv, SVt_PVMG);
- sv_magic(tv, sv, 'q', Nullch, 0);
- SvREFCNT_dec(sv); /* Undo refcnt inc from sv_magic() */
+ sv_magic(tv, obj, 'q', Nullch, 0);
+
+ if (obj) {
+ /* Undo refcnt inc from sv_magic() */
+ SvREFCNT_dec(obj);
+ }
TRACEME(("ok (retrieve_tied_scalar at 0x%"UVxf")", PTR2UV(tv)));
@@ -4969,7 +4986,7 @@
*/
sub = newSVpvn("sub ", 4);
- sv_catpv(sub, SvPV(text, PL_na)); /* XXX no sv_catsv! */
+ sv_catpv(sub, SvPV_nolen(text)); /* XXX no sv_catsv! */
SvREFCNT_dec(text);
/*
@@ -5008,16 +5025,17 @@
CROAK(("Unexpected return value from $Storable::Eval callback\n"));
cv = POPs;
if (SvTRUE(errsv)) {
- CROAK(("code %s caused an error: %s", SvPV(sub, PL_na), SvPV(errsv, PL_na)));
+ CROAK(("code %s caused an error: %s",
+ SvPV_nolen(sub), SvPV_nolen(errsv)));
}
PUTBACK;
} else {
- cv = eval_pv(SvPV(sub, PL_na), TRUE);
+ cv = eval_pv(SvPV_nolen(sub), TRUE);
}
if (cv && SvROK(cv) && SvTYPE(SvRV(cv)) == SVt_PVCV) {
sv = SvRV(cv);
} else {
- CROAK(("code %s did not evaluate to a subroutine reference\n", SvPV(sub, PL_na)));
+ CROAK(("code %s did not evaluate to a subroutine reference\n", SvPV_nolen(sub)));
}
SvREFCNT_inc(sv); /* XXX seems to be necessary */
Modified: trunk/orca/packages/Storable-2.07/t/integer.t
==============================================================================
--- trunk/orca/packages/Storable-2.06/t/integer.t (original)
+++ trunk/orca/packages/Storable-2.07/t/integer.t Mon May 5 08:30:26 2003
@@ -64,6 +64,8 @@
0x7FFFFFFF, 0x80000000, 0x80000001, 0xFFFFFFFF, 0xDEADBEEF,
# UV bounds
$max_iv_p1, $max_uv_m1, $max_uv, $lots_of_9C,
+ # NV-UV conversion
+ 2559831922.0,
);
plan tests => @processes * @numbers * 5;
Modified: trunk/orca/packages/Storable-2.07/t/restrict.t
==============================================================================
--- trunk/orca/packages/Storable-2.06/t/restrict.t (original)
+++ trunk/orca/packages/Storable-2.07/t/restrict.t Mon May 5 08:30:26 2003
@@ -16,7 +16,7 @@
exit 0;
}
} else {
- if ($[ < 5.005) {
+ if ($] < 5.005) {
print "1..0 # Skip: No Hash::Util pre 5.005\n";
exit 0;
# And doing this seems on 5.004 seems to create bogus warnings about
Modified: trunk/orca/packages/Storable-2.07/t/st-dump.pl
==============================================================================
--- trunk/orca/packages/Storable-2.06/t/st-dump.pl (original)
+++ trunk/orca/packages/Storable-2.07/t/st-dump.pl Mon May 5 08:30:26 2003
@@ -39,6 +39,7 @@
%dump = (
'SCALAR' => 'dump_scalar',
+ 'LVALUE' => 'dump_scalar',
'ARRAY' => 'dump_array',
'HASH' => 'dump_hash',
'REF' => 'dump_ref',
Modified: trunk/orca/packages/Storable-2.07/t/tied.t
==============================================================================
--- trunk/orca/packages/Storable-2.06/t/tied.t (original)
+++ trunk/orca/packages/Storable-2.07/t/tied.t Mon May 5 08:30:26 2003
@@ -25,7 +25,7 @@
use Storable qw(freeze thaw);
-print "1..22\n";
+print "1..23\n";
($scalar_fetch, $array_fetch, $hash_fetch) = (0, 0, 0);
@@ -207,3 +207,14 @@
ok 20, defined $ht;
ok 21, $ht->{'x'} == 1;
ok 22, $FAULT::fault == 2;
+
+{
+ package P;
+ use Storable qw(freeze thaw);
+ use vars qw($a $b);
+ $b = "not ok ";
+ sub TIESCALAR { bless \$a } sub FETCH { "ok " }
+ tie $a, P; my $r = thaw freeze \$a; $b = $$r;
+ print $b , 23, "\n";
+}
+
More information about the Orca-checkins
mailing list