From: Perl 5 Porters Date: Mon, 30 Sep 1996 05:13:28 +0000 (-0400) Subject: perl 5.003_06: mg.c X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=946ec16ea935ac14ffffc87fcb9676a65aabcaa5;p=p5sagit%2Fp5-mst-13.2.git perl 5.003_06: mg.c Restore the 5.003 gv_fullname() and gv_efullname() functions. Provide new 3-arg forms gv_fullname3() and gv_efullname3(). Date: Sun, 29 Sep 1996 22:18:19 -0400 (EDT) From: Chip Salzenberg Subject: 5.003_05: Fix numeric value of $! This patch undoes a bit of over-zealous integerization in mg.c, related to the numeric value of $!. Date: Mon, 30 Sep 1996 01:13:28 -0400 From: Spider Boardman Subject: Re: pre extending hash? - need speed The patch below (which is relative to perl5.001l) implements "keys %hash = 50_000;" (or other integer-evaluable sizes) for pre-sizing hashes. I've only moved the patch forward from when I first did it. I'm sure the code in hv_ksplit could be improved. Date: Thu, 03 Oct 1996 16:31:46 -0400 (EDT) From: Charles Bailey Subject: VMS patches to 5.003_05 Date: Fri, 4 Oct 1996 12:38:31 -0400 (EDT) From: Chip Salzenberg Subject: 5.003_05: Fix numeric $! and $^E This patch undoes a bit of over-zealous integerization in mg.c, related to the numeric values of $! and $^E. This patch *REPLACES* the one I posted earlier, which was only effective for $!. [Some of this is superceded by similar stuff in the VMS patches.] --- diff --git a/mg.c b/mg.c index bd3bd2a..934c776 100644 --- a/mg.c +++ b/mg.c @@ -352,7 +352,7 @@ MAGIC *mg; # include char msg[255]; $DESCRIPTOR(msgdsc,msg); - sv_setiv(sv, (IV)vaxc$errno); + sv_setnv(sv,(double) vaxc$errno); if (sys$getmsg(vaxc$errno,&msgdsc.dsc$w_length,&msgdsc,0,0) & 1) sv_setpvn(sv,msgdsc.dsc$a_pointer,msgdsc.dsc$w_length); else @@ -360,14 +360,14 @@ MAGIC *mg; } #else #ifdef OS2 - sv_setiv(sv, (IV)Perl_rc); + sv_setnv(sv, (double)Perl_rc); sv_setpv(sv, os2error(Perl_rc)); #else - sv_setiv(sv, (IV)errno); + sv_setnv(sv, (double)errno); sv_setpv(sv, errno ? Strerror(errno) : ""); #endif #endif - SvIOK_on(sv); /* what a wonderful hack! */ + SvNOK_on(sv); /* what a wonderful hack! */ break; case '\006': /* ^F */ sv_setiv(sv, (IV)maxsysfd); @@ -506,12 +506,12 @@ MAGIC *mg; break; case '!': #ifdef VMS - sv_setiv(sv, (IV)((errno == EVMSERR) ? vaxc$errno : errno)); + sv_setnv(sv, (double)((errno == EVMSERR) ? vaxc$errno : errno)); sv_setpv(sv, errno ? Strerror(errno) : ""); #else { int saveerrno = errno; - sv_setiv(sv, (IV)errno); + sv_setnv(sv, (double)errno); #ifdef OS2 if (errno == errno_isOS2) sv_setpv(sv, os2error(Perl_rc)); else @@ -520,7 +520,7 @@ MAGIC *mg; errno = saveerrno; } #endif - SvIOK_on(sv); /* what a wonderful hack! */ + SvNOK_on(sv); /* what a wonderful hack! */ break; case '<': sv_setiv(sv, (IV)uid); @@ -551,7 +551,7 @@ MAGIC *mg; } #endif sv_setpv(sv,buf); - SvIOK_on(sv); /* what a wonderful hack! */ + SvNOK_on(sv); /* what a wonderful hack! */ break; case '*': break; @@ -815,6 +815,18 @@ MAGIC* mg; } #endif /* OVERLOAD */ +int +magic_setnkeys(sv,mg) +SV* sv; +MAGIC* mg; +{ + if (LvTARG(sv)) { + hv_ksplit((HV*)LvTARG(sv), SvIV(sv)); + LvTARG(sv) = Nullsv; /* Don't allow a ref to reassign this. */ + } + return 0; +} + static int magic_methpack(sv,mg,meth) SV* sv; @@ -1042,11 +1054,11 @@ MAGIC* mg; { if (SvFAKE(sv)) { /* FAKE globs can get coerced */ SvFAKE_off(sv); - gv_efullname(sv,((GV*)sv), "*"); + gv_efullname3(sv,((GV*)sv), "*"); SvFAKE_on(sv); } else - gv_efullname(sv,((GV*)sv), "*"); /* a gv value, be nice */ + gv_efullname3(sv,((GV*)sv), "*"); /* a gv value, be nice */ return 0; }