From: Vincent Pit Date: Wed, 26 Oct 2011 17:26:26 +0000 (+0200) Subject: The magic signatures are no longer needed X-Git-Tag: v0.47~8 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=e7d06d42b01cc371aabcd4cee7ef786059ed7a1b;p=perl%2Fmodules%2FVariable-Magic.git The magic signatures are no longer needed --- diff --git a/Magic.xs b/Magic.xs index 3c4cd33..a095332 100644 --- a/Magic.xs +++ b/Magic.xs @@ -406,11 +406,6 @@ typedef struct { START_MY_CXT -/* --- Signatures ---------------------------------------------------------- */ - -#define SIG_WZO ((U16) (0x3891)) -#define SIG_WIZ ((U16) (0x3892)) - /* --- structure ---------------------------------------------- */ #if VMG_THREADSAFE @@ -644,7 +639,7 @@ STATIC SV *vmg_wizard_sv_new(pTHX_ const vmg_wizard *w) { if (w) { MAGIC *mg = sv_magicext(wiz, NULL, PERL_MAGIC_ext, &vmg_wizard_sv_vtbl, (const char *) w, 0); - mg->mg_private = SIG_WZO; + mg->mg_private = 0; #if VMG_THREADSAFE mg->mg_flags |= MGf_DUP; #endif @@ -789,7 +784,7 @@ STATIC UV vmg_cast(pTHX_ SV *sv, const vmg_wizard *w, const SV *wiz, SV **args, mg = sv_magicext(sv, data, PERL_MAGIC_ext, vmg_vtable_vtbl(w->vtable), (const char *) wiz, HEf_SVKEY); SvREFCNT_dec(data); - mg->mg_private = SIG_WIZ; + mg->mg_private = 0; if (w->cb_copy) mg->mg_flags |= MGf_COPY; #if 0 diff --git a/lib/Variable/Magic.pm b/lib/Variable/Magic.pm index af44f01..01b1c70 100644 --- a/lib/Variable/Magic.pm +++ b/lib/Variable/Magic.pm @@ -196,9 +196,6 @@ This last one triggers when a key is deleted in the hash, regardless of whether You can refer to the tests to have more insight of where the different magics are invoked. -To prevent any clash between different magics defined with this module, an unique numerical signature is attached to each kind of magic (i.e. each set of callbacks for magic operations). -At the C level, magic tokens owned by magic created by this module have their C<< mg->mg_private >> field set to C<0x3891> or C<0x3892>, so please don't use these magic (sic) numbers in other extensions. - =head1 FUNCTIONS =cut