X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2Fgdcmjpegls%2FDecoder%2Fglobal.c;h=5ec5c37d8f0f6bb92c9836e694edf073a2343760;hb=20233e0e4bc268a63105f697c663feedecbe99f7;hp=55d1ddc7e9034ea865940fe29768bcbfe289c1e7;hpb=94015b89675cf4431c7e4953a597b70cfde03bcc;p=gdcm.git diff --git a/src/gdcmjpegls/Decoder/global.c b/src/gdcmjpegls/Decoder/global.c index 55d1ddc7..5ec5c37d 100644 --- a/src/gdcmjpegls/Decoder/global.c +++ b/src/gdcmjpegls/Decoder/global.c @@ -51,12 +51,16 @@ */ #include -#include #include "global.h" +#ifdef HAVE_UNISTD_H +#include +#else +#include +#endif -char *disclaimer = "\ +char disclaimer[] = "\ This program is Copyright (c) University of British Columbia.\n\ All rights reserved. It may be freely redistributed in its\n\ entirety provided that this copyright notice is not removed.\n\ @@ -70,7 +74,7 @@ without the written permission of the copyright holder.\n\ FILE *in, *out; FILE *c_in[MAX_COMPONENTS]; FILE *c_out[MAX_COMPONENTS]; -FILE *msgfile = NULL; // = stdout; +FILE *msgfile = NULL; /* = stdout;*/ /* Context quantization thresholds - initially unset */ int T3 = -1, @@ -99,14 +103,10 @@ int bpp, /* bits per sample */ limit_reduce; /* reduction on above for EOR states */ -/* define color mode strings */ -char *plane_int_string = "plane by plane", - *line_int_string = "line intlv", - *pixel_int_string = "sample intlv"; /* function to print out error messages */ -void error(char *msg) { +void error(const char *msg) { fprintf(stderr, msg); exit(-1); } @@ -141,8 +141,8 @@ void *safecalloc(size_t numels, size_t size) { double get_utime() { - clock_t c; - (void)c; + /*clock_t c; + (void)c;*/ return (double)clock()/CLOCKS_PER_SEC; } @@ -322,35 +322,35 @@ void check_compatibility(jpeg_ls_header *head_frame, jpeg_ls_header *head_scan, /* for writing disclaimer to command line in DOS */ -char *ttyfilename = "CON"; +char ttyfilename[] = "CON"; #define PAUSE 20 void fprint_disclaimer(FILE *fp, int nopause) { - char *p0, *p1; - FILE *ttyf; - int i, c; + char *p0, *p1; + FILE *ttyf = NULL; + int i; /*, c;*/ - nopause = nopause | !isatty(fileno(fp)); + nopause = nopause | !isatty(fileno(fp)); - if ( !nopause && (ttyf=fopen(ttyfilename,"r"))==NULL ) { - nopause = 1; - } + if ( !nopause && (ttyf=fopen(ttyfilename,"r"))==NULL ) { + nopause = 1; + } - for ( i=1, p0=disclaimer; ; i++ ) { - if ( !(*p0) ) break; - if ( !nopause && i%PAUSE==0 ) { + for ( i=1, p0=disclaimer; ; i++ ) { + if ( !(*p0) ) break; + if ( !nopause && i%PAUSE==0 ) { fflush(fp); fprintf(stderr, "--- (press RETURN to continue) ---"); fflush(stderr); - c = getc(ttyf); - } - for ( p1=p0; (*p1 != '\n') && (*p1 != 0); p1++ ); - *p1 = 0; - fprintf(fp,"%s\n",p0); - p0 = p1+1; +/* c = getc(ttyf);*/ } - fprintf(fp,"\n"); fflush(fp); - if ( !nopause) fclose(ttyf); + for ( p1=p0; (*p1 != '\n') && (*p1 != 0); p1++ ); + *p1 = 0; + fprintf(fp,"%s\n",p0); + p0 = p1+1; + } + fprintf(fp,"\n"); fflush(fp); + if ( !nopause) fclose(ttyf); }