From d31dacbd4792e49cccecc51ffd9d93fd71541561 Mon Sep 17 00:00:00 2001 From: regrain Date: Tue, 7 Dec 2004 13:39:31 +0000 Subject: [PATCH] * Test/TestUtil.cxx : reformat the source code * vtk/vtkGdcmReader.cxx : remove and change prints * src/gdcmValEntry.[cxx|h] : now set the length of the value when calling SetValue * src/gdcmBinEntry.[cxx|h] : SetValue method don't set the length * src/*.cxx : remove all useless call to SetLength of a ValEntry object -- BeNours --- ChangeLog | 8 ++++ Testing/TestUtil.cxx | 18 ++++++--- src/gdcmBinEntry.h | 6 ++- src/gdcmDicomDir.cxx | 53 +------------------------ src/gdcmDicomDirObject.cxx | 26 +------------ src/gdcmDocument.cxx | 79 ++------------------------------------ src/gdcmDocument.h | 14 +------ src/gdcmFile.cxx | 16 +------- src/gdcmHeader.cxx | 8 ++-- src/gdcmSQItem.cxx | 7 +--- src/gdcmValEntry.cxx | 45 ++++++++++++++++++---- src/gdcmValEntry.h | 12 ++++-- vtk/vtkGdcmReader.cxx | 11 +++--- 13 files changed, 91 insertions(+), 212 deletions(-) diff --git a/ChangeLog b/ChangeLog index 75dfeb08..3557fc48 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2004-12-07 Benoit Regrain + * Test/TestUtil.cxx : reformat the source code + * vtk/vtkGdcmReader.cxx : remove and change prints + * src/gdcmValEntry.[cxx|h] : now set the length of the value when calling + SetValue + * src/gdcmBinEntry.[cxx|h] : SetValue method don't set the length + * src/*.cxx : remove all useless call to SetLength of a ValEntry object + 2004-12-07 Benoit Regrain * src/gdcmPixelWriteConvert.[h|cxx] : ficnished this class * src/gdcmFile.cxx : finished the correctly use of PixelWriteConvert diff --git a/Testing/TestUtil.cxx b/Testing/TestUtil.cxx index 9e0261dc..b61aa4cd 100644 --- a/Testing/TestUtil.cxx +++ b/Testing/TestUtil.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestUtil.cxx,v $ Language: C++ - Date: $Date: 2004/12/03 20:16:56 $ - Version: $Revision: 1.4 $ + Date: $Date: 2004/12/07 13:39:32 $ + Version: $Revision: 1.5 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -23,8 +23,10 @@ int TestUtil(int , char * []) { + // Unique UID test std::cout << gdcm::Util::CreateUniqueUID("") << std::endl; + // DicomString test const char ref[] = "MONOCHROME1"; std::string a = "MONOCHROME1"; a += '\0'; @@ -32,10 +34,14 @@ int TestUtil(int , char * []) std::string c = gdcm::Util::DicomString("MONOCHROME1"); std::string d = "MONOCHROME1"; - if( !gdcm::Util::DicomStringEqual(a,ref) ) return 1; - if( !gdcm::Util::DicomStringEqual(b,ref) ) return 1; - if( !gdcm::Util::DicomStringEqual(c,ref) ) return 1; - if( gdcm::Util::DicomStringEqual(d,ref) ) return 1; + if( !gdcm::Util::DicomStringEqual(a,ref) ) + return 1; + if( !gdcm::Util::DicomStringEqual(b,ref) ) + return 1; + if( !gdcm::Util::DicomStringEqual(c,ref) ) + return 1; + if( gdcm::Util::DicomStringEqual(d,ref) ) + return 1; return 0; } diff --git a/src/gdcmBinEntry.h b/src/gdcmBinEntry.h index c659b11d..1142ed57 100644 --- a/src/gdcmBinEntry.h +++ b/src/gdcmBinEntry.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmBinEntry.h,v $ Language: C++ - Date: $Date: 2004/12/03 20:16:57 $ - Version: $Revision: 1.27 $ + Date: $Date: 2004/12/07 13:39:32 $ + Version: $Revision: 1.28 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -48,6 +48,8 @@ public: uint8_t* GetBinArea() { return BinArea; } void SetBinArea( uint8_t* area, bool self = true ); + /// Sets the value (string) of the current Dicom Document Entry + virtual void SetValue(std::string const & val) {SetValueOnly(val);}; private: /// \brief unsecure memory area to hold 'non string' values /// (ie : Lookup Tables, overlays, icons) diff --git a/src/gdcmDicomDir.cxx b/src/gdcmDicomDir.cxx index 1f668e97..7ab7f7d6 100644 --- a/src/gdcmDicomDir.cxx +++ b/src/gdcmDicomDir.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDicomDir.cxx,v $ Language: C++ - Date: $Date: 2004/12/06 11:37:38 $ - Version: $Revision: 1.87 $ + Date: $Date: 2004/12/07 13:39:33 $ + Version: $Revision: 1.88 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -519,28 +519,6 @@ DicomDirPatient * DicomDir::NewPatient() entry->SetOffset(0); // just to avoid further missprinting entry->SetValue( it->Value ); - // dealing with value length ... - - if( dictEntry->GetGroup() == 0xfffe) - { - entry->SetLength(entry->GetValue().length()); - } - else if( dictEntry->GetVR() == "UL" || dictEntry->GetVR() == "SL" ) - { - entry->SetLength( 4 ); - } - else if( dictEntry->GetVR() == "US" || dictEntry->GetVR() == "SS" ) - { - entry->SetLength(2); - } - else if( dictEntry->GetVR() == "SQ" ) - { - entry->SetLength( 0xffffffff ); - } - else - { - entry->SetLength( entry->GetValue().length() ); - } p->AddEntry( entry ); } @@ -639,7 +617,6 @@ void DicomDir::SetElement(std::string const & path, DicomDirType type, entry = new ValEntry( dictEntry ); // Be sure it's never a BinEntry ! entry->SetOffset(0); // just to avoid further missprinting - entry->SetLength(0); // just to avoid further missprinting if( header ) { @@ -683,34 +660,8 @@ void DicomDir::SetElement(std::string const & path, DicomDirType type, val = it->Value; } - // GDCM_UNFOUND or not ! - entry->SetValue( val ); // troubles expected when vr=SQ ... - if( dictEntry ) - { - if( dictEntry->GetGroup() == 0xfffe ) - { - entry->SetLength( entry->GetValue().length() ); // FIXME - } - else if( dictEntry->GetVR() == "UL" || dictEntry->GetVR() == "SL" ) - { - entry->SetLength(4); - } - else if( dictEntry->GetVR() == "US" || dictEntry->GetVR() == "SS" ) - { - entry->SetLength(2); - } - else if( dictEntry->GetVR() == "SQ" ) - { - entry->SetLength( 0xffffffff ); - } - else - { - entry->SetLength( entry->GetValue().length() ); - } - } - if ( type == GDCM_DICOMDIR_META ) // fusible : should never print ! { std::cout << "GDCM_DICOMDIR_META ?!? should never print that" diff --git a/src/gdcmDicomDirObject.cxx b/src/gdcmDicomDirObject.cxx index db99f950..1d3d8ce2 100644 --- a/src/gdcmDicomDirObject.cxx +++ b/src/gdcmDicomDirObject.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDicomDirObject.cxx,v $ Language: C++ - Date: $Date: 2004/12/07 09:32:24 $ - Version: $Revision: 1.11 $ + Date: $Date: 2004/12/07 13:39:33 $ + Version: $Revision: 1.12 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -99,28 +99,6 @@ void DicomDirObject::FillObject(ListDicomDirMetaElem const & elemList) entry->SetOffset(0); // just to avoid further missprinting entry->SetValue(it->Value); - // dealing with value length ... - - if(dictEntry->GetGroup()==0xfffe) - { - entry->SetLength(entry->GetValue().length()); - } - else if( dictEntry->GetVR() == "UL" || dictEntry->GetVR() == "SL" ) - { - entry->SetLength(4); - } - else if( dictEntry->GetVR() == "US" || dictEntry->GetVR() == "SS" ) - { - entry->SetLength(2); - } - else if( dictEntry->GetVR() == "SQ" ) - { - entry->SetLength(0xffffffff); - } - else - { - entry->SetLength(entry->GetValue().length()); - } AddEntry(entry); } } diff --git a/src/gdcmDocument.cxx b/src/gdcmDocument.cxx index 60c002f2..62d542d2 100644 --- a/src/gdcmDocument.cxx +++ b/src/gdcmDocument.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDocument.cxx,v $ Language: C++ - Date: $Date: 2004/12/06 12:54:40 $ - Version: $Revision: 1.148 $ + Date: $Date: 2004/12/07 13:39:33 $ + Version: $Revision: 1.149 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -839,7 +839,6 @@ std::string Document::GetEntryVRByName(TagName const& tagName) std::string Document::GetEntryByNumber(uint16_t group, uint16_t element) { TagKey key = DictEntry::TranslateToKey(group, element); - /// \todo use map methods, instead of multimap JPR if ( !TagHT.count(key)) { return GDCM_UNFOUND; @@ -919,9 +918,6 @@ bool Document::SetEntryByName( std::string const & content, bool Document::SetEntryByNumber(std::string const& content, uint16_t group, uint16_t element) { - int c; - int l; - ValEntry* valEntry = GetValEntryByNumber(group, element); if (!valEntry ) { @@ -930,29 +926,7 @@ bool Document::SetEntryByNumber(std::string const& content, return false; } // Non even content must be padded with a space (020H)... - std::string finalContent = Util::DicomString( content.c_str() ); - assert( !(finalContent.size() % 2) ); - valEntry->SetValue(finalContent); - - // Integers have a special treatement for their length: - l = finalContent.length(); - if ( l != 0) // To avoid to be cheated by 'zero length' integers - { - VRKey vr = valEntry->GetVR(); - if( vr == "US" || vr == "SS" ) - { - // for multivaluated items - c = Util::CountSubstring(content, "\\") + 1; - l = c*2; - } - else if( vr == "UL" || vr == "SL" ) - { - // for multivaluated items - c = Util::CountSubstring(content, "\\") + 1; - l = c*4;; - } - } - valEntry->SetLength(l); + valEntry->SetValue(content); return true; } @@ -990,53 +964,6 @@ bool Document::SetEntryByNumber(uint8_t*content, int lgth, return true; } -/** - * \brief Accesses an existing DocEntry (i.e. a Dicom Element) - * in the PubDocEntrySet of this instance - * through it's (group, element) and modifies it's length with - * the given value. - * \warning Use with extreme caution. - * @param l new length to substitute with - * @param group group number of the Entry to modify - * @param element element number of the Entry to modify - * @return true on success, false otherwise. - */ -/*bool Document::SetEntryLengthByNumber(uint32_t l, - uint16_t group, uint16_t element) -{ - /// \todo use map methods, instead of multimap JPR - TagKey key = DictEntry::TranslateToKey(group, element); - if ( !TagHT.count(key) ) - { - return false; - } - if ( l % 2 ) - { - l++; // length must be even - } - ( ((TagHT.equal_range(key)).first)->second )->SetLength(l); - - return true ; -}*/ - -/** - * \brief Gets (from Header) the offset of a 'non string' element value - * (LoadElementValues has already be executed) - * @param group group number of the Entry - * @param elem element number of the Entry - * @return File Offset of the Element Value - */ -/*size_t Document::GetEntryOffsetByNumber(uint16_t group, uint16_t elem) -{ - DocEntry* entry = GetDocEntryByNumber(group, elem); - if (!entry) - { - dbg.Verbose(1, "Document::GetDocEntryByNumber: no entry present."); - return 0; - } - return entry->GetOffset(); -}*/ - /** * \brief Gets (from Header) a 'non string' element value * (LoadElementValues has already be executed) diff --git a/src/gdcmDocument.h b/src/gdcmDocument.h index 2df5f0be..ed1d87d4 100644 --- a/src/gdcmDocument.h +++ b/src/gdcmDocument.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDocument.h,v $ Language: C++ - Date: $Date: 2004/12/03 20:16:58 $ - Version: $Revision: 1.67 $ + Date: $Date: 2004/12/07 13:39:33 $ + Version: $Revision: 1.68 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -197,16 +197,6 @@ public: uint16_t group, uint16_t element); virtual bool SetEntryByNumber(uint8_t* content, int lgth, uint16_t group, uint16_t element); - // FIXME - // Verify the usefull of this method... otherwise remove it - // It's body is commented in the .xx - //virtual bool SetEntryLengthByNumber(uint32_t length, - // uint16_t group, uint16_t element); - - // FIXME - // Verify the usefull of this method... otherwise remove it - // It's body is commented in the .xx - // virtual size_t GetEntryOffsetByNumber(uint16_t group, uint16_t elem); virtual void* GetEntryBinAreaByNumber(uint16_t group, uint16_t elem); // FIXME // Verify the usefull of this method... otherwise remove it diff --git a/src/gdcmFile.cxx b/src/gdcmFile.cxx index 3de485f7..43804b36 100644 --- a/src/gdcmFile.cxx +++ b/src/gdcmFile.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmFile.cxx,v $ Language: C++ - Date: $Date: 2004/12/07 09:32:24 $ - Version: $Revision: 1.172 $ + Date: $Date: 2004/12/07 13:39:33 $ + Version: $Revision: 1.173 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -532,12 +532,10 @@ void File::SetWriteToDecompressed() if(HeaderInternal->HasLUT()) { photInt->SetValue("PALETTE COLOR "); - photInt->SetLength(14); } else { photInt->SetValue("MONOCHROME1 "); - photInt->SetLength(12); } PixelWriteConverter->SetReadData(PixelReadConverter->GetDecompressed(), @@ -561,15 +559,12 @@ void File::SetWriteToRGB() ValEntry* spp = CopyValEntry(0x0028,0x0002); spp->SetValue("3 "); - spp->SetLength(2); ValEntry* planConfig = CopyValEntry(0x0028,0x0006); planConfig->SetValue("0 "); - planConfig->SetLength(2); ValEntry* photInt = CopyValEntry(0x0028,0x0004); photInt->SetValue("RGB "); - photInt->SetLength(4); if(PixelReadConverter->GetRGB()) { @@ -607,15 +602,12 @@ void File::SetWriteToRGB() { ValEntry* bitsAlloc = CopyValEntry(0x0028,0x0100); bitsAlloc->SetValue("8 "); - bitsAlloc->SetLength(2); ValEntry* bitsStored = CopyValEntry(0x0028,0x0101); bitsStored->SetValue("8 "); - bitsStored->SetLength(2); ValEntry* highBit = CopyValEntry(0x0028,0x0102); highBit->SetValue("7 "); - highBit->SetLength(2); Archive->Push(bitsAlloc); Archive->Push(bitsStored); @@ -661,7 +653,6 @@ void File::SetWriteFileTypeToExplicitVR() ValEntry* tss = CopyValEntry(0x0002,0x0010); tss->SetValue(ts); - tss->SetLength(ts.length()); Archive->Push(tss); } @@ -673,7 +664,6 @@ void File::SetWriteFileTypeToImplicitVR() ValEntry* tss = CopyValEntry(0x0002,0x0010); tss->SetValue(ts); - tss->SetLength(ts.length()); } void File::RestoreWriteFileType() @@ -705,7 +695,6 @@ void File::SetWriteToLibido() ValEntry *libidoCode = CopyValEntry(0x0008,0x0010); libidoCode->SetValue("ACRNEMA_LIBIDO_1.1"); - libidoCode->SetLength(10); Archive->Push(libidoCode); } @@ -718,7 +707,6 @@ void File::SetWriteToNoLibido() { ValEntry *libidoCode = CopyValEntry(0x0008,0x0010); libidoCode->SetValue(""); - libidoCode->SetLength(0); Archive->Push(libidoCode); } } diff --git a/src/gdcmHeader.cxx b/src/gdcmHeader.cxx index 1857184c..9bef4bd0 100644 --- a/src/gdcmHeader.cxx +++ b/src/gdcmHeader.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmHeader.cxx,v $ Language: C++ - Date: $Date: 2004/12/07 02:36:21 $ - Version: $Revision: 1.212 $ + Date: $Date: 2004/12/07 13:39:33 $ + Version: $Revision: 1.213 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -979,7 +979,7 @@ std::string Header::GetPixelType() { return "FD"; } - if ( bitsAlloc == "12" ) + else if ( bitsAlloc == "12" ) { // It will be unpacked bitsAlloc = "16"; @@ -997,7 +997,7 @@ std::string Header::GetPixelType() dbg.Verbose(0, "Header::GetPixelType: unfound Pixel Representation"); bitsAlloc = "0"; } - if ( sign == "0" ) + else if ( sign == "0" ) { sign = "U"; } diff --git a/src/gdcmSQItem.cxx b/src/gdcmSQItem.cxx index 13af2367..a95d8d16 100644 --- a/src/gdcmSQItem.cxx +++ b/src/gdcmSQItem.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmSQItem.cxx,v $ Language: C++ - Date: $Date: 2004/12/06 11:37:38 $ - Version: $Revision: 1.41 $ + Date: $Date: 2004/12/07 13:39:33 $ + Version: $Revision: 1.42 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -200,12 +200,10 @@ bool SQItem::SetEntryByNumber(std::string const & val, uint16_t group, } // we assume the constructor didn't fail entry = new ValEntry(dictEntry); - if (entry) { entry->SetValue(val); } - entry->SetLength(val.length()); DocEntries.insert(i,entry); return true; @@ -216,7 +214,6 @@ bool SQItem::SetEntryByNumber(std::string const & val, uint16_t group, { entry->SetValue(val); } - (*i)->SetLength(val.length()); return true; } } diff --git a/src/gdcmValEntry.cxx b/src/gdcmValEntry.cxx index d6d7b89d..270fdd3a 100644 --- a/src/gdcmValEntry.cxx +++ b/src/gdcmValEntry.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmValEntry.cxx,v $ Language: C++ - Date: $Date: 2004/11/25 15:46:12 $ - Version: $Revision: 1.38 $ + Date: $Date: 2004/12/07 13:39:33 $ + 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 @@ -17,6 +17,7 @@ =========================================================================*/ #include "gdcmValEntry.h" +#include "gdcmVR.h" #include "gdcmTS.h" #include "gdcmGlobal.h" #include "gdcmUtil.h" @@ -174,6 +175,39 @@ void ValEntry::Print(std::ostream & os) os << s.str(); } +//----------------------------------------------------------------------------- +// Public +void ValEntry::SetValue(std::string const & val) +{ + // Integers have a special treatement for their length: + int l = val.length(); + if ( l != 0) // To avoid to be cheated by 'zero length' integers + { + VRKey vr = GetVR(); + if( vr == "US" || vr == "SS" ) + { + // for multivaluated items + l = (Util::CountSubstring(val, "\\") + 1) * 2; + } + else if( vr == "UL" || vr == "SL" ) + { + // for multivaluated items + l = (Util::CountSubstring(val, "\\") + 1) * 4;; + } + SetValueOnly(val); + } + else + { + std::string finalVal = Util::DicomString( val.c_str() ); + assert( !(finalVal.size() % 2) ); + + l = finalVal.length(); + SetValueOnly(finalVal); + } + + SetLength(l); +} + /* * \brief canonical Writer */ @@ -181,8 +215,6 @@ void ValEntry::WriteContent(std::ofstream* fp, FileType filetype) { DocEntry::WriteContent(fp, filetype); - //std::cout << "=====================================" << GetVR() << std::endl; - if ( GetGroup() == 0xfffe ) { return; //delimitors have NO value @@ -224,13 +256,10 @@ void ValEntry::WriteContent(std::ofstream* fp, FileType filetype) return; } - assert( lgr == GetValue().size() ); + assert( lgr == GetValue().length() ); binary_write(*fp, GetValue()); } -//----------------------------------------------------------------------------- -// Public - //----------------------------------------------------------------------------- // Protected diff --git a/src/gdcmValEntry.h b/src/gdcmValEntry.h index b014e74b..d83a18c1 100644 --- a/src/gdcmValEntry.h +++ b/src/gdcmValEntry.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmValEntry.h,v $ Language: C++ - Date: $Date: 2004/12/03 20:16:58 $ - Version: $Revision: 1.32 $ + Date: $Date: 2004/12/07 13:39:33 $ + 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 @@ -43,13 +43,17 @@ public: /// current Dicom Document Entry std::string const & GetValue() const { return Value; }; - /// Sets the value (string) of the current Dicom Document Entry - void SetValue(std::string const & val) { Value = val; }; + /// Sets the value (string) of the current Dicom Document Entry. + /// The size is updated + virtual void SetValue(std::string const & val); virtual void Print(std::ostream &os = std::cout); + virtual void WriteContent(std::ofstream *fp, FileType filetype); protected: + /// Sets the value (string) of the current Dicom Document Entry + void SetValueOnly(std::string const & val) { Value = val; }; private: // Members : diff --git a/vtk/vtkGdcmReader.cxx b/vtk/vtkGdcmReader.cxx index 580379cb..584305bc 100644 --- a/vtk/vtkGdcmReader.cxx +++ b/vtk/vtkGdcmReader.cxx @@ -58,7 +58,7 @@ #include #include -vtkCxxRevisionMacro(vtkGdcmReader, "$Revision: 1.60 $"); +vtkCxxRevisionMacro(vtkGdcmReader, "$Revision: 1.61 $"); vtkStandardNewMacro(vtkGdcmReader); //----------------------------------------------------------------------------- @@ -460,10 +460,10 @@ int vtkGdcmReader::CheckFileCoherence() && (type != "16U") && (type != "16S") && (type != "32U") && (type != "32S") ) { - vtkErrorMacro(<< "Bad File Type for file" << filename->c_str()); - vtkErrorMacro(<< " " << type.c_str()); - vtkErrorMacro(<< "Removing this file from readed files " - << filename->c_str()); + vtkErrorMacro(<< "Bad File Type for file " << filename->c_str() << "\n" + << " File type found : " << type.c_str() + << " (might be 8U, 8S, 16U, 16S, 32U, 32S) \n" + << " Removing this file from readed files"); *filename = "GDCM_UNREADABLE"; continue; } @@ -666,7 +666,6 @@ size_t vtkGdcmReader::LoadImageInMemory( { for (int line = 0; line < numLines; line++) { - cerr << line << endl; // Copy one line at proper destination: memcpy((void*)destination, (void*)source, lineSize); source += lineSize; -- 2.45.1