PERFORCE change 179341 for review

Garrett Cooper gcooper at FreeBSD.org
Wed Jun 9 02:29:49 UTC 2010


On Tue, Jun 8, 2010 at 7:17 PM, Benjamin Fiedler <bfiedler at freebsd.org> wrote:
> http://p4web.freebsd.org/@@179341?ac=10
>
> Change 179341 by bfiedler at freebsd-7803 on 2010/06/09 02:17:04
>
>        Added a few basic options (help, [no]ignore-file-name-case) and integer definitions. Changed makefile to use -g by default.

...

>
> +DEBUG = -g
>  PROG=  diff
>  SRCS=  diff.c diffdir.c diffreg.c
> -CFLAGS+=       -std=c99 -Wall -pedantic
> +CFLAGS+=       -std=c99 -Wall -pedantic $(DEBUG)

That's what the DEBUG_FLAG var does?

>  .include <bsd.prog.mk>
>
> ==== //depot/projects/soc2010/bsdtextproc/diff/diff.c#2 (text+ko) ====
>
> @@ -44,7 +44,7 @@
>
>  #include "diff.h"
>
> -int     aflag, bflag, dflag, iflag, lflag, Nflag, Pflag, pflag, rflag;
> +int     aflag, Bflag, bflag, dflag, iflag, lflag, Nflag, Pflag, pflag, rflag;

This could make merging patches entertaining if you add or remove a
variable; it probably would be easier if each variable was per-line.

This doesn't contradict style(9) though (and it says that that's ok as
long as it doesn't overflow 80 columns).

>  int     sflag, tflag, Tflag, wflag;
>  int     format, context, status;

...

> +                   strcmp(dent1->d_name, dent2->d_name) ;

This is kind of hard to read... can this be split up into if-based
branch statements?

>                if (pos == 0) {
>                        /* file exists in both dirs, diff it */
>                        diffit(dent1, path1, dirlen1, path2, dirlen2);

Thanks!
-Garrett


More information about the p4-projects mailing list