sv_x(pTHX_ SV *sv, const char *str, STRLEN len, I32 n)
{
if (!sv)
- sv = newSVpvn("", 0);
+ sv = newSVpvs("");
#ifdef DEBUGGING
else
assert(SvTYPE(sv) >= SVt_PV);
else { /* store our name and continue */
SV *namesv;
if (name[0] == '@' || name[0] == '%') {
- namesv = newSVpvn("\\", 1);
+ namesv = newSVpvs("\\");
sv_catpvn(namesv, name, namelen);
}
else if (realtype == SVt_PVCV && name[0] == '*') {
- namesv = newSVpvn("\\", 2);
+ namesv = newSVpvs("\\");
sv_catpvn(namesv, name, namelen);
(SvPVX(namesv))[1] = '&';
}
realtype <= SVt_PVMG
#endif
) { /* scalar ref */
- SV * const namesv = newSVpvn("${", 2);
+ SV * const namesv = newSVpvs("${");
sv_catpvn(namesv, name, namelen);
sv_catpvn(namesv, "}", 1);
if (realpack) { /* blessed */
SvREFCNT_dec(namesv);
}
else if (realtype == SVt_PVGV) { /* glob ref */
- SV * const namesv = newSVpvn("*{", 2);
+ SV * const namesv = newSVpvs("*{");
sv_catpvn(namesv, name, namelen);
sv_catpvn(namesv, "}", 1);
sv_catpvn(retval, "\\", 1);
if (sortkeys) {
if (sortkeys == &PL_sv_yes) {
#if PERL_VERSION < 8
- sortkeys = sv_2mortal(newSVpvn("Data::Dumper::_sortkeys", 23));
+ sortkeys = sv_2mortal(newSVpvs("Data::Dumper::_sortkeys"));
#else
keys = newAV();
(void)hv_iterinit((HV*)ival);
* Note that we'd have to check for weak-refs, too, but this is
* already the branch for non-refs only. */
else if (val != &PL_sv_undef && (!use_sparse_seen_hash || SvREFCNT(val) > 1)) {
- SV * const namesv = newSVpvn("\\", 1);
+ SV * const namesv = newSVpvs("\\");
sv_catpvn(namesv, name, namelen);
seenentry = newAV();
av_push(seenentry, namesv);
static const char* const entries[] = { "{SCALAR}", "{ARRAY}", "{HASH}" };
static const STRLEN sizes[] = { 8, 7, 6 };
SV *e;
- SV * const nname = newSVpvn("", 0);
- SV * const newapad = newSVpvn("", 0);
+ SV * const nname = newSVpvs("");
+ SV * const newapad = newSVpvs("");
GV * const gv = (GV*)val;
I32 j;
#
# This is the exact equivalent of Dump. Well, almost. The things that are
# different as of now (due to Laziness):
-# * doesn't deparse yet.
+# * doesn't deparse yet.'
#
void
terse = purity = deepcopy = useqq = 0;
quotekeys = 1;
- retval = newSVpvn("", 0);
+ retval = newSVpvs("");
if (SvROK(href)
&& (hv = (HV*)SvRV((SV*)href))
&& SvTYPE(hv) == SVt_PVHV) {
imax = av_len(todumpav);
else
imax = -1;
- valstr = newSVpvn("",0);
+ valstr = newSVpvs("");
for (i = 0; i <= imax; ++i) {
SV *newapad;
if (gimme == G_ARRAY) {
XPUSHs(sv_2mortal(retval));
if (i < imax) /* not the last time thro ? */
- retval = newSVpvn("",0);
+ retval = newSVpvs("");
}
}
SvREFCNT_dec(postav);
* blessed code references.
*/
/* Ownership of both SVs is passed to load_module, which frees them. */
- load_module(PERL_LOADMOD_NOIMPORT, newSVpvn("B::Deparse",10), newSVnv(0.61));
+ load_module(PERL_LOADMOD_NOIMPORT, newSVpvs("B::Deparse"), newSVnv(0.61));
SPAGAIN;
ENTER;
* prepend "sub " to the source
*/
- sub = newSVpvn("sub ", 4);
+ sub = newSVpvs("sub ");
if (SvUTF8(text))
SvUTF8_on(sub);
sv_catpv(sub, SvPV_nolen(text)); /* XXX no sv_catsv! */
* using Perl variables that belong to another thread, we create our
* own for this thread.
*/
- MY_CXT.x_dl_last_error = newSVpvn("", 0);
+ MY_CXT.x_dl_last_error = newSVpvs("");
#endif
* using Perl variables that belong to another thread, we create our
* own for this thread.
*/
- MY_CXT.x_dl_last_error = newSVpvn("", 0);
+ MY_CXT.x_dl_last_error = newSVpvs("");
#endif
* using Perl variables that belong to another thread, we create our
* own for this thread.
*/
- MY_CXT.x_dl_last_error = newSVpvn("", 0);
+ MY_CXT.x_dl_last_error = newSVpvs("");
#endif
* using Perl variables that belong to another thread, we create our
* own for this thread.
*/
- MY_CXT.x_dl_last_error = newSVpvn("", 0);
+ MY_CXT.x_dl_last_error = newSVpvs("");
#endif
* using Perl variables that belong to another thread, we create our
* own for this thread.
*/
- MY_CXT.x_dl_last_error = newSVpvn("", 0);
+ MY_CXT.x_dl_last_error = newSVpvs("");
dl_resolve_using = get_av("DynaLoader::dl_resolve_using", GV_ADDMULTI);
dl_require_symbols = get_av("DynaLoader::dl_require_symbols", GV_ADDMULTI);
* using Perl variables that belong to another thread, we create our
* own for this thread.
*/
- MY_CXT.x_dl_last_error = newSVpvn("", 0);
+ MY_CXT.x_dl_last_error = newSVpvs("");
dl_resolve_using = get_av("DynaLoader::dl_resolve_using", GV_ADDMULTI);
#endif
* using Perl variables that belong to another thread, we create our
* own for this thread.
*/
- MY_CXT.x_dl_last_error = newSVpvn("", 0);
+ MY_CXT.x_dl_last_error = newSVpvs("");
#endif
* using Perl variables that belong to another thread, we create our
* own for this thread.
*/
- MY_CXT.x_dl_last_error = newSVpvn("", 0);
+ MY_CXT.x_dl_last_error = newSVpvs("");
dl_require_symbols = get_av("DynaLoader::dl_require_symbols", GV_ADDMULTI);
#endif
DWORD err = GetLastError();
STRLEN len;
if (!dl_error_sv)
- dl_error_sv = newSVpvn("",0);
+ dl_error_sv = newSVpvs("");
PerlProc_GetOSError(dl_error_sv,err);
return SvPV(dl_error_sv,len);
}
* using Perl variables that belong to another thread, we create our
* own for this thread.
*/
- MY_CXT.x_dl_last_error = newSVpvn("", 0);
+ MY_CXT.x_dl_last_error = newSVpvs("");
#endif
char *perl_dl_nonlazy;
MY_CXT_INIT;
- MY_CXT.x_dl_last_error = newSVpvn("", 0);
+ MY_CXT.x_dl_last_error = newSVpvs("");
dl_nonlazy = 0;
#ifdef DL_LOADONCEONLY
dl_loaded_files = NULL;
STRLEN i;
int len;
CODE:
- RETVAL = newSVpvn("", 0);
+ RETVAL = newSVpvs("");
SvGROW(RETVAL, L_tmpnam);
/* Yes, we know tmpnam() is bad. So bad that some compilers
* and linkers warn against using it. But it is here for
Perl_warner(aTHX_ packWARN(WARN_IO), ":encoding without 'use Encode'");
#endif
/* The SV is magically freed by load_module */
- load_module(PERL_LOADMOD_NOIMPORT, newSVpvn("Encode", 6), Nullsv, Nullsv);
+ load_module(PERL_LOADMOD_NOIMPORT, newSVpvs("Encode"), Nullsv, Nullsv);
assert(sp == PL_stack_sp);
}
PUSHMARK(sp);
}
}
else {
- s->var = newSVpvn("", 0);
+ s->var = newSVpvs("");
}
SvUPGRADE(s->var, SVt_PV);
* subs
*/
const char *function = (const char *) XSANY.any_ptr;
- Perl_load_module(aTHX_ PERL_LOADMOD_NOIMPORT, newSVpvn("Win32",5), newSVnv(0.27));
+ Perl_load_module(aTHX_ PERL_LOADMOD_NOIMPORT, newSVpvs("Win32"), newSVnv(0.27));
SetLastError(err);
errno = saved_errno;
/* mark and SP from caller are passed through unchanged */
ST(4) = cop_hints_fetch_pvs(cx->blk_oldcop, "foo", 0);
ST(5) = cop_hints_fetch_pvn(cx->blk_oldcop, "foo", 3, 0, 0);
ST(6) = cop_hints_fetch_sv(cx->blk_oldcop,
- sv_2mortal(newSVpvn("foo", 3)), 0, 0);
+ sv_2mortal(newSVpvs("foo")), 0, 0);
hv = cop_hints_2hv(cx->blk_oldcop, 0);
ST(7) = hv ? sv_2mortal(newRV_noinc((SV *)hv)) : &PL_sv_undef;
return &PL_sv_undef;
return &PL_sv_no;
}
- sv = newSVpvn("", 0);
+ sv = newSVpvs("");
SvGROW(sv, l + 1);
len = QueryWindowText(hwnd, l + 1, SvPV_force(sv, n_a));
if (len != l) {
SV *
myQueryClassName(HWND hwnd)
{
- SV *sv = newSVpvn("",0);
+ SV *sv = newSVpvs("");
STRLEN l = 46, len = 0, n_a;
while (l + 1 >= len) {
ULONG len = QueryAtomLength(hAtomTbl, atom);
if (len) { /* Probably always so... */
- SV *sv = newSVpvn("",0);
+ SV *sv = newSVpvs("");
STRLEN n_a;
SvGROW(sv, len + 1);
int num, n = 0;
STRLEN n_a;
PSWBLOCK pswblk;
- SV *sv = newSVpvn("",0);
+ SV *sv = newSVpvs("");
if (!(_emx_env & 0x200))
croak("swentries_list not implemented on DOS"); /* not OS/2. */
if (size <= 0)
Perl_croak(aTHX_ "OS2::_headerInfo(): unexpected size: %d", (int)size);
- ST(0) = newSVpvn("",0);
+ ST(0) = newSVpvs("");
SvGROW(ST(0), size + 1);
sv_2mortal(ST(0));
Perl_croak(aTHX_ "OS2::_headerInfo(%ld,%ld,%ld,%ld) error: %s",
DQHI_QUERYLIBPATHSIZE, sizeof(size), 0, 0,
os2error(Perl_rc));
- ST(0) = newSVpvn("",0);
+ ST(0) = newSVpvs("");
SvGROW(ST(0), size + 1);
sv_2mortal(ST(0));
/* if we know we have at least two args, create an empty string,
* then concatenate args to that. For no args, return an empty string */
if (!pat && pat_count != 1) {
- pat = newSVpvn("", 0);
+ pat = newSVpvs("");
SAVEFREESV(pat);
alloced = TRUE;
}
AV* this_array;
STRLEN cp_count = utf8_length(foldbuf,
foldbuf + foldlen);
- SV* multi_fold = sv_2mortal(newSVpvn("", 0));
+ SV* multi_fold = sv_2mortal(newSVpvs(""));
Perl_sv_catpvf(aTHX_ multi_fold, "\\x{%"UVXf"}", value);
/* If requested, return a printable version of what this swash matches */
if (listsvp) {
- SV* matches_string = newSVpvn("", 0);
+ SV* matches_string = newSVpvs("");
/* The swash should be used, if possible, to get the data, as it
* contains the resolved data. But this function can be called at
{
dTHX;
if (!*svp)
- *svp = sv_2mortal(newSVpvn("",0));
+ *svp = sv_2mortal(newSVpvs(""));
SvGROW(*svp, datalen);
retval = RegQueryValueEx(handle, valuename, 0, NULL,
(PBYTE)SvPVX(*svp), &datalen);
/* directory exists */
dTHX;
if (!*prev_pathp)
- *prev_pathp = sv_2mortal(newSVpvn("",0));
+ *prev_pathp = sv_2mortal(newSVpvs(""));
else if (SvPVX(*prev_pathp))
sv_catpvn(*prev_pathp, ";", 1);
sv_catpv(*prev_pathp, mod_name);
needlen = GetEnvironmentVariableA(name,NULL,0);
if (needlen != 0) {
- curitem = sv_2mortal(newSVpvn("", 0));
+ curitem = sv_2mortal(newSVpvs(""));
do {
SvGROW(curitem, needlen+1);
needlen = GetEnvironmentVariableA(name,SvPVX(curitem),
if (retval == ERROR_SUCCESS && type == REG_SZ) {
dTHX;
if (!*svp)
- *svp = sv_2mortal(newSVpvn("",0));
+ *svp = sv_2mortal(newSVpvs(""));
SvGROW(*svp, datalen);
retval = XCERegQueryValueExA(handle, valuename, 0, NULL,
(PBYTE)SvPVX(*svp), &datalen);
/* directory exists */
dTHX;
if (!*prev_pathp)
- *prev_pathp = sv_2mortal(newSVpvn("",0));
+ *prev_pathp = sv_2mortal(newSVpvs(""));
sv_catpvn(*prev_pathp, ";", 1);
sv_catpv(*prev_pathp, mod_name);
if(len)