summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>2002-04-21 22:32:29 +0000
committerGurusamy Sarathy <gsar@cpan.org>2002-04-21 22:32:29 +0000
commit91f3b821ca3eaa8b7d74bb338729ba51b7b68a90 (patch)
tree07c31a8443cfe72d822b821516a5f4ef90099af5 /ext
parent11ef8fddd64f78304dc923b07dffddd7a4f28074 (diff)
downloadperl-91f3b821ca3eaa8b7d74bb338729ba51b7b68a90.tar.gz
squelch some more type mismatch warnings
SvREFCNT_dec(x ? y : z) did not typecast the right thing due to missing parens in macro definition p4raw-id: //depot/perl@16055
Diffstat (limited to 'ext')
-rw-r--r--ext/Cwd/Cwd.xs7
-rw-r--r--ext/Data/Dumper/Dumper.xs2
-rw-r--r--ext/File/Glob/bsd_glob.c3
-rw-r--r--ext/IO/IO.xs4
-rw-r--r--ext/IO/poll.c4
-rw-r--r--ext/PerlIO/Scalar/Scalar.xs8
-rw-r--r--ext/PerlIO/encoding/encoding.xs2
7 files changed, 17 insertions, 13 deletions
diff --git a/ext/Cwd/Cwd.xs b/ext/Cwd/Cwd.xs
index 667a1e2167..f53f6ee19e 100644
--- a/ext/Cwd/Cwd.xs
+++ b/ext/Cwd/Cwd.xs
@@ -73,8 +73,7 @@ bsd_realpath(path, resolved)
dTHX;
return Perl_rmsexpand(aTHX_ (char*)path, resolved, NULL, 0);
#else
- struct stat sb;
- int n, rootd, serrno;
+ int rootd, serrno;
char *p, *q, wbuf[MAXPATHLEN];
int symlinks = 0;
@@ -124,9 +123,12 @@ loop:
p = resolved;
#if defined(HAS_LSTAT) && defined(HAS_READLINK) && defined(HAS_SYMLINK)
+ {
+ struct stat sb;
/* Deal with the last component. */
if (lstat(p, &sb) == 0) {
if (S_ISLNK(sb.st_mode)) {
+ int n;
if (++symlinks > MAXSYMLINKS) {
errno = ELOOP;
goto err1;
@@ -143,6 +145,7 @@ loop:
p = "";
}
}
+ }
#endif
/*
diff --git a/ext/Data/Dumper/Dumper.xs b/ext/Data/Dumper/Dumper.xs
index 62f3099d8a..19037a839e 100644
--- a/ext/Data/Dumper/Dumper.xs
+++ b/ext/Data/Dumper/Dumper.xs
@@ -580,7 +580,7 @@ DD_dump(pTHX_ SV *val, char *name, STRLEN namelen, SV *retval, HV *seenhv,
STRLEN keylen;
bool do_utf8 = FALSE;
- if ((sortkeys && !(keys && i <= av_len(keys))) ||
+ if ((sortkeys && !(keys && (I32)i <= av_len(keys))) ||
!(entry = hv_iternext((HV *)ival)))
break;
diff --git a/ext/File/Glob/bsd_glob.c b/ext/File/Glob/bsd_glob.c
index d0d4a9186a..46b52aa67a 100644
--- a/ext/File/Glob/bsd_glob.c
+++ b/ext/File/Glob/bsd_glob.c
@@ -506,7 +506,6 @@ globexp2(const Char *ptr, const Char *pattern,
static const Char *
globtilde(const Char *pattern, Char *patbuf, size_t patbuf_len, glob_t *pglob)
{
- struct passwd *pwd;
char *h;
const Char *p;
Char *b, *eb;
@@ -534,6 +533,7 @@ globtilde(const Char *pattern, Char *patbuf, size_t patbuf_len, glob_t *pglob)
*/
if ((h = getenv("HOME")) == NULL) {
#ifdef HAS_PASSWD
+ struct passwd *pwd;
if ((pwd = getpwuid(getuid())) == NULL)
return pattern;
else
@@ -547,6 +547,7 @@ globtilde(const Char *pattern, Char *patbuf, size_t patbuf_len, glob_t *pglob)
* Expand a ~user
*/
#ifdef HAS_PASSWD
+ struct passwd *pwd;
if ((pwd = getpwnam((char*) patbuf)) == NULL)
return pattern;
else
diff --git a/ext/IO/IO.xs b/ext/IO/IO.xs
index dc810d68a5..7edbf2c3e3 100644
--- a/ext/IO/IO.xs
+++ b/ext/IO/IO.xs
@@ -64,12 +64,12 @@ not_here(char *s)
static int
io_blocking(pTHX_ InputStream f, int block)
{
+#if defined(HAS_FCNTL)
int RETVAL;
if(!f) {
errno = EBADF;
return -1;
}
-#if defined(HAS_FCNTL)
RETVAL = fcntl(PerlIO_fileno(f), F_GETFL, 0);
if (RETVAL >= 0) {
int mode = RETVAL;
@@ -145,7 +145,7 @@ io_blocking(pTHX_ InputStream f, int block)
}
return RETVAL;
#else
- return -1;
+ return -1;
#endif
}
diff --git a/ext/IO/poll.c b/ext/IO/poll.c
index 024c52ff9f..a09c2472a7 100644
--- a/ext/IO/poll.c
+++ b/ext/IO/poll.c
@@ -58,7 +58,7 @@ again:
FD_ZERO(&wfd);
FD_ZERO(&efd);
- for(i = 0 ; i < nfds ; i++) {
+ for(i = 0 ; i < (int)nfds ; i++) {
int events = fds[i].events;
int fd = fds[i].fd;
@@ -105,7 +105,7 @@ again:
count = 0;
- for(i = 0 ; i < nfds ; i++) {
+ for(i = 0 ; i < (int)nfds ; i++) {
int revents = (fds[i].events & POLL_EVENTS_MASK);
int fd = fds[i].fd;
diff --git a/ext/PerlIO/Scalar/Scalar.xs b/ext/PerlIO/Scalar/Scalar.xs
index 86c54fa62c..c904394693 100644
--- a/ext/PerlIO/Scalar/Scalar.xs
+++ b/ext/PerlIO/Scalar/Scalar.xs
@@ -90,9 +90,9 @@ PerlIOScalar_seek(pTHX_ PerlIO *f, Off_t offset, int whence)
s->posn = offset + SvCUR(s->var);
break;
}
- if (s->posn > SvCUR(s->var))
+ if ((STRLEN)s->posn > SvCUR(s->var))
{
- (void) SvGROW(s->var,s->posn);
+ (void) SvGROW(s->var,(STRLEN)s->posn);
}
return 0;
}
@@ -141,7 +141,7 @@ PerlIOScalar_write(pTHX_ PerlIO *f, const void *vbuf, Size_t count)
s->posn += count;
}
Move(vbuf,dst+offset,count,char);
- if (s->posn > SvCUR(sv))
+ if ((STRLEN)s->posn > SvCUR(sv))
SvCUR_set(sv,s->posn);
SvPOK_on(s->var);
return count;
@@ -190,7 +190,7 @@ PerlIOScalar_get_cnt(pTHX_ PerlIO *f)
if (PerlIOBase(f)->flags & PERLIO_F_CANREAD)
{
PerlIOScalar *s = PerlIOSelf(f,PerlIOScalar);
- if (SvCUR(s->var) > s->posn)
+ if (SvCUR(s->var) > (STRLEN)s->posn)
return SvCUR(s->var) - s->posn;
else
return 0;
diff --git a/ext/PerlIO/encoding/encoding.xs b/ext/PerlIO/encoding/encoding.xs
index ea15e56877..23de989514 100644
--- a/ext/PerlIO/encoding/encoding.xs
+++ b/ext/PerlIO/encoding/encoding.xs
@@ -237,7 +237,7 @@ PerlIOEncode_fill(pTHX_ PerlIO * f)
if (SvLEN(e->dataSV) && SvPVX(e->dataSV)) {
Safefree(SvPVX(e->dataSV));
}
- if (use > e->base.bufsiz) {
+ if (use > (SSize_t)e->base.bufsiz) {
use = e->base.bufsiz;
}
SvPVX(e->dataSV) = (char *) ptr;