View Issue Details [ Jump to Notes ] | [ Print ] | ||||||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||||||
0009260 | ITK | public | 2009-07-11 12:03 | 2010-11-07 01:18 | |||||||||
Reporter | Luis Ibanez | ||||||||||||
Assigned To | Luis Ibanez | ||||||||||||
Priority | urgent | Severity | minor | Reproducibility | have not tried | ||||||||
Status | assigned | Resolution | open | ||||||||||
Platform | OS | OS Version | |||||||||||
Product Version | |||||||||||||
Target Version | Fixed in Version | ||||||||||||
Summary | 0009260: Integer types inconsistency in 64 bits platforms | ||||||||||||
Description | Windows 64 bits platforms define "long" as a 32-bits integer. As a consequence, the Index, Size, and Offset types are unable to manage images larger than 2Gb. | ||||||||||||
Additional Information | Thread in the users mailing list: http://www.itk.org/pipermail/insight-users/2009-July/031463.html [^] | ||||||||||||
Tags | No tags attached. | ||||||||||||
Resolution Date | |||||||||||||
Sprint | |||||||||||||
Sprint Status | |||||||||||||
Attached Files | MetaImage64BitsWarnings.patch [^] (47,426 bytes) 2009-11-21 13:47 [Show Content] [Hide Content]? MetaImage64BitsWarnings.patch Index: metaArray.cxx =================================================================== RCS file: /cvsroot/Insight/Insight/Utilities/MetaIO/metaArray.cxx,v retrieving revision 1.10 diff -u -r1.10 metaArray.cxx --- metaArray.cxx 21 Jun 2009 21:54:05 -0000 1.10 +++ metaArray.cxx 21 Nov 2009 18:41:26 -0000 @@ -1156,7 +1156,7 @@ } unsigned char* compr = new unsigned char[m_CompressedElementDataSize]; - _fstream->read((char *)compr, m_CompressedElementDataSize); + _fstream->read((char *)compr, (size_t)m_CompressedElementDataSize); MET_PerformUncompression(compr, m_CompressedElementDataSize, (unsigned char *)_data, readSize); @@ -1198,7 +1198,7 @@ // bool MetaArray:: M_WriteElements(METAIO_STREAM::ofstream * _fstream, const void * _data, - int _dataQuantity) + METAIO_STL::streamoff _dataQuantity) { bool localData = false; METAIO_STREAM::ofstream* tmpWriteStream; @@ -1256,7 +1256,7 @@ } else { - tmpWriteStream->write( (const char *)_data, _dataQuantity ); + tmpWriteStream->write( (const char *)_data, (size_t)_dataQuantity ); } if(!localData) Index: metaArray.h =================================================================== RCS file: /cvsroot/Insight/Insight/Utilities/MetaIO/metaArray.h,v retrieving revision 1.6 diff -u -r1.6 metaArray.h --- metaArray.h 9 Apr 2008 01:44:29 -0000 1.6 +++ metaArray.h 21 Nov 2009 18:41:26 -0000 @@ -187,7 +187,7 @@ bool m_AutoFreeElementData; - unsigned int m_CompressedElementDataSize; + METAIO_STL::streamoff m_CompressedElementDataSize; char m_ElementDataFileName[255]; @@ -207,7 +207,7 @@ bool M_WriteElements(METAIO_STREAM::ofstream * _fstream, const void * _data, - int _dataQuantity); + METAIO_STL::streamoff _dataQuantity); }; Index: metaBlob.cxx =================================================================== RCS file: /cvsroot/Insight/Insight/Utilities/MetaIO/metaBlob.cxx,v retrieving revision 1.28 diff -u -r1.28 metaBlob.cxx --- metaBlob.cxx 9 Apr 2008 01:44:28 -0000 1.28 +++ metaBlob.cxx 21 Nov 2009 18:41:26 -0000 @@ -40,10 +40,10 @@ } //Color is red by default - m_Color[0]=1.0; - m_Color[1]=0.0; - m_Color[2]=0.0; - m_Color[3]=1.0; + m_Color[0]=1.0f; + m_Color[1]=0.0f; + m_Color[2]=0.0f; + m_Color[3]=1.0f; } BlobPnt:: Index: metaContour.cxx =================================================================== RCS file: /cvsroot/Insight/Insight/Utilities/MetaIO/metaContour.cxx,v retrieving revision 1.16 diff -u -r1.16 metaContour.cxx --- metaContour.cxx 24 Apr 2008 19:13:40 -0000 1.16 +++ metaContour.cxx 21 Nov 2009 18:41:27 -0000 @@ -44,10 +44,10 @@ m_V[i] = 0; } //Color is red by default - m_Color[0]=1.0; - m_Color[1]=0.0; - m_Color[2]=0.0; - m_Color[3]=1.0; + m_Color[0]=1.0f; + m_Color[1]=0.0f; + m_Color[2]=0.0f; + m_Color[3]=1.0f; } ContourControlPnt:: Index: metaContour.h =================================================================== RCS file: /cvsroot/Insight/Insight/Utilities/MetaIO/metaContour.h,v retrieving revision 1.9 diff -u -r1.9 metaContour.h --- metaContour.h 9 Apr 2008 01:44:29 -0000 1.9 +++ metaContour.h 21 Nov 2009 18:41:27 -0000 @@ -68,10 +68,10 @@ m_Id = 0; m_X = new float[m_Dim]; //Color is red by default - m_Color[0]=1.0; - m_Color[1]=0.0; - m_Color[2]=0.0; - m_Color[3]=1.0; + m_Color[0]=1.0f; + m_Color[1]=0.0f; + m_Color[2]=0.0f; + m_Color[3]=1.0f; } ~ContourInterpolatedPnt() Index: metaImage.cxx =================================================================== RCS file: /cvsroot/Insight/Insight/Utilities/MetaIO/metaImage.cxx,v retrieving revision 1.122 diff -u -r1.122 metaImage.cxx --- metaImage.cxx 16 Nov 2009 16:30:17 -0000 1.122 +++ metaImage.cxx 21 Nov 2009 18:41:27 -0000 @@ -576,7 +576,7 @@ // // // -METAIO_STL::streamsize MetaImage:: +METAIO_STL::streamoff MetaImage:: Quantity(void) const { return m_Quantity; @@ -585,13 +585,13 @@ // // // -const METAIO_STL::streamsize * MetaImage:: +const METAIO_STL::streamoff * MetaImage:: SubQuantity(void) const { return m_SubQuantity; } -METAIO_STL::streamsize MetaImage:: +METAIO_STL::streamoff MetaImage:: SubQuantity(int _i) const { return m_SubQuantity[_i]; @@ -699,11 +699,11 @@ // // void MetaImage:: -ElementByteOrderSwap(METAIO_STL::streamsize _quantity) +ElementByteOrderSwap(METAIO_STL::streamoff _quantity) { // use the user provided value if provided or the internal ivar - METAIO_STL::streamsize quantity = _quantity ? _quantity : m_Quantity; + METAIO_STL::streamoff quantity = _quantity ? _quantity : m_Quantity; if(META_DEBUG) { @@ -757,7 +757,7 @@ } bool MetaImage:: -ElementByteOrderFix(METAIO_STL::streamsize _quantity) +ElementByteOrderFix(METAIO_STL::streamoff _quantity) { if(m_BinaryDataByteOrderMSB != MET_SystemByteOrderMSB()) { @@ -903,7 +903,7 @@ } double MetaImage:: -ElementData(METAIO_STL::streamsize _i) const +ElementData(METAIO_STL::streamoff _i) const { double tf = 0; MET_ValueToDouble(m_ElementType, m_ElementData, _i, &tf); @@ -912,7 +912,7 @@ } bool MetaImage:: -ElementData(METAIO_STL::streamsize _i, double _v) +ElementData(METAIO_STL::streamoff _i, double _v) { if(_i<m_Quantity) { @@ -1709,7 +1709,7 @@ NULL, false ); // no memory allocation METAIO_STL::string filename = ElementDataFileName(); - unsigned long dataPos = 0; + METAIO_STL::streampos dataPos = 0; // local file if( filename == "LOCAL" ) @@ -1759,12 +1759,12 @@ int elementNumberOfBytes = elementSize*m_ElementNumberOfChannels; // seek to the end and write one byte to allocate the entire file size - unsigned long seekpos = m_Quantity*elementNumberOfBytes; + METAIO_STL::streamoff seekoff = m_Quantity*elementNumberOfBytes; tmpWriteStream->seekp(0, METAIO_STREAM::ios::end); - if ((unsigned long)(tmpWriteStream->tellp()) != dataPos+seekpos) + if (tmpWriteStream->tellp() != (dataPos+seekoff)) { - seekpos = seekpos - 1; - tmpWriteStream->seekp(dataPos+seekpos, METAIO_STREAM::ios::beg); + seekoff = seekoff - 1; + tmpWriteStream->seekp(dataPos+seekoff, METAIO_STREAM::ios::beg); const char zerobyte = 0; tmpWriteStream->write(&zerobyte, 1); } @@ -1916,7 +1916,7 @@ M_SetupWriteFields(); M_Write(); - unsigned long dataPos = m_WriteStream->tellp(); + METAIO_STL::streampos dataPos = m_WriteStream->tellp(); // If data is in a separate file, set dataPos and point to that file. // ( we've already verified the name isn't LIST and doesn't @@ -1970,9 +1970,9 @@ int elementNumberOfBytes = elementSize*m_ElementNumberOfChannels; // write the last byte in the file to allocate it - unsigned long seekpos = m_Quantity * elementNumberOfBytes; - seekpos -= 1; - m_WriteStream->seekp(seekpos, METAIO_STREAM::ios::cur); + METAIO_STL::streamoff seekoff = m_Quantity * elementNumberOfBytes; + seekoff -= 1; + m_WriteStream->seekp(seekoff, METAIO_STREAM::ios::cur); const char zerobyte = 0; m_WriteStream->write(&zerobyte, 1); @@ -1996,7 +1996,7 @@ bool MetaImage:: M_WriteElementsROI(METAIO_STREAM::ofstream * _fstream, const void * _data, - unsigned long _dataPos, + METAIO_STL::streampos _dataPos, int * _indexMin, int* _indexMax ) { @@ -2017,7 +2017,7 @@ // region shape // This calculate the number of continuous bytes in the file // which can be written - METAIO_STL::streamsize elementsToWrite = 1; + METAIO_STL::streamoff elementsToWrite = 1; int movingDirection = 0; do { @@ -2033,12 +2033,12 @@ while(!done) { // Seek to the right position - unsigned long seekpos = _dataPos; + METAIO_STL::streamoff seekoff = _dataPos; for(int i=0; i<m_NDims; i++) { - seekpos += m_SubQuantity[i] * currentIndex[i] * elementNumberOfBytes; + seekoff += m_SubQuantity[i] * currentIndex[i] * elementNumberOfBytes; } - _fstream->seekp( seekpos, METAIO_STREAM::ios::beg ); + _fstream->seekp( seekoff, METAIO_STREAM::ios::beg ); M_WriteElementData( _fstream, data, elementsToWrite ); data += elementsToWrite * elementNumberOfBytes; @@ -2446,7 +2446,7 @@ // bool MetaImage:: M_ReadElements(METAIO_STREAM::ifstream * _fstream, void * _data, - METAIO_STL::streamsize _dataQuantity) + METAIO_STL::streamoff _dataQuantity) { if(META_DEBUG) { @@ -2466,7 +2466,7 @@ int elementSize; MET_SizeOfType(m_ElementType, &elementSize); - METAIO_STL::streamsize readSize = _dataQuantity*m_ElementNumberOfChannels*elementSize; + METAIO_STL::streamoff readSize = _dataQuantity*m_ElementNumberOfChannels*elementSize; if(META_DEBUG) { METAIO_STREAM::cout << "MetaImage: M_ReadElements: ReadSize = " @@ -2534,7 +2534,7 @@ bool MetaImage:: M_WriteElements(METAIO_STREAM::ofstream * _fstream, const void * _data, - METAIO_STL::streamsize _dataQuantity) + METAIO_STL::streamoff _dataQuantity) { if(!strcmp(m_ElementDataFileName, "LOCAL")) @@ -2561,8 +2561,8 @@ char fName[255]; int elementSize; MET_SizeOfType(m_ElementType, &elementSize); - METAIO_STL::streamsize elementNumberOfBytes = elementSize*m_ElementNumberOfChannels; - METAIO_STL::streamsize sliceNumberOfBytes = m_SubQuantity[m_NDims-1]*elementNumberOfBytes; + METAIO_STL::streamoff elementNumberOfBytes = elementSize*m_ElementNumberOfChannels; + METAIO_STL::streamoff sliceNumberOfBytes = m_SubQuantity[m_NDims-1]*elementNumberOfBytes; METAIO_STREAM::ofstream* writeStreamTemp = new METAIO_STREAM::ofstream; for(i=1; i<=m_DimSize[m_NDims-1]; i++) @@ -2593,7 +2593,7 @@ else { unsigned char * compressedData = NULL; - unsigned int compressedDataSize = 0; + METAIO_STL::streamoff compressedDataSize = 0; // Compress the data slice by slice compressedData = MET_PerformCompression( @@ -2645,13 +2645,13 @@ bool MetaImage:: M_WriteElementData(METAIO_STREAM::ofstream * _fstream, const void * _data, - METAIO_STL::streamsize _dataQuantity) + METAIO_STL::streamoff _dataQuantity) { if(!m_BinaryData) { double tf; - for(METAIO_STL::streamsize i=0; i<_dataQuantity; i++) + for(METAIO_STL::streamoff i=0; i<_dataQuantity; i++) { MET_ValueToDouble(m_ElementType, _data, i, &tf); if((i+1)/10 == (double)(i+1.0)/10.0) @@ -2669,11 +2669,11 @@ if(m_CompressedData) { // the data is writen in writes no bigger then MaxIOChunk - size_t bytesRemaining = _dataQuantity; + METAIO_STL::streamoff bytesRemaining = _dataQuantity; while ( bytesRemaining ) { - size_t chunkToWrite = bytesRemaining > MaxIOChunk ? MaxIOChunk : bytesRemaining; - _fstream->write( (const char *)_data, chunkToWrite ); + METAIO_STL::streamoff chunkToWrite = bytesRemaining > MaxIOChunk ? MaxIOChunk : bytesRemaining; + _fstream->write( (const char *)_data, (size_t)chunkToWrite ); _data = (const char *)(_data) + chunkToWrite; // <- Note: data is changed bytesRemaining -= chunkToWrite; } @@ -2682,14 +2682,14 @@ { int elementSize; MET_SizeOfType(m_ElementType, &elementSize); - METAIO_STL::streamsize elementNumberOfBytes = elementSize*m_ElementNumberOfChannels; + METAIO_STL::streamoff elementNumberOfBytes = elementSize*m_ElementNumberOfChannels; // the data is writen in writes no bigger then MaxIOChunk - size_t bytesRemaining = _dataQuantity * elementNumberOfBytes; + METAIO_STL::streamoff bytesRemaining = _dataQuantity * elementNumberOfBytes; while ( bytesRemaining ) { - size_t chunkToWrite = bytesRemaining > MaxIOChunk ? MaxIOChunk : bytesRemaining; - _fstream->write( (const char *)_data, chunkToWrite ); + METAIO_STL::streamoff chunkToWrite = bytesRemaining > MaxIOChunk ? MaxIOChunk : bytesRemaining; + _fstream->write( (const char *)_data, (size_t)chunkToWrite ); _data = (const char *)(_data) + chunkToWrite; // <- Note: _data is changed bytesRemaining -= chunkToWrite; } @@ -2796,7 +2796,7 @@ } // Streaming related. We need to update some of the fields - METAIO_STL::streamsize quantity = 1; + METAIO_STL::streamoff quantity = 1; int i; size_t j; for(i=0; i<m_NDims; i++) @@ -3054,9 +3054,9 @@ /** Read an ROI */ bool MetaImage:: M_ReadElementsROI(METAIO_STREAM::ifstream * _fstream, void * _data, - METAIO_STL::streamsize _dataQuantity, + METAIO_STL::streamoff _dataQuantity, int* _indexMin, int* _indexMax,unsigned int subSamplingFactor, - METAIO_STL::streamsize _totalDataQuantity) + METAIO_STL::streamoff _totalDataQuantity) { if(_totalDataQuantity ==0) { @@ -3088,7 +3088,7 @@ int elementSize; MET_SizeOfType(m_ElementType, &elementSize); - METAIO_STL::streamsize readSize = _dataQuantity*m_ElementNumberOfChannels*elementSize; + METAIO_STL::streamoff readSize = _dataQuantity*m_ElementNumberOfChannels*elementSize; int elementNumberOfBytes = elementSize*m_ElementNumberOfChannels; if(META_DEBUG) @@ -3104,12 +3104,12 @@ METAIO_STREAM::cout << "MetaImage: M_ReadElementsROI: Skipping header" << METAIO_STREAM::endl; } - METAIO_STL::streamsize headSize = _totalDataQuantity*m_ElementNumberOfChannels*elementSize; + METAIO_STL::streamoff headSize = _totalDataQuantity*m_ElementNumberOfChannels*elementSize; _fstream->seekg(-headSize, METAIO_STREAM::ios::end); } - unsigned long dataPos = _fstream->tellg(); - METAIO_STL::streamsize i; + METAIO_STL::streampos dataPos = _fstream->tellg(); + METAIO_STL::streamoff i; // If compressed we inflate if(m_BinaryData && m_CompressedData) @@ -3135,7 +3135,7 @@ // region shape // This calculate the number of continuous bytes in the file // which can be read - METAIO_STL::streamsize elementsToRead = 1; + METAIO_STL::streamoff elementsToRead = 1; int movingDirection = 0; do { @@ -3147,17 +3147,17 @@ && _indexMin[movingDirection-1] == 0 && _indexMax[movingDirection-1] == m_DimSize[movingDirection-1]-1); - METAIO_STL::streamsize bytesToRead = elementsToRead*elementNumberOfBytes; - long gc = 0; + METAIO_STL::streamoff bytesToRead = elementsToRead*elementNumberOfBytes; + METAIO_STL::streamoff gc = 0; bool done = false; while(!done) { // Seek to the right position - unsigned long seekpos = 0; + METAIO_STL::streamoff seekoff = 0; for(i=0; i<m_NDims; i++) { - seekpos += m_SubQuantity[i]*elementNumberOfBytes*currentIndex[i]; + seekoff += m_SubQuantity[i]*elementNumberOfBytes*currentIndex[i]; } @@ -3165,11 +3165,11 @@ { unsigned char* subdata = new unsigned char[bytesToRead]; - MET_UncompressStream(_fstream, seekpos, subdata, + MET_UncompressStream(_fstream, seekoff, subdata, bytesToRead, m_CompressedDataSize, m_CompressionTable); - for(METAIO_STL::streamsize p=0; + for(METAIO_STL::streamoff p=0; p<bytesToRead; p+=(subSamplingFactor*m_ElementNumberOfChannels*elementSize)) { @@ -3184,8 +3184,8 @@ } else { - METAIO_STL::streamsize read = MET_UncompressStream( - _fstream, seekpos, data, + METAIO_STL::streamoff read = MET_UncompressStream( + _fstream, seekoff, data, bytesToRead, m_CompressedDataSize, m_CompressionTable); data += bytesToRead; @@ -3253,7 +3253,7 @@ // region shape // This calculate the number of continuous bytes in the file // which can be read - METAIO_STL::streamsize elementsToRead = 1; + METAIO_STL::streamoff elementsToRead = 1; int movingDirection = 0; do { @@ -3268,19 +3268,19 @@ //readLine *= m_ElementNumberOfChannels*elementSize; - long gc = 0; + METAIO_STL::streamoff gc = 0; bool done = false; while(!done) { // Seek to the right position - unsigned long seekpos = 0; + METAIO_STL::streamoff seekoff = 0; for(i=0;i<m_NDims;i++) { - seekpos += m_SubQuantity[i]*m_ElementNumberOfChannels*elementSize*currentIndex[i]; + seekoff += m_SubQuantity[i]*m_ElementNumberOfChannels*elementSize*currentIndex[i]; } - _fstream->seekg(dataPos+seekpos, METAIO_STREAM::ios::beg); + _fstream->seekg(dataPos+seekoff, METAIO_STREAM::ios::beg); // Read a line if(subSamplingFactor > 1) @@ -3302,9 +3302,9 @@ { char* subdata = new char[elementsToRead*elementNumberOfBytes]; - _fstream->read(subdata, elementsToRead*elementNumberOfBytes); + _fstream->read(subdata, size_t(elementsToRead*elementNumberOfBytes)); - for(METAIO_STL::streamsize p=0; + for(METAIO_STL::streamoff p=0; p<elementsToRead*elementNumberOfBytes; p+=(subSamplingFactor*elementNumberOfBytes)) { @@ -3325,8 +3325,9 @@ // anyone using ROI reading of ASCII?? // does this work? what about incrementing data? // what about data sizes and random access of file? - M_ReadElementData( _fstream, data, elementsToRead*m_ElementNumberOfChannels*elementSize ); - gc += elementsToRead*m_ElementNumberOfChannels*elementSize; + METAIO_STL::streamoff blockSize = elementsToRead*m_ElementNumberOfChannels*elementSize; + M_ReadElementData( _fstream, data, (size_t)blockSize ); + gc += blockSize; } else // binary data @@ -3392,10 +3393,10 @@ bool MetaImage:: M_ReadElementData(METAIO_STREAM::ifstream * _fstream, void * _data, - METAIO_STL::streamsize _dataQuantity) + METAIO_STL::streamoff _dataQuantity) { // NOTE: this method is different from WriteElementData - METAIO_STL::streamsize gc = 0; + METAIO_STL::streamoff gc = 0; if(!m_BinaryData) { @@ -3415,11 +3416,11 @@ { // the data is read with calls no bigger then MaxIOChunk - size_t bytesRemaining = _dataQuantity; + METAIO_STL::streamoff bytesRemaining = _dataQuantity; while ( bytesRemaining ) { - size_t chunkToRead = bytesRemaining > MaxIOChunk ? MaxIOChunk : bytesRemaining; - _fstream->read( (char *)_data, chunkToRead ); + METAIO_STL::streamoff chunkToRead = bytesRemaining > MaxIOChunk ? MaxIOChunk : bytesRemaining; + _fstream->read( (char *)_data, (size_t)chunkToRead ); _data = (char *)(_data) + chunkToRead; bytesRemaining -= chunkToRead; gc += _fstream->gcount(); @@ -3430,14 +3431,14 @@ { int elementSize; MET_SizeOfType(m_ElementType, &elementSize); - METAIO_STL::streamsize elementNumberOfBytes = elementSize*m_ElementNumberOfChannels; + METAIO_STL::streamoff elementNumberOfBytes = elementSize*m_ElementNumberOfChannels; // the data is read with calls no bigger then MaxIOChunk - size_t bytesRemaining = _dataQuantity * elementNumberOfBytes; + METAIO_STL::streamoff bytesRemaining = _dataQuantity * elementNumberOfBytes; while ( bytesRemaining ) { - size_t chunkToRead = bytesRemaining > MaxIOChunk ? MaxIOChunk : bytesRemaining; - _fstream->read( (char *)_data, chunkToRead ); + METAIO_STL::streamoff chunkToRead = bytesRemaining > MaxIOChunk ? MaxIOChunk : bytesRemaining; + _fstream->read( (char *)_data, (size_t)chunkToRead ); _data = (char *)(_data) + chunkToRead; bytesRemaining -= chunkToRead; gc += _fstream->gcount(); Index: metaImage.h =================================================================== RCS file: /cvsroot/Insight/Insight/Utilities/MetaIO/metaImage.h,v retrieving revision 1.34 diff -u -r1.34 metaImage.h --- metaImage.h 12 Nov 2009 17:01:02 -0000 1.34 +++ metaImage.h 21 Nov 2009 18:41:28 -0000 @@ -138,14 +138,14 @@ // Quantity() // Not a field in file // Total number of elements in image (Prod(dimSize[i])) - METAIO_STL::streamsize Quantity(void) const; + METAIO_STL::streamoff Quantity(void) const; // SubQuantity(...) // Not a field in file // Number of elements in image spanning sub-dimensions // E.g., elements per line, 2D sub-image, 3D sub-volume, - const METAIO_STL::streamsize * SubQuantity(void) const; - METAIO_STL::streamsize SubQuantity(int _i) const; + const METAIO_STL::streamoff * SubQuantity(void) const; + METAIO_STL::streamoff SubQuantity(int _i) const; // SequenceID(...) // Optional Field @@ -181,8 +181,8 @@ // if streaming is used, then the size of buffer in total number // of elements, should be passed as an argument, otherwise the // internal value Quantity() will be used - void ElementByteOrderSwap( METAIO_STL::streamsize _quantity = 0); - bool ElementByteOrderFix( METAIO_STL::streamsize _quantity = 0); + void ElementByteOrderSwap( METAIO_STL::streamoff _quantity = 0); + bool ElementByteOrderFix( METAIO_STL::streamoff _quantity = 0); // Min(...) Max(...) // The default max returned is the largest allowed by @@ -222,8 +222,8 @@ // // void * ElementData(void); - double ElementData(METAIO_STL::streamsize _i) const; - bool ElementData(METAIO_STL::streamsize _i, double _v); + double ElementData(METAIO_STL::streamoff _i) const; + bool ElementData(METAIO_STL::streamoff _i, double _v); void ElementData(void * _data, bool _autoFreeElementData=false); // ConverTo(...) @@ -304,8 +304,8 @@ MET_CompressionTableType* m_CompressionTable; int m_DimSize[10]; - METAIO_STL::streamsize m_SubQuantity[10]; - METAIO_STL::streamsize m_Quantity; + METAIO_STL::streamoff m_SubQuantity[10]; + METAIO_STL::streamoff m_Quantity; int m_HeaderSize; @@ -342,33 +342,33 @@ bool M_ReadElements(METAIO_STREAM::ifstream * _fstream, void * _data, - METAIO_STL::streamsize _dataQuantity); + METAIO_STL::streamoff _dataQuantity); bool M_ReadElementsROI(METAIO_STREAM::ifstream * _fstream, void * _data, - METAIO_STL::streamsize _dataQuantity, + METAIO_STL::streamoff _dataQuantity, int * _indexMin, int* _indexMax, unsigned int subSamplingFactor=1, - METAIO_STL::streamsize _totalDataQuantity=0); + METAIO_STL::streamoff _totalDataQuantity=0); bool M_ReadElementData(METAIO_STREAM::ifstream * _fstream, void * _data, - METAIO_STL::streamsize _dataQuantity); + METAIO_STL::streamoff _dataQuantity); bool M_WriteElements(METAIO_STREAM::ofstream * _fstream, const void * _data, - METAIO_STL::streamsize _dataQuantity); + METAIO_STL::streamoff _dataQuantity); bool M_WriteElementsROI(METAIO_STREAM::ofstream * _fstream, const void * _data, - unsigned long _dataPos, + METAIO_STL::streampos _dataPos, int * _indexMin, int* _indexMax); bool M_WriteElementData(METAIO_STREAM::ofstream * _fstream, const void * _data, - METAIO_STL::streamsize _dataQuantity); + METAIO_STL::streamoff _dataQuantity); bool M_FileExists(const char* filename) const; Index: metaLandmark.cxx =================================================================== RCS file: /cvsroot/Insight/Insight/Utilities/MetaIO/metaLandmark.cxx,v retrieving revision 1.15 diff -u -r1.15 metaLandmark.cxx --- metaLandmark.cxx 9 Apr 2008 01:44:28 -0000 1.15 +++ metaLandmark.cxx 21 Nov 2009 18:41:28 -0000 @@ -40,10 +40,10 @@ } //Color is red by default - m_Color[0]=1.0; - m_Color[1]=0.0; - m_Color[2]=0.0; - m_Color[3]=1.0; + m_Color[0]=1.0f; + m_Color[1]=0.0f; + m_Color[2]=0.0f; + m_Color[3]=1.0f; } LandmarkPnt:: @@ -333,12 +333,12 @@ { int elementSize; MET_SizeOfType(m_ElementType, &elementSize); - int readSize = m_NPoints*(m_NDims+4)*elementSize; + METAIO_STL::streamsize readSize = m_NPoints*(m_NDims+4)*elementSize; char* _data = new char[readSize]; m_ReadStream->read((char *)_data, readSize); - int gc = m_ReadStream->gcount(); + METAIO_STL::streamsize gc = m_ReadStream->gcount(); if(gc != readSize) { METAIO_STREAM::cout << "MetaLandmark: m_Read: data not read completely" Index: metaLine.cxx =================================================================== RCS file: /cvsroot/Insight/Insight/Utilities/MetaIO/metaLine.cxx,v retrieving revision 1.31 diff -u -r1.31 metaLine.cxx --- metaLine.cxx 9 Apr 2008 01:44:28 -0000 1.31 +++ metaLine.cxx 21 Nov 2009 18:41:28 -0000 @@ -48,10 +48,10 @@ } //Color is red by default - m_Color[0]=1.0; - m_Color[1]=0.0; - m_Color[2]=0.0; - m_Color[3]=1.0; + m_Color[0]=1.0f; + m_Color[1]=0.0f; + m_Color[2]=0.0f; + m_Color[3]=1.0f; } LinePnt:: Index: metaMesh.cxx =================================================================== RCS file: /cvsroot/Insight/Insight/Utilities/MetaIO/metaMesh.cxx,v retrieving revision 1.24 diff -u -r1.24 metaMesh.cxx --- metaMesh.cxx 24 Apr 2008 19:13:40 -0000 1.24 +++ metaMesh.cxx 21 Nov 2009 18:41:28 -0000 @@ -701,7 +701,7 @@ } } - long int pos = m_ReadStream->tellg(); + METAIO_STL::streampos pos = m_ReadStream->tellg(); // Now reading the cell links MetaObject::ClearFields(); Index: metaObject.cxx =================================================================== RCS file: /cvsroot/Insight/Insight/Utilities/MetaIO/metaObject.cxx,v retrieving revision 1.52 diff -u -r1.52 metaObject.cxx --- metaObject.cxx 9 Apr 2008 09:54:25 -0000 1.52 +++ metaObject.cxx 21 Nov 2009 18:41:28 -0000 @@ -1044,10 +1044,10 @@ memset(m_Color, 0, 4*sizeof(float)); m_ID = -1; - m_Color[0]=1.0; - m_Color[1]=1.0; - m_Color[2]=1.0; - m_Color[3]=1.0; // white by default + m_Color[0]=1.0f; + m_Color[1]=1.0f; + m_Color[2]=1.0f; + m_Color[3]=1.0f; // white by default m_ParentID = -1; strcpy(m_AcquisitionDate, ""); m_BinaryData = false; Index: metaObject.h =================================================================== RCS file: /cvsroot/Insight/Insight/Utilities/MetaIO/metaObject.h,v retrieving revision 1.32 diff -u -r1.32 metaObject.h --- metaObject.h 9 Apr 2008 01:44:29 -0000 1.32 +++ metaObject.h 21 Nov 2009 18:41:28 -0000 @@ -82,7 +82,7 @@ bool m_BinaryDataByteOrderMSB; - unsigned int m_CompressedDataSize; + METAIO_STL::streamoff m_CompressedDataSize; // Used internally to set if the dataSize should be written bool m_WriteCompressedDataSize; bool m_CompressedData; Index: metaSurface.cxx =================================================================== RCS file: /cvsroot/Insight/Insight/Utilities/MetaIO/metaSurface.cxx,v retrieving revision 1.25 diff -u -r1.25 metaSurface.cxx --- metaSurface.cxx 9 Apr 2008 01:44:28 -0000 1.25 +++ metaSurface.cxx 21 Nov 2009 18:41:29 -0000 @@ -41,10 +41,10 @@ m_V[i] = 0; } //Color is red by default - m_Color[0]=1.0; - m_Color[1]=0.0; - m_Color[2]=0.0; - m_Color[3]=1.0; + m_Color[0]=1.0f; + m_Color[1]=0.0f; + m_Color[2]=0.0f; + m_Color[3]=1.0f; } SurfacePnt:: Index: metaTube.cxx =================================================================== RCS file: /cvsroot/Insight/Insight/Utilities/MetaIO/metaTube.cxx,v retrieving revision 1.34 diff -u -r1.34 metaTube.cxx --- metaTube.cxx 9 Apr 2008 01:44:28 -0000 1.34 +++ metaTube.cxx 21 Nov 2009 18:41:29 -0000 @@ -46,10 +46,10 @@ } m_R=0; //Color is red by default - m_Color[0]=1.0; - m_Color[1]=0.0; - m_Color[2]=0.0; - m_Color[3]=1.0; + m_Color[0]=1.0f; + m_Color[1]=0.0f; + m_Color[2]=0.0f; + m_Color[3]=1.0f; m_ID = -1; } Index: metaUtils.cxx =================================================================== RCS file: /cvsroot/Insight/Insight/Utilities/MetaIO/metaUtils.cxx,v retrieving revision 1.58 diff -u -r1.58 metaUtils.cxx --- metaUtils.cxx 8 Jul 2009 15:54:08 -0000 1.58 +++ metaUtils.cxx 21 Nov 2009 18:41:29 -0000 @@ -123,7 +123,7 @@ // METAIO_STL::string MET_ReadForm(METAIO_STREAM::istream &_fp) { - unsigned int pos = _fp.tellg(); + METAIO_STL::streampos pos = _fp.tellg(); METAIO_STL::vector<MET_FieldRecordType *> fields; MET_FieldRecordType* mF = new MET_FieldRecordType; MET_InitReadField(mF, "Form", MET_STRING, false); @@ -153,7 +153,7 @@ // METAIO_STL::string MET_ReadType(METAIO_STREAM::istream &_fp) { - unsigned int pos = _fp.tellg(); + METAIO_STL::streampos pos = _fp.tellg(); METAIO_STL::vector<MET_FieldRecordType *> fields; MET_FieldRecordType* mF = new MET_FieldRecordType; MET_InitReadField(mF, "ObjectType", MET_STRING, false); @@ -183,7 +183,7 @@ // char* MET_ReadSubType(METAIO_STREAM::istream &_fp) { - unsigned int pos = _fp.tellg(); + METAIO_STL::streampos pos = _fp.tellg(); METAIO_STL::vector<MET_FieldRecordType *> fields; MET_FieldRecordType* mF; mF = new MET_FieldRecordType; @@ -251,7 +251,7 @@ // Value to Double // bool MET_ValueToDouble(MET_ValueEnumType _type, const void *_data, - METAIO_STL::streamsize _index, + METAIO_STL::streamoff _index, double *_value) { switch(_type) @@ -324,7 +324,7 @@ bool MET_DoubleToValue(double _value, MET_ValueEnumType _type, void *_data, - METAIO_STL::streamsize _index) + METAIO_STL::streamoff _index) { switch(_type) { @@ -387,7 +387,7 @@ } bool MET_ValueToValue(MET_ValueEnumType _fromType, const void *_fromData, - METAIO_STL::streamsize _index, + METAIO_STL::streamoff _index, MET_ValueEnumType _toType, void *_toData, double _fromMin, double _fromMax, double _toMin, double _toMax) @@ -468,29 +468,29 @@ // Uncompress a stream given an uncompressedSeekPosition METAIO_EXPORT -long MET_UncompressStream(METAIO_STREAM::ifstream * stream, - METAIO_STL::streamsize uncompressedSeekPosition, +METAIO_STL::streamoff MET_UncompressStream(METAIO_STREAM::ifstream * stream, + METAIO_STL::streamoff uncompressedSeekPosition, unsigned char * uncompressedData, - METAIO_STL::streamsize uncompressedDataSize, - METAIO_STL::streamsize compressedDataSize, + METAIO_STL::streamoff uncompressedDataSize, + METAIO_STL::streamoff compressedDataSize, MET_CompressionTableType * compressionTable ) { // Keep the currentpos of the string - METAIO_STL::streamsize currentPos = stream->tellg(); - if(currentPos == -1) + METAIO_STL::streampos currentPos = stream->tellg(); + if(currentPos == METAIO_STL::streampos(-1)) { METAIO_STREAM::cout << "MET_UncompressStream: ERROR Stream is not valid!" << METAIO_STREAM::endl; return -1; } - long read = 0; + METAIO_STL::streamoff read = 0; //METAIO_STREAM::cout << "Wanted Seek = " << uncompressedSeekPosition << METAIO_STREAM::endl; //METAIO_STREAM::cout << "Wanted size = " << uncompressedDataSize << METAIO_STREAM::endl; // Size of the output buffer - unsigned long buffersize = 1000; + METAIO_STL::streamoff buffersize = 1000; // We try to guess the compression rate // Note that sometime the size of the input buffer @@ -498,8 +498,8 @@ // We assume that they are equal double compressionRate = 1; - long zseekpos = 0; - long seekpos = 0; + METAIO_STL::streamoff zseekpos = 0; + METAIO_STL::streamoff seekpos = 0; bool firstchunk = true; // Allocate the stream if necessary @@ -535,14 +535,14 @@ } char* buffer = compressionTable->buffer; - unsigned long start = uncompressedSeekPosition-((*it).uncompressedOffset-compressionTable->bufferSize); + METAIO_STL::streamoff start = uncompressedSeekPosition-((*it).uncompressedOffset-compressionTable->bufferSize); buffer += start; - unsigned long readSize = uncompressedDataSize; - unsigned long sizeInBuffer = compressionTable->bufferSize-start; + METAIO_STL::streamoff readSize = uncompressedDataSize; + METAIO_STL::streamoff sizeInBuffer = compressionTable->bufferSize-start; if(readSize>sizeInBuffer) { - memcpy(uncompressedData,buffer,sizeInBuffer); + memcpy(uncompressedData,buffer,(size_t)sizeInBuffer); uncompressedData += sizeInBuffer; zseekpos = (*it).compressedOffset; seekpos = (*it).uncompressedOffset; @@ -551,7 +551,7 @@ } else // read from buffer and return { - memcpy(uncompressedData,buffer,readSize); + memcpy(uncompressedData,buffer,(size_t)readSize); return uncompressedDataSize; } } @@ -564,10 +564,10 @@ //METAIO_STREAM::cout << "Using = " << seekpos << " : " << zseekpos << METAIO_STREAM::endl; - while(seekpos < (long)uncompressedSeekPosition+uncompressedDataSize) + while(seekpos < uncompressedSeekPosition+uncompressedDataSize) { // If we are reading the current buffer we read everything - if(seekpos >= (long)uncompressedSeekPosition) + if(seekpos >= uncompressedSeekPosition) { buffersize = uncompressedSeekPosition+uncompressedDataSize-seekpos; firstchunk = false; @@ -575,22 +575,22 @@ unsigned char* outdata = new unsigned char[buffersize]; - d_stream->avail_out = buffersize; + d_stream->avail_out = (uInt)( buffersize ); // How many byte from compressed streamed should we read - unsigned long inputBufferSize = (unsigned long)(buffersize/compressionRate); + METAIO_STL::streamoff inputBufferSize = buffersize/compressionRate; if(inputBufferSize == 0) { inputBufferSize = 1; } - if((long)(currentPos+zseekpos+inputBufferSize) > compressedDataSize) + if((currentPos+zseekpos+inputBufferSize) > compressedDataSize) { inputBufferSize = compressedDataSize-zseekpos; } unsigned char* inputBuffer = new unsigned char[inputBufferSize]; stream->seekg(currentPos+zseekpos,METAIO_STREAM::ios::beg); - stream->read((char *)inputBuffer, inputBufferSize); + stream->read((char *)inputBuffer, (size_t)inputBufferSize); d_stream->next_in = inputBuffer; d_stream->avail_in = stream->gcount(); @@ -598,39 +598,39 @@ inflate(d_stream, Z_NO_FLUSH); - unsigned long previousSeekpos = seekpos; + METAIO_STL::streampos previousSeekpos = seekpos; seekpos += buffersize-d_stream->avail_out; zseekpos += stream->gcount()-d_stream->avail_in; // Store the last buffer into memory in case we need it // in the near future. - long previousBufferSize = seekpos-previousSeekpos; + METAIO_STL::streamoff previousBufferSize = seekpos-previousSeekpos; if(previousBufferSize>1000) { // WARNING: We probably need to offset outdata at some point... previousBufferSize = 1000; } - memcpy(compressionTable->buffer,outdata,previousBufferSize); + memcpy(compressionTable->buffer,outdata,(size_t)previousBufferSize); compressionTable->bufferSize = previousBufferSize; //METAIO_STREAM::cout << "Current pos = " << seekpos << " : " << zseekpos << METAIO_STREAM::endl; // If go further than the uncompressedSeekPosition we start writing the stream - if(seekpos >= (long)uncompressedSeekPosition) + if(seekpos >= uncompressedSeekPosition) { if(firstchunk) { outdata += uncompressedSeekPosition-previousSeekpos; - METAIO_STL::streamsize writeSize = seekpos-uncompressedSeekPosition; + METAIO_STL::streamoff writeSize = seekpos-uncompressedSeekPosition; if(writeSize > uncompressedDataSize) { writeSize = uncompressedDataSize; } - memcpy(uncompressedData,outdata,writeSize); + memcpy(uncompressedData,outdata,(size_t)writeSize); // Restore the position of the buffer outdata -= uncompressedSeekPosition-previousSeekpos; @@ -642,8 +642,8 @@ } else // read everything { - METAIO_STL::streamsize writeSize = seekpos-previousSeekpos; - memcpy(uncompressedData,outdata,writeSize); + METAIO_STL::streamoff writeSize = seekpos-previousSeekpos; + memcpy(uncompressedData,outdata,(size_t)writeSize); if(writeSize > uncompressedDataSize) { writeSize = uncompressedDataSize; @@ -672,8 +672,8 @@ // // unsigned char * MET_PerformCompression(const unsigned char * source, - METAIO_STL::streamsize sourceSize, - unsigned int * compressedDataSize) + METAIO_STL::streamoff sourceSize, + METAIO_STL::streamoff * compressedDataSize) { unsigned char * compressedData; @@ -686,7 +686,7 @@ // Choices are Z_BEST_SPEED,Z_BEST_COMPRESSION,Z_DEFAULT_COMPRESSION int compression_rate = Z_DEFAULT_COMPRESSION; - METAIO_STL::streamsize buffer_size = sourceSize; + METAIO_STL::streamoff buffer_size = sourceSize; unsigned char * input_buffer = const_cast<unsigned char *>(source); unsigned char * output_buffer = new unsigned char[buffer_size]; @@ -694,13 +694,13 @@ deflateInit(&z, compression_rate); - z.avail_in = buffer_size; + z.avail_in = (uInt)buffer_size; z.next_in = input_buffer; z.next_out = output_buffer; - z.avail_out = buffer_size; + z.avail_out = (uInt)buffer_size; - METAIO_STL::streamsize count; - METAIO_STL::streamsize j=0; + METAIO_STL::streamoff count; + METAIO_STL::streamoff j=0; // Perform the compression for ( ; ; ) { @@ -715,12 +715,12 @@ if(j+count>=buffer_size) { unsigned char* compressedDataTemp = new unsigned char[j+count+1]; - memcpy(compressedDataTemp,compressedData,buffer_size); + memcpy(compressedDataTemp,compressedData,(size_t)buffer_size); delete [] compressedData; compressedData = compressedDataTemp; } - memcpy((char*)compressedData+j, (char *)output_buffer, count); + memcpy((char*)compressedData+j, (char *)output_buffer, (size_t)count); } break; } @@ -732,16 +732,16 @@ if(j+count>=buffer_size) { unsigned char* compressedDataTemp = new unsigned char[j+count+1]; - memcpy(compressedDataTemp,compressedData,buffer_size); + memcpy(compressedDataTemp,compressedData,(size_t)buffer_size); delete [] compressedData; compressedData = compressedDataTemp; } - memcpy((char*)compressedData+j, (char*)output_buffer, count); + memcpy((char*)compressedData+j, (char*)output_buffer, (size_t)count); } j += count; z.next_out = output_buffer; - z.avail_out = buffer_size; + z.avail_out = (uInt)buffer_size; } delete [] output_buffer; @@ -758,9 +758,9 @@ // // bool MET_PerformUncompression(const unsigned char * sourceCompressed, - METAIO_STL::streamsize sourceCompressedSize, + METAIO_STL::streamoff sourceCompressedSize, unsigned char * uncompressedData, - METAIO_STL::streamsize uncompressedDataSize) + METAIO_STL::streamoff uncompressedDataSize) { z_stream d_stream; @@ -770,12 +770,12 @@ inflateInit(&d_stream); d_stream.next_in = const_cast<unsigned char *>(sourceCompressed); - d_stream.avail_in = sourceCompressedSize; + d_stream.avail_in = (uInt)sourceCompressedSize; for (;;) { d_stream.next_out = (unsigned char *)uncompressedData; - d_stream.avail_out = uncompressedDataSize; + d_stream.avail_out = (uInt)uncompressedDataSize; int err = inflate(&d_stream, Z_NO_FLUSH); if((err == Z_STREAM_END) @@ -801,16 +801,16 @@ // bool MET_StringToWordArray(const char *s, int *n, char ***val) { - long l = static_cast<long>( strlen(s) ); + ptrdiff_t l = strlen(s); - int p = 0; + ptrdiff_t p = 0; while(p<l && s[p] == ' ') { p++; } *n = 0; - int pp = p; + ptrdiff_t pp = p; bool space = false; while(pp<l) { @@ -841,7 +841,7 @@ *val = new char *[*n]; - long i, j; + ptrdiff_t i, j; for(i=0; i<*n; i++) { if(p == l) @@ -872,7 +872,7 @@ { long i; - long l = static_cast<long>( strlen(_fName) ); + size_t l = strlen(_fName); for(i=l-1; i>=0; i--) if(_fName[i] == '\\' || _fName[i] == '/') @@ -1136,7 +1136,7 @@ } MET_CHAR_TYPE * str = (MET_CHAR_TYPE *)((*fieldIter)->value); fp.getline( str, 500 ); - j = static_cast<long>( strlen(str) ) - 1; + j = strlen(str) - 1; while(!isprint(str[j]) || isspace(str[j])) { str[j--] = '\0'; Index: metaUtils.h =================================================================== RCS file: /cvsroot/Insight/Insight/Utilities/MetaIO/metaUtils.h,v retrieving revision 1.44 diff -u -r1.44 metaUtils.h --- metaUtils.h 21 Jun 2009 21:54:05 -0000 1.44 +++ metaUtils.h 21 Nov 2009 18:41:29 -0000 @@ -68,8 +68,8 @@ // Types used for storing the compression table typedef struct MET_CompressionOffset { - METAIO_STL::streamsize uncompressedOffset; - METAIO_STL::streamsize compressedOffset; + METAIO_STL::streamoff uncompressedOffset; + METAIO_STL::streamoff compressedOffset; } MET_CompressionOffsetType; typedef METAIO_STL::vector<MET_CompressionOffsetType> @@ -80,7 +80,7 @@ MET_CompressionOffsetListType offsetList; z_stream* compressedStream; char* buffer; - METAIO_STL::streamsize bufferSize; + METAIO_STL::streamoff bufferSize; } MET_CompressionTableType; ///////////////////////////////////////////////////////// @@ -287,19 +287,19 @@ METAIO_EXPORT bool MET_ValueToDouble(MET_ValueEnumType _pType, const void *_data, - METAIO_STL::streamsize _index, + METAIO_STL::streamoff _index, double *_value); METAIO_EXPORT bool MET_DoubleToValue(double _value, MET_ValueEnumType _type, void *_data, - METAIO_STL::streamsize _index); + METAIO_STL::streamoff _index); METAIO_EXPORT bool MET_ValueToValue(MET_ValueEnumType _fromType, const void *_fromData, - METAIO_STL::streamsize _index, + METAIO_STL::streamoff _index, MET_ValueEnumType _toType, void *_toData, double _fromMin=0, double _fromMax=0, @@ -307,22 +307,22 @@ METAIO_EXPORT unsigned char * MET_PerformCompression(const unsigned char * source, - METAIO_STL::streamsize sourceSize, - unsigned int * compressedDataSize); + METAIO_STL::streamoff sourceSize, + METAIO_STL::streamoff * compressedDataSize); METAIO_EXPORT bool MET_PerformUncompression(const unsigned char * sourceCompressed, - METAIO_STL::streamsize sourceCompressedSize, + METAIO_STL::streamoff sourceCompressedSize, unsigned char * uncompressedData, - METAIO_STL::streamsize uncompressedDataSize); + METAIO_STL::streamoff uncompressedDataSize); // Uncompress a stream given an uncompressedSeekPosition METAIO_EXPORT -long MET_UncompressStream(METAIO_STREAM::ifstream * stream, - METAIO_STL::streamsize uncompressedSeekPosition, +METAIO_STL::streamoff MET_UncompressStream(METAIO_STREAM::ifstream * stream, + METAIO_STL::streamoff uncompressedSeekPosition, unsigned char * uncompressedData, - METAIO_STL::streamsize uncompressedDataSize, - METAIO_STL::streamsize compressedDataSize, + METAIO_STL::streamoff uncompressedDataSize, + METAIO_STL::streamoff compressedDataSize, MET_CompressionTableType * compressionTable); Index: metaVesselTube.cxx =================================================================== RCS file: /cvsroot/Insight/Insight/Utilities/MetaIO/metaVesselTube.cxx,v retrieving revision 1.17 diff -u -r1.17 metaVesselTube.cxx --- metaVesselTube.cxx 9 Apr 2008 01:44:27 -0000 1.17 +++ metaVesselTube.cxx 21 Nov 2009 18:41:29 -0000 @@ -55,10 +55,10 @@ m_Mark=false; //Color is red by default - m_Color[0]=1.0; - m_Color[1]=0.0; - m_Color[2]=0.0; - m_Color[3]=1.0; + m_Color[0]=1.0f; + m_Color[1]=0.0f; + m_Color[2]=0.0f; + m_Color[3]=1.0f; m_ID = -1; } | ||||||||||||
Relationships | ||||||
|
Relationships |
Notes | |
(0016848) Luis Ibanez (manager) 2009-07-11 12:05 |
verified in the following way: http://www.itk.org/pipermail/insight-users/2009-July/031442.html [^] #include <iostream> #include "itkOffset.h" #include "itkNumericTraits.h" int main() { unsigned long tt; std::cout << "size = " << sizeof(tt) << std::endl; tt = -1; std::cout << "tt = " << tt << std::endl; typedef itk::Offset<3> OffsetType; typedef OffsetType::OffsetValueType OffsetValueType; OffsetValueType offsetValue; std::cout << "sizeof(offsetValue) = " << sizeof( offsetValue ) << std::endl; offsetValue = itk::NumericTraits< OffsetValueType >::max(); std::cout << "OffsetValueType max() = " << offsetValue << std::endl; return EXIT_SUCCESS; } |
(0016849) Luis Ibanez (manager) 2009-07-11 13:33 |
In order to be consistent across platforms and across architectures we suggest that the types should be: ptrdiff_t for OffsetValueType (this is signed) size_t for SizeValueType (this is unsigned) ptrdiff_t for IndexValueType (this is signed) and that the use of "int" and "long" should be discouraged when loading values into these variables. Instead developers should use the Traits from the ImageType as ImageType::OffsetValueType ImageType::SizeValueType ImageType::IndexValueType More details in the discussion at: http://www.itk.org/pipermail/insight-users/2009-July/031466.html [^] |
(0016850) Luis Ibanez (manager) 2009-07-12 06:56 |
First pass of changes committed: Introducing Traits for IndexValueType, SizeValueType and OffsetType. Replacing explicit use of "long" in the Tests, when refering to this concepts. Also expanded use of SpacingValueType and PointValueType. In general, all these types should have always been obtained as Traits of the Image... |
(0018499) Luis Ibanez (manager) 2009-11-21 13:46 |
Adding patch for the MetaImage library. Most of the changes are related to METAIO_STL::streampos METAIO_STL::streamoff METAIO_STL::streamsize |
(0018506) Luis Ibanez (manager) 2009-11-21 14:34 |
Julien committed the patch. Thanks ! |
(0022985) Luis Ibanez (manager) 2010-11-07 01:18 |
This is still an issue, and requires a toolkit-wide review for correcting it. |
Notes |
Issue History | |||
Date Modified | Username | Field | Change |
2009-07-11 12:03 | Luis Ibanez | New Issue | |
2009-07-11 12:05 | Luis Ibanez | Note Added: 0016848 | |
2009-07-11 12:05 | Luis Ibanez | Status | new => confirmed |
2009-07-11 12:05 | Luis Ibanez | Status | confirmed => assigned |
2009-07-11 12:05 | Luis Ibanez | Assigned To | => Luis Ibanez |
2009-07-11 12:05 | Luis Ibanez | Priority | normal => urgent |
2009-07-11 13:33 | Luis Ibanez | Note Added: 0016849 | |
2009-07-12 06:56 | Luis Ibanez | Note Added: 0016850 | |
2009-11-21 13:46 | Luis Ibanez | Note Added: 0018499 | |
2009-11-21 13:47 | Luis Ibanez | File Added: MetaImage64BitsWarnings.patch | |
2009-11-21 14:34 | Luis Ibanez | Note Added: 0018506 | |
2009-11-22 10:01 | Bradley Lowekamp | Relationship added | related to 0008371 |
2010-11-07 01:18 | Luis Ibanez | Note Added: 0022985 |
Issue History |
Copyright © 2000 - 2018 MantisBT Team |