Page 1 of 1

hsBool

PostPosted: Tue Jun 21, 2011 4:19 pm
by Stucuk
What is the point of hsBool? Its an Integer which stores a True/False... At least thats how it seems to be mainly used. Seems a waste to use a 4 byte number to store a 1 byte value(Ok its technically a 1 bit value but we don't have 1 bit numbers).

P.S Never assume a hsBool is written as a 4 Byte or a 1 Byte value as due to inconsistencies it can be stored in a PRP as either (Took me hours to find a bug in my loading code caused by Cyans inconsistencies).

Re: hsBool

PostPosted: Tue Jun 21, 2011 6:05 pm
by Branan
hsBool is around because... who knows. It's probably been around since the 90s. Presumably it existed (at one point) to guarantee that bools were always the same size, regardless of compiler. As you've noticed, that's no longer the case. There's probably not much point in it being around anymore, but it's one of those big code cleanup jobs that nobody has gotten around to yet.

Re: hsBool

PostPosted: Tue Jun 21, 2011 8:03 pm
by Paradox
Since it's just a typedef, I tried changing it from int to bool at one point... when the number of errors/warnings grew by several hundred, I quickly changed it back >.>