diff options
author | Erkin Bahceci <erkinbah@gmail.com> | 2009-07-30 19:41:38 -0500 |
---|---|---|
committer | Erkin Bahceci <erkinbah@gmail.com> | 2009-07-30 19:41:38 -0500 |
commit | e234d8717fc54f6adf4e8fa74bd9929cc912eaf7 (patch) | |
tree | 075bc50d29463a5b3033dce2296bd16662aa874e /src | |
parent | 955e5653053af15a7c7732558fa4a4b7dda4099d (diff) | |
download | zcomp-e234d8717fc54f6adf4e8fa74bd9929cc912eaf7.tar.gz zcomp-e234d8717fc54f6adf4e8fa74bd9929cc912eaf7.tar.bz2 |
More unsigned int to int conversion.
Diffstat (limited to 'src')
-rw-r--r-- | src/screen.cpp | 19 | ||||
-rw-r--r-- | src/window.cpp | 16 | ||||
-rw-r--r-- | src/windowgeometry.cpp | 32 |
3 files changed, 35 insertions, 32 deletions
diff --git a/src/screen.cpp b/src/screen.cpp index 86dacf5..cbd8ef8 100644 --- a/src/screen.cpp +++ b/src/screen.cpp @@ -1699,7 +1699,8 @@ PrivateScreen::updateOutputDevices () CompOption::Value::Vector &list = optionGetOutputs (); unsigned int nOutput = 0; int x, y, bits; - unsigned int width, height; + unsigned int uWidth, uHeight; + int width, height; int x1, y1, x2, y2; char str[10]; @@ -1707,10 +1708,12 @@ PrivateScreen::updateOutputDevices () { x = 0; y = 0; - width = screen->width (); - height = screen->height (); + uWidth = (unsigned) screen->width (); + uHeight = (unsigned) screen->height (); - bits = XParseGeometry (value.s ().c_str (), &x, &y, &width, &height); + bits = XParseGeometry (value.s ().c_str (), &x, &y, &uWidth, &uHeight); + width = (int) uWidth; + height = (int) uHeight; if (bits & XNegative) x = screen->width () + x - width; @@ -1727,9 +1730,9 @@ PrivateScreen::updateOutputDevices () x1 = 0; if (y1 < 0) y1 = 0; - if (x2 > (int) screen->width ()) + if (x2 > screen->width ()) x2 = screen->width (); - if (y2 > (int) screen->height ()) + if (y2 > screen->height ()) y2 = screen->height (); if (x1 < x2 && y1 < y2) @@ -3773,12 +3776,12 @@ CompScreen::warpPointer (int dx, pointerX += dx; pointerY += dy; - if (pointerX >= (int) width ()) + if (pointerX >= width ()) pointerX = width () - 1; else if (pointerX < 0) pointerX = 0; - if (pointerY >= (int) height ()) + if (pointerY >= height ()) pointerY = height () - 1; else if (pointerY < 0) pointerY = 0; diff --git a/src/window.cpp b/src/window.cpp index e6188b8..fa431c6 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -1353,9 +1353,9 @@ CompWindow::resize (XWindowAttributes attr) bool CompWindow::resize (int x, int y, - unsigned int width, - unsigned int height, - unsigned int border) + int width, + int height, + int border) { return resize (Geometry (x, y, width, height, border)); } @@ -1363,12 +1363,12 @@ CompWindow::resize (int x, bool CompWindow::resize (CompWindow::Geometry gm) { - if (priv->attrib.width != (int) gm.width () || - priv->attrib.height != (int) gm.height () || - priv->attrib.border_width != (int) gm.border ()) + if (priv->attrib.width != gm.width () || + priv->attrib.height != gm.height () || + priv->attrib.border_width != gm.border ()) { - unsigned int pw, ph; - int dx, dy, dwidth, dheight; + int pw, ph; + int dx, dy, dwidth, dheight; pw = gm.width () + gm.border () * 2; ph = gm.height () + gm.border () * 2; diff --git a/src/windowgeometry.cpp b/src/windowgeometry.cpp index 9ef15d2..1bbefd6 100644 --- a/src/windowgeometry.cpp +++ b/src/windowgeometry.cpp @@ -33,34 +33,34 @@ CompWindow::Geometry::Geometry () : { } -CompWindow::Geometry::Geometry (int x, - int y, - unsigned int width, - unsigned int height, - unsigned int border) : +CompWindow::Geometry::Geometry (int x, + int y, + int width, + int height, + int border) : CompRect (x, y, width, height), mBorder (border) { } -unsigned int +int CompWindow::Geometry::border () const { return mBorder; } void -CompWindow::Geometry::setBorder (unsigned int border) +CompWindow::Geometry::setBorder (int border) { mBorder = border; } void -CompWindow::Geometry::set (int x, - int y, - unsigned int width, - unsigned int height, - unsigned int border) +CompWindow::Geometry::set (int x, + int y, + int width, + int height, + int border) { setX (x); setY (y); @@ -100,13 +100,13 @@ CompWindow::pos () const } /* With border */ -unsigned int +int CompWindow::width () const { return priv->width; } -unsigned int +int CompWindow::height () const { return priv->height; @@ -138,14 +138,14 @@ CompWindow::serverPos () const } /* With border */ -unsigned int +int CompWindow::serverWidth () const { return priv->serverGeometry.width () + 2 * priv->serverGeometry.border (); } -unsigned int +int CompWindow::serverHeight () const { return priv->serverGeometry.height () + |