вторник, 29 марта 2016 г.

A VERY important notice

Today, yesterday (and a few days before) I was asking myself am I so stupid to read a single set of bits from file and reinterpret it depending on its content?

Sure, but there is a trick. 

Although Visual C++ uses the sign bit to fill vacated bit positions, there is no guarantee that other implementations also do so.

In my case (DWG reading) ITS IMPORTANT to fill vacated bits with zero, because the sign of the variable is not defined until it will be readed.

Although, problem was solved by declaring the shifted buffer as unsigned.

Комментариев нет:

Отправить комментарий