[Asterisk-Dev] Patching flags to bitfield structs
Michael Giagnocavo
mgg-digium at atrevido.net
Thu Jan 20 02:38:31 MST 2005
No, I'm referring to using macros instead of structs to set options. i.e.:
if (ast_test_flag(&foo, MY_BAR))
versus
if (foo.mybar)
As I understand, it was moved from a bunch of ints ("if (foo_mybar)") to the
flag macros, which works if you need a portable (i.e., not just inprocess)
bitfield, but doesn't really help if you just wanna keep track of settings
without wasting memory.
-Michael
-----Original Message-----
From: asterisk-dev-bounces at lists.digium.com
[mailto:asterisk-dev-bounces at lists.digium.com] On Behalf Of Rob Gagnon
Sent: Thursday, January 20, 2005 2:48 AM
To: Asterisk Developers Mailing List
Subject: Re: [Asterisk-Dev] Patching flags to bitfield structs
under which version of Asterisk are you talking?
chan_sip.c for example in CVS is already full of "flagified" code (using
the "flags" member of the structs)
Do you mean to extend that? or are you reading old source code (pre 1.0.4)
that does not have that
----- Original Message -----
From: "Kevin P. Fleming" <kpfleming at starnetworks.us>
To: "Asterisk Developers Mailing List" <asterisk-dev at lists.digium.com>
Sent: Thursday, January 20, 2005 12:03 AM
Subject: Re: [Asterisk-Dev] Patching flags to bitfield structs
> Michael Giagnocavo wrote:
>
>> So, I'll volunteer to rewrite the flagified code that only uses flags to
>> save memory. This isn't making the code "inconsistent". It's making it
>> consistent with the intent of the variables. So, if I'm volunteering, and
>> make the changes, would this get any traction? Or will I just be wasting
>> my
>> time?
>
> As I said in the previous thread, this would get my vote. I think the best
> course of action is to make the changes to a single module (chan_sip would
> be ideal, but it's big and it's somewhat hard to keep track of as it gets
> a lot of changes) and demonstrate to everyone exactly how beneficial this
> would be. Make a patch, post it to Mantis, and all the interested parties
> can express their opinions.
> _______________________________________________
> Asterisk-Dev mailing list
> Asterisk-Dev at lists.digium.com
> http://lists.digium.com/mailman/listinfo/asterisk-dev
> To UNSUBSCRIBE or update options visit:
> http://lists.digium.com/mailman/listinfo/asterisk-dev
_______________________________________________
Asterisk-Dev mailing list
Asterisk-Dev at lists.digium.com
http://lists.digium.com/mailman/listinfo/asterisk-dev
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-dev
More information about the asterisk-dev
mailing list