aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2017-12-10 23:57:35 +0100
committerMihai Moldovan <ionic@ionic.de>2017-12-28 00:17:54 +0100
commit6acbfab33133a92dbd7f128284d26f94bfeb1af2 (patch)
treea270c581d3268b20ef8527cffeb8ad91b26b9cf7 /nx-X11/programs/Xserver/hw/nxagent/NXwindow.c
parentbc5f9a2363cb865fa1a8a1427d9320514e7d1889 (diff)
downloadnx-libs-6acbfab33133a92dbd7f128284d26f94bfeb1af2.tar.gz
nx-libs-6acbfab33133a92dbd7f128284d26f94bfeb1af2.tar.bz2
nx-libs-6acbfab33133a92dbd7f128284d26f94bfeb1af2.zip
reduce usage of uninitialised bytes
as reported by valgrind
Diffstat (limited to 'nx-X11/programs/Xserver/hw/nxagent/NXwindow.c')
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/NXwindow.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c b/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c
index 44d398304..5df252d34 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c
@@ -310,7 +310,6 @@ DeleteWindow(void * value, XID wid)
{
register WindowPtr pParent;
register WindowPtr pWin = (WindowPtr)value;
- xEvent event;
UnmapWindow(pWin, FALSE);
@@ -319,7 +318,7 @@ DeleteWindow(void * value, XID wid)
pParent = pWin->parent;
if (wid && pParent && SubStrSend(pWin, pParent))
{
- memset(&event, 0, sizeof(xEvent));
+ xEvent event = {0};
event.u.u.type = DestroyNotify;
event.u.destroyNotify.window = pWin->drawable.id;
DeliverEvents(pWin, &event, 1, NullWindow);
@@ -371,8 +370,7 @@ ResizeChildrenWinSize(register WindowPtr pWin, int dx, int dy, int dw, int dh)
pSib->winGravity, &cwsx, &cwsy);
if (cwsx != pSib->origin.x || cwsy != pSib->origin.y)
{
- xEvent event;
-
+ xEvent event = {0};
event.u.u.type = GravityNotify;
event.u.gravity.window = pSib->drawable.id;
event.u.gravity.x = cwsx - wBorderWidth (pSib);
@@ -450,7 +448,7 @@ ConfigureWindow(register WindowPtr pWin, register Mask mask, XID *vlist, ClientP
h = pWin->drawable.height,
bw = pWin->borderWidth;
int action, smode = Above;
- xEvent event;
+ xEvent event = {0};
if ((pWin->drawable.class == InputOnly) && (mask & IllegalInputOnlyConfigureMask))
return(BadMatch);
@@ -607,8 +605,7 @@ ConfigureWindow(register WindowPtr pWin, register Mask mask, XID *vlist, ClientP
|| (h != pWin->drawable.height);
if (size_change && ((pWin->eventMask|wOtherEventMasks(pWin)) & ResizeRedirectMask))
{
- xEvent eventT;
- memset(&eventT, 0, sizeof(xEvent));
+ xEvent eventT = {0};
eventT.u.u.type = ResizeRequest;
eventT.u.resizeRequest.window = pWin->drawable.id;
eventT.u.resizeRequest.width = w;
@@ -723,7 +720,7 @@ ReparentWindow(register WindowPtr pWin, register WindowPtr pParent,
{
WindowPtr pPrev, pPriorParent;
Bool WasMapped = (Bool)(pWin->mapped);
- xEvent event;
+ xEvent event = {0};
int bw = wBorderWidth (pWin);
register ScreenPtr pScreen;
@@ -736,7 +733,6 @@ ReparentWindow(register WindowPtr pWin, register WindowPtr pParent,
if (WasMapped)
UnmapWindow(pWin, FALSE);
- memset(&event, 0, sizeof(xEvent));
event.u.u.type = ReparentNotify;
event.u.reparent.window = pWin->drawable.id;
event.u.reparent.parent = pParent->drawable.id;
@@ -949,7 +945,6 @@ int
UnmapWindow(register WindowPtr pWin, Bool fromConfigure)
{
register WindowPtr pParent;
- xEvent event;
Bool wasRealized = (Bool)pWin->realized;
Bool wasViewable = (Bool)pWin->viewable;
ScreenPtr pScreen = pWin->drawable.pScreen;
@@ -967,7 +962,7 @@ UnmapWindow(register WindowPtr pWin, Bool fromConfigure)
return(Success);
if (SubStrSend(pWin, pParent))
{
- memset(&event, 0, sizeof(xEvent));
+ xEvent event = {0};
event.u.u.type = UnmapNotify;
event.u.unmapNotify.window = pWin->drawable.id;
event.u.unmapNotify.fromConfigure = fromConfigure;