CompuServe Thread

#shorter types(2)

4 messages in this thread
#87595From: Douglas HoltMar 1, 1994 10:10 AM
Jonas, Just wondering if you had heard anything about using the shorter types with 3DS's data structures… (ie. using 'char flags' instead of 'unsigned long flags' in struct FaceIO) doug
#87653From: Jonas Ruikis [ADESK]Mar 1, 1994 12:52 PM
Doug, see msg. 87348. but here it is again.. ————————————— Answered by Grant. Member of the development team. > The flags variable in the FaceIO type is an unsigned long > (32 bits), the only valid values for that are 1 | 2 | 4, only 3 > bits, shouldn't an unsigned char be used instead? Just > curious but there are more of these types of, well, wasted > space, and I was wondering if there was actually more > data in those vars than is documented. Basically, can I > use the shorter types in my code without worrying? > > Just curious… > doug > > No, the internal code to 3DS expects the data to be at that size. If you change the type definitions to more efficient sizes, 3DS will not be able to make sense of the data.
#87679From: Douglas HoltMar 1, 1994 3:17 PM
Jonas and Grant, I'm not proposing to change the type declarations for the FaceIO struct, just my own copies of the info for my external code. I just wanted to know if there is any pertinent data in the high order bits… Type conversions should not affect the operation of 3DS… Am I wrong? (I am very close to a major deadline…) doug
#87722From: [F] Grant Blaha [Adesk]Mar 1, 1994 5:49 PM
Only the low order byte of the flags field, and the low order byte of the materials field, are actually used by 3D Studio. The internal code to 3D Studio actually casts them to these values anyway. Ciao, Grant