From 0bea1cc50e0a66cc13d165604ad94aa24224b40b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= Date: Mon, 7 Jan 2008 16:54:46 +0000 Subject: [PATCH] Fix property format 32 usage for 64b. svn path=/trunk/KDE/kdebase/workspace/; revision=758332 --- effects.cpp | 3 ++- effects/taskbarthumbnail.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/effects.cpp b/effects.cpp index 4790a52465..a83578451e 100644 --- a/effects.cpp +++ b/effects.cpp @@ -1080,7 +1080,8 @@ QByteArray EffectWindowImpl::readProperty( long atom, long type, int format ) co } if( long( rtype ) == type && rformat == format ) { - QByteArray ret( reinterpret_cast< const char* >( data ), nitems * ( format / 8 )); + int bytelen = format == 8 ? nitems : format == 16 ? nitems * sizeof( short ) : nitems * sizeof( long ); + QByteArray ret( reinterpret_cast< const char* >( data ), bytelen ); XFree( data ); return ret; } diff --git a/effects/taskbarthumbnail.cpp b/effects/taskbarthumbnail.cpp index 6f1dd380c5..1dd51219e4 100644 --- a/effects/taskbarthumbnail.cpp +++ b/effects/taskbarthumbnail.cpp @@ -100,7 +100,7 @@ void TaskbarThumbnailEffect::propertyNotify( EffectWindow* w, long a ) if( data.length() < 1 ) return; long* d = reinterpret_cast< long* >( data.data()); - int len = data.length() / 4; + int len = data.length() / sizeof( d[ 0 ] ); int pos = 0; int cnt = d[ 0 ]; ++pos;