develooper Front page | perl.perl5.porters | Postings from December 2000

[8104] Encode

Thread Next
From:
H . Merijn Brand
Date:
December 14, 2000 05:50
Subject:
[8104] Encode
Message ID:
20001214142101.B338.H.M.BRAND@hccnet.nl
Either change the return type of both sv_grow () and SvPVX () to be (STDCHAR *)
or apply next patch.

*** ext/Encode/Encode.xs	Mon Dec 11 23:22:36 2000
--- ext/Encode/Encode.xs.new	Thu Dec 14 14:20:12 2000
***************
*** 102,108 ****
     e->bufsv = newSV(e->base.bufsiz);
     sv_setpvn(e->bufsv,"",0);
    }
!  e->base.buf = SvPVX(e->bufsv);
   if (!e->base.ptr)
    e->base.ptr = e->base.buf;
   if (!e->base.end)
--- 102,108 ----
     e->bufsv = newSV(e->base.bufsiz);
     sv_setpvn(e->bufsv,"",0);
    }
!  e->base.buf = (STDCHAR *)SvPVX(e->bufsv);
   if (!e->base.ptr)
    e->base.ptr = e->base.buf;
   if (!e->base.end)
***************
*** 117,123 ****
    {
     SSize_t poff = e->base.ptr - e->base.buf;
     SSize_t eoff = e->base.end - e->base.buf;
!    e->base.buf  = SvGROW(e->bufsv,e->base.bufsiz);
     e->base.ptr  = e->base.buf + poff;
     e->base.end  = e->base.buf + eoff;
    }
--- 117,123 ----
    {
     SSize_t poff = e->base.ptr - e->base.buf;
     SSize_t eoff = e->base.end - e->base.buf;
!    e->base.buf  = (STDCHAR *)SvGROW(e->bufsv,e->base.bufsiz);
     e->base.ptr  = e->base.buf + poff;
     e->base.end  = e->base.buf + eoff;
    }
***************
*** 166,172 ****
     s = SvPVutf8(uni,len);
     if (s != SvPVX(e->bufsv))
      {
!      e->base.buf = SvGROW(e->bufsv,len);
       Move(s,e->base.buf,len,char);
       SvCUR_set(e->bufsv,len);
      }
--- 166,172 ----
     s = SvPVutf8(uni,len);
     if (s != SvPVX(e->bufsv))
      {
!      e->base.buf = (STDCHAR *)SvGROW(e->bufsv,len);
       Move(s,e->base.buf,len,char);
       SvCUR_set(e->bufsv,len);
      }
***************
*** 217,223 ****
     s = SvPV(str,len);
     if (s != SvPVX(e->bufsv))
      {
!      e->base.buf = SvGROW(e->bufsv,len);
       Move(s,e->base.buf,len,char);
       SvCUR_set(e->bufsv,len);
      }
--- 217,223 ----
     s = SvPV(str,len);
     if (s != SvPVX(e->bufsv))
      {
!      e->base.buf = (STDCHAR *)SvGROW(e->bufsv,len);
       Move(s,e->base.buf,len,char);
       SvCUR_set(e->bufsv,len);
      }
End of patch

-- 
H.Merijn Brand           Amsterdam Perl Mongers (http://www.amsterdam.pm.org/)
using perl-5.005.03, 5.6.0, 5.7.1 & 620 on HP-UX 10.20 & 11.00, AIX 4.2 & 4.3,
     DEC OSF/1 4.0 and WinNT 4.0 SP-6a,  often with Tk800.022 and/or DBD-Unify
ftp://ftp.funet.fi/pub/languages/perl/CPAN/authors/id/H/HM/HMBRAND/


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About