« Return to Thread: libpng-1.5.6rc01 is available

Re: libpng-1.5.6rc01 is available

by John Bowler-3 :: Rate this Message:

| View in Thread

And the first right shift is negative when (p)<4 is true (when the pass is 4 or more); i.e. the compiler is complaining about the part of the ?: branch that is not taken in each case.  This change to the macros in question fixes it:

         * With Microsoft Visual C and potentially other compilers the shifts
          * below to extract the relevant fields from a 64 bit value are faulted
          * if evaluated at compile time because the non-taken branch has an
          * invalid shift (negative or more than 31), hence the following.
          */
#        if defined PNG_USE_COMPILE_TIME_MASKS && defined _MSC_VER
#           define LSR(x,s) ((x)>>((s) & 0x1f))
#        else
#           define LSR(x,s) ((x)>>(s))
#        endif
#        define S_COPY(p,x) (((p)<4 ? LSR(0x80088822,(3-(p))*8+(7-(x))) :\
            LSR(0xaa55ff00,(7-(p))*8+(7-(x)))) & 1)
#        define B_COPY(p,x) (((p)<4 ? LSR(0xff0fff33,(3-(p))*8+(7-(x))) :\
            LSR(0xff55ff00,(7-(p))*8+(7-(x)))) & 1)

John Bowler <jbowler@...>

-----Original Message-----
From: Max Stepin [mailto:newstop@...]
Sent: Thursday, October 27, 2011 9:20 AM
To: png-mng-implement@...
Subject: Re: [png-mng-implement] libpng-1.5.6rc01 is available


I think for p=0 and x=0 this:

#define S_COPY(p,x) (((p)<4 ? 0x80088822 >> ((3-(p))*8+(7-(x))) :\
            0xaa55ff00 >> ((7-(p))*8+(7-(x)))) & 1)

evaluates into

(((0)<4 ? 0x80088822 >> 31 : 0xaa55ff00 >> 63) & 1)

and then it complains about 63 being too big.
--
View this message in context: http://old.nabble.com/libpng-1.5.6rc01-is-available-tp32724829p32732609.html
Sent from the PNG MNG - Dev mailing list archive at Nabble.com.


------------------------------------------------------------------------------
The demand for IT networking professionals continues to grow, and the
demand for specialized networking skills is growing even more rapidly.
Take a complimentary Learning@Cisco Self-Assessment and learn
about Cisco certifications, training, and career opportunities.
http://p.sf.net/sfu/cisco-dev2dev
_______________________________________________
png-mng-implement mailing list
png-mng-implement@...
https://lists.sourceforge.net/lists/listinfo/png-mng-implement


------------------------------------------------------------------------------
The demand for IT networking professionals continues to grow, and the
demand for specialized networking skills is growing even more rapidly.
Take a complimentary Learning@Cisco Self-Assessment and learn
about Cisco certifications, training, and career opportunities.
http://p.sf.net/sfu/cisco-dev2dev
_______________________________________________
png-mng-implement mailing list
png-mng-implement@...
https://lists.sourceforge.net/lists/listinfo/png-mng-implement

 « Return to Thread: libpng-1.5.6rc01 is available