From f3a76bbce03c6b6d11ab5615e759a1adf1f79f25 Mon Sep 17 00:00:00 2001 From: malaterre Date: Wed, 29 Oct 2003 17:12:07 +0000 Subject: [PATCH] *ENH: Two steps is necessary to please VC++ compiler... --- src/gdcmFile.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 ? -- 2.48.1