From: malaterre Date: Tue, 11 Jan 2005 00:24:44 +0000 (+0000) Subject: STYLE: Rework IsCurrentProcessorBigEndian to be smarter X-Git-Tag: Version1.0.bp~400 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=74eaba3baaf7c13f2b2b848aaac8ba1a3ede6297;p=gdcm.git STYLE: Rework IsCurrentProcessorBigEndian to be smarter --- diff --git a/src/gdcmUtil.cxx b/src/gdcmUtil.cxx index 98e4e107..443abb45 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/01/10 22:54:34 $ - Version: $Revision: 1.88 $ + Date: $Date: 2005/01/11 00:24:44 $ + Version: $Revision: 1.89 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -347,14 +347,11 @@ bool Util::DicomStringEqual(const std::string &s1, const char *s2) */ bool Util::IsCurrentProcessorBigEndian() { - uint16_t intVal = 1; - uint8_t bigEndianRepr[4] = { 0x00, 0x00, 0x00, 0x01 }; - int res = memcmp(reinterpret_cast(&intVal), - reinterpret_cast(bigEndianRepr), 4); - if (res == 0) - return true; - else - return false; +#ifdef GDCM_WORDS_BIGENDIAN + return true; +#else + return false; +#endif }