From: Jarkko Hietaniemi Date: Sat, 18 Mar 2000 19:37:01 +0000 (+0000) Subject: Use the newSVuv(). X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b448e4fea9d52c651a1814ffb2d1d8745f1f0de9;p=p5sagit%2Fp5-mst-13.2.git Use the newSVuv(). p4raw-id: //depot/cfgperl@5804 --- diff --git a/embed.h b/embed.h index 770bbbe..737fbb7 100644 --- a/embed.h +++ b/embed.h @@ -471,6 +471,7 @@ #define newSVREF Perl_newSVREF #define newSVOP Perl_newSVOP #define newSViv Perl_newSViv +#define newSVuv Perl_newSVuv #define newSVnv Perl_newSVnv #define newSVpv Perl_newSVpv #define newSVpvn Perl_newSVpvn @@ -1914,6 +1915,7 @@ #define newSVREF(a) Perl_newSVREF(aTHX_ a) #define newSVOP(a,b,c) Perl_newSVOP(aTHX_ a,b,c) #define newSViv(a) Perl_newSViv(aTHX_ a) +#define newSVuv(a) Perl_newSVuv(aTHX_ a) #define newSVnv(a) Perl_newSVnv(aTHX_ a) #define newSVpv(a,b) Perl_newSVpv(aTHX_ a,b) #define newSVpvn(a,b) Perl_newSVpvn(aTHX_ a,b) @@ -3743,6 +3745,8 @@ #define newSVOP Perl_newSVOP #define Perl_newSViv CPerlObj::Perl_newSViv #define newSViv Perl_newSViv +#define Perl_newSVuv CPerlObj::Perl_newSVuv +#define newSVuv Perl_newSVuv #define Perl_newSVnv CPerlObj::Perl_newSVnv #define newSVnv Perl_newSVnv #define Perl_newSVpv CPerlObj::Perl_newSVpv diff --git a/op.c b/op.c index 35fa3f5..38738c7 100644 --- a/op.c +++ b/op.c @@ -2746,7 +2746,8 @@ Perl_pmtrans(pTHX_ OP *o, OP *expr, OP *repl) SvREFCNT_dec(transv); if (!del && havefinal) - (void)hv_store((HV*)SvRV((cSVOPo->op_sv)), "FINAL", 5, newSViv((IV)final), 0); + (void)hv_store((HV*)SvRV((cSVOPo->op_sv)), "FINAL", 5, + newSVuv((UV)final), 0); if (grows && to_utf) o->op_private |= OPpTRANS_GROWS; diff --git a/pp_sys.c b/pp_sys.c index 5831f4c..e1d74ae 100644 --- a/pp_sys.c +++ b/pp_sys.c @@ -470,7 +470,7 @@ PP(pp_die) GV *gv = gv_fetchmethod(stash, "PROPAGATE"); if (gv) { SV *file = sv_2mortal(newSVpv(CopFILE(PL_curcop),0)); - SV *line = sv_2mortal(newSViv(CopLINE(PL_curcop))); + SV *line = sv_2mortal(newSVuv(CopLINE(PL_curcop))); EXTEND(SP, 3); PUSHMARK(SP); PUSHs(error); @@ -864,9 +864,9 @@ PP(pp_dbmopen) PUSHs(sv); PUSHs(left); if (SvIV(right)) - PUSHs(sv_2mortal(newSViv(O_RDWR|O_CREAT))); + PUSHs(sv_2mortal(newSVuv(O_RDWR|O_CREAT))); else - PUSHs(sv_2mortal(newSViv(O_RDWR))); + PUSHs(sv_2mortal(newSVuv(O_RDWR))); PUSHs(right); PUTBACK; call_sv((SV*)GvCV(gv), G_SCALAR); @@ -877,7 +877,7 @@ PP(pp_dbmopen) PUSHMARK(SP); PUSHs(sv); PUSHs(left); - PUSHs(sv_2mortal(newSViv(O_RDONLY))); + PUSHs(sv_2mortal(newSVuv(O_RDONLY))); PUSHs(right); PUTBACK; call_sv((SV*)GvCV(gv), G_SCALAR); @@ -1793,9 +1793,9 @@ PP(pp_sysseek) #if LSEEKSIZE > IVSIZE XPUSHs(sv_2mortal(newSVnv((NV) offset))); #else - XPUSHs(sv_2mortal(newSViv((IV) offset))); + XPUSHs(sv_2mortal(newSViv(offset))); #endif - XPUSHs(sv_2mortal(newSViv((IV) whence))); + XPUSHs(sv_2mortal(newSViv(whence))); PUTBACK; ENTER; call_method("SEEK", G_SCALAR); @@ -1807,15 +1807,15 @@ PP(pp_sysseek) if (PL_op->op_type == OP_SEEK) PUSHs(boolSV(do_seek(gv, offset, whence))); else { - Off_t n = do_sysseek(gv, offset, whence); - if (n < 0) + Off_t sought = do_sysseek(gv, offset, whence); + if (sought < 0) PUSHs(&PL_sv_undef); else { - SV* sv = n ? + SV* sv = sought ? #if LSEEKSIZE > IVSIZE - newSVnv((NV)n) + newSVnv((NV)sought) #else - newSViv((IV)n) + newSViv(sought) #endif : newSVpvn(zero_but_true, ZBTLEN); PUSHs(sv_2mortal(sv)); @@ -2541,8 +2541,8 @@ PP(pp_stat) EXTEND_MORTAL(max); PUSHs(sv_2mortal(newSViv(PL_statcache.st_dev))); PUSHs(sv_2mortal(newSViv(PL_statcache.st_ino))); - PUSHs(sv_2mortal(newSViv(PL_statcache.st_mode))); - PUSHs(sv_2mortal(newSViv(PL_statcache.st_nlink))); + PUSHs(sv_2mortal(newSVuv(PL_statcache.st_mode))); + PUSHs(sv_2mortal(newSVuv(PL_statcache.st_nlink))); #if Uid_t_size > IVSIZE PUSHs(sv_2mortal(newSVnv(PL_statcache.st_uid))); #else @@ -2573,8 +2573,8 @@ PP(pp_stat) PUSHs(sv_2mortal(newSViv(PL_statcache.st_ctime))); #endif #ifdef USE_STAT_BLOCKS - PUSHs(sv_2mortal(newSViv(PL_statcache.st_blksize))); - PUSHs(sv_2mortal(newSViv(PL_statcache.st_blocks))); + PUSHs(sv_2mortal(newSVuv(PL_statcache.st_blksize))); + PUSHs(sv_2mortal(newSVuv(PL_statcache.st_blocks))); #else PUSHs(sv_2mortal(newSVpvn("", 0))); PUSHs(sv_2mortal(newSVpvn("", 0))); diff --git a/toke.c b/toke.c index 2d96802..a6d86c1 100644 --- a/toke.c +++ b/toke.c @@ -3278,7 +3278,7 @@ Perl_yylex(pTHX) /* This kludge not intended to be bulletproof. */ if (PL_tokenbuf[1] == '[' && !PL_tokenbuf[2]) { yylval.opval = newSVOP(OP_CONST, 0, - newSViv((IV)PL_compiling.cop_arybase)); + newSViv(PL_compiling.cop_arybase)); yylval.opval->op_private = OPpCONST_ARYBASE; TERM(THING); }