This is a good idea, but there is also a snippet out there. Ammaross' Unlimited bits, that will allow you to have as many bits as you needs in 16 blocks. That way if you only need 16 bits you don't have to keep a large 64 bit size to store it. And it also allows you to use as many bits as you want. I belive with them mud me and him run think were up to 72 mob act flags all stored on the ch->act variable.
The snippet is rather nice and rather fuctional. ----- Original Message ----- From: "Chad Simmons" <[EMAIL PROTECTED]> To: "Cyhawk" <[EMAIL PROTECTED]> Cc: <[email protected]> Sent: Tuesday, December 23, 2003 12:06 AM Subject: Re: Question about Flags (general) > > --- Cyhawk <[EMAIL PROTECTED]> wrote: > > Hey all, my question involves flags. As i understand it, diku dirvs use > > letter flags to represent numbers (like PLR_ flags) and i know theyre > > powers of two ths allowing for easy addition of more 'flags' to the > > equasion.. I also noticed the max you can use is dd (30 letters) > > (1073741824) without causing issues. My question is, what determines the > > max number you can use? Is it complier controled, CPU architechture > > controled? Just curious on how the thing works more indepth =) > > > > It's the data type used to store the flags, which in this case is a long int. > On most archetectures the size of a long int is 32 bits (with one being used to > denote positive or negative). You should probably consider using a larger data > type (or a dynamic flag system) if you need more than that. For example, you > can increase the size of your flags to 64 bits by using the (now standard) > uint64_t data type. I typically find that 64 bits is sufficient for any flag > variable. If I need more than that, they probably can (and should) be > refactored into a more manageable data type. > > > ~Kender > > ===== > -----BEGIN GEEK CODE BLOCK----- > Version 3.1 > GCS/L/C/O d-(+) s++: a-- C+++$>++++ UBLS++++$ > P+++(--)$ L+++>++++ E--- W+>++$ N !o K? w(--) !O > M- !V PS+ PE(++) Y+ PGP->+ t+ 5 X+() R(+) tv+@ > b++(+++) !DI+++ D G(-) e>+++$ h---() r+++ y+++ > ------END GEEK CODE BLOCK------ > > __________________________________ > Do you Yahoo!? > New Yahoo! Photos - easier uploading and sharing. > http://photos.yahoo.com/ > > -- > ROM mailing list > [email protected] > http://www.rom.org/cgi-bin/mailman/listinfo/rom >

