> Date: Sat, 26 Jan 2008 11:12:16 +0100
> From: mstsxfx@gmail.com
> To: pdfedit-cvs@lists.sourceforge.net
> Subject: Re: [Pdfedit-cvs] pdfedit/src/xpdf/xpdf GfxFont.cc, 1.4, 1.5 XRef.cc, 1.9, 1.10
>
> On Fri, Jan 25, 2008 at 09:22:50PM +0000, Jozef Misutka wrote:
> > Update of /cvsroot/pdfedit/pdfedit/src/xpdf/xpdf
> > In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11503
> >
> > Modified Files:
> > GfxFont.cc XRef.cc
> > Log Message:
> > - caused assert errors in win (signed int to unsigned int conversion error, char should be <= 255)
>
> Which assert (test, our code, other code)?
 
http://msdn2.microsoft.com/en-us/library/fcc4ksh8(VS.80).aspx
unsigned(-1) is let's say MAX_INT and that is out of range of any valid char ([0,255]).
unsigned((unsigned char)-1) is MAX_CHAR and that is IN the range of a valid char ([0,255]).
 
 
Have you checked that on
> linux/unix too (how can I test it)?
>
> >
> > Index: XRef.cc
> > ===================================================================
> > RCS file: /cvsroot/pdfedit/pdfedit/src/xpdf/xpdf/XRef.cc,v
> > retrieving revision 1.9
> > retrieving revision 1.10
> > diff -u -d -r1.9 -r1.10
> > --- XRef.cc 16 Jan 2008 13:50:37 -0000 1.9
> > +++ XRef.cc 25 Jan 2008 21:22:47 -0000 1.10
> > @@ -719,7 +719,7 @@
> > delete parser;
> >
> > // look for object
> > - } else if (isdigit(*p)) {
> > + } else if (isdigit((unsigned char)(*p))) {
>
> I don't see point here. isdigit is implemented as macro on linux (i
> would expect on most systems) and it casts parameter to int co this cast
> gets lost. Is this different on windows?
> How can casting help if it doesn't change the value?
>
> > num = atoi(p);
> > if (num > 0) {
> > do {
> >
> > Index: GfxFont.cc
> > ===================================================================
> > RCS file: /cvsroot/pdfedit/pdfedit/src/xpdf/xpdf/GfxFont.cc,v
> > retrieving revision 1.4
> > retrieving revision 1.5
> > diff -u -d -r1.4 -r1.5
> > --- GfxFont.cc 16 Jan 2008 13:50:36 -0000 1.4
> > +++ GfxFont.cc 25 Jan 2008 21:22:47 -0000 1.5
> > @@ -713,13 +713,13 @@
> > // and 'xx' is two hex digits
> > if ((strlen(charName) == 3 &&
> > isalpha(charName[0]) &&
> > - isxdigit(charName[1]) && isxdigit(charName[2]) &&
> > + isxdigit((unsigned char)charName[1]) && isxdigit((unsigned char)charName[2]) &&
> > ((charName[1] >= 'a' && charName[1] <= 'f') ||
> > (charName[1] >= 'A' && charName[1] <= 'F') ||
> > (charName[2] >= 'a' && charName[2] <= 'f') ||
> > (charName[2] >= 'A' && charName[2] <= 'F'))) ||
> > (strlen(charName) == 2 &&
> > - isxdigit(charName[0]) && isxdigit(charName[1]) &&
> > + isxdigit((unsigned char)charName[0]) && isxdigit((unsigned char)charName[1]) &&
> > ((charName[0] >= 'a' && charName[0] <= 'f') ||
> > (charName[0] >= 'A' && charName[0] <= 'F') ||
> > (charName[1] >= 'a' && charName[1] <= 'f') ||
> > @@ -744,19 +744,19 @@
> > n = strlen(charName);
> > code2 = -1;
> > if (hex && n == 3 && isalpha(charName[0]) &&
> > - isxdigit(charName[1]) && isxdigit(charName[2])) {
> > + isxdigit((unsigned char)charName[1]) && isxdigit((unsigned char)charName[2])) {
> > sscanf(charName+1, "%x", &code2);
> > } else if (hex && n == 2 &&
> > - isxdigit(charName[0]) && isxdigit(charName[1])) {
> > + isxdigit((unsigned char)charName[0]) && isxdigit((unsigned char)charName[1])) {
> > sscanf(charName, "%x", &code2);
> > } else if (!hex && n >= 2 && n <= 4 &&
> > - isdigit(charName[0]) && isdigit(charName[1])) {
> > + isdigit((unsigned char)charName[0]) && isdigit((unsigned char)charName[1])) {
> > code2 = atoi(charName);
> > } else if (n >= 3 && n <= 5 &&
> > - isdigit(charName[1]) && isdigit(charName[2])) {
> > + isdigit((unsigned char)charName[1]) && isdigit((unsigned char)charName[2])) {
> > code2 = atoi(charName+1);
> > } else if (n >= 4 && n <= 6 &&
> > - isdigit(charName[2]) && isdigit(charName[3])) {
> > + isdigit((unsigned char)charName[2]) && isdigit((unsigned char)charName[3])) {
> > code2 = atoi(charName+2);
> > }
> > if (code2 >= 0 && code2 <= 0xff) {
> >
> >
> > -------------------------------------------------------------------------
> > This SF.net email is sponsored by: Microsoft
> > Defy all challenges. Microsoft(R) Visual Studio 2008.
> > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> > _______________________________________________
> > Pdfedit-cvs mailing list
> > Pdfedit-cvs@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/pdfedit-cvs
>
> --
> Michal Hocko
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Pdfedit-cvs mailing list
> Pdfedit-cvs@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/pdfedit-cvs



Need to know the score, the latest news, or you need your HotmailŪ-get your "fix". Check it out.