summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Spilsbury <smspillaz@gmail.com>2010-12-13 21:41:34 +0800
committerSam Spilsbury <smspillaz@gmail.com>2010-12-13 21:41:34 +0800
commit25edfca526e6f3eb2fae85372d139810ca869e78 (patch)
treeef447803fb8c470145f2b85a1bee571bbd647f07
parent1647f9f9f74b2e396a2b32ccdac81b955bc84aa6 (diff)
downloadcompiz-with-glib-mainloop-25edfca526e6f3eb2fae85372d139810ca869e78.tar.gz
compiz-with-glib-mainloop-25edfca526e6f3eb2fae85372d139810ca869e78.tar.bz2
Fix unintialized variable usage
-rw-r--r--plugins/resize/src/resize.cpp6
-rw-r--r--plugins/scale/src/scale.cpp8
2 files changed, 8 insertions, 6 deletions
diff --git a/plugins/resize/src/resize.cpp b/plugins/resize/src/resize.cpp
index a2b3bb8..d38e604 100644
--- a/plugins/resize/src/resize.cpp
+++ b/plugins/resize/src/resize.cpp
@@ -1040,8 +1040,8 @@ ResizeScreen::handleMotionEvent (int xRoot, int yRoot)
/* only constrain movement if previous position was valid */
if (inRegionStatus)
{
- bool xStatus;
- int yForXResize;
+ bool xStatus = false;
+ int yForXResize = y;
int nx = x;
int nw = wi;
int nh = he;
@@ -1636,7 +1636,7 @@ ResizeScreen::optionChanged (CompOption *option,
ResizeOptions::Options num)
{
int *mask = NULL;
- int valueMask;
+ int valueMask = 0;
switch (num)
{
diff --git a/plugins/scale/src/scale.cpp b/plugins/scale/src/scale.cpp
index 44adaf7..8fbcbb3 100644
--- a/plugins/scale/src/scale.cpp
+++ b/plugins/scale/src/scale.cpp
@@ -1418,7 +1418,7 @@ PrivateScaleScreen::hoverTimeout ()
void
PrivateScaleScreen::handleEvent (XEvent *event)
{
- CompWindow *w;
+ CompWindow *w = NULL;
switch (event->type) {
case KeyPress:
@@ -1577,10 +1577,12 @@ PrivateScaleScreen::handleEvent (XEvent *event)
switch (event->type) {
case UnmapNotify:
- windowRemove (w);
+ if (w)
+ windowRemove (w);
break;
case DestroyNotify:
- windowRemove (w);
+ if (w)
+ windowRemove (w);
break;
}
}