summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Spilsbury <smspillaz@gmail.com>2010-02-05 01:16:02 +0800
committerSam Spilsbury <smspillaz@gmail.com>2010-02-05 01:16:02 +0800
commit0813bc61659e212af9df22e30c655fd35f9fbc3d (patch)
tree3ec00a4a294e6843a35daf174a34d482d350b9f1
parentda75fba9478b5fd7461ae31500f95bb21227c412 (diff)
downloadcompiz-with-glib-mainloop-0813bc61659e212af9df22e30c655fd35f9fbc3d.tar.gz
compiz-with-glib-mainloop-0813bc61659e212af9df22e30c655fd35f9fbc3d.tar.bz2
plugins: fix warnings
-rw-r--r--plugins/annotate/src/annotate.cpp66
-rw-r--r--plugins/blur/src/blur.cpp16
-rw-r--r--plugins/clone/src/clone.cpp10
-rw-r--r--plugins/composite/src/window.cpp4
-rw-r--r--plugins/cube/src/cube.cpp21
-rw-r--r--plugins/fade/src/fade.cpp4
-rw-r--r--plugins/imgpng/src/imgpng.cpp4
-rw-r--r--plugins/imgsvg/src/imgsvg.cpp10
-rw-r--r--plugins/place/src/place.cpp4
-rw-r--r--plugins/regex/src/regex.cpp6
-rw-r--r--plugins/scale/src/scale.cpp7
-rw-r--r--plugins/zoom/src/zoom.cpp6
12 files changed, 88 insertions, 70 deletions
diff --git a/plugins/annotate/src/annotate.cpp b/plugins/annotate/src/annotate.cpp
index 4786dd2..b64d262 100644
--- a/plugins/annotate/src/annotate.cpp
+++ b/plugins/annotate/src/annotate.cpp
@@ -595,42 +595,44 @@ AnnoScreen::glPaintOutput (const GLScreenPaintAttrib &attrib,
glEnable (GL_BLEND);
if (content && !region.isEmpty ())
- foreach (GLTexture *tex, texture)
{
- CompRect::vector rect = region.rects ();
- numRect = region.rects ().size ();
+ foreach (GLTexture *tex, texture)
+ {
+ CompRect::vector rect = region.rects ();
+ numRect = region.rects ().size ();
- tex->enable (GLTexture::Fast);
+ tex->enable (GLTexture::Fast);
- glBegin (GL_QUADS);
+ glBegin (GL_QUADS);
- while (numRect--)
- {
- glTexCoord2f (
- COMP_TEX_COORD_X (tex->matrix (), rect.at (pos).x1 ()),
- COMP_TEX_COORD_Y (tex->matrix (), rect.at (pos).y2 ()));
- glVertex2i (rect.at (pos).x1 (), rect.at (pos).y2 ());
-
- glTexCoord2f (
- COMP_TEX_COORD_X (tex->matrix (), rect.at (pos).x2 ()),
- COMP_TEX_COORD_Y (tex->matrix (), rect.at (pos).y2 ()));
- glVertex2i (rect.at (pos).x2 (), rect.at (pos).y2 ());
-
- glTexCoord2f (
- COMP_TEX_COORD_X (tex->matrix (), rect.at (pos).x2 ()),
- COMP_TEX_COORD_Y (tex->matrix (), rect.at (pos).y1 ()));
- glVertex2i (rect.at (pos).x2 (), rect.at (pos).y1 ());
-
- glTexCoord2f (
- COMP_TEX_COORD_X (tex->matrix (), rect.at (pos).x1 ()),
- COMP_TEX_COORD_Y (tex->matrix (), rect.at (pos).y1 ()));
- glVertex2i (rect.at (pos).x1 (), rect.at (pos).y1 ());
-
- pos++;
- }
+ while (numRect--)
+ {
+ glTexCoord2f (
+ COMP_TEX_COORD_X (tex->matrix (), rect.at (pos).x1 ()),
+ COMP_TEX_COORD_Y (tex->matrix (), rect.at (pos).y2 ()));
+ glVertex2i (rect.at (pos).x1 (), rect.at (pos).y2 ());
- glEnd ();
- tex->disable ();
+ glTexCoord2f (
+ COMP_TEX_COORD_X (tex->matrix (), rect.at (pos).x2 ()),
+ COMP_TEX_COORD_Y (tex->matrix (), rect.at (pos).y2 ()));
+ glVertex2i (rect.at (pos).x2 (), rect.at (pos).y2 ());
+
+ glTexCoord2f (
+ COMP_TEX_COORD_X (tex->matrix (), rect.at (pos).x2 ()),
+ COMP_TEX_COORD_Y (tex->matrix (), rect.at (pos).y1 ()));
+ glVertex2i (rect.at (pos).x2 (), rect.at (pos).y1 ());
+
+ glTexCoord2f (
+ COMP_TEX_COORD_X (tex->matrix (), rect.at (pos).x1 ()),
+ COMP_TEX_COORD_Y (tex->matrix (), rect.at (pos).y1 ()));
+ glVertex2i (rect.at (pos).x1 (), rect.at (pos).y1 ());
+
+ pos++;
+ }
+
+ glEnd ();
+ tex->disable ();
+ }
}
if (drawMode == RectangleMode)
@@ -756,6 +758,8 @@ AnnoScreen::handleMotionEvent (int xRoot,
circle.centerY - circle.radius,
circle.radius * 2, circle.radius * 2);
break;
+ default:
+ break;
}
if (cScreen && (drawMode == CircleMode || drawMode == RectangleMode))
diff --git a/plugins/blur/src/blur.cpp b/plugins/blur/src/blur.cpp
index b8ce008..555b7d0 100644
--- a/plugins/blur/src/blur.cpp
+++ b/plugins/blur/src/blur.cpp
@@ -321,7 +321,7 @@ BlurWindow::update (int state)
if ((n - 2) / 6)
{
- int i;
+ unsigned int i;
data += 2;
@@ -578,7 +578,7 @@ BlurScreen::getSrcBlurFragmentFunction (GLTexture *texture,
if (data.status ())
{
static const char *temp[] = { "offset0", "offset1", "sum" };
- int i;
+ unsigned int i;
for (i = 0; i < sizeof (temp) / sizeof (temp[0]); i++)
data.addTempHeaderOp (temp[i]);
@@ -653,14 +653,14 @@ BlurScreen::getDstBlurFragmentFunction (GLTexture *texture,
if (data.status ())
{
static const char *temp[] = { "fCoord", "mask", "sum", "dst" };
- int i, j;
+ int i, j;
char str[1024];
int saturation = optionGetSaturation ();
int numIndirect;
int numIndirectOp;
int base, end, ITCbase;
- for (i = 0; i < sizeof (temp) / sizeof (temp[0]); i++)
+ for (i = 0; (unsigned int) i < sizeof (temp) / sizeof (temp[0]); i++)
data.addTempHeaderOp (temp[i]);
if (saturation < 100)
@@ -673,7 +673,9 @@ BlurScreen::getDstBlurFragmentFunction (GLTexture *texture,
"s0", "s1", "s2", "s3"
};
- for (i = 0; i < sizeof (filterTemp) / sizeof (filterTemp[0]); i++)
+ for (i = 0;
+ (unsigned int) i < sizeof (filterTemp) / sizeof (filterTemp[0]);
+ i++)
data.addTempHeaderOp (filterTemp[i]);
data.addFetchOp ("output", NULL, target);
@@ -2214,8 +2216,8 @@ BlurScreen::setOption (const CompString &name, CompOption::Value &value)
BlurScreen::BlurScreen (CompScreen *screen) :
PluginClassHandler<BlurScreen,CompScreen> (screen),
- cScreen (CompositeScreen::get (screen)),
gScreen (GLScreen::get (screen)),
+ cScreen (CompositeScreen::get (screen)),
moreBlur (false),
filterRadius (0),
srcBlurFunctions (0),
@@ -2290,8 +2292,8 @@ BlurScreen::~BlurScreen ()
BlurWindow::BlurWindow (CompWindow *w) :
PluginClassHandler<BlurWindow,CompWindow> (w),
window (w),
- gWindow (GLWindow::get (w)),
cWindow (CompositeWindow::get (w)),
+ gWindow (GLWindow::get (w)),
bScreen (BlurScreen::get (screen)),
blur (0),
pulse (false),
diff --git a/plugins/clone/src/clone.cpp b/plugins/clone/src/clone.cpp
index afdd39b..ac3413d 100644
--- a/plugins/clone/src/clone.cpp
+++ b/plugins/clone/src/clone.cpp
@@ -200,7 +200,9 @@ CloneScreen::glPaintOutput (const GLScreenPaintAttrib &attrib,
unsigned int dstForThisOutput, outputId = 0;
CompRegion sRegion = region;
- dstForThisOutput = outputId = (output->id () != ~0) ? output->id () : 0;
+ dstForThisOutput = outputId =
+ ((unsigned int) output->id () != (unsigned int) ~0) ?
+ output->id () : 0;
if (!grab || (unsigned int) grabbedOutput != outputId)
{
@@ -224,7 +226,7 @@ CloneScreen::glPaintOutput (const GLScreenPaintAttrib &attrib,
}
}
- if (output->id () != ~0)
+ if (output->id () != (unsigned int) ~0)
status = gScreen->glPaintOutput (attrib, transform, sRegion,
&screen->outputDevs ()[dstForThisOutput], mask);
else
@@ -533,8 +535,8 @@ CloneScreen::outputChangeNotify ()
for (it = clones.begin (); it != clones.end (); it++)
{
- if ((*it)->dst >= screen->outputDevs ().size () ||
- (*it)->src >= screen->outputDevs ().size ())
+ if ((unsigned int) (*it)->dst >= screen->outputDevs ().size () ||
+ (unsigned int) (*it)->src >= screen->outputDevs ().size ())
{
clones.erase (it);
it = clones.begin ();
diff --git a/plugins/composite/src/window.cpp b/plugins/composite/src/window.cpp
index aa9331f..7cf7094 100644
--- a/plugins/composite/src/window.cpp
+++ b/plugins/composite/src/window.cpp
@@ -575,8 +575,8 @@ PrivateCompositeWindow::resizeNotify (int dx, int dy, int dwidth, int dheight)
result = XGetGeometry (screen->dpy (), pixmap, &root, &i, &i,
&actualWidth, &actualHeight, &ui, &ui);
- if (!result || actualWidth != window->size ().width () ||
- actualHeight != window->size ().height ())
+ if (!result || actualWidth != (unsigned int) window->size ().width () ||
+ actualHeight != (unsigned int) window->size ().height ())
{
XFreePixmap (screen->dpy (), pixmap);
return;
diff --git a/plugins/cube/src/cube.cpp b/plugins/cube/src/cube.cpp
index 4dbfe65..53deff9 100644
--- a/plugins/cube/src/cube.cpp
+++ b/plugins/cube/src/cube.cpp
@@ -354,7 +354,8 @@ void
PrivateCubeScreen::updateOutputs ()
{
CompOutput *pBox0, *pBox1;
- int i, j, k, x;
+ unsigned int i, j;
+ int k, x;
k = 0;
@@ -405,7 +406,7 @@ PrivateCubeScreen::updateOutputs ()
return;
}
- if (k != screen->outputDevs ().size ())
+ if ((unsigned int) k != screen->outputDevs ().size ())
{
mFullscreenOutput = false;
mNOutput = 1;
@@ -866,7 +867,8 @@ PrivateCubeScreen::glPaintOutput (const GLScreenPaintAttrib &sAttrib,
mask |= PAINT_SCREEN_TRANSFORMED_MASK;
}
- mSrcOutput = (output->id () != ~0) ? output->id () : 0;
+ mSrcOutput = ((unsigned int) output->id () != (unsigned int) ~0) ?
+ output->id () : 0;
/* Always use BTF painting on non-transformed screen */
mPaintOrder = BTF;
@@ -965,7 +967,8 @@ PrivateCubeScreen::moveViewportAndPaint (const GLScreenPaintAttrib &sAttrib,
paintOrder))
return;
- output = (outputPtr->id () != ~0) ? outputPtr->id () : 0;
+ output = ((unsigned int) outputPtr->id () != (unsigned int) ~0)
+ ? outputPtr->id () : 0;
mPaintOrder = paintOrder;
@@ -1353,15 +1356,17 @@ PrivateCubeScreen::glPaintTransformedOutput (const GLScreenPaintAttrib &sAttrib,
int cullNorm, cullInv;
int output = 0;
- output = (outputPtr->id () != ~0) ? outputPtr->id () : 0;
+ output = ((unsigned int) outputPtr->id () != (unsigned int) ~0) ?
+ outputPtr->id () : 0;
mReversedWindowList = cScreen->getWindowPaintList ();
mReversedWindowList.reverse ();
- if (((outputPtr->id () != ~0) && mRecalcOutput) ||
- ((outputPtr->id () == ~0) && !mRecalcOutput && mNOutput > 1))
+ if ((((unsigned int) outputPtr->id () != (unsigned int) ~0) && mRecalcOutput) ||
+ (((unsigned int) outputPtr->id () == (unsigned int) ~0) && !mRecalcOutput &&
+ mNOutput > 1))
{
- mRecalcOutput = (outputPtr->id () == ~0);
+ mRecalcOutput = ((unsigned int) outputPtr->id () == (unsigned int) ~0);
mNOutput = 1;
updateGeometry (screen->vpSize ().width (), mInvert);
}
diff --git a/plugins/fade/src/fade.cpp b/plugins/fade/src/fade.cpp
index fa0d5f6..49bcb84 100644
--- a/plugins/fade/src/fade.cpp
+++ b/plugins/fade/src/fade.cpp
@@ -313,8 +313,8 @@ FadeWindow::glPaint (const GLWindowPaintAttrib& attrib,
FadeScreen::FadeScreen (CompScreen *s) :
PluginClassHandler<FadeScreen, CompScreen> (s),
- cScreen (CompositeScreen::get (s)),
- displayModals (0)
+ displayModals (0),
+ cScreen (CompositeScreen::get (s))
{
fadeTime = 1000.0f / optionGetFadeSpeed ();
diff --git a/plugins/imgpng/src/imgpng.cpp b/plugins/imgpng/src/imgpng.cpp
index ae2abd4..3b95acf 100644
--- a/plugins/imgpng/src/imgpng.cpp
+++ b/plugins/imgpng/src/imgpng.cpp
@@ -72,8 +72,8 @@ PngScreen::readPngData (png_struct *png,
CompSize &size)
{
png_uint_32 pngWidth, pngHeight;
- int depth, colorType, interlace, i;
- unsigned int pixelSize;
+ int depth, colorType, interlace;
+ unsigned int pixelSize, i;
png_byte **rowPointers;
char *d;
diff --git a/plugins/imgsvg/src/imgsvg.cpp b/plugins/imgsvg/src/imgsvg.cpp
index a473898..626d9e2 100644
--- a/plugins/imgsvg/src/imgsvg.cpp
+++ b/plugins/imgsvg/src/imgsvg.cpp
@@ -191,12 +191,12 @@ SvgScreen::readSvgToImage (const char *file,
SvgWindow::SvgWindow (CompWindow *window) :
PluginClassHandler<SvgWindow, CompWindow> (window),
+ source (NULL),
+ context (NULL),
sScreen (SvgScreen::get (screen)),
gScreen (GLScreen::get (screen)),
window (window),
- gWindow (GLWindow::get (window)),
- source (NULL),
- context (NULL)
+ gWindow (GLWindow::get (window))
{
if (gWindow)
GLWindowInterface::setHandler (gWindow, false);
@@ -234,7 +234,7 @@ SvgWindow::glDraw (const GLMatrix &transform,
if (context && reg.numRects ())
{
GLTexture::MatrixList matrix (1);
- int i, j;
+ unsigned int i, j;
int x1, y1, x2, y2;
CompRect rect = context->box.boundingRect ();
@@ -374,7 +374,7 @@ SvgWindow::updateSvgMatrix ()
{
SvgTexture *texture;
GLTexture::Matrix *m;
- int i;
+ unsigned int i;
CompRect rect;
rect = context->box.boundingRect ();
diff --git a/plugins/place/src/place.cpp b/plugins/place/src/place.cpp
index 8a3f555..d58975f 100644
--- a/plugins/place/src/place.cpp
+++ b/plugins/place/src/place.cpp
@@ -786,7 +786,7 @@ PlaceWindow::doPlacement (CompPoint &pos)
/* When placing to the fullscreen output, constrain to one
output nevertheless */
- if (output.id () == ~0)
+ if ((unsigned int) output.id () == (unsigned int) ~0)
{
int id;
CompWindow::Geometry geom (window->serverGeometry ());
@@ -1599,7 +1599,7 @@ PlaceWindow::matchXYValue (CompOption::Value::Vector &matches,
CompOption::Value::Vector *constrainValues,
bool *keepInWorkarea)
{
- int i, min;
+ unsigned int i, min;
if (window->type () & CompWindowTypeDesktopMask)
return false;
diff --git a/plugins/regex/src/regex.cpp b/plugins/regex/src/regex.cpp
index 9be7272..7a29d87 100644
--- a/plugins/regex/src/regex.cpp
+++ b/plugins/regex/src/regex.cpp
@@ -72,7 +72,7 @@ const RegexExp::Prefix RegexExp::prefix[] = {
RegexExp::RegexExp (const CompString& str, int item) :
mRegex (NULL)
{
- if (item < sizeof (prefix) / sizeof (prefix[0]))
+ if ((unsigned int) item < sizeof (prefix) / sizeof (prefix[0]))
{
int status;
CompString value;
@@ -143,11 +143,11 @@ RegexExp::evaluate (CompWindow *w)
int
RegexExp::matches (const CompString& str)
{
- int i;
+ unsigned int i;
for (i = 0; i < sizeof (prefix) / sizeof (prefix[0]); i++)
if (str.compare (0, prefix[i].length, prefix[i].name) == 0)
- return i;
+ return (int) i;
return -1;
}
diff --git a/plugins/scale/src/scale.cpp b/plugins/scale/src/scale.cpp
index d266008..939e345 100644
--- a/plugins/scale/src/scale.cpp
+++ b/plugins/scale/src/scale.cpp
@@ -90,7 +90,8 @@ PrivateScaleWindow::isScaleWin () const
return false;
break;
case ScaleTypeOutput:
- if (window->outputDevice () != screen->currentOutputDev ().id ())
+ if ((unsigned int) window->outputDevice () !=
+ (unsigned int) screen->currentOutputDev ().id ())
return false;
default:
break;
@@ -411,7 +412,7 @@ PrivateScaleScreen::layoutSlotsForArea (const CompRect& workArea,
SlotArea::vector
PrivateScaleScreen::getSlotAreas ()
{
- int i = 0;
+ unsigned int i = 0;
CompRect workArea;
std::vector<float> size;
float sizePerWindow, sum = 0.0f;
@@ -494,8 +495,10 @@ PrivateScaleScreen::layoutSlots ()
{
SlotArea::vector slotAreas = getSlotAreas ();
if (slotAreas.size ())
+ {
foreach (SlotArea &sa, slotAreas)
layoutSlotsForArea (sa.workArea, sa.nWindows);
+ }
}
break;
case ScaleOptions::MultioutputModeOnCurrentOutputDevice:
diff --git a/plugins/zoom/src/zoom.cpp b/plugins/zoom/src/zoom.cpp
index 290af37..7231342 100644
--- a/plugins/zoom/src/zoom.cpp
+++ b/plugins/zoom/src/zoom.cpp
@@ -156,7 +156,8 @@ ZoomScreen::glPaintOutput (const GLScreenPaintAttrib &sAttrib,
GLMatrix zTransform (transform);
bool status;
- if (output->id () != ~0 && (zoomed & (1 << output->id ())))
+ if ((unsigned int) output->id () != (unsigned int) ~0 &&
+ (zoomed & (1 << (unsigned int) output->id ())))
{
GLTexture::Filter saveFilter;
ZoomBox box;
@@ -186,7 +187,8 @@ ZoomScreen::glPaintOutput (const GLScreenPaintAttrib &sAttrib,
saveFilter = gScreen->filter (SCREEN_TRANS_FILTER);
- if ((zoomOutput != output->id () || !adjust) && scale > 3.9f &&
+ if (((unsigned int) zoomOutput != (unsigned int) output->id () || !adjust) &&
+ scale > 3.9f &&
!optionGetFilterLinear ())
gScreen->setFilter (SCREEN_TRANS_FILTER, GLTexture::Fast);