]> Creatis software - gdcm.git/blobdiff - src/jpeg/ljpg/huffd.c
FIX: Some warnings
[gdcm.git] / src / jpeg / ljpg / huffd.c
index e23fffb55c8f2698985df733a84d0980b409bf51..89803a0f022092f47ad72a74766afbeea6bf3b6a 100644 (file)
@@ -5,7 +5,7 @@
  * software
  */
 /*
- * $Id: huffd.c,v 1.1 2003/10/21 12:08:53 jpr Exp $
+ * $Id: huffd.c,v 1.4 2004/09/12 02:08:10 malaterre Exp $
  */
 #include <stdio.h>
 #include <stdlib.h>
 #include "proto.h"
 #include "predict.h"
 
-
 #define RST0    0xD0                /* RST0 marker code */
 
 static long getBuffer;              /* current bit-extraction buffer */
-static int  bitsLeft;               /* # of unused bits in it */
+static unsigned int  bitsLeft;               /* # of unused bits in it */
 
 /*
  * The following variables keep track of the input buffer
  * for the JPEG data, which is read by ReadJpegData.
  */
-Uchar *inputBuffer;               /* Input buffer for JPEG data */
+Uchar *inputBuffer = 0;           /* Input buffer for JPEG data */
 int inputBufferOffset = 0;        /* Offset of current byte */
 
 /*
@@ -111,7 +110,7 @@ static int bmask[] = {0x0000,
 }
 
 #define get_bits(nbits,rv) {                                            \
-        if (bitsLeft < nbits) FillBitBuffer(nbits);                     \
+        if (bitsLeft < (unsigned)nbits) FillBitBuffer(nbits);                     \
         rv = ((getBuffer >> (bitsLeft -= (nbits)))) & bmask[nbits];     \
 }
 
@@ -533,7 +532,7 @@ void DecodeImage (DecompressInfo *dcPtr, unsigned short **image, int depth)
     else if (depth == 24)
                 PmPutRow24 (curRowBuf, numCOL, &image24tmp);
 
-    swap(MCU *, prevRowBuf, curRowBuf);
+    gdcmSWAP(MCU *, prevRowBuf, curRowBuf);
 
     /* optimal case : 8 bit image, one color component, no restartInRows */
     if ((depth == 8) && (compsInScan == 1) && (dcPtr->restartInRows == 0)) 
@@ -631,7 +630,7 @@ void DecodeImage (DecompressInfo *dcPtr, unsigned short **image, int depth)
               else if (depth == 24)
                         PmPutRow24 (curRowBuf, numCOL, &image24tmp);
 
-              swap(MCU *,prevRowBuf,curRowBuf);
+              gdcmSWAP(MCU *,prevRowBuf,curRowBuf);
               continue;
            }
            dcPtr->restartRowsToGo--;
@@ -646,7 +645,7 @@ void DecodeImage (DecompressInfo *dcPtr, unsigned short **image, int depth)
 
         /* The upper neighbors are predictors for the first column. */
         for (curComp = 0; curComp < compsInScan; curComp++) 
-                {              
+                {
             ci = dcPtr->MCUmembership[curComp];
             compptr = dcPtr->curCompInfo[ci];
             dctbl = dcPtr->dcHuffTblPtrs[compptr->dcTblNo];
@@ -661,7 +660,7 @@ void DecodeImage (DecompressInfo *dcPtr, unsigned short **image, int depth)
         for (col=1; col < numCOL; col++) 
                 {
             for (curComp = 0; curComp < compsInScan; curComp++) 
-                        {                      
+                        {
                 ci = dcPtr->MCUmembership[curComp];
                 compptr = dcPtr->curCompInfo[ci];
                 dctbl = dcPtr->dcHuffTblPtrs[compptr->dcTblNo];
@@ -684,7 +683,7 @@ void DecodeImage (DecompressInfo *dcPtr, unsigned short **image, int depth)
               else if (depth == 24)
                         PmPutRow24 (curRowBuf, numCOL, &image24tmp);
 
-              swap(MCU *, prevRowBuf, curRowBuf);
+              gdcmSWAP(MCU *, prevRowBuf, curRowBuf);
       
       }/*endfor row*/
     }/*endelse*/