OutCopFILE(cop), (IV)CopLINE(cop));
if (GvIO(PL_last_in_gv) && IoLINES(GvIOp(PL_last_in_gv))) {
const bool line_mode = (RsSIMPLE(PL_rs) &&
- SvCUR(PL_rs) == 1 && *SvPVX(PL_rs) == '\n');
+ SvCUR(PL_rs) == 1 && *SvPVX_const(PL_rs) == '\n');
Perl_sv_catpvf(aTHX_ sv, ", <%s> %s %"IVdf,
PL_last_in_gv == PL_argvgv ?
"" : GvNAME(PL_last_in_gv),
{
dVAR;
if (ckDEAD(err)) {
- SV *msv = vmess(pat, args);
+ SV * const msv = vmess(pat, args);
STRLEN msglen;
const char *message = SvPV(msv, msglen);
- I32 utf8 = SvUTF8(msv);
+ const I32 utf8 = SvUTF8(msv);
if (PL_diehook) {
assert(message);
#ifndef HAS_RENAME
I32
-Perl_same_dirent(pTHX_ char *a, char *b)
+Perl_same_dirent(pTHX_ const char *a, const char *b)
{
char *fa = strrchr(a,'/');
char *fb = strrchr(b,'/');
sv_setpv(tmpsv, ".");
else
sv_setpvn(tmpsv, a, fa - a);
- if (PerlLIO_stat(SvPVX(tmpsv), &tmpstatbuf1) < 0)
+ if (PerlLIO_stat(SvPVX_const(tmpsv), &tmpstatbuf1) < 0)
return FALSE;
if (fb == b)
sv_setpv(tmpsv, ".");
else
sv_setpvn(tmpsv, b, fb - b);
- if (PerlLIO_stat(SvPVX(tmpsv), &tmpstatbuf2) < 0)
+ if (PerlLIO_stat(SvPVX_const(tmpsv), &tmpstatbuf2) < 0)
return FALSE;
return tmpstatbuf1.st_dev == tmpstatbuf2.st_dev &&
tmpstatbuf1.st_ino == tmpstatbuf2.st_ino;
* size from the heap if they are given a NULL buffer pointer.
* The problem is that this behaviour is not portable. */
if (getcwd(buf, sizeof(buf) - 1)) {
- STRLEN len = strlen(buf);
- sv_setpvn(sv, buf, len);
+ sv_setpvn(sv, buf, strlen(buf));
return TRUE;
}
else {
Stat_t statbuf;
int orig_cdev, orig_cino, cdev, cino, odev, oino, tdev, tino;
- int namelen, pathlen=0;
- DIR *dir;
+ int pathlen=0;
Direntry_t *dp;
(void)SvUPGRADE(sv, SVt_PV);
cino = orig_cino;
for (;;) {
+ DIR *dir;
odev = cdev;
oino = cino;
while ((dp = PerlDir_read(dir)) != NULL) {
#ifdef DIRNAMLEN
- namelen = dp->d_namlen;
+ const int namelen = dp->d_namlen;
#else
- namelen = strlen(dp->d_name);
+ const int namelen = strlen(dp->d_name);
#endif
/* skip . and .. */
if (SV_CWD_ISDOT(dp)) {
if (pathlen) {
/* shift down */
- Move(SvPVX(sv), SvPVX(sv) + namelen + 1, pathlen, char);
+ Move(SvPVX_const(sv), SvPVX(sv) + namelen + 1, pathlen, char);
}
/* prepend current directory to the front */
*SvEND(sv) = '\0';
SvPOK_only(sv);
- if (PerlDir_chdir(SvPVX(sv)) < 0) {
+ if (PerlDir_chdir(SvPVX_const(sv)) < 0) {
SV_CWD_RETURN_UNDEF;
}
}
AvREAL_on((AV*)sv);
for ( key = 0; key <= av_len(av); key++ )
{
- I32 rev = SvIV(*av_fetch(av, key, FALSE));
+ const I32 rev = SvIV(*av_fetch(av, key, FALSE));
av_push((AV *)sv, newSViv(rev));
}
return rv;
errno = ECONNABORTED;
tidy_up_and_fail:
{
- int save_errno = errno;
+ const int save_errno = errno;
if (sockets[0] != -1)
PerlLIO_close(sockets[0]);
if (sockets[1] != -1)
#endif /* PERL_GLOBAL_STRUCT */
+/*
+ * Local variables:
+ * c-indentation-style: bsd
+ * c-basic-offset: 4
+ * indent-tabs-mode: t
+ * End:
+ *
+ * ex: set ts=8 sts=4 sw=4 noet:
+ */