From ab29b03833ed6434b17b26043b4aed4525297e1d Mon Sep 17 00:00:00 2001 From: Artem Pavlenko Date: Sun, 6 Apr 2008 09:23:17 +0000 Subject: [PATCH] reverting r681 --- include/mapnik/color.hpp | 10 +++++----- src/wkb.cpp | 21 +++++++++------------ tinyxml/tinyxmlparser.cpp | 2 +- 3 files changed, 15 insertions(+), 18 deletions(-) diff --git a/include/mapnik/color.hpp b/include/mapnik/color.hpp index 7128ac8d8..484b2e611 100644 --- a/include/mapnik/color.hpp +++ b/include/mapnik/color.hpp @@ -40,10 +40,10 @@ namespace mapnik { :abgr_(0xffffffff) {} Color(int red,int green,int blue,int alpha=0xff) - : abgr_(((alpha&0xff) << 24 | - (blue&0xff)) << 16 | - ((green&0xff) << 8 | - (red&0xff))) {} + : abgr_((alpha&0xff) << 24 | + (blue&0xff) << 16 | + (green&0xff) << 8 | + red&0xff) {} explicit Color(int rgba) : abgr_(rgba) {} @@ -88,7 +88,7 @@ namespace mapnik { } inline void set_alpha(unsigned int a) { - abgr_ = (abgr_ & 0x00ffffff) | ((a&0xff) << 24); + abgr_ = (abgr_ & 0x00ffffff | (a&0xff) << 24); } inline unsigned int rgba() const diff --git a/src/wkb.cpp b/src/wkb.cpp index 25db577c8..2f2e3b8dd 100644 --- a/src/wkb.cpp +++ b/src/wkb.cpp @@ -145,10 +145,7 @@ namespace mapnik else { const char* b=wkb_+pos_; - n = (((b[3]&0xff) | - (b[2]&0xff)) << 8 | - ((b[1]&0xff) << 16 | - (b[0]&0xff)) << 24); + n = b[3]&0xff | (b[2]&0xff)<<8 | (b[1]&0xff)<<16 | (b[0]&0xff)<<24; } pos_+=4; @@ -169,14 +166,14 @@ namespace mapnik // but not in C++ yet // this is not quite portable const char* b= wkb_+pos_; - long long n = (((long long)b[7]&0xff) | - ((long long)b[6]&0xff)<<8 | - ((long long)b[5]&0xff)<<16 | - ((long long)b[4]&0xff)<<24 | - ((long long)b[3]&0xff)<<32 | - ((long long)b[2]&0xff)<<40 | - ((long long)b[1]&0xff)<<48 | - ((long long)b[0]&0xff)<<56); + long long n = (long long)b[7]&0xff | + ((long long)b[6]&0xff)<<8 | + ((long long)b[5]&0xff)<<16 | + ((long long)b[4]&0xff)<<24 | + ((long long)b[3]&0xff)<<32 | + ((long long)b[2]&0xff)<<40 | + ((long long)b[1]&0xff)<<48 | + ((long long)b[0]&0xff)<<56; memcpy(&d,&n,8); } pos_+=8; diff --git a/tinyxml/tinyxmlparser.cpp b/tinyxml/tinyxmlparser.cpp index 994f8f7fa..c73609e10 100644 --- a/tinyxml/tinyxmlparser.cpp +++ b/tinyxml/tinyxmlparser.cpp @@ -354,7 +354,7 @@ const char* TiXmlBase::SkipWhiteSpace( const char* p, TiXmlEncoding encoding ) } else { - while ((*p && IsWhiteSpace( *p )) || *p == '\n' || *p =='\r' ) + while ( *p && IsWhiteSpace( *p ) || *p == '\n' || *p =='\r' ) ++p; }