From d6dd94778c2b293d536be0499507abfcc7e314bd Mon Sep 17 00:00:00 2001 From: Sanel Zukan Date: Sun, 2 Mar 2014 11:12:17 +0000 Subject: [PATCH] Cleaning some compiler warnings. --- pekwm/Action.hh | 3 ++- pekwm/AutoProperties.cc | 2 +- pekwm/ManagerWindows.cc | 10 ++++++++-- pekwm/PDecor.cc | 5 ++++- pekwm/PImage.cc | 2 +- pekwm/PImageLoaderXpm.cc | 2 +- 6 files changed, 17 insertions(+), 7 deletions(-) diff --git a/pekwm/Action.hh b/pekwm/Action.hh index 694212e..86d50a2 100644 --- a/pekwm/Action.hh +++ b/pekwm/Action.hh @@ -171,7 +171,8 @@ public: Action(uint action, int param_i[3]) : _action(action) { - std::memcpy(_param_i, param_i, sizeof(param_i)); + // used references explicitly to shout memcpy warning + std::memcpy(&_param_i, ¶m_i, sizeof(param_i)); } Action(uint action, const std::string ¶m_s) : _action(action), _param_s(param_s) diff --git a/pekwm/AutoProperties.cc b/pekwm/AutoProperties.cc index 0cdfc7f..c169e09 100644 --- a/pekwm/AutoProperties.cc +++ b/pekwm/AutoProperties.cc @@ -260,7 +260,7 @@ AutoProperties::findProperty(const ClassHint* class_hint, list::iterator w_it; // start searching for a suitable property - for (bool ok = false; it != prop_list->end(); ++it, ok = false) { + for (; it != prop_list->end(); ++it) { // see if the type matches, if we have one if ((type != 0) && ! (*it)->isApplyOn(type)) continue; diff --git a/pekwm/ManagerWindows.cc b/pekwm/ManagerWindows.cc index 360d457..41adadf 100644 --- a/pekwm/ManagerWindows.cc +++ b/pekwm/ManagerWindows.cc @@ -244,7 +244,9 @@ RootWO::RootWO(Window root) AtomUtil::setLong(_window, Atoms::getAtom(NET_NUMBER_OF_DESKTOPS), Config::instance()->getWorkspaces()); AtomUtil::setLong(_window, Atoms::getAtom(NET_CURRENT_DESKTOP), 0); - long desktop_geometry[2] = { _gm.width, _gm.height }; + long desktop_geometry[2]; + desktop_geometry[0] = _gm.width; + desktop_geometry[1] = _gm.height; AtomUtil::setLongs(_window, Atoms::getAtom(NET_DESKTOP_GEOMETRY), desktop_geometry, 2); woListAdd(this); @@ -339,7 +341,11 @@ RootWO::handleLeaveEvent(XCrossingEvent *ev) void RootWO::setEwmhWorkarea(const Geometry &workarea) { - long workarea_array[4] = { workarea.x, workarea.y, workarea.width, workarea.height }; + long workarea_array[4]; + workarea_array[0] = workarea.x; + workarea_array[1] = workarea.y; + workarea_array[2] = workarea.width; + workarea_array[3] = workarea.height; AtomUtil::setLongs(_window, Atoms::getAtom(NET_WORKAREA), workarea_array, 4); } diff --git a/pekwm/PDecor.cc b/pekwm/PDecor.cc index f07e686..e10e5b6 100644 --- a/pekwm/PDecor.cc +++ b/pekwm/PDecor.cc @@ -125,7 +125,10 @@ PDecor::Button::setState(ButtonState state) ScreenResources::instance()->getPixmapHandler()->returnPixmap(shape); } } else { - XRectangle rect = {0 /* x */, 0 /* y */, _gm.width, _gm.height }; + XRectangle rect; + rect.x = 0; rect.y = 0; + rect.width = _gm.width; + rect.height = _gm.height; XShapeCombineRectangles(_dpy, _window, ShapeBounding, 0, 0, &rect, 1, ShapeSet, YXBanded); } diff --git a/pekwm/PImage.cc b/pekwm/PImage.cc index ed9c10e..df04116 100644 --- a/pekwm/PImage.cc +++ b/pekwm/PImage.cc @@ -488,7 +488,7 @@ PImage::createXImage(uchar *data, uint width, uint height) g = *src++; b = *src++; if (_has_alpha) { - *src++; + src++; } XPutPixel(ximage, x, y, getPixelFromRgb(ximage, r, g, b)); diff --git a/pekwm/PImageLoaderXpm.cc b/pekwm/PImageLoaderXpm.cc index 78e8c2d..1d844e5 100644 --- a/pekwm/PImageLoaderXpm.cc +++ b/pekwm/PImageLoaderXpm.cc @@ -96,7 +96,7 @@ PImageLoaderXpm::load(const std::string &file, uint &width, uint &height, use_alpha = true; } - *src++; + src++; } }