[Asterisk-Dev] ast_flags question

Andrew Thompson asteriskuser at aktzero.com
Fri Jan 7 08:13:46 MST 2005


I've been looking at bug 3083 
(http://bugs.digium.com/bug_view_page.php?bug_id=0003083), and am 
wondering if there has been discussion on whether an int is big enough 
to hold everything that we might want to store, or what to do when there 
  are more than 32 things that can be reduced to flags? (OK, when I 
originally wrote this question, I thought it as 16 bits, but anyway, 
isn't there always just one more thing?)

I see in bug 3136 
(http://bugs.digium.com/bug_view_page.php?bug_id=0003136) that a struct 
is being used to hold the flags variable, which I am guessing means an 
"unsigned int moreflags" could be added to handle more flags, but I see 
other code that just uses an int.

Also, there was a note in 3136 that suggested the use of unsigned int 
instead of int, but I see in bug 3083 that an int was used for the flags 
variable. If this was going to be defined locally, shouldn't it have 
been unsigned as well? And, is there a reason why the struct was not used?

Note: I am not a super-coder, I know just enough to be dangerous, and I 
hate pointers!

-- 
Andrew Thompson
http://aktzero.com/
http://dev.asteriskdocs.org/



More information about the asterisk-dev mailing list