]> git.vpit.fr Git - perl/modules/Variable-Magic.git/commitdiff
Importing Variable-Magic-0.14.tar.gz v0.14
authorVincent Pit <vince@profvince.com>
Sun, 29 Jun 2008 16:24:48 +0000 (18:24 +0200)
committerVincent Pit <vince@profvince.com>
Sun, 29 Jun 2008 16:24:48 +0000 (18:24 +0200)
Changes
META.yml
Magic.xs
README
lib/Variable/Magic.pm
t/16-huf.t
t/25-copy.t
t/34-glob.t

diff --git a/Changes b/Changes
index c77f730e7c8bd579c0e91a68be4f6e7d6f1e7c77..b4d14af2c24cf31c527a9267382303666e44af96 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,5 +1,17 @@
 Revision history for Variable-Magic
 
+0.14    2008-03-24 12:35 UTC
+        + Fix : t/16-huf.t failures on Solaris and FreeBSD caused by not
+                updating mg->mg_ptr after Renew-ing it on dispell.
+        + Fix : Undefining MGf_DUP caused the wizard's magic to be wrongly
+                initialized. MGf_DUP now appears as true from the user point of
+                view, but the dup callback isn't actually set.
+        + Fix : Warnings with blead due to copy callbacks now taking an I32 (API
+                change #33256).
+        + Fix : vmg_svt_val() and vmg_uvar_del() aren't required if no uvar
+                magic is available.
+        + Tst : Tests now output the version of optional modules loaded.
+
 0.13    2008-03-19 14:35 UTC
         + Doc : Link to coverage report.
         + Fix : Correct dependencies listing in META.yml.
index 8362d35e369884854c4c93a49f4d652cdcfca849..c968d388d20ace58e2e045d3fe17f0eab0cc56f9 100644 (file)
--- a/META.yml
+++ b/META.yml
@@ -1,11 +1,11 @@
 --- #YAML:1.0
 name:                Variable-Magic
-version:             0.13
+version:             0.14
 abstract:            Associate user-defined magic to variables from Perl.
 license:             perl
 author:              
     - Vincent Pit <perl@profvince.com>
-generated_by:        ExtUtils::MakeMaker version 6.44
+generated_by:        ExtUtils::MakeMaker version 6.42
 distribution_type:   module
 requires:     
     Carp:                          0
index 936e8cd0c5e166cbb16aeab755021498a43c99c1..b218de98cbc0bee835762d1d6d07b01b37f75971 100644 (file)
--- a/Magic.xs
+++ b/Magic.xs
@@ -53,7 +53,6 @@
 # define MGf_COPY 0
 #endif
 
-#undef MGf_DUP /* Disable it for now. */
 #ifndef MGf_DUP
 # define MGf_DUP 0
 #endif
@@ -222,6 +221,7 @@ STATIC SV *vmg_data_get(SV *sv, U16 sig) {
 
 /* ... Magic cast/dispell .................................................. */
 
+#if VMG_UVAR
 STATIC I32 vmg_svt_val(pTHX_ IV, SV *);
 
 STATIC void vmg_uvar_del(SV *sv, MAGIC *prevmagic, MAGIC *mg, MAGIC *moremagic) {
@@ -234,6 +234,7 @@ STATIC void vmg_uvar_del(SV *sv, MAGIC *prevmagic, MAGIC *mg, MAGIC *moremagic)
  Safefree(mg->mg_ptr);
  Safefree(mg);
 }
+#endif /* VMG_UVAR */
 
 STATIC UV vmg_cast(pTHX_ SV *sv, SV *wiz, AV *args) {
 #define vmg_cast(S, W, A) vmg_cast(aTHX_ (S), (W), (A))
@@ -376,6 +377,7 @@ STATIC UV vmg_dispell(pTHX_ SV *sv, U16 sig) {
     /* Revert the original uvar magic. */
     uf[0] = uf[1];
     Renew(uf, 1, struct ufuncs);
+    mg->mg_ptr = (char *) uf;
     mg->mg_len = sizeof(struct ufuncs);
    } else {
     /* Remove the uvar magic. */
@@ -551,7 +553,13 @@ STATIC int vmg_svt_free(pTHX_ SV *sv, MAGIC *mg) {
 }
 
 #if MGf_COPY
-STATIC int vmg_svt_copy(pTHX_ SV *sv, MAGIC *mg, SV *nsv, const char *key, int keylen) {
+STATIC int vmg_svt_copy(pTHX_ SV *sv, MAGIC *mg, SV *nsv, const char *key,
+# if PERL_API_VERSION_GE(5, 11, 0)
+  I32 keylen
+# else
+  int keylen
+# endif
+ ) {
  SV *keysv;
  int ret;
 
@@ -571,7 +579,7 @@ STATIC int vmg_svt_copy(pTHX_ SV *sv, MAGIC *mg, SV *nsv, const char *key, int k
 }
 #endif /* MGf_COPY */
 
-#if MGf_DUP
+#if 0 /*  MGf_DUP */
 STATIC int vmg_svt_dup(pTHX_ MAGIC *mg, CLONE_PARAMS *param) {
  return 0;
 }
@@ -811,7 +819,10 @@ CODE:
  VMG_SET_SVT_CB(ST(i++), copy);
 #endif /* MGf_COPY */
 #if MGf_DUP
- VMG_SET_SVT_CB(ST(i++), dup);
+ /* VMG_SET_SVT_CB(ST(i++), dup); */
+ i++;
+ t->svt_dup = NULL;
+ w->cb_dup  = NULL;
 #endif /* MGf_DUP */
 #if MGf_LOCAL
  VMG_SET_SVT_CB(ST(i++), local);
diff --git a/README b/README
index 4acb5fed83c4808c0a2ca313d7db1ab0ddc30d5f..abca8852c15c97d8f109598eb5624e6dde7f3ea3 100644 (file)
--- a/README
+++ b/README
@@ -2,7 +2,7 @@ NAME
     Variable::Magic - Associate user-defined magic to variables from Perl.
 
 VERSION
-    Version 0.13
+    Version 0.14
 
 SYNOPSIS
         use Variable::Magic qw/wizard cast dispell/;
index fb2e2524e87ab30f7be5d35cedaf37b760516368..b91c0847ccefbe7930d01314e93701632c361adf 100644 (file)
@@ -13,13 +13,13 @@ Variable::Magic - Associate user-defined magic to variables from Perl.
 
 =head1 VERSION
 
-Version 0.13
+Version 0.14
 
 =cut
 
 our $VERSION;
 BEGIN {
- $VERSION = '0.13';
+ $VERSION = '0.14';
 }
 
 =head1 SYNOPSIS
index 6a2f750834587a701918fd5360fd37ea6b505686..0941fb288c71cc5671cf64a53800ee033a627e61 100644 (file)
@@ -16,6 +16,8 @@ if ($@) {
  plan skip_all => 'Hash::Util::FieldHash required for testing uvar interaction';
 } else {
  plan tests => 12;
+ my $v = $Hash::Util::FieldHash::VERSION;
+ diag "Using Hash::Util::FieldHash $v" if defined $v;
 }
 
 Hash::Util::FieldHash::fieldhash(\my %h);
index 83e604a2485b5603cfd0f01870c0c97a36d1c2c0..cb00b6322ce90db2be5754297a01d16f587a8753 100644 (file)
@@ -20,6 +20,7 @@ is($c, 0, 'copy : create wizard');
 SKIP: {
  eval "use Tie::Array";
  skip 'Tie::Array required to test copy magic on arrays', 8 if $@;
+ diag "Using Tie::Array $Tie::Array::VERSION" if defined $Tie::Array::VERSION;
 
  tie my @a, 'Tie::StdArray';
  @a = (1 .. 10);
@@ -46,6 +47,7 @@ SKIP: {
 SKIP: {
  eval "use Tie::Hash";
  skip 'Tie::Hash required to test copy magic on hashes', 14 if $@;
+ diag "Using Tie::Hash $Tie::Hash::VERSION" if defined $Tie::Hash::VERSION;
 
  tie my %h, 'Tie::StdHash';
  %h = (a => 1, b => 2, c => 3);
index b401b4c429578a89de0836f3f2b5af7d1f568b2d..d5d62d81b8d1d02628c3de6c90c3773c8254f514 100644 (file)
@@ -10,6 +10,7 @@ if ($@) {
  plan skip_all => "Symbol::gensym required for testing magic for globs";
 } else {
  plan tests => 7;
+ diag "Using Symbol $Symbol::VERSION" if defined $Symbol::VERSION;
 }
 
 use Variable::Magic qw/wizard cast dispell/;