See inline comments.

On 4/27/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:

I don't want to write this kind of code:



And if we had 10 more members, then .. oh god


Understandable, I wouldn't want to write that code for each new either.
Each additional member would add a rediculous amount of complexity to write
and execute.

It becomes even more complicated in long functions that have lots of
nested ifs and new's in them.


*nod* and that is why they created exceptions, but our code is not
structured well enough to use exceptions, and we use libraries that don't
like exceptions either, unfortunately...  *sigh*

We could have a macro "AllocationCheck(P)" that would check whether the
pointer is NULL, and if it is, then print the line of code to cerr with
an error message and do exit(-somecode).


This sounds like a pretty good approach, though, given this is in the
sipXxxx libraries, we probably want to use osPrintf instead of cerr, and
maybe an assert?

--
Keith Kyzivat

SIPez LLC.
SIP VoIP, IM and Presence Consulting
http://www.SIPez.com
tel: +1 (617) 273-4000
_______________________________________________
sipxtapi-dev mailing list
[email protected]
List Archive: http://list.sipfoundry.org/archive/sipxtapi-dev/

Reply via email to