lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: lynx-dev lynx2.8.5dev.16i.patch.gz


From: Thomas Dickey
Subject: Re: lynx-dev lynx2.8.5dev.16i.patch.gz
Date: Wed, 14 Jan 2004 05:45:07 -0500 (EST)

On Tue, 13 Jan 2004, Mike Castle wrote:

> Wow!  Is that ugly!

;-)

> It took me a good number of years to get away from cuddling braces, but
> this is one example of why to put braces on a line by themselves.
>
> I would have written this as:

I might have - but kept the brace-style consistent.  Actually I'd prefer
to use indent and (as in ncurses, xterm, vile) only handle special cases
manually.  But lynx's ARGSx macros won't work nicely with indent (and it's
such a special case that I'm reluctant to modify indent to handle it).

I've access to only one machine that has a K&R compiler, and (it also has
gcc) am considering removing K&R support for 2.8.6 (along with converting
lynx to using indent).

> #ifdef EXP_NESTED_TABLES
>     if (nested_tables)
>     {
>         enclosing = Stbl_get_enclosing(me->stbl);
>         me->last_anchor_before_stbl = Stbl_get_last_anchor_before(me->stbl);
>         if (enclosing == NULL) {
>             Stbl_free(me->stbl);
>             free_enclosed_stbl(me);
>         } else {
>             if (me->enclosed_stbl == NULL)
>                 me->enclosed_stbl = HTList_new();
>             HTList_addObject(me->enclosed_stbl, me->stbl);
>             CTRACE((tfp, "endStblTABLE: postpone free %p\n", me->stbl));
>         }
>         me->stbl = enclosing;
>     }
>     else
> #endif
>     {
>         Stbl_free(me->stbl);
>         me->stbl = NULL;
>     }
>
> Still 22 lines, but at least eliminated the duplicated code, and no #else.
>
> At least that code wasn't like:

yes - I don't like doing it that way either.

>
>     } else {
> #else
>     {
> #endif
>         Stbl_free(me->stbl);
>         me->stbl = NULL;
> #ifdef EXP_NESTED_TABLES
>     }
> #endif

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net

; To UNSUBSCRIBE: Send "unsubscribe lynx-dev" to address@hidden

reply via email to

[Prev in Thread] Current Thread [Next in Thread]