From: malaterre Date: Wed, 29 Oct 2003 17:12:07 +0000 (+0000) Subject: *ENH: Two steps is necessary to please VC++ compiler... X-Git-Tag: Version0.3.1~76 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=f3a76bbce03c6b6d11ab5615e759a1adf1f79f25;p=gdcm.git *ENH: Two steps is necessary to please VC++ compiler... --- diff --git a/src/gdcmFile.cxx b/src/gdcmFile.cxx index 5952e63b..e6e12b3e 100644 --- a/src/gdcmFile.cxx +++ b/src/gdcmFile.cxx @@ -142,11 +142,11 @@ bool gdcmFile::ReadPixelData(void* destination) { fread(&b0,1,1,fp); fread(&b1,1,1,fp); fread(&b2,1,1,fp); - *((unsigned short int*)destination)++ = - ((b0 >> 4) << 8) + ((b0 & 0x0f) << 4) + (b1 & 0x0f); + //Two steps is necessary to please VC++: + unsigned short int* pdestination = (unsigned short int*)destination; + *pdestination++ = ((b0 >> 4) << 8) + ((b0 & 0x0f) << 4) + (b1 & 0x0f); /* A */ /* B */ /* D */ - *((unsigned short int*)destination)++ = - ((b2 & 0x0f) << 8) + ((b1 >> 4) << 4) + (b2 >> 4); + *pdestination++ = ((b2 & 0x0f) << 8) + ((b1 >> 4) << 4) + (b2 >> 4); /* F */ /* C */ /* E */ // Troubles expected on Big-Endian processors ?