]> Creatis software - gdcm.git/blobdiff - src/gdcmjpegls/Decoder/decoder.c
COMP: Fix compilation on broken compiler (scope/for loop)
[gdcm.git] / src / gdcmjpegls / Decoder / decoder.c
index 16a88c00b4c274289ea16d5b741c5cc8ddb70bac..463fa8d43df4a73f52d2dd5a7c08fc50d40625ee 100644 (file)
@@ -118,8 +118,8 @@ int     alpha,     /* alphabet size */
 int     highmask;
 #endif
 
-void usage();
 
+void usage();
 
 
 
@@ -138,7 +138,7 @@ inline void write_one_line(pixel* line, int cols, FILE* outfile)
       line8 = (unsigned char*)safealloc(cols);
   
       for (i=0; i< cols; i++)
-        *(line8+i)=ENDIAN8(*(line+i));
+        *(line8+i)=(unsigned char)ENDIAN8(*(line+i));
     
       fwrite(line8, sizeof(unsigned char), cols, outfile);
 
@@ -316,7 +316,7 @@ int initialize(int argc, char *argv[])
   int pos;   /* position in the file, after the header */
 
   for (i=0;i<MAX_COMPONENTS;i++) {
-    c_outfilename[i]=malloc(strlen(OUTFILE)+20);
+    c_outfilename[i]=(char*)malloc(strlen(OUTFILE)+20);
     sprintf(c_outfilename[i],"%s%d.out",OUTFILE,i+1);
   }
 
@@ -876,6 +876,7 @@ int main (int argc, char *argv[]) {
     tot_out = 0;
   pixel *local_scanl0,*local_scanl1,*local_pscanline,*local_cscanline;
   int MCUs_counted;
+  local_cscanline = local_pscanline = NULL;
   
   
   /* Parse the parameters, initialize */
@@ -1465,9 +1466,9 @@ int main (int argc, char *argv[]) {
 
 
   t1 = get_utime();
-  fprintf(msgfile,"Total bits  in: %ld  Symbols out: %ld  %5.3lf bps\n",
+  fprintf(msgfile,"Total bits  in: %ld  Symbols out: %ld  %5.3f bps\n",
            tot_in,tot_out,tot_in/(double)tot_out);
-  fprintf(msgfile,"Time = %1.3lf secs : %1.0lf KSymbols/sec\n",t1-t0,
+  fprintf(msgfile,"Time = %1.3f secs : %1.0f KSymbols/sec\n",t1-t0,
           (tot_out)/(1024*(t1-t0)));
 
   if ( found_EOF )