hsBool

Announcements and discussion regarding any projects related to Cyan Worlds' Plasma Engine including (but not limited to) CyanWorlds.com Engine, Drizzle, OfflineKI, PyPRP, and libHSPlasma.

hsBool

Postby Stucuk » Tue Jun 21, 2011 4:19 pm

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).
Image
-Stu
Stucuk
 
Posts: 45
Joined: Wed Jul 14, 2010 5:29 pm

Re: hsBool

Postby Branan » Tue Jun 21, 2011 6:05 pm

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.
Image
Your friendly neighborhood shard admin
User avatar
Branan
Gehn Shard Admin
 
Posts: 694
Joined: Fri Nov 16, 2007 9:45 pm
Location: Portland, OR

Re: hsBool

Postby Paradox » Tue Jun 21, 2011 8:03 pm

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 >.>
Paradox
 
Posts: 1290
Joined: Fri Sep 28, 2007 6:48 pm
Location: Canada


Return to Plasma Development

Who is online

Users browsing this forum: No registered users and 0 guests

cron