вторник, 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.

четверг, 24 марта 2016 г.

That's the first post in this blog, and it's just not to forget send ODA feedback that their DWG specification has mistake in it:

Page 82 (AcDb:Classes)

The ending sentinel should be like this:

\x72\x5E\x3B\x47\x3B\x56\x07\x3A\x3F\x23\x0B\xA0\x18\x30\x49\x75

second byte is 5E instead of 5L in specification. This mistake has place in R13-15, and occasionally in later pages.