Re: [OT] Is od broken?

2008-06-13 Thread Jim Meyering
Eric Blake <[EMAIL PROTECTED]> wrote: ... > But POSIX is clear that FLT_DIG is rounded down (unless your radix is a power > of 10), to cover the decimal-binary-decimal round trip, whereas DECIMAL_DIG is > rounded up, to cover the binary-decimal-binary round trip. In the case of od, > we want the a

Re: [OT] Is od broken?

2008-06-12 Thread Bo Borgerson
Eric Blake wrote: > OK, I'll keep them as separate commits. Bo inspired me, and I finally > figured > out how to use repo.or.cz. Now you can do: > git fetch git://repo.or.cz/coreutils/ericb.git refs/heads/od > > to see my patch series. Awesome! That was actually Jim's suggestion, but I'm gl

Re: [OT] Is od broken?

2008-06-12 Thread Eric Blake
Jim Meyering meyering.net> writes: > > Unrelated to this patch: Should we use %g instead of %e for floating point? > > Seeing 1.0e+00 is somewhat distracting in isolation; on the other hand, > > the variable-width nature of %g might not look as nice as the fixed-width > > precision of %e

Re: [OT] Is od broken?

2008-06-12 Thread Jim Meyering
Eric Blake <[EMAIL PROTECTED]> wrote: ... >>/* Don't use %#e; not all systems support it. */ >> - pre_fmt_string = " %%%d.%de"; >> + pre_fmt_string = ""; > > Unrelated to this patch: Should we use %g instead of %e for floating point? > Seeing 1.0e+00 is somewhat distracti

Re: [OT] Is od broken?

2008-06-12 Thread Eric Blake
Paul Eggert CS.UCLA.EDU> writes: > /* Names for some non-printing characters. */ > -static const char *const charname[33] = > +static char const charname[33][4] = I like this idea of using a single padding for both purposes, which means the 2D array is okay... > { >"nul", "soh", "stx",

Re: [OT] Is od broken?

2008-06-11 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Paul Eggert on 6/11/2008 5:09 PM: | Eric Blake <[EMAIL PROTECTED]> writes: | |> -printf (fmt_string, *p++); |> +printf (fmt_string, pad, "", *p++); | | How about doing padding this way instead? | | printf (fmt_string, widt

Re: [OT] Is od broken?

2008-06-11 Thread Paul Eggert
Eric Blake <[EMAIL PROTECTED]> writes: > -printf (fmt_string, *p++); > +printf (fmt_string, pad, "", *p++); How about doing padding this way instead? printf (fmt_string, width, *p++);; I think this would be clearer all-around. Here is a revised patch to od.c to do it that way.

Re: [OT] Is od broken?

2008-06-11 Thread Jim Meyering
Eric Blake <[EMAIL PROTECTED]> wrote: > Eric Blake byu.net> writes: > >> >> Gary noticed an issue with the indentation of multi-specifier od: >> >> $ od -t cx1 abc.txt >> ~ 000 T h i s i s a b c f i l e >> ~ 54 68 69 73 20 69 73 20 61 62 63 20

Re: [OT] Is od broken?

2008-06-11 Thread Jim Meyering
Eric Blake <[EMAIL PROTECTED]> wrote: > Eric Blake byu.net> writes: >> $ src/od -An -N48 configure -tfL >> 0.00e+ >> 0.00e+ >> 0.00e+ >> 0.00e+ >> >> I'm not sure why cygwin is printing such a weird value for (inv

Re: [OT] Is od broken?

2008-06-11 Thread Eric Blake
Eric Blake byu.net> writes: > $ src/od -An -N48 configure -tfL > 0.00e+ > 0.00e+ > 0.00e+ > 0.00e+ > > I'm not sure why cygwin is printing such a weird value for (invalid) long > doubles, but this patch didn't

Re: [OT] Is od broken?

2008-06-11 Thread Eric Blake
Eric Blake byu.net> writes: > > Gary noticed an issue with the indentation of multi-specifier od: > > $ od -t cx1 abc.txt > ~ 000 T h i s i s a b c f i l e > ~ 54 68 69 73 20 69 73 20 61 62 63 20 66 69 6c 65 > ~ 020 \n > ~

Re: [OT] Is od broken?

2008-06-11 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 [adding bug-coreutils; this was originally reported on the cygwin mailing list] According to Gary Johnson on 6/11/2008 1:26 AM: Gary noticed an issue with the indentation of multi-specifier od: $ od -t cx1 abc.txt ~ 000 T h i s