diff --git a/effects.cpp b/effects.cpp index e0d755e408..f945476f86 100644 --- a/effects.cpp +++ b/effects.cpp @@ -185,9 +185,8 @@ static QByteArray readWindowProperty(xcb_window_t win, xcb_atom_t atom, xcb_atom continue; } if (prop->type == type && prop->format == format) { - const int nitems = xcb_get_property_value_length(prop.data()); - int bytelen = format == 8 ? nitems : format == 16 ? nitems * sizeof(short) : nitems * sizeof(long); - return QByteArray(reinterpret_cast< const char* >(xcb_get_property_value(prop.data())), bytelen); + return QByteArray(reinterpret_cast< const char* >(xcb_get_property_value(prop.data())), + xcb_get_property_value_length(prop.data())); } else { return QByteArray(); } diff --git a/effects/highlightwindow/highlightwindow.cpp b/effects/highlightwindow/highlightwindow.cpp index b480c4618f..e29a739943 100644 --- a/effects/highlightwindow/highlightwindow.cpp +++ b/effects/highlightwindow/highlightwindow.cpp @@ -145,7 +145,7 @@ void HighlightWindowEffect::slotPropertyNotify(EffectWindow* w, long a, EffectWi finishHighlighting(); return; } - long* data = reinterpret_cast(byteData.data()); + auto* data = reinterpret_cast(byteData.data()); if (!data[0]) { // Purposely clearing highlight by issuing a NULL target diff --git a/effects/kscreen/kscreen.cpp b/effects/kscreen/kscreen.cpp index 6eb9aa3083..ccc9ee72d3 100644 --- a/effects/kscreen/kscreen.cpp +++ b/effects/kscreen/kscreen.cpp @@ -126,7 +126,7 @@ void KscreenEffect::propertyNotify(EffectWindow *window, long int atom) return; } QByteArray byteData = effects->readRootProperty(m_atom, XCB_ATOM_CARDINAL, 32); - long *data = reinterpret_cast(byteData.data()); + auto *data = reinterpret_cast(byteData.data()); if (!data[0]) { // Property was deleted if (m_state != StateNormal) { diff --git a/effects/presentwindows/presentwindows.cpp b/effects/presentwindows/presentwindows.cpp index e90a7d171f..326f6c8236 100755 --- a/effects/presentwindows/presentwindows.cpp +++ b/effects/presentwindows/presentwindows.cpp @@ -810,7 +810,7 @@ void PresentWindowsEffect::slotPropertyNotify(EffectWindow* w, long a) setActive(false); return; } - long* data = reinterpret_cast(byteData.data()); + auto* data = reinterpret_cast(byteData.data()); if (!data[0]) { // Purposely ending present windows by issuing a NULL target @@ -839,7 +839,7 @@ void PresentWindowsEffect::slotPropertyNotify(EffectWindow* w, long a) setActive(false); return; } - long* data = reinterpret_cast(byteData.data()); + auto* data = reinterpret_cast(byteData.data()); if (!data[0]) { // Purposely ending present windows by issuing a NULL target diff --git a/effects/slidingpopups/slidingpopups.cpp b/effects/slidingpopups/slidingpopups.cpp index 3d67558234..1f31a8517b 100644 --- a/effects/slidingpopups/slidingpopups.cpp +++ b/effects/slidingpopups/slidingpopups.cpp @@ -280,13 +280,13 @@ void SlidingPopupsEffect::slotPropertyNotify(EffectWindow* w, long a) return; } - long* d = reinterpret_cast< long* >(data.data()); + auto* d = reinterpret_cast< uint32_t* >(data.data()); Data animData; animData.start = d[ 0 ]; animData.from = (Position)d[ 1 ]; - if (data.length() >= (int)(sizeof(long) * 3)) { + if (data.length() >= (int)(sizeof(uint32_t) * 3)) { animData.fadeInDuration = d[2]; - if (data.length() >= (int)(sizeof(long) * 4)) + if (data.length() >= (int)(sizeof(uint32_t) * 4)) animData.fadeOutDuration = d[3]; else animData.fadeOutDuration = d[2]; diff --git a/effects/taskbarthumbnail/taskbarthumbnail.cpp b/effects/taskbarthumbnail/taskbarthumbnail.cpp index 22443d3ea1..31fcd5dd52 100644 --- a/effects/taskbarthumbnail/taskbarthumbnail.cpp +++ b/effects/taskbarthumbnail/taskbarthumbnail.cpp @@ -127,7 +127,7 @@ void TaskbarThumbnailEffect::slotPropertyNotify(EffectWindow* w, long a) QByteArray data = w->readProperty(atom, atom, 32); if (data.length() < 1) return; - long* d = reinterpret_cast< long* >(data.data()); + auto* d = reinterpret_cast< uint32_t* >(data.data()); int len = data.length() / sizeof(d[ 0 ]); int pos = 0; int cnt = d[ 0 ];