summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorAndy Lester <andy@petdance.com>2005-05-04 23:55:00 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2005-05-07 17:15:45 +0000
commit4373e329bbd25cac77cfe128757db8cbb63c47bb (patch)
tree0f56bb79f020f97f6f453ae711bed9154d9608e6 /util.c
parent892b45be8fb48b672b1d646c00fb1b9bac292d07 (diff)
downloadperl-4373e329bbd25cac77cfe128757db8cbb63c47bb.tar.gz
GCC attributes!
Message-ID: <20050504215540.GA20413@petdance.com> p4raw-id: //depot/perl@24414
Diffstat (limited to 'util.c')
-rw-r--r--util.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/util.c b/util.c
index 9d8a0c1113..5ad01e8072 100644
--- a/util.c
+++ b/util.c
@@ -2710,7 +2710,7 @@ Perl_repeatcpy(pTHX_ register char *to, register const char *from, I32 len, regi
#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,'/');
@@ -3682,8 +3682,7 @@ Perl_getcwd_sv(pTHX_ register SV *sv)
* 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 {
@@ -3696,8 +3695,7 @@ Perl_getcwd_sv(pTHX_ register SV *sv)
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);
@@ -3712,6 +3710,7 @@ Perl_getcwd_sv(pTHX_ register SV *sv)
cino = orig_cino;
for (;;) {
+ DIR *dir;
odev = cdev;
oino = cino;
@@ -3734,9 +3733,9 @@ Perl_getcwd_sv(pTHX_ register SV *sv)
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)) {
@@ -4354,7 +4353,7 @@ S_socketpair_udp (int fd[2]) {
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)