🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

some suggestion about shift instruction!

Started by
3 comments, last by loboWu 16 years, 2 months ago
Ther is a big difference between AngelScript and VC about shit operation. For a example: uint8[] buf={1,2,3,4,5,6}; uint32 version; version = buf[0]<<24; <<== AS won't expand to uint32, so version is 0 version |= buf[1]<<16; version |= buf[2]<<8; version |= buf[3]; In VC, it will expand uint8 to uint32, so the version=0x01020304; buf in AS, version=0x00000004; Could it be possible to expand type when operator of shit instruction is larger than 8 ? Thanks a lot.
Advertisement
use cast<uint>() ?

I do not try to do this :)
I think you may have discovered a bug in AngelScript. The shift operators should indeed result in 32bit integers if the left operand is <= 32bit.

I'll investigate this tomorrow.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

It was indeed a bug, one that I've fixed now. The correction is available in SVN revision 255.

Regards,
Andreas

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Thanks.
I will check the SVN

This topic is closed to new replies.

Advertisement