return win32_fdupopen(f);
#else
if (f) {
- int fd = PerlLIO_dup(PerlIO_fileno(f));
+ const int fd = PerlLIO_dup(PerlIO_fileno(f));
if (fd >= 0) {
char mode[8];
int omode = fcntl(fd, F_GETFL);
if (*args == &PL_sv_undef)
return PerlIO_tmpfile();
else {
- const char *name = SvPV_nolen(*args);
+ const char *name = SvPV_nolen_const(*args);
if (*mode == IoTYPE_NUMERIC) {
fd = PerlLIO_open3(name, imode, perm);
if (fd >= 0)
if (items < 2)
Perl_croak(aTHX_ "Usage class->find(name[,load])");
else {
- const char *name = SvPV_nolen(ST(1));
+ const char *name = SvPV_nolen_const(ST(1));
ST(0) = (strEQ(name, "crlf")
|| strEQ(name, "raw")) ? &PL_sv_yes : &PL_sv_undef;
XSRETURN(1);
(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
SAVEINT(PL_in_load_module);
if (cv) {
SAVEGENERICSV(PL_warnhook);
- SvREFCNT_inc(cv);
+ (void)SvREFCNT_inc(cv);
PL_warnhook = (SV *) cv;
}
PL_in_load_module++;
Perl_warn(aTHX_ "attrib %" SVf, sv);
for (i = 2; i < items; i++) {
STRLEN len;
- const char *name = SvPV(ST(i), len);
+ const char *name = SvPV_const(ST(i), len);
SV *layer = PerlIO_find_layer(aTHX_ name, len, 1);
if (layer) {
av_push(av, SvREFCNT_inc(layer));
*/
dXSARGS;
if (items)
- PerlIO_debug("warning:%s\n",SvPV_nolen(ST(0)));
+ PerlIO_debug("warning:%s\n",SvPV_nolen_const(ST(0)));
XSRETURN(0);
}
Perl_croak(aTHX_ "Usage class->find(name[,load])");
else {
STRLEN len;
- const char *name = SvPV(ST(1), len);
+ const char *name = SvPV_const(ST(1), len);
const bool load = (items > 2) ? SvTRUE(ST(2)) : 0;
PerlIO_funcs *layer = PerlIO_find_layer(aTHX_ name, len, load);
ST(0) =
Perl_croak(aTHX_ "Layer does not match this perl");
}
if (tab->size) {
- PerlIOl *l = NULL;
+ PerlIOl *l;
if (tab->size < sizeof(PerlIOl)) {
goto mismatch;
}
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
perm = 0666;
}
if (imode != -1) {
- const char *path = SvPV_nolen(*args);
+ const char *path = SvPV_nolen_const(*args);
fd = PerlLIO_open3(path, imode, perm);
}
}
return 0;
}
while (1) {
- SSize_t len = PerlLIO_read(fd, vbuf, count);
+ const SSize_t len = PerlLIO_read(fd, vbuf, count);
if (len >= 0 || errno != EINTR) {
if (len < 0) {
if (errno != EAGAIN) {
}
PERL_ASYNC_CHECK();
}
+ /*NOTREACHED*/
}
SSize_t
{
char tmode[8];
if (PerlIOValid(f)) {
- const char *path = SvPV_nolen(*args);
+ const char *path = SvPV_nolen_const(*args);
PerlIOStdio *s = PerlIOSelf(f, PerlIOStdio);
FILE *stdio;
PerlIOUnix_refcnt_dec(fileno(s->stdio));
}
else {
if (narg > 0) {
- const char *path = SvPV_nolen(*args);
+ const char *path = SvPV_nolen_const(*args);
if (*mode == IoTYPE_NUMERIC) {
mode++;
fd = PerlLIO_open3(path, imode, perm);
*/
# error "Don't know how to set FILE.fileno on your platform"
#endif
+ (void)f;
return 0;
# endif
}
{
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;
f = PerlIO_fdopen(fd, "w+");
if (f)
PerlIOBase(f)->flags |= PERLIO_F_TEMP;
- PerlLIO_unlink(SvPVX(sv));
+ PerlLIO_unlink(SvPVX_const(sv));
SvREFCNT_dec(sv);
}
# else /* !HAS_MKSTEMP, fallback to stdio tmpfile(). */
* indent-tabs-mode: t
* End:
*
- * vim: ts=8 sts=4 sw=4 noet:
-*/
+ * ex: set ts=8 sts=4 sw=4 noet:
+ */