X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=lib-src%2Fhexl.c;h=2389bad805ea340af1bf8868c02cf05d96e64e54;hb=d8654f7c5ad0c04060008c6fbbd90add1f4537e3;hp=58855a0752afa915c715d0d5ea32ff9c12af07e1;hpb=6883ee56ec887c2c48abe5b06b5e66aa74031910;p=chise%2Fxemacs-chise.git.1 diff --git a/lib-src/hexl.c b/lib-src/hexl.c index 58855a0..2389bad 100644 --- a/lib-src/hexl.c +++ b/lib-src/hexl.c @@ -1,16 +1,19 @@ /* Synched up with: FSF 19.28. */ -#include <../src/config.h> +#include #include #include -#ifdef MSDOS +#ifdef WIN32_NATIVE +#include #include #endif #if __STDC__ || defined(STDC_HEADERS) #include +#ifdef HAVE_UNISTD_H #include +#endif #include #endif @@ -29,9 +32,7 @@ char *progname; void usage (void); int -main(argc, argv) - int argc; - char *argv[]; +main (int argc, char *argv[]) { register long address; char string[18]; @@ -143,13 +144,12 @@ main(argc, argv) { char buf[18]; -#ifdef MSDOS - (stdout)->_flag &= ~_IOTEXT; /* print binary */ - _setmode (fileno (stdout), O_BINARY); +#ifdef WIN32_NATIVE + _setmode (_fileno (stdout), O_BINARY); #endif for (;;) { - register int i, c, d; + register int i, c = 0, d; #define hexchar(x) (isdigit (x) ? x - '0' : x - 'a' + 10) @@ -187,16 +187,15 @@ main(argc, argv) } else { -#ifdef MSDOS - (fp)->_flag &= ~_IOTEXT; /* read binary */ - _setmode (fileno (fp), O_BINARY); +#ifdef WIN32_NATIVE + _setmode (_fileno (fp), O_BINARY); #endif address = 0; string[0] = ' '; string[17] = '\0'; for (;;) { - register int i, c; + register int i, c = 0; for (i=0; i < 16; ++i) { @@ -245,8 +244,8 @@ main(argc, argv) } void -usage () +usage (void) { - (void) fprintf (stderr, "usage: %s [-de] [-iso]\n", progname); + fprintf (stderr, "Usage: %s [-de] [-iso]\n", progname); exit (1); }