From: malaterre Date: Fri, 11 Feb 2005 19:12:40 +0000 (+0000) Subject: BUG: Ok I really need to compile before committing stuff X-Git-Tag: Version1.0.bp~16 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=9ff82cbdfb4c2d470da936199a415421181c5413;p=gdcm.git BUG: Ok I really need to compile before committing stuff --- diff --git a/src/gdcmUtil.cxx b/src/gdcmUtil.cxx index 64562315..6d015ddd 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/11 19:09:30 $ - Version: $Revision: 1.136 $ + Date: $Date: 2005/02/11 19:12:40 $ + Version: $Revision: 1.137 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -897,7 +897,7 @@ std::ostream &binary_write(std::ostream &os, const uint16_t *val, size_t len) #ifdef GDCM_WORDS_BIGENDIAN const int BUFFER_SIZE = 4096; uint16_t *buffer = new uint16_t[BUFFER_SIZE/2]; - uint16_t *binArea16 = val; + uint16_t *binArea16 = (uint16_t*)val; // how many BUFFER_SIZE long pieces in binArea ? int nbPieces = len/BUFFER_SIZE; //(16 bits = 2 Bytes) @@ -911,7 +911,7 @@ std::ostream &binary_write(std::ostream &os, const uint16_t *val, size_t len) uint16_t val16 = binArea16[i]; buffer[i] = ((( val16 << 8 ) & 0xff00 ) | (( val16 >> 8 ) & 0x00ff ) ); } - fp->write ( (char*)buffer, BUFFER_SIZE ); + os.write ( (char*)buffer, BUFFER_SIZE ); binArea16 += BUFFER_SIZE/2; } if ( remainingSize > 0) @@ -922,9 +922,10 @@ std::ostream &binary_write(std::ostream &os, const uint16_t *val, size_t len) uint16_t val16 = binArea16[i]; buffer[i] = ((( val16 << 8 ) & 0xff00 ) | (( val16 >> 8 ) & 0x00ff ) ); } - fp->write ( (char*)buffer, remainingSize ); + os.write ( (char*)buffer, remainingSize ); } delete[] buffer; + return os; #else return os.write(reinterpret_cast(val), len); #endif