mirror of
https://github.com/Perl/perl5.git
synced 2026-01-26 08:38:23 +00:00
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
This commit is contained in:
parent
11ef8fddd6
commit
91f3b821ca
4
dump.c
4
dump.c
@ -75,8 +75,8 @@ Perl_dump_sub(pTHX_ GV *gv)
|
||||
gv_fullname3(sv, gv, Nullch);
|
||||
Perl_dump_indent(aTHX_ 0, Perl_debug_log, "\nSUB %s = ", SvPVX(sv));
|
||||
if (CvXSUB(GvCV(gv)))
|
||||
Perl_dump_indent(aTHX_ 0, Perl_debug_log, "(xsub 0x%lx %d)\n",
|
||||
(long)CvXSUB(GvCV(gv)),
|
||||
Perl_dump_indent(aTHX_ 0, Perl_debug_log, "(xsub 0x%"UVxf" %d)\n",
|
||||
PTR2UV(CvXSUB(GvCV(gv))),
|
||||
(int)CvXSUBANY(GvCV(gv)).any_i32);
|
||||
else if (CvROOT(GvCV(gv)))
|
||||
op_dump(CvROOT(GvCV(gv)));
|
||||
|
||||
@ -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
|
||||
|
||||
/*
|
||||
|
||||
@ -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;
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
}
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
2
pp.c
2
pp.c
@ -1185,7 +1185,7 @@ PP(pp_divide)
|
||||
}
|
||||
/* 2s complement assumption */
|
||||
if (result <= (UV)IV_MIN)
|
||||
SETi( -result );
|
||||
SETi( -(IV)result );
|
||||
else {
|
||||
/* It's exact but too negative for IV. */
|
||||
SETn( -(NV)result );
|
||||
|
||||
@ -3070,10 +3070,10 @@ S_regmatch(pTHX_ regnode *prog)
|
||||
|
||||
DEBUG_r(
|
||||
PerlIO_printf(Perl_debug_log,
|
||||
"%*s %ld out of %ld..%ld cc=%lx\n",
|
||||
"%*s %ld out of %ld..%ld cc=%"UVxf"\n",
|
||||
REPORT_CODE_OFF+PL_regindent*2, "",
|
||||
(long)n, (long)cc->min,
|
||||
(long)cc->max, (long)cc)
|
||||
(long)cc->max, (UV)cc)
|
||||
);
|
||||
|
||||
/* If degenerate scan matches "", assume scan done. */
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user