From a7ec88c2132dec4b8a038c8abc39b670e80afc42 Mon Sep 17 00:00:00 2001 From: Robert Knight Date: Sun, 30 Mar 2008 22:57:42 +0000 Subject: [PATCH] Re-write CharacterColor::operator==(), CharacterColor::operator!=(). Previous implementation caused memory alignment trap on ARM. BUG:160137 svn path=/trunk/KDE/kdebase/apps/konsole/; revision=792018 --- src/CharacterColor.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/CharacterColor.h b/src/CharacterColor.h index b4b04d0f2..eb6f648c0 100644 --- a/src/CharacterColor.h +++ b/src/CharacterColor.h @@ -244,14 +244,11 @@ private: inline bool operator == (const CharacterColor& a, const CharacterColor& b) { - return *reinterpret_cast(&a._colorSpace) == - *reinterpret_cast(&b._colorSpace); + return !memcmp(&a,&b,sizeof(CharacterColor)); } - inline bool operator != (const CharacterColor& a, const CharacterColor& b) { - return *reinterpret_cast(&a._colorSpace) != - *reinterpret_cast(&b._colorSpace); + return !operator==(a,b); } inline const QColor color256(quint8 u, const ColorEntry* base)