[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Re: #ifdefectomy for editors/cmp.c
From:       Denys Vlasenko <vda.linux () googlemail ! com>
Date:       2010-04-26 12:07:18
Message-ID: h2q1158166a1004260507yb2f0fd47n1abd7b91fcd3cad9 () mail ! gmail ! com
[Download RAW message or body]

On Sun, Apr 25, 2010 at 9:43 PM, Rob Landley <rob@landley.net> wrote:
> I'm not sure why cmp.c is an editor, but ok.
>
> Turn #if ENABLE_DESKTOP preprocessor blocks into normal C code using if
> (ENABLE_DESKTOP) and let the compiler's dead code elimination drop out the
> code.
>
> With ENABLE_DESKTOP switched off (both before and after), make bloatcheck
> reports no size change:
>
> function                                             old     new   delta
> ------------------------------------------------------------------------------
> (add/remove: 0/0 grow/shrink: 0/0 up/down: 0/0)                 Total: 0 bytes

Verified.

> Possibly for this block:
>
> -       opt_complementary = "-1"
> -                       IF_DESKTOP(":?4")
> -                       IF_NOT_DESKTOP(":?2")
> +       opt_complementary = "-1:?"IF_DESKTOP("4")IF_NOT_DESKTOP("2")
>
> What we really need is some kind of IF_ELSE_DESKTOP("4","2").  It wouldn't be
> able to handle stuff with commas in it, but in cases like this it might be
> useful...

I think this part was ok as-is. It was easy to read.
Applied the rest. Thanks.

> By the way, this block near the start:
>
> /* Mar 16, 2003      Manuel Novoa III   (mjn3@codepoet.org)
>  *
>  * Original version majorly reworked for SUSv3 compliance, bug fixes, and
>  * size optimizations.  Changes include:
>  * 1) Now correctly distinguishes between errors and actual file differences.
>  * 2) Proper handling of '-' args.
>  * 3) Actual error checking of i/o.
>  * 4) Accept SUSv3 -l option.  Note that we use the slightly nicer gnu format
>  *    in the '-l' case.
>  */
>
> Is really a repository comment, not something that belongs in the source.
> (What I'd do is have a separate commit that removes that, and the comment for
> the commit should have the complete text of the comment it's removing from the
> source.)

Done.

> Denys: should I set up a git tree you can pull from for this sort of thing?  I
> vaguely plan to make some time to do random cleanups like this to get back up
> to speed on busybox development...

If it makes your life easier, yes.

-- 
vda
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic