On Tue, 2010-12-07 at 11:58 +1100, Stephen Ecob wrote: > On Tue, Dec 7, 2010 at 11:48 AM, Peter Clifton <pc...@cam.ac.uk> wrote: > > On Tue, 2010-12-07 at 10:04 +1100, Stephen Ecob wrote: > > > >> Dropping the (a) ? (a) : 1 foolishness would be cleaner, but could > >> expose latent bugs in the 71 callers of the mymem allocators. > >> I'm happy to proceed either way. What is your preference ? > > > > Let me push a big patch nuking the My* allocation functions, that would > > make me feel much happier. > > Great! It'll be good to lay those functions to rest :)
Aside from the error checking we know about, there is also the symantic that MyStrdup (NULL) returns NULL, rather than seg-faulting. Also, in a number of cases, replacing MYFREE() requires you to explicitly NULL the free'd variable. I'm still all for making these changes.. just that it will require a bit more thought than I've got time for tonight. The scope is approximately: 30 files changed, 251 insertions(+), 432 deletions(-) But I've got a segfault on start due to the naive s/MyStrdup/strdup/ changes that involves. (I've adjusted the MYFREE invocations as appropriate). -- Peter Clifton Electrical Engineering Division, Engineering Department, University of Cambridge, 9, JJ Thomson Avenue, Cambridge CB3 0FA Tel: +44 (0)7729 980173 - (No signal in the lab!) Tel: +44 (0)1223 748328 - (Shared lab phone, ask for me) _______________________________________________ geda-user mailing list geda-user@moria.seul.org http://www.seul.org/cgi-bin/mailman/listinfo/geda-user