[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: gEDA-user: Removing My* memory alllocation functions



On Wed, Dec 8, 2010 at 12:52 AM, Peter Clifton <pcjc2@xxxxxxxxx> wrote:
> Note that the second patch gets my test PCB loading again, but does not
> consider every possible case.
>
> Before committing, these MUST be squashed, but it is convenient to keep
> them separate for now.
>
> Thinking about it, a pre-patch converting all "safe" MyStrdup calls to
> plain "strdup" would probably be best, then the MyStrdup -> WHATEVER can
> be purely mechanical along with the rest of the mechanical patch.

That sounds good.  In the interest of saving your development time (I
don't want to keep you from PCB+GL !), I suggest:
Of the 51 calls to MyStrdup()
    7 are "safe" because of calling with a fixed string eg MyStrdup
("Font", "FontEdit")
    2 are "safe" because of calling with the UNKNOWN macro, which can
never expand to NULL
    the remaining 42 should be assumed to be unsafe and replaced with
(x) ? strdup(x) : NULL or equivalent
I'd guess that many of the 42 are safe but I don't think it's worth
the time to exhaustively prove each safe or unsafe.


_______________________________________________
geda-user mailing list
geda-user@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user