diff options
author | Zefram <zefram@fysh.org> | 2010-12-11 18:18:12 +0000 |
---|---|---|
committer | Zefram <zefram@fysh.org> | 2010-12-11 18:23:16 +0000 |
commit | c33e8be1506a75e393304af89d64e3f46e0ca7cb (patch) | |
tree | 064f08620e62d11eca50f73b7439564b702f47ad /ext/PerlIO-scalar | |
parent | d6f31ecf904f01f8a2aab2bca55e33b1b51e0b4d (diff) | |
download | perl-c33e8be1506a75e393304af89d64e3f46e0ca7cb.tar.gz |
fix various compiler warnings from XS code
Trivial changes to fix warnings of types
* unclear precedence
* assignment as conditional
* signed/unsigned mixing
* unused parameter/variable
* value computed not used
* wrong argument type for a printf format
* variable may be used uninitialised (due to unhandled switch case)
Diffstat (limited to 'ext/PerlIO-scalar')
-rw-r--r-- | ext/PerlIO-scalar/scalar.xs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/ext/PerlIO-scalar/scalar.xs b/ext/PerlIO-scalar/scalar.xs index 6fe551d34c..e081c17f50 100644 --- a/ext/PerlIO-scalar/scalar.xs +++ b/ext/PerlIO-scalar/scalar.xs @@ -84,6 +84,7 @@ PerlIOScalar_close(pTHX_ PerlIO * f) IV PerlIOScalar_fileno(pTHX_ PerlIO * f) { + PERL_UNUSED_ARG(f); return -1; } @@ -156,7 +157,7 @@ PerlIOScalar_read(pTHX_ PerlIO *f, void *vbuf, Size_t count) got = len - (STRLEN)(s->posn); if (got <= 0) return 0; - if (got > (STRLEN)count) + if ((STRLEN)got > (STRLEN)count) got = (STRLEN)count; Copy(p + (STRLEN)(s->posn), vbuf, got, STDCHAR); s->posn += (Off_t)got; @@ -201,12 +202,14 @@ PerlIOScalar_write(pTHX_ PerlIO * f, const void *vbuf, Size_t count) IV PerlIOScalar_fill(pTHX_ PerlIO * f) { + PERL_UNUSED_ARG(f); return -1; } IV PerlIOScalar_flush(pTHX_ PerlIO * f) { + PERL_UNUSED_ARG(f); return 0; } @@ -260,6 +263,7 @@ void PerlIOScalar_set_ptrcnt(pTHX_ PerlIO * f, STDCHAR * ptr, SSize_t cnt) { PerlIOScalar *s = PerlIOSelf(f, PerlIOScalar); + PERL_UNUSED_ARG(ptr); SvGETMAGIC(s->var); s->posn = SvCUR(s->var) - cnt; } @@ -270,6 +274,9 @@ PerlIOScalar_open(pTHX_ PerlIO_funcs * self, PerlIO_list_t * layers, IV n, PerlIO * f, int narg, SV ** args) { SV *arg = (narg > 0) ? *args : PerlIOArg; + PERL_UNUSED_ARG(fd); + PERL_UNUSED_ARG(imode); + PERL_UNUSED_ARG(perm); if (SvROK(arg) || SvPOK(arg)) { if (!f) { f = PerlIO_allocate(aTHX); |