[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-gnulib] full-write.c / full-read.c consolidation
From: |
Bruno Haible |
Subject: |
Re: [Bug-gnulib] full-write.c / full-read.c consolidation |
Date: |
Wed, 8 Jan 2003 13:55:17 +0100 (CET) |
Jim Meyering writes:
> Any objection to this?
>
> * full-write.c: Rework so that it may serve to define full_read, too.
> * full-read.c: Simply #define FULL_READ and include full-write.c.
>
> With the above change, full-read.c is just two lines (modulo copyright):
Nothing against unification of duplicated code - where it is
duplicated and not only similar. But here, when 50% of the resulting
code is #ifdef'ed, my gut feeling is that we are going too far. The
#ifdef spaghetti is harder to maintain than the two earlier functions.
> # undef const
> # define const /* empty */
I think it would be safer to do this after including <errno.h>, not
before. You never know what <errno.h> contains.
> const char *ptr = buf;
>
> while (count > 0)
Any reason why you undid the "really nothing to do if count == 0"
optimization that I had put in?
Bruno
- [Bug-gnulib] full-write.c / full-read.c consolidation, Jim Meyering, 2003/01/07
- Re: [Bug-gnulib] full-write.c / full-read.c consolidation,
Bruno Haible <=
- Re: [Bug-gnulib] full-write.c / full-read.c consolidation, Karl Berry, 2003/01/07
- Re: [Bug-gnulib] full-write.c / full-read.c consolidation, Karl Berry, 2003/01/08
- Re: [Bug-gnulib] full-write.c / full-read.c consolidation, Karl Berry, 2003/01/08
- Re: [Bug-gnulib] full-write.c / full-read.c consolidation, Karl Berry, 2003/01/08
- Re: [Bug-gnulib] full-write.c / full-read.c consolidation, Karl Berry, 2003/01/08