On Wed, Apr 08, 2009 at 01:19:11PM +0200, Udo Giacomozzi wrote:
> Hello strk,
> 
> Wednesday, April 8, 2009, 10:53:13 AM, you wrote:
> s> "invalid cast" came from a testcase of mine.
> s> The problem was that htons(short) was returing a 32bit integer
> s> when -O2 was used. Follow file/linenum and use a temp 16bit variable
> s> to hold the return from htons(). If it fixes, it's it.
> 
> 
> Not sure what I have to do, exactly.
> 
> I tried:
> 
>     short int temp
>       = htons(version)
>       + htons(headers)
>       + htons(messages);
> 
>     *buf = temp;        
> 
> But it still gives me the same error on the buf=temp assignment.

Try:

        boost::uint16_t tmp
        tmp = htons(version);
        *buf = tmp;
        tmp = htons(headers);
        *buf += tmp;
        tmp = htons(messages);
        *buf += tmp;

--strk;

 Free GIS & Flash consultant/developer      ()  ASCII Ribbon Campaign
 http://foo.keybit.net/~strk/services.html  /\  Keep it simple! 


_______________________________________________
Gnash-dev mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/gnash-dev

Reply via email to