]> Creatis software - gdcm.git/commitdiff
Should suppress some warnings from Borland compiler
authorjpr <jpr>
Tue, 19 Apr 2005 09:58:19 +0000 (09:58 +0000)
committerjpr <jpr>
Tue, 19 Apr 2005 09:58:19 +0000 (09:58 +0000)
Testing/TestAllReadCompareDicom.cxx
Testing/TestBuildUpDicomDir.cxx
Testing/TestCopyRescaleDicom.cxx
Testing/TestWriteSimple.cxx
src/gdcmDocEntry.cxx
src/gdcmFile.cxx
src/gdcmFileHelper.cxx
src/gdcmUtil.cxx

index ab0b3b45a08c7be2aaa7e10ca0f4ec1a86a4d385..56f5646b85814d3ae0bbb79aa6b1cabc31154077 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: TestAllReadCompareDicom.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/04/18 01:50:54 $
-  Version:   $Revision: 1.38 $
+  Date:      $Date: 2005/04/19 10:05:36 $
+  Version:   $Revision: 1.39 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -102,8 +102,8 @@ private:
    int sizeX;
    int sizeY;
    int sizeZ;
-   int scalarSize;
-   int components;
+   uint16_t scalarSize;
+   uint16_t components;
    uint8_t *data;
    int swapCode;
 
@@ -247,7 +247,7 @@ bool TestFile::ReadFileHeader(std::ifstream *fp)
    sizeY = ReadInt32(fp); // Size Y
    sizeZ = ReadInt32(fp); // Size Z
    scalarSize = ReadInt16(fp)/8; // bits per scalar
-   components = ReadInt16(fp); // Number of components
+   components = ReadInt16(fp);   // Number of components
 
    return(true);
 }
@@ -293,7 +293,7 @@ bool TestFile::WriteFileHeader(std::ofstream *fp)
    WriteInt32(fp,sizeY); // Size Y
    WriteInt32(fp,sizeZ); // Size Z
    WriteInt16(fp,scalarSize*8); // bits per scalar
-   WriteInt16(fp,components); // number of components
+   WriteInt16(fp,components);   // number of components
 
    return(true);
 }
index f191a9c8d08bb84f46532a26ddfac286aab005ba..ac2a79bd62da64ca782ca00025a5cb2518ba1417 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: TestBuildUpDicomDir.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/02/02 10:41:10 $
-  Version:   $Revision: 1.1 $
+  Date:      $Date: 2005/04/19 10:03:22 $
+  Version:   $Revision: 1.2 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -259,7 +259,7 @@ int TestBuildUpDicomDir(int argc, char *argv[])
       std::cout << "Pysician : [" 
                 << valueStuff
                 << "]" << std::endl;
