]> Creatis software - gdcm.git/blobdiff - src/gdcmPixelWriteConvert.cxx
Fix mistypings
[gdcm.git] / src / gdcmPixelWriteConvert.cxx
index f4b2bbf141abcd51e10f42527e78c21c9e8cb45c..4cd1fcddbcf970252a744132cb0bcf773916bcf1 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmPixelWriteConvert.cxx,v $
   Language:  C++
-  Date:      $Date: 2007/09/04 13:14:33 $
-  Version:   $Revision: 1.23 $
+  Date:      $Date: 2008/04/10 12:15:36 $
+  Version:   $Revision: 1.25 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -22,6 +22,7 @@
 #include "gdcmUtil.h"
 
 #include <vector>
+#include <stdlib.h> // abs
 
 #define WITHOFFSETTABLE 1
 
@@ -252,7 +253,7 @@ void PixelWriteConvert::SetCompressJPEG2000UserData(uint8_t *data, size_t size,
     //assert( fragment_size*zsize == size );
     
     gdcmDebugMacro("fragment_size " << fragment_size << " zsize " << zsize << " size " << size);    
-    assert( abs(fragment_size*zsize-size) <=1 );
+    assert( abs((long)(fragment_size*zsize-size)) <=1 );
     
    JpegVector JpegFragmentSize;
       gdcmDebugMacro("Call Encode..BasicOffsetTable " );
@@ -343,7 +344,7 @@ void PixelWriteConvert::SetCompressJPEGUserData(uint8_t *data, size_t size, File
 
     unsigned int fragment_size = xsize*ysize*samplesPerPixel * (bitsAllocated / 8);
     gdcmDebugMacro("fragment_size " << fragment_size << " zsize " << zsize << " size " << size);
-    assert( abs(fragment_size*zsize-size) <=1 );
+    assert( abs((long)(fragment_size*zsize-size)) <=1 );
 
    JpegVector JpegFragmentSize;
 #if WITHOFFSETTABLE