Perl_magic_setenv(pTHX_ SV *sv, MAGIC *mg)
{
dVAR;
- register char *s;
+ const char *s;
const char *ptr;
STRLEN len, klen;
- s = SvPV(sv,len);
+ s = SvPV_const(sv,len);
ptr = MgPV_const(mg,klen);
my_setenv(ptr, s);
if (!len) {
SV **valp;
if ((valp = hv_fetch(GvHVn(PL_envgv), ptr, klen, FALSE)))
- s = SvPV(*valp, len);
+ s = SvPV_const(*valp, len);
}
#endif
}
#endif /* VMS */
if (s && klen == 4 && strEQ(ptr,"PATH")) {
- char *strend = s + len;
+ const char *strend = s + len;
while (s < strend) {
char tmpbuf[256];
#else
if (PL_localizing) {
HE* entry;
- STRLEN n_a;
magic_clear_all_env(sv,mg);
hv_iterinit((HV*)sv);
while ((entry = hv_iternext((HV*)sv))) {
I32 keylen;
my_setenv(hv_iterkey(entry, &keylen),
- SvPV(hv_iterval((HV*)sv, entry), n_a));
+ SvPV_nolen_const(hv_iterval((HV*)sv, entry)));
}
}
#endif
static void
restore_sigmask(pTHX_ SV *save_sv)
{
- sigset_t *ossetp = (sigset_t *) SvPV_nolen( save_sv );
+ const sigset_t *ossetp = (const sigset_t *) SvPV_nolen_const( save_sv );
(void)sigprocmask(SIG_SETMASK, ossetp, (sigset_t *)0);
}
#endif
{
STRLEN len;
SV * const lsv = LvTARG(sv);
- const char * const tmps = SvPV(lsv,len);
+ const char * const tmps = SvPV_const(lsv,len);
I32 offs = LvTARGOFF(sv);
I32 rem = LvTARGLEN(sv);
(void)mg;
Perl_magic_setsubstr(pTHX_ SV *sv, MAGIC *mg)
{
STRLEN len;
- char *tmps = SvPV(sv, len);
+ const char *tmps = SvPV_const(sv, len);
SV * const lsv = LvTARG(sv);
I32 lvoff = LvTARGOFF(sv);
I32 lvlen = LvTARGLEN(sv);
case '\004': /* ^D */
#ifdef DEBUGGING
- s = SvPV_nolen(sv);
+ s = SvPV_nolen_const(sv);
PL_debug = get_debug_opts(&s, 0) | DEBUG_TOP_FLAG;
DEBUG_x(dump_all());
#else
STRLEN len, i;
int accumulate = 0 ;
int any_fatals = 0 ;
- const char * const ptr = (char*)SvPV(sv, len) ;
+ const char * const ptr = SvPV_const(sv, len) ;
for (i = 0 ; i < len ; ++i) {
accumulate |= ptr[i] ;
any_fatals |= (ptr[i] & 0xAA) ;
case ')':
#ifdef HAS_SETGROUPS
{
- const char *p = SvPV(sv, len);
+ const char *p = SvPV_const(sv, len);
Groups_t gary[NGROUPS];
while (isSPACE(*p))
* show a string from the process struct and provide
* the setproctitle() routine to manipulate that. */
{
- s = SvPV(sv, len);
+ s = SvPV_const(sv, len);
# if __FreeBSD_version > 410001
/* The leading "-" removes the "perl: " prefix,
* but not the "(perl) suffix from the ps(1)
#if defined(__hpux) && defined(PSTAT_SETCMD)
{
union pstun un;
- s = SvPV(sv, len);
+ s = SvPV_const(sv, len);
un.pst_command = (char *)s;
pstat(PSTAT_SETCMD, un, len, 0, 0);
}
(IV) CopLINE(PL_curcop));
Perl_sv_vcatpvf(aTHX_ sv, fmt, &ap);
- s = SvPV(sv, len);
+ s = SvPV_const(sv, len);
PerlLIO_write(PL_perlio_debug_fd, s, len);
SvREFCNT_dec(sv);
#endif
SV *layers = PL_curcop->cop_io;
if (layers) {
STRLEN len;
- type = SvPV(layers, len);
+ type = SvPV_const(layers, len);
if (type && mode[0] != 'r') {
/*
* Skip to write part
{
dTHX;
SV *sv = newSVpvn("", 0);
- char *s;
+ const char *s;
STRLEN len;
SSize_t wrote;
#ifdef NEED_VA_COPY
#else
sv_vcatpvf(sv, fmt, &ap);
#endif
- s = SvPV(sv, len);
+ s = SvPV_const(sv, len);
wrote = PerlIO_write(f, s, len);
SvREFCNT_dec(sv);
return wrote;