-      if ( !(s12 = p1->GetNextStudy()) )
+      if ( (s12 = p1->GetNextStudy()) == 0 )
       {
          errorFound = true;
          break;
@@ -290,7 +290,7 @@ int TestBuildUpDicomDir(int argc, char *argv[])
                 << s12->GetEntryValue(0x0008,0x1060)
                 << "]" << std::endl;
 
-      if ( !(s13 = p1->GetNextStudy()) )
+      if ( (s13 = p1->GetNextStudy()) == 0 )
       {
          std::cout << "Study StudyDescrOne.Tree missing" << std::endl;
          break;
@@ -317,7 +317,7 @@ int TestBuildUpDicomDir(int argc, char *argv[])
                 << valueStuff
                 << "]" << std::endl;
 
-      if (!(s111 = s11->GetFirstSerie()) )
+      if ((s111 = s11->GetFirstSerie()) == 0 )
       {
          std::cout << "Serie 01-01-111 missing" << std::endl;
          errorFound = true;
@@ -337,7 +337,7 @@ int TestBuildUpDicomDir(int argc, char *argv[])
                 << valueStuff
                 << "]" << std::endl;
 
-      if ( !(s1111 = s111->GetFirstImage()) )
+      if ( (s1111 = s111->GetFirstImage()) == 0 )
       {
          std::cout << "missing image S1111" << std::endl;
          errorFound = true;
@@ -350,7 +350,7 @@ int TestBuildUpDicomDir(int argc, char *argv[])
          break;
       }
 */
-      if ( !(s1112 = s111->GetNextImage()) )
+      if ( (s1112 = s111->GetNextImage()) == 0 )
       {
          std::cout << "missing image S1112" << std::endl;
          errorFound = true;
index 409c2ef8202550ad162b23e1e21ec4fdca94fbf9..907dad9b54eaaaee5ecfc7224b8646d423d7815e 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: TestCopyRescaleDicom.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/02/09 22:50:47 $
-  Version:   $Revision: 1.17 $
+  Date:      $Date: 2005/04/19 10:02:40 $
+  Version:   $Revision: 1.18 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -85,14 +85,14 @@ int CopyRescaleDicom(std::string const &filename,
       if ( gdcm::BinEntry *b = dynamic_cast<gdcm::BinEntry*>(d) )
       {
          copyF.InsertBinEntry( b->GetBinArea(),b->GetLength(),
-                                b->GetGroup(),b->GetElement(),
-                                b->GetVR() );
+                               b->GetGroup(),b->GetElement(),
+                               b->GetVR() );
       }
       else if ( gdcm::ValEntry *v = dynamic_cast<gdcm::ValEntry*>(d) )
       {   
           copyF.InsertValEntry( v->GetValue(),
-                                 v->GetGroup(),v->GetElement(),
-                                 v->GetVR() ); 
+                                v->GetGroup(),v->GetElement(),
+                                v->GetVR() ); 
       }
       else
       {
@@ -128,7 +128,7 @@ int CopyRescaleDicom(std::string const &filename,
       uint8_t *tmpRescale = rescaleImage;
       for(unsigned int i=0; i<rescaleSize; i++)
       {
-         *tmpRescale = (*tmpImage)>>8;
+         *tmpRescale = (uint8_t)( (*tmpImage)>>8 );
          tmpImage++;
          tmpRescale++;
       }
index f16d153fd532aadacb38b62ae2d39b41a476eb3e..6408315567365bb4b55bd0382ec1ce1a2345b78c 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: TestWriteSimple.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/03/09 09:45:33 $
-  Version:   $Revision: 1.28 $
+  Date:      $Date: 2005/04/19 10:05:37 $
+  Version:   $Revision: 1.29 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -137,7 +137,7 @@ int WriteSimple(Image &img)
    fileToBuild->InsertValEntry(str.str(),0x0028,0x0101); // Bits Stored
 
    str.str("");
-   str << img.componentSize - 1;
+   str << ( img.componentSize - 1 );
    fileToBuild->InsertValEntry(str.str(),0x0028,0x0102); // High Bit
 
    // Set the pixel representation
@@ -195,10 +195,10 @@ int WriteSimple(Image &img)
          {
             for(int c=0;c<img.components;c++)
             {
-               *tmp = j%256;
+               *tmp = (unsigned char)(j%256);
                if( img.componentSize>8 )
                {
-                  *(tmp+1) = j/256;
+                  *(tmp+1) = (unsigned char)(j/256);
                }
                tmp += img.componentSize/8;
             }
@@ -352,7 +352,7 @@ int TestWriteSimple(int argc, char *argv[])
       return 1;
    }
 
-   //gdcm::Debug::DebugOn();
+   gdcm::Debug::DebugOn();
        
    int ret=0;
    int i=0;
index 7ed8dc72a6b41778240d1c886b0821e8e7917c16..6224b551b049469b671de3a294bd18da5a1c871f 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDocEntry.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/03/11 11:08:31 $
-  Version:   $Revision: 1.54 $
+  Date:      $Date: 2005/04/19 09:58:19 $
+  Version:   $Revision: 1.55 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -93,7 +93,7 @@ void DocEntry::WriteContent(std::ofstream *fp, FileType filetype)
       }
 
       uint16_t z = 0;
-      uint16_t shortLgr = lgth;
+      uint16_t shortLgr = (uint16_t)lgth;
 
       if (vr == GDCM_UNKNOWN)
       {
index d18ce400659f2308d23de69d412f952ed3bbef2a..71e8a7782c480f78418d2a0f8eed787410a826f3 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmFile.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/04/14 14:26:19 $
-  Version:   $Revision: 1.232 $
+  Date:      $Date: 2005/04/19 09:58:19 $
+  Version:   $Revision: 1.233 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -1454,7 +1454,7 @@ void File::ComputeRLEInfo()
    //       - when more than one frame are present, then we are in 
    //         the case of a multi-frame image.
    long frameLength;
-   while ( (frameLength = ReadTagLength(0xfffe, 0xe000)) )
+   while ( (frameLength = ReadTagLength(0xfffe, 0xe000)) != 0 )
    { 
       // Parse the RLE Header and store the corresponding RLE Segment
       // Offset Table information on fragments of this current Frame.
@@ -1533,7 +1533,7 @@ void File::ComputeJPEGFragmentInfo()
    // Loop on the fragments[s] and store the parsed information in a
    // JPEGInfo.
    long fragmentLength;
-   while ( (fragmentLength = ReadTagLength(0xfffe, 0xe000)) )
+   while ( (fragmentLength = ReadTagLength(0xfffe, 0xe000)) != 0 )
    { 
       long fragmentOffset = Fp->tellg();
 
index f0de399a07f43b301377ea4896c74d8080811576..d5eacb720fd371b39cdeccd4c6360f6719d23496 100644 (file)
@@ -4,8 +4,8 @@
   Module:    $RCSfile: gdcmFileHelper.cxx,v $
   Language:  C++
 
-  Date:      $Date: 2005/04/04 15:15:24 $
-  Version:   $Revision: 1.32 $
+  Date:      $Date: 2005/04/19 09:58:19 $
+  Version:   $Revision: 1.33 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -626,9 +626,10 @@ bool FileHelper::Write(std::string const &fileName)
         if ( ! FileInternal->GetValEntry(0x0008, 0x0010) )
             FileInternal->InsertValEntry("", 0x0008, 0x0010);
          SetWriteFileTypeToACR();
-         break;
-         SetWriteFileTypeToExplicitVR();
+         SetWriteFileTypeToImplicitVR();
          CheckMandatoryElements();
+         break;
+
    }
 
    // --------------------------------------------------------------
index 8f18840c2dce663b03a3d80a38cd3dc926a26d96..780655e3a81a6fcc183fca66f3953d5298ab65f9 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmUtil.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/02/28 18:56:29 $
-  Version:   $Revision: 1.147 $
+  Date:      $Date: 2005/04/19 09:58:19 $
+  Version:   $Revision: 1.148 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -452,7 +452,7 @@ int GetMacAddrSys ( unsigned char *addr )
 {
 #ifdef _WIN32
    WSADATA WinsockData;
-   if (WSAStartup(MAKEWORD(2, 0), &WinsockData) != 0) 
+   if ( (WSAStartup(MAKEWORD(2, 0), &WinsockData)) != 0) 
    {
       std::cerr << "This program requires Winsock 2.x!" << std::endl;
       return -1;