summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/compwindow.h4
-rw-r--r--src/event.cpp11
-rw-r--r--src/main.cpp5
-rw-r--r--src/privatescreen.h2
-rw-r--r--src/privatewindow.h4
-rw-r--r--src/screen.cpp31
-rw-r--r--src/window.cpp46
7 files changed, 52 insertions, 51 deletions
diff --git a/include/compwindow.h b/include/compwindow.h
index a48f55c..cc7baa1 100644
--- a/include/compwindow.h
+++ b/include/compwindow.h
@@ -307,7 +307,7 @@ class CompWindow : public WrapableHandler<WindowInterface>, public CompObject {
close (Time serverTime);
bool
- handlePingTimeout (int lastPing);
+ handlePingTimeout (unsigned int lastPing);
void
handlePing (int lastPing);
@@ -519,7 +519,7 @@ class CompWindow : public WrapableHandler<WindowInterface>, public CompObject {
unminimize ();
void
- maximize (int state);
+ maximize (unsigned int state = 0);
bool
getUserTime (Time *time);
diff --git a/src/event.cpp b/src/event.cpp
index b2dc872..7f508a3 100644
--- a/src/event.cpp
+++ b/src/event.cpp
@@ -234,7 +234,7 @@ PrivateDisplay::triggerButtonPressBindings (CompOption::Vector &options,
if (isInitiateBinding (option, CompAction::BindingTypeButton, state,
&action))
{
- if (action->button ().button () == event->xbutton.button)
+ if (action->button ().button () == (int) event->xbutton.button)
{
bindMods = display->virtualToRealModMask (
action->button ().modifiers ());
@@ -251,7 +251,8 @@ PrivateDisplay::triggerButtonPressBindings (CompOption::Vector &options,
if (isInitiateBinding (option, CompAction::BindingTypeEdgeButton,
state | CompAction::StateInitEdge, &action))
{
- if ((action->button ().button () == event->xbutton.button) &&
+ if ((action->button ().button () ==
+ (int) event->xbutton.button) &&
(action->edgeMask () & edge))
{
bindMods = display->virtualToRealModMask (
@@ -285,7 +286,7 @@ PrivateDisplay::triggerButtonReleaseBindings (CompOption::Vector &options,
{
if (isTerminateBinding (option, type, state, &action))
{
- if (action->button ().button () == event->xbutton.button)
+ if (action->button ().button () == (int) event->xbutton.button)
{
if (action->terminate () (display, action, state,
arguments))
@@ -338,7 +339,7 @@ PrivateDisplay::triggerKeyPressBindings (CompOption::Vector &options,
bindMods = display->virtualToRealModMask (
action->key ().modifiers ());
- if (action->key ().keycode () == event->xkey.keycode)
+ if (action->key ().keycode () == (int) event->xkey.keycode)
{
if ((bindMods & modMask) == (event->xkey.state & modMask))
if (action->initiate () (display, action, state,
@@ -1497,7 +1498,7 @@ CompDisplay::handleEvent (XEvent *event)
}
else if (event->xclient.message_type == priv->atoms.wmProtocols)
{
- if (event->xclient.data.l[0] == priv->atoms.wmPing)
+ if ((unsigned long) event->xclient.data.l[0] == priv->atoms.wmPing)
{
w = findWindow (event->xclient.data.l[2]);
if (w)
diff --git a/src/main.cpp b/src/main.cpp
index ab8c749..bc27859 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -53,7 +53,7 @@ GLushort defaultColor[4] = { 0xffff, 0xffff, 0xffff, 0xffff };
Window currentRoot = 0;
int defaultRefreshRate = 50;
-char *defaultTextureFilter = "Good";
+const char *defaultTextureFilter = "Good";
bool shutDown = false;
bool restartSignal = false;
@@ -259,7 +259,8 @@ main (int argc, char **argv)
}
else if (!strcmp (argv[i], "--fast-filter"))
{
- ctx.textureFilterData = "<default>Fast</default>";
+ ctx.textureFilterData =
+ const_cast<char *> ("<default>Fast</default>");
defaultTextureFilter = "Fast";
}
else if (!strcmp (argv[i], "--indirect-rendering"))
diff --git a/src/privatescreen.h b/src/privatescreen.h
index a4ffd5c..d2c1660 100644
--- a/src/privatescreen.h
+++ b/src/privatescreen.h
@@ -24,7 +24,7 @@ extern bool useDesktopHints;
extern bool onlyCurrentScreen;
extern int defaultRefreshRate;
-extern char *defaultTextureFilter;
+extern const char *defaultTextureFilter;
#define RED_SATURATION_WEIGHT 0.30f
#define GREEN_SATURATION_WEIGHT 0.59f
diff --git a/src/privatewindow.h b/src/privatewindow.h
index 52ff71f..12da68a 100644
--- a/src/privatewindow.h
+++ b/src/privatewindow.h
@@ -11,8 +11,8 @@
(!(w)->damaged) || \
(w)->attrib.x + (w)->width + (w)->output.right <= 0 || \
(w)->attrib.y + (w)->height + (w)->output.bottom <= 0 || \
- (w)->attrib.x - (w)->output.left >= (w)->screen->size().width () || \
- (w)->attrib.y - (w)->output.top >= (w)->screen->size().height () )
+ (w)->attrib.x - (w)->output.left >= (int) (w)->screen->size().width () || \
+ (w)->attrib.y - (w)->output.top >= (int) (w)->screen->size().height () )
class PrivateWindow {
diff --git a/src/screen.cpp b/src/screen.cpp
index fcd6632..1511425 100644
--- a/src/screen.cpp
+++ b/src/screen.cpp
@@ -219,9 +219,9 @@ PrivateScreen::updateOutputDevices ()
x1 = 0;
if (y1 < 0)
y1 = 0;
- if (x2 > size.width ())
+ if (x2 > (int) size.width ())
x2 = size.width ();
- if (y2 > size.height ())
+ if (y2 > (int) size.height ())
y2 = size.height ();
if (x1 < x2 && y1 < y2)
@@ -285,7 +285,7 @@ PrivateScreen::updateOutputDevices ()
if (display->screenInfo ().size ())
{
- for (int i = 0; i < display->screenInfo ().size (); i++)
+ for (unsigned int i = 0; i < display->screenInfo ().size (); i++)
{
r.extents.x1 = display->screenInfo ()[i].x_org;
r.extents.y1 = display->screenInfo ()[i].y_org;
@@ -528,7 +528,6 @@ PrivateScreen::updateStartupFeedback ()
bool
PrivateScreen::handleStartupSequenceTimeout()
{
- CompStartupSequence *s;
struct timeval now, active;
double elapsed;
@@ -839,7 +838,7 @@ PrivateScreen::updateScreenBackground (CompTexture *texture)
if (XGetGeometry (dpy, p, &w, &i, &i,
&width, &height, &ui, &depth))
{
- if (depth == attrib.depth)
+ if ((int) depth == attrib.depth)
pixmap = p;
}
}
@@ -2177,7 +2176,7 @@ CompScreen::init (CompDisplay *display,
&rootReturn, &parentReturn,
&children, &nchildren);
- for (i = 0; i < nchildren; i++)
+ for (unsigned int i = 0; i < nchildren; i++)
new CompWindow (this, children[i], i ? children[i - 1] : 0);
foreach (CompWindow *w, priv->windows)
@@ -2482,7 +2481,6 @@ CompScreen::insertWindow (CompWindow *w, Window aboveId)
void
CompScreen::unhookWindow (CompWindow *w)
{
- CompWindow *prev, *next;
CompWindowList::iterator it =
std::find (priv->windows.begin (), priv->windows.end (), w);
@@ -2659,7 +2657,8 @@ PrivateScreen::grabUngrabKeys (unsigned int modifiers,
bool grab)
{
XModifierKeymap *modMap = display->modMap ();
- int ignore, mod, k;
+ int mod, k;
+ unsigned int ignore;
CompDisplay::checkForError (display->dpy ());
@@ -3590,8 +3589,8 @@ CompScreen::clearOutput (CompOutput *output,
if (pBox->x1 != 0 ||
pBox->y1 != 0 ||
- pBox->x2 != priv->size.width () ||
- pBox->y2 != priv->size.height ())
+ pBox->x2 != (int) priv->size.width () ||
+ pBox->y2 != (int) priv->size.height ())
{
glPushAttrib (GL_SCISSOR_BIT);
@@ -3627,8 +3626,8 @@ CompScreen::viewportForGeometry (CompWindow::Geometry gm,
gm.setWidth (gm.width () + (gm.border () * 2));
gm.setHeight (gm.height () + (gm.border () * 2));
- if ((gm.x () < priv->size.width () && gm.x () + gm.width () > 0) &&
- (gm.y () < priv->size.height () && gm.y ()+ gm.height () > 0))
+ if ((gm.x () < (int) priv->size.width () && gm.x () + gm.width () > 0) &&
+ (gm.y () < (int) priv->size.height () && gm.y ()+ gm.height () > 0))
{
if (viewportX)
*viewportX = priv->vp.x ();
@@ -4148,12 +4147,12 @@ CompScreen::warpPointer (int dx, int dy)
pointerX += dx;
pointerY += dy;
- if (pointerX >= priv->size.width ())
+ if (pointerX >= (int) priv->size.width ())
pointerX = priv->size.width () - 1;
else if (pointerX < 0)
pointerX = 0;
- if (pointerY >= priv->size.height ())
+ if (pointerY >= (int) priv->size.height ())
pointerY = priv->size.height () - 1;
else if (pointerY < 0)
pointerY = 0;
@@ -4286,8 +4285,8 @@ CompScreen::handlePaintTimeout ()
if (priv->tmpRegion->numRects == 1 &&
priv->tmpRegion->rects->x1 == 0 &&
priv->tmpRegion->rects->y1 == 0 &&
- priv->tmpRegion->rects->x2 == priv->size.width () &&
- priv->tmpRegion->rects->y2 == priv->size.height ())
+ priv->tmpRegion->rects->x2 == (int) priv->size.width () &&
+ priv->tmpRegion->rects->y2 == (int) priv->size.height ())
damageScreen ();
}
diff --git a/src/window.cpp b/src/window.cpp
index 98165a3..f35ec4f 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -1237,10 +1237,10 @@ CompWindow::updateStruts ()
{
int strutX1, strutY1, strutX2, strutY2;
int x1, y1, x2, y2;
- int i;
/* applications expect us to clip struts to xinerama edges */
- for (i = 0; i < priv->screen->display ()->screenInfo ().size (); i++)
+ for (unsigned int i = 0;
+ i < priv->screen->display ()->screenInfo ().size (); i++)
{
x1 = priv->screen->display ()->screenInfo ()[i].x_org;
y1 = priv->screen->display ()->screenInfo ()[i].y_org;
@@ -1842,8 +1842,8 @@ CompWindow::focus ()
if (priv->attrib.x + priv->width <= 0 ||
priv->attrib.y + priv->height <= 0 ||
- priv->attrib.x >= priv->screen->size().width ()||
- priv->attrib.y >= priv->screen->size().height ())
+ priv->attrib.x >= (int) priv->screen->size().width ()||
+ priv->attrib.y >= (int) priv->screen->size().height ())
return false;
return true;
@@ -3436,13 +3436,13 @@ PrivateWindow::constrainNewWindowSize (int width,
{
delta = FLOOR64 (height - width * min_aspect_y / min_aspect_x,
yinc);
- if (height - delta >= min_height)
+ if (height - (int) delta >= min_height)
height -= delta;
else
{
delta = FLOOR64 (height * min_aspect_x / min_aspect_y - width,
xinc);
- if (width + delta <= max_width)
+ if (width + (int) delta <= max_width)
width += delta;
}
}
@@ -3451,13 +3451,13 @@ PrivateWindow::constrainNewWindowSize (int width,
{
delta = FLOOR64 (width - height * max_aspect_x / max_aspect_y,
xinc);
- if (width - delta >= min_width)
+ if (width - (int) delta >= min_width)
width -= delta;
else
{
delta = FLOOR64 (width * min_aspect_y / min_aspect_x - height,
yinc);
- if (height + delta <= max_height)
+ if (height + (int) delta <= max_height)
height += delta;
}
}
@@ -3622,7 +3622,7 @@ CompWindow::unminimize ()
}
void
-CompWindow::maximize (int state)
+CompWindow::maximize (unsigned int state)
{
if (priv->attrib.override_redirect)
return;
@@ -3882,8 +3882,9 @@ CompWindow::defaultViewport (int *vx, int *vy)
CompIcon *
CompWindow::getIcon (int width, int height)
{
- CompIcon *icon;
- int i, wh, diff, oldDiff;
+ CompIcon *icon;
+ int wh, diff, oldDiff;
+ unsigned int i;
/* need to fetch icon property */
if (priv->icons.size () == 0 && !priv->noIcons)
@@ -3902,7 +3903,6 @@ CompWindow::getIcon (int width, int height)
if (result == Success && n && data)
{
- CompIcon **pIcon;
CARD32 *p;
CARD32 alpha, red, green, blue;
int iw, ih, j;
@@ -3911,10 +3911,10 @@ CompWindow::getIcon (int width, int height)
{
unsigned long *idata = (unsigned long *) data;
- iw = idata[i];
+ iw = idata[i];
ih = idata[i + 1];
- if (iw * ih + 2 > n - i)
+ if (iw * ih + 2 > (int) (n - i))
break;
if (iw && ih)
@@ -3967,8 +3967,8 @@ CompWindow::getIcon (int width, int height)
for (i = 0; i < priv->icons.size (); i++)
{
- if (priv->icons[i]->width () > width ||
- priv->icons[i]->height () > height)
+ if ((int) priv->icons[i]->width () > width ||
+ (int) priv->icons[i]->height () > height)
continue;
if (icon)
@@ -3990,8 +3990,6 @@ CompWindow::getIcon (int width, int height)
void
CompWindow::freeIcons ()
{
- int i;
-
for (unsigned int i = 0; i < priv->icons.size (); i++)
{
delete priv->icons[i];
@@ -4120,7 +4118,7 @@ CompWindow::getMovementForOffset (int offX,
else
{
m = priv->attrib.x + offX;
- if (m - priv->input.left < s->size().width () - vWidth)
+ if (m - priv->input.left < (int) s->size().width () - vWidth)
*retX = offX + vWidth;
else if (m + priv->width + priv->input.right > vWidth)
*retX = offX - vWidth;
@@ -4135,7 +4133,7 @@ CompWindow::getMovementForOffset (int offX,
else
{
m = priv->attrib.y + offY;
- if (m - priv->input.top < s->size().height () - vHeight)
+ if (m - priv->input.top < (int) s->size().height () - vHeight)
*retY = offY + vHeight;
else if (m + priv->height + priv->input.bottom > vHeight)
*retY = offY - vHeight;
@@ -4336,7 +4334,7 @@ CompWindow::close (Time serverTime)
}
bool
-CompWindow::handlePingTimeout (int lastPing)
+CompWindow::handlePingTimeout (unsigned int lastPing)
{
if (priv->attrib.map_state != IsViewable)
return false;
@@ -4598,7 +4596,8 @@ CompWindow::moveToViewportPosition (int x, int y, bool sync)
{
m = priv->attrib.x + tx;
- if (m - priv->output.left < priv->screen->size().width () - vWidth)
+ if (m - priv->output.left <
+ (int) priv->screen->size().width () - vWidth)
wx = tx + vWidth;
else if (m + priv->width + priv->output.right > vWidth)
wx = tx - vWidth;
@@ -4608,7 +4607,8 @@ CompWindow::moveToViewportPosition (int x, int y, bool sync)
{
m = priv->attrib.y + ty;
- if (m - priv->output.top < priv->screen->size().height () - vHeight)
+ if (m - priv->output.top <
+ (int) priv->screen->size().height () - vHeight)
wy = ty + vHeight;
else if (m + priv->height + priv->output.bottom > vHeight)
wy = ty - vHeight;