From: jpr Date: Tue, 19 Apr 2005 09:58:19 +0000 (+0000) Subject: Should suppress some warnings from Borland compiler X-Git-Tag: Version1.2.bp~775 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=de5fc413dc579fc61f7e04397efd1dc1087fe3cf;p=gdcm.git Should suppress some warnings from Borland compiler --- diff --git a/Testing/TestAllReadCompareDicom.cxx b/Testing/TestAllReadCompareDicom.cxx index ab0b3b45..56f5646b 100644 --- a/Testing/TestAllReadCompareDicom.cxx +++ b/Testing/TestAllReadCompareDicom.cxx @@ -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); } diff --git a/Testing/TestBuildUpDicomDir.cxx b/Testing/TestBuildUpDicomDir.cxx index f191a9c8..ac2a79bd 100644 --- a/Testing/TestBuildUpDicomDir.cxx +++ b/Testing/TestBuildUpDicomDir.cxx @@ -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; diff --git a/Testing/TestCopyRescaleDicom.cxx b/Testing/TestCopyRescaleDicom.cxx index 409c2ef8..907dad9b 100644 --- a/Testing/TestCopyRescaleDicom.cxx +++ b/Testing/TestCopyRescaleDicom.cxx @@ -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(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(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>8; + *tmpRescale = (uint8_t)( (*tmpImage)>>8 ); tmpImage++; tmpRescale++; } diff --git a/Testing/TestWriteSimple.cxx b/Testing/TestWriteSimple.cxx index f16d153f..64083155 100644 --- a/Testing/TestWriteSimple.cxx +++ b/Testing/TestWriteSimple.cxx @@ -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;c8 ) { - *(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; diff --git a/src/gdcmDocEntry.cxx b/src/gdcmDocEntry.cxx index 7ed8dc72..6224b551 100644 --- a/src/gdcmDocEntry.cxx +++ b/src/gdcmDocEntry.cxx @@ -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) { diff --git a/src/gdcmFile.cxx b/src/gdcmFile.cxx index d18ce400..71e8a778 100644 --- a/src/gdcmFile.cxx +++ b/src/gdcmFile.cxx @@ -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(); diff --git a/src/gdcmFileHelper.cxx b/src/gdcmFileHelper.cxx index f0de399a..d5eacb72 100644 --- a/src/gdcmFileHelper.cxx +++ b/src/gdcmFileHelper.cxx @@ -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; + } // -------------------------------------------------------------- diff --git a/src/gdcmUtil.cxx b/src/gdcmUtil.cxx index 8f18840c..780655e3 100644 --- a/src/gdcmUtil.cxx +++ b/src/gdcmUtil.cxx @@ -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;