Unverified Commit 061c3577 authored by Mihai Moldovan's avatar Mihai Moldovan

Merge branch 'uli42-pr/reduce_uninitialised' into 3.6.x

parents bc5f9a23 6acbfab3
...@@ -510,7 +510,7 @@ int DoMakeCurrent( __GLXclientState *cl, ...@@ -510,7 +510,7 @@ int DoMakeCurrent( __GLXclientState *cl,
ClientPtr client = cl->client; ClientPtr client = cl->client;
DrawablePtr pDraw; DrawablePtr pDraw;
DrawablePtr pRead; DrawablePtr pRead;
xGLXMakeCurrentReply reply; xGLXMakeCurrentReply reply = {0};
__GLXpixmap *drawPixmap = NULL; __GLXpixmap *drawPixmap = NULL;
__GLXpixmap *readPixmap = NULL; __GLXpixmap *readPixmap = NULL;
__GLXcontext *glxc, *prevglxc; __GLXcontext *glxc, *prevglxc;
...@@ -745,7 +745,7 @@ int __glXIsDirect(__GLXclientState *cl, GLbyte *pc) ...@@ -745,7 +745,7 @@ int __glXIsDirect(__GLXclientState *cl, GLbyte *pc)
{ {
ClientPtr client = cl->client; ClientPtr client = cl->client;
xGLXIsDirectReq *req = (xGLXIsDirectReq *) pc; xGLXIsDirectReq *req = (xGLXIsDirectReq *) pc;
xGLXIsDirectReply reply; xGLXIsDirectReply reply = {0};
__GLXcontext *glxc; __GLXcontext *glxc;
/* /*
...@@ -775,7 +775,7 @@ int __glXQueryVersion(__GLXclientState *cl, GLbyte *pc) ...@@ -775,7 +775,7 @@ int __glXQueryVersion(__GLXclientState *cl, GLbyte *pc)
{ {
ClientPtr client = cl->client; ClientPtr client = cl->client;
xGLXQueryVersionReq *req = (xGLXQueryVersionReq *) pc; xGLXQueryVersionReq *req = (xGLXQueryVersionReq *) pc;
xGLXQueryVersionReply reply; xGLXQueryVersionReply reply = {0};
GLuint major, minor; GLuint major, minor;
major = req->majorVersion; major = req->majorVersion;
...@@ -921,10 +921,10 @@ int DoGetVisualConfigs(__GLXclientState *cl, unsigned screen, ...@@ -921,10 +921,10 @@ int DoGetVisualConfigs(__GLXclientState *cl, unsigned screen,
GLboolean do_swap) GLboolean do_swap)
{ {
ClientPtr client = cl->client; ClientPtr client = cl->client;
xGLXGetVisualConfigsReply reply; xGLXGetVisualConfigsReply reply = {0};
__GLXscreenInfo *pGlxScreen; __GLXscreenInfo *pGlxScreen;
__GLcontextModes *modes; __GLcontextModes *modes;
CARD32 buf[__GLX_TOTAL_CONFIG]; CARD32 buf[__GLX_TOTAL_CONFIG] = {0};
int p; int p;
__GLX_DECLARE_SWAP_VARIABLES; __GLX_DECLARE_SWAP_VARIABLES;
__GLX_DECLARE_SWAP_ARRAY_VARIABLES; __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
...@@ -1029,7 +1029,7 @@ int __glXGetVisualConfigs(__GLXclientState *cl, GLbyte *pc) ...@@ -1029,7 +1029,7 @@ int __glXGetVisualConfigs(__GLXclientState *cl, GLbyte *pc)
int DoGetFBConfigs(__GLXclientState *cl, unsigned screen, GLboolean do_swap) int DoGetFBConfigs(__GLXclientState *cl, unsigned screen, GLboolean do_swap)
{ {
ClientPtr client = cl->client; ClientPtr client = cl->client;
xGLXGetFBConfigsReply reply; xGLXGetFBConfigsReply reply = {0};
__GLXscreenInfo *pGlxScreen; __GLXscreenInfo *pGlxScreen;
CARD32 buf[__GLX_FBCONFIG_ATTRIBS_LENGTH]; CARD32 buf[__GLX_FBCONFIG_ATTRIBS_LENGTH];
int p; int p;
...@@ -1365,7 +1365,7 @@ int __glXQueryContextInfoEXT(__GLXclientState *cl, GLbyte *pc) ...@@ -1365,7 +1365,7 @@ int __glXQueryContextInfoEXT(__GLXclientState *cl, GLbyte *pc)
ClientPtr client = cl->client; ClientPtr client = cl->client;
__GLXcontext *ctx; __GLXcontext *ctx;
xGLXQueryContextInfoEXTReq *req; xGLXQueryContextInfoEXTReq *req;
xGLXQueryContextInfoEXTReply reply; xGLXQueryContextInfoEXTReply reply = {0};
int nProps; int nProps;
int *sendBuf, *pSendBuf; int *sendBuf, *pSendBuf;
int nReplyBytes; int nReplyBytes;
...@@ -1780,7 +1780,7 @@ static int __glXQueryMaxSwapBarriersSGIX(__GLXclientState *cl, GLbyte *pc) ...@@ -1780,7 +1780,7 @@ static int __glXQueryMaxSwapBarriersSGIX(__GLXclientState *cl, GLbyte *pc)
ClientPtr client = cl->client; ClientPtr client = cl->client;
xGLXQueryMaxSwapBarriersSGIXReq *req = xGLXQueryMaxSwapBarriersSGIXReq *req =
(xGLXQueryMaxSwapBarriersSGIXReq *) pc; (xGLXQueryMaxSwapBarriersSGIXReq *) pc;
xGLXQueryMaxSwapBarriersSGIXReply reply; xGLXQueryMaxSwapBarriersSGIXReply reply = {0};
int screen = req->screen; int screen = req->screen;
if (__glXSwapBarrierFuncs && if (__glXSwapBarrierFuncs &&
...@@ -1810,7 +1810,7 @@ static int __glxQueryHyperpipeNetworkSGIX(__GLXclientState *cl, GLbyte *pc) ...@@ -1810,7 +1810,7 @@ static int __glxQueryHyperpipeNetworkSGIX(__GLXclientState *cl, GLbyte *pc)
{ {
ClientPtr client = cl->client; ClientPtr client = cl->client;
xGLXQueryHyperpipeNetworkSGIXReq * req = (xGLXQueryHyperpipeNetworkSGIXReq *) pc; xGLXQueryHyperpipeNetworkSGIXReq * req = (xGLXQueryHyperpipeNetworkSGIXReq *) pc;
xGLXQueryHyperpipeNetworkSGIXReply reply; xGLXQueryHyperpipeNetworkSGIXReply reply = {0};
int screen = req->screen; int screen = req->screen;
void *rdata = NULL; void *rdata = NULL;
...@@ -1851,7 +1851,7 @@ static int __glxDestroyHyperpipeConfigSGIX (__GLXclientState *cl, GLbyte *pc) ...@@ -1851,7 +1851,7 @@ static int __glxDestroyHyperpipeConfigSGIX (__GLXclientState *cl, GLbyte *pc)
ClientPtr client = cl->client; ClientPtr client = cl->client;
xGLXDestroyHyperpipeConfigSGIXReq * req = xGLXDestroyHyperpipeConfigSGIXReq * req =
(xGLXDestroyHyperpipeConfigSGIXReq *) pc; (xGLXDestroyHyperpipeConfigSGIXReq *) pc;
xGLXDestroyHyperpipeConfigSGIXReply reply; xGLXDestroyHyperpipeConfigSGIXReply reply = {0};
int screen = req->screen; int screen = req->screen;
int success = GLX_BAD_HYPERPIPE_SGIX; int success = GLX_BAD_HYPERPIPE_SGIX;
int hpId ; int hpId ;
...@@ -1886,7 +1886,7 @@ static int __glxQueryHyperpipeConfigSGIX(__GLXclientState *cl, GLbyte *pc) ...@@ -1886,7 +1886,7 @@ static int __glxQueryHyperpipeConfigSGIX(__GLXclientState *cl, GLbyte *pc)
ClientPtr client = cl->client; ClientPtr client = cl->client;
xGLXQueryHyperpipeConfigSGIXReq * req = xGLXQueryHyperpipeConfigSGIXReq * req =
(xGLXQueryHyperpipeConfigSGIXReq *) pc; (xGLXQueryHyperpipeConfigSGIXReq *) pc;
xGLXQueryHyperpipeConfigSGIXReply reply; xGLXQueryHyperpipeConfigSGIXReply reply = {0};
int screen = req->screen; int screen = req->screen;
void *rdata = NULL; void *rdata = NULL;
int length; int length;
...@@ -1930,7 +1930,7 @@ static int __glxHyperpipeConfigSGIX(__GLXclientState *cl, GLbyte *pc) ...@@ -1930,7 +1930,7 @@ static int __glxHyperpipeConfigSGIX(__GLXclientState *cl, GLbyte *pc)
ClientPtr client = cl->client; ClientPtr client = cl->client;
xGLXHyperpipeConfigSGIXReq * req = xGLXHyperpipeConfigSGIXReq * req =
(xGLXHyperpipeConfigSGIXReq *) pc; (xGLXHyperpipeConfigSGIXReq *) pc;
xGLXHyperpipeConfigSGIXReply reply; xGLXHyperpipeConfigSGIXReply reply = {0};
int screen = req->screen; int screen = req->screen;
void *rdata; void *rdata;
...@@ -2059,7 +2059,7 @@ int __glXQueryExtensionsString(__GLXclientState *cl, GLbyte *pc) ...@@ -2059,7 +2059,7 @@ int __glXQueryExtensionsString(__GLXclientState *cl, GLbyte *pc)
{ {
ClientPtr client = cl->client; ClientPtr client = cl->client;
xGLXQueryExtensionsStringReq *req = (xGLXQueryExtensionsStringReq *) pc; xGLXQueryExtensionsStringReq *req = (xGLXQueryExtensionsStringReq *) pc;
xGLXQueryExtensionsStringReply reply; xGLXQueryExtensionsStringReply reply = {0};
GLuint screen; GLuint screen;
size_t n, length; size_t n, length;
const char *ptr; const char *ptr;
...@@ -2104,7 +2104,7 @@ int __glXQueryServerString(__GLXclientState *cl, GLbyte *pc) ...@@ -2104,7 +2104,7 @@ int __glXQueryServerString(__GLXclientState *cl, GLbyte *pc)
{ {
ClientPtr client = cl->client; ClientPtr client = cl->client;
xGLXQueryServerStringReq *req = (xGLXQueryServerStringReq *) pc; xGLXQueryServerStringReq *req = (xGLXQueryServerStringReq *) pc;
xGLXQueryServerStringReply reply; xGLXQueryServerStringReply reply = {0};
int name; int name;
GLuint screen; GLuint screen;
size_t n, length; size_t n, length;
......
...@@ -101,7 +101,7 @@ ProcDPMSGetVersion(client) ...@@ -101,7 +101,7 @@ ProcDPMSGetVersion(client)
register ClientPtr client; register ClientPtr client;
{ {
/* REQUEST(xDPMSGetVersionReq); */ /* REQUEST(xDPMSGetVersionReq); */
xDPMSGetVersionReply rep; xDPMSGetVersionReply rep = {0};
REQUEST_SIZE_MATCH(xDPMSGetVersionReq); REQUEST_SIZE_MATCH(xDPMSGetVersionReq);
...@@ -123,7 +123,7 @@ static int ...@@ -123,7 +123,7 @@ static int
ProcDPMSCapable(register ClientPtr client) ProcDPMSCapable(register ClientPtr client)
{ {
/* REQUEST(xDPMSCapableReq); */ /* REQUEST(xDPMSCapableReq); */
xDPMSCapableReply rep; xDPMSCapableReply rep = {0};
REQUEST_SIZE_MATCH(xDPMSCapableReq); REQUEST_SIZE_MATCH(xDPMSCapableReq);
...@@ -144,7 +144,7 @@ ProcDPMSGetTimeouts(client) ...@@ -144,7 +144,7 @@ ProcDPMSGetTimeouts(client)
register ClientPtr client; register ClientPtr client;
{ {
/* REQUEST(xDPMSGetTimeoutsReq); */ /* REQUEST(xDPMSGetTimeoutsReq); */
xDPMSGetTimeoutsReply rep; xDPMSGetTimeoutsReply rep = {0};
REQUEST_SIZE_MATCH(xDPMSGetTimeoutsReq); REQUEST_SIZE_MATCH(xDPMSGetTimeoutsReq);
...@@ -258,7 +258,7 @@ static int ...@@ -258,7 +258,7 @@ static int
ProcDPMSInfo(register ClientPtr client) ProcDPMSInfo(register ClientPtr client)
{ {
/* REQUEST(xDPMSInfoReq); */ /* REQUEST(xDPMSInfoReq); */
xDPMSInfoReply rep; xDPMSInfoReply rep = {0};
REQUEST_SIZE_MATCH(xDPMSInfoReq); REQUEST_SIZE_MATCH(xDPMSInfoReq);
......
...@@ -266,7 +266,7 @@ RegionPtr ...@@ -266,7 +266,7 @@ RegionPtr
CreateBoundingShape (pWin) CreateBoundingShape (pWin)
WindowPtr pWin; WindowPtr pWin;
{ {
BoxRec extents; BoxRec extents = {0};
extents.x1 = -wBorderWidth (pWin); extents.x1 = -wBorderWidth (pWin);
extents.y1 = -wBorderWidth (pWin); extents.y1 = -wBorderWidth (pWin);
...@@ -279,7 +279,7 @@ RegionPtr ...@@ -279,7 +279,7 @@ RegionPtr
CreateClipShape (pWin) CreateClipShape (pWin)
WindowPtr pWin; WindowPtr pWin;
{ {
BoxRec extents; BoxRec extents = {0};
extents.x1 = 0; extents.x1 = 0;
extents.y1 = 0; extents.y1 = 0;
...@@ -292,7 +292,7 @@ static int ...@@ -292,7 +292,7 @@ static int
ProcShapeQueryVersion (client) ProcShapeQueryVersion (client)
register ClientPtr client; register ClientPtr client;
{ {
xShapeQueryVersionReply rep; xShapeQueryVersionReply rep = {0};
REQUEST_SIZE_MATCH (xShapeQueryVersionReq); REQUEST_SIZE_MATCH (xShapeQueryVersionReq);
memset(&rep, 0, sizeof(xShapeQueryVersionReply)); memset(&rep, 0, sizeof(xShapeQueryVersionReply));
...@@ -713,8 +713,8 @@ ProcShapeQueryExtents (client) ...@@ -713,8 +713,8 @@ ProcShapeQueryExtents (client)
{ {
REQUEST(xShapeQueryExtentsReq); REQUEST(xShapeQueryExtentsReq);
WindowPtr pWin; WindowPtr pWin;
xShapeQueryExtentsReply rep; xShapeQueryExtentsReply rep = {0};
BoxRec extents, *pExtents; BoxRec extents = {0}, *pExtents;
RegionPtr region; RegionPtr region;
REQUEST_SIZE_MATCH (xShapeQueryExtentsReq); REQUEST_SIZE_MATCH (xShapeQueryExtentsReq);
...@@ -919,8 +919,8 @@ SendShapeNotify (pWin, which) ...@@ -919,8 +919,8 @@ SendShapeNotify (pWin, which)
int which; int which;
{ {
ShapeEventPtr *pHead, pShapeEvent; ShapeEventPtr *pHead, pShapeEvent;
xShapeNotifyEvent se; xShapeNotifyEvent se = {0};
BoxRec extents; BoxRec extents = {0};
RegionPtr region; RegionPtr region;
BYTE shaped; BYTE shaped;
...@@ -992,7 +992,7 @@ ProcShapeInputSelected (client) ...@@ -992,7 +992,7 @@ ProcShapeInputSelected (client)
WindowPtr pWin; WindowPtr pWin;
ShapeEventPtr pShapeEvent, *pHead; ShapeEventPtr pShapeEvent, *pHead;
int enabled; int enabled;
xShapeInputSelectedReply rep; xShapeInputSelectedReply rep = {0};
REQUEST_SIZE_MATCH (xShapeInputSelectedReq); REQUEST_SIZE_MATCH (xShapeInputSelectedReq);
pWin = LookupWindow (stuff->window, client); pWin = LookupWindow (stuff->window, client);
...@@ -1030,7 +1030,7 @@ ProcShapeGetRectangles (client) ...@@ -1030,7 +1030,7 @@ ProcShapeGetRectangles (client)
{ {
REQUEST(xShapeGetRectanglesReq); REQUEST(xShapeGetRectanglesReq);
WindowPtr pWin; WindowPtr pWin;
xShapeGetRectanglesReply rep; xShapeGetRectanglesReply rep = {0};
xRectangle *rects; xRectangle *rects;
int nrects, i; int nrects, i;
RegionPtr region; RegionPtr region;
......
...@@ -111,7 +111,7 @@ static int ...@@ -111,7 +111,7 @@ static int
ProcXTestGetVersion(client) ProcXTestGetVersion(client)
register ClientPtr client; register ClientPtr client;
{ {
xXTestGetVersionReply rep; xXTestGetVersionReply rep = {0};
REQUEST_SIZE_MATCH(xXTestGetVersionReq); REQUEST_SIZE_MATCH(xXTestGetVersionReq);
rep.type = X_Reply; rep.type = X_Reply;
...@@ -132,7 +132,7 @@ ProcXTestCompareCursor(client) ...@@ -132,7 +132,7 @@ ProcXTestCompareCursor(client)
register ClientPtr client; register ClientPtr client;
{ {
REQUEST(xXTestCompareCursorReq); REQUEST(xXTestCompareCursorReq);
xXTestCompareCursorReply rep; xXTestCompareCursorReply rep = {0};
WindowPtr pWin; WindowPtr pWin;
CursorPtr pCursor; CursorPtr pCursor;
......
...@@ -474,7 +474,7 @@ FreeColormap (void * value, XID mid) ...@@ -474,7 +474,7 @@ FreeColormap (void * value, XID mid)
static int static int
TellNoMap (WindowPtr pwin, Colormap *pmid) TellNoMap (WindowPtr pwin, Colormap *pmid)
{ {
xEvent xE; xEvent xE = {0};
if (wColormap(pwin) == *pmid) if (wColormap(pwin) == *pmid)
{ {
...@@ -502,7 +502,7 @@ int ...@@ -502,7 +502,7 @@ int
TellLostMap (WindowPtr pwin, void * value) TellLostMap (WindowPtr pwin, void * value)
{ {
Colormap *pmid = (Colormap *)value; Colormap *pmid = (Colormap *)value;
xEvent xE; xEvent xE = {0};
#ifdef PANORAMIX #ifdef PANORAMIX
if(!noPanoramiXExtension && pwin->drawable.pScreen->myNum) if(!noPanoramiXExtension && pwin->drawable.pScreen->myNum)
...@@ -527,7 +527,7 @@ int ...@@ -527,7 +527,7 @@ int
TellGainedMap (WindowPtr pwin, void * value) TellGainedMap (WindowPtr pwin, void * value)
{ {
Colormap *pmid = (Colormap *)value; Colormap *pmid = (Colormap *)value;
xEvent xE; xEvent xE = {0};
#ifdef PANORAMIX #ifdef PANORAMIX
if(!noPanoramiXExtension && pwin->drawable.pScreen->myNum) if(!noPanoramiXExtension && pwin->drawable.pScreen->myNum)
......
...@@ -1158,7 +1158,8 @@ ProcGetKeyboardMapping(ClientPtr client) ...@@ -1158,7 +1158,8 @@ ProcGetKeyboardMapping(ClientPtr client)
int int
ProcGetPointerMapping(ClientPtr client) ProcGetPointerMapping(ClientPtr client)
{ {
xGetPointerMappingReply rep; xGetPointerMappingReply rep = {0};
ButtonClassPtr butc = inputInfo.pointer->button; ButtonClassPtr butc = inputInfo.pointer->button;
REQUEST_SIZE_MATCH(xReq); REQUEST_SIZE_MATCH(xReq);
......
...@@ -806,7 +806,7 @@ GetGeometry(register ClientPtr client, xGetGeometryReply *rep) ...@@ -806,7 +806,7 @@ GetGeometry(register ClientPtr client, xGetGeometryReply *rep)
int int
ProcGetGeometry(register ClientPtr client) ProcGetGeometry(register ClientPtr client)
{ {
xGetGeometryReply rep; xGetGeometryReply rep = {0};
int status; int status;
if ((status = GetGeometry(client, &rep)) != Success) if ((status = GetGeometry(client, &rep)) != Success)
...@@ -821,7 +821,7 @@ ProcGetGeometry(register ClientPtr client) ...@@ -821,7 +821,7 @@ ProcGetGeometry(register ClientPtr client)
int int
ProcQueryTree(register ClientPtr client) ProcQueryTree(register ClientPtr client)
{ {
xQueryTreeReply reply; xQueryTreeReply reply = {0};
int numChildren = 0; int numChildren = 0;
register WindowPtr pChild, pWin, pHead; register WindowPtr pChild, pWin, pHead;
Window *childIDs = (Window *)NULL; Window *childIDs = (Window *)NULL;
...@@ -832,7 +832,6 @@ ProcQueryTree(register ClientPtr client) ...@@ -832,7 +832,6 @@ ProcQueryTree(register ClientPtr client)
DixReadAccess); DixReadAccess);
if (!pWin) if (!pWin)
return(BadWindow); return(BadWindow);
memset(&reply, 0, sizeof(xQueryTreeReply));
reply.type = X_Reply; reply.type = X_Reply;
reply.root = pWin->drawable.pScreen->root->drawable.id; reply.root = pWin->drawable.pScreen->root->drawable.id;
reply.sequenceNumber = client->sequence; reply.sequenceNumber = client->sequence;
...@@ -887,8 +886,7 @@ ProcInternAtom(register ClientPtr client) ...@@ -887,8 +886,7 @@ ProcInternAtom(register ClientPtr client)
atom = MakeAtom(tchar, stuff->nbytes, !stuff->onlyIfExists); atom = MakeAtom(tchar, stuff->nbytes, !stuff->onlyIfExists);
if (atom != BAD_RESOURCE) if (atom != BAD_RESOURCE)
{ {
xInternAtomReply reply; xInternAtomReply reply = {0};
memset(&reply, 0, sizeof(xInternAtomReply));
reply.type = X_Reply; reply.type = X_Reply;
reply.length = 0; reply.length = 0;
reply.sequenceNumber = client->sequence; reply.sequenceNumber = client->sequence;
...@@ -904,15 +902,14 @@ int ...@@ -904,15 +902,14 @@ int
ProcGetAtomName(register ClientPtr client) ProcGetAtomName(register ClientPtr client)
{ {
const char *str; const char *str;
xGetAtomNameReply reply;
int len; int len;
REQUEST(xResourceReq); REQUEST(xResourceReq);
REQUEST_SIZE_MATCH(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq);
if ( (str = NameForAtom(stuff->id)) ) if ( (str = NameForAtom(stuff->id)) )
{ {
xGetAtomNameReply reply = {0};
len = strlen(str); len = strlen(str);
memset(&reply, 0, sizeof(xGetAtomNameReply));
reply.type = X_Reply; reply.type = X_Reply;
reply.length = (len + 3) >> 2; reply.length = (len + 3) >> 2;
reply.sequenceNumber = client->sequence; reply.sequenceNumber = client->sequence;
...@@ -965,8 +962,6 @@ ProcSetSelectionOwner(register ClientPtr client) ...@@ -965,8 +962,6 @@ ProcSetSelectionOwner(register ClientPtr client)
i++; i++;
if (i < NumCurrentSelections) if (i < NumCurrentSelections)
{ {
xEvent event;
/* If the timestamp in client's request is in the past relative /* If the timestamp in client's request is in the past relative
to the time stamp indicating the last time the owner of the to the time stamp indicating the last time the owner of the
selection was set, do not set the selection, just return selection was set, do not set the selection, just return
...@@ -977,6 +972,7 @@ ProcSetSelectionOwner(register ClientPtr client) ...@@ -977,6 +972,7 @@ ProcSetSelectionOwner(register ClientPtr client)
if (CurrentSelections[i].client && if (CurrentSelections[i].client &&
(!pWin || (CurrentSelections[i].client != client))) (!pWin || (CurrentSelections[i].client != client)))
{ {
xEvent event = {0};
event.u.u.type = SelectionClear; event.u.u.type = SelectionClear;
event.u.selectionClear.time = time.milliseconds; event.u.selectionClear.time = time.milliseconds;
event.u.selectionClear.window = CurrentSelections[i].window; event.u.selectionClear.window = CurrentSelections[i].window;
...@@ -1010,7 +1006,7 @@ ProcSetSelectionOwner(register ClientPtr client) ...@@ -1010,7 +1006,7 @@ ProcSetSelectionOwner(register ClientPtr client)
CurrentSelections[i].client = (pWin ? client : NullClient); CurrentSelections[i].client = (pWin ? client : NullClient);
if (SelectionCallback) if (SelectionCallback)
{ {
SelectionInfoRec info; SelectionInfoRec info = {0};
info.selection = &CurrentSelections[i]; info.selection = &CurrentSelections[i];
info.kind= SelectionSetOwner; info.kind= SelectionSetOwner;
...@@ -1144,7 +1140,7 @@ ProcGrabServer(register ClientPtr client) ...@@ -1144,7 +1140,7 @@ ProcGrabServer(register ClientPtr client)
if (ServerGrabCallback) if (ServerGrabCallback)
{ {
ServerGrabInfoRec grabinfo; ServerGrabInfoRec grabinfo = {0};
grabinfo.client = client; grabinfo.client = client;
grabinfo.grabstate = SERVER_GRABBED; grabinfo.grabstate = SERVER_GRABBED;
CallCallbacks(&ServerGrabCallback, (void *)&grabinfo); CallCallbacks(&ServerGrabCallback, (void *)&grabinfo);
...@@ -1173,7 +1169,7 @@ UngrabServer(ClientPtr client) ...@@ -1173,7 +1169,7 @@ UngrabServer(ClientPtr client)
if (ServerGrabCallback) if (ServerGrabCallback)
{ {
ServerGrabInfoRec grabinfo; ServerGrabInfoRec grabinfo = {0};
grabinfo.client = client; grabinfo.client = client;
grabinfo.grabstate = SERVER_UNGRABBED; grabinfo.grabstate = SERVER_UNGRABBED;
CallCallbacks(&ServerGrabCallback, (void *)&grabinfo); CallCallbacks(&ServerGrabCallback, (void *)&grabinfo);
...@@ -1194,7 +1190,7 @@ ProcTranslateCoords(register ClientPtr client) ...@@ -1194,7 +1190,7 @@ ProcTranslateCoords(register ClientPtr client)
REQUEST(xTranslateCoordsReq); REQUEST(xTranslateCoordsReq);
register WindowPtr pWin, pDst; register WindowPtr pWin, pDst;
xTranslateCoordsReply rep; xTranslateCoordsReply rep = {0};
REQUEST_SIZE_MATCH(xTranslateCoordsReq); REQUEST_SIZE_MATCH(xTranslateCoordsReq);
pWin = (WindowPtr)SecurityLookupWindow(stuff->srcWid, client, pWin = (WindowPtr)SecurityLookupWindow(stuff->srcWid, client,
...@@ -1205,7 +1201,6 @@ ProcTranslateCoords(register ClientPtr client) ...@@ -1205,7 +1201,6 @@ ProcTranslateCoords(register ClientPtr client)
DixReadAccess); DixReadAccess);
if (!pDst) if (!pDst)
return(BadWindow); return(BadWindow);
memset(&rep, 0, sizeof(xTranslateCoordsReply));
rep.type = X_Reply; rep.type = X_Reply;
rep.length = 0; rep.length = 0;
rep.sequenceNumber = client->sequence; rep.sequenceNumber = client->sequence;
...@@ -1227,7 +1222,7 @@ ProcTranslateCoords(register ClientPtr client) ...@@ -1227,7 +1222,7 @@ ProcTranslateCoords(register ClientPtr client)
while (pWin) while (pWin)
{ {
#ifdef SHAPE #ifdef SHAPE
BoxRec box; BoxRec box = {0};
#endif #endif
if ((pWin->mapped) && if ((pWin->mapped) &&
(x >= pWin->drawable.x - wBorderWidth (pWin)) && (x >= pWin->drawable.x - wBorderWidth (pWin)) &&
...@@ -1353,13 +1348,12 @@ ProcQueryFont(register ClientPtr client) ...@@ -1353,13 +1348,12 @@ ProcQueryFont(register ClientPtr client)
FONTINFONPROPS(FONTCHARSET(pFont)) * sizeof(xFontProp) + FONTINFONPROPS(FONTCHARSET(pFont)) * sizeof(xFontProp) +
nprotoxcistructs * sizeof(xCharInfo); nprotoxcistructs * sizeof(xCharInfo);
reply = (xQueryFontReply *)malloc(rlength); reply = (xQueryFontReply *)calloc(1, rlength);
if(!reply) if(!reply)
{ {
return(BadAlloc); return(BadAlloc);
} }
memset(reply, 0, rlength);
reply->type = X_Reply; reply->type = X_Reply;
reply->length = (rlength - sizeof(xGenericReply)) >> 2; reply->length = (rlength - sizeof(xGenericReply)) >> 2;
reply->sequenceNumber = client->sequence; reply->sequenceNumber = client->sequence;
...@@ -1375,7 +1369,7 @@ int ...@@ -1375,7 +1369,7 @@ int
ProcQueryTextExtents(register ClientPtr client) ProcQueryTextExtents(register ClientPtr client)
{ {
REQUEST(xQueryTextExtentsReq); REQUEST(xQueryTextExtentsReq);
xQueryTextExtentsReply reply; xQueryTextExtentsReply reply = {0};
FontPtr pFont; FontPtr pFont;
GC *pGC; GC *pGC;
ExtentInfoRec info; ExtentInfoRec info;
...@@ -2099,7 +2093,7 @@ DoGetImage(register ClientPtr client, int format, Drawable drawable, ...@@ -2099,7 +2093,7 @@ DoGetImage(register ClientPtr client, int format, Drawable drawable,
long widthBytesLine, length; long widthBytesLine, length;
Mask plane = 0; Mask plane = 0;
char *pBuf; char *pBuf;
xGetImageReply xgi; xGetImageReply xgi = {0};
#ifdef XCSECURITY #ifdef XCSECURITY
RegionPtr pVisibleRegion = NULL; RegionPtr pVisibleRegion = NULL;
#endif #endif
...@@ -2111,7 +2105,6 @@ DoGetImage(register ClientPtr client, int format, Drawable drawable, ...@@ -2111,7 +2105,6 @@ DoGetImage(register ClientPtr client, int format, Drawable drawable,
} }
SECURITY_VERIFY_DRAWABLE(pDraw, drawable, client, DixReadAccess); SECURITY_VERIFY_DRAWABLE(pDraw, drawable, client, DixReadAccess);
memset(&xgi, 0, sizeof(xGetImageReply));
if(pDraw->type == DRAWABLE_WINDOW) if(pDraw->type == DRAWABLE_WINDOW)
{ {
if( /* check for being viewable */ if( /* check for being viewable */
...@@ -2597,7 +2590,7 @@ ProcAllocColor (register ClientPtr client) ...@@ -2597,7 +2590,7 @@ ProcAllocColor (register ClientPtr client)
{ {
ColormapPtr pmap; ColormapPtr pmap;
int retval; int retval;
xAllocColorReply acr; xAllocColorReply acr = {0};
REQUEST(xAllocColorReq); REQUEST(xAllocColorReq);
REQUEST_SIZE_MATCH(xAllocColorReq); REQUEST_SIZE_MATCH(xAllocColorReq);
...@@ -2605,7 +2598,6 @@ ProcAllocColor (register ClientPtr client) ...@@ -2605,7 +2598,6 @@ ProcAllocColor (register ClientPtr client)
RT_COLORMAP, DixWriteAccess); RT_COLORMAP, DixWriteAccess);
if (pmap) if (pmap)
{ {
memset(&acr, 0, sizeof(xAllocColorReply));
acr.type = X_Reply; acr.type = X_Reply;
acr.length = 0; acr.length = 0;
acr.sequenceNumber = client->sequence; acr.sequenceNumber = client->sequence;
...@@ -2648,7 +2640,7 @@ ProcAllocNamedColor (register ClientPtr client) ...@@ -2648,7 +2640,7 @@ ProcAllocNamedColor (register ClientPtr client)
{ {
int retval; int retval;
xAllocNamedColorReply ancr; xAllocNamedColorReply ancr = {0};
ancr.type = X_Reply; ancr.type = X_Reply;
ancr.length = 0; ancr.length = 0;
...@@ -2698,7 +2690,7 @@ ProcAllocColorCells (register ClientPtr client) ...@@ -2698,7 +2690,7 @@ ProcAllocColorCells (register ClientPtr client)
RT_COLORMAP, DixWriteAccess); RT_COLORMAP, DixWriteAccess);
if (pcmp) if (pcmp)
{ {
xAllocColorCellsReply accr; xAllocColorCellsReply accr = {0};
int npixels, nmasks, retval; int npixels, nmasks, retval;
long length; long length;
Pixel *ppixels, *pmasks; Pixel *ppixels, *pmasks;
...@@ -2764,7 +2756,7 @@ ProcAllocColorPlanes(register ClientPtr client) ...@@ -2764,7 +2756,7 @@ ProcAllocColorPlanes(register ClientPtr client)
RT_COLORMAP, DixWriteAccess); RT_COLORMAP, DixWriteAccess);
if (pcmp) if (pcmp)
{ {
xAllocColorPlanesReply acpr; xAllocColorPlanesReply acpr = {0};
int npixels, retval; int npixels, retval;
long length; long length;
Pixel *ppixels; Pixel *ppixels;
...@@ -2897,7 +2889,7 @@ ProcStoreNamedColor (register ClientPtr client) ...@@ -2897,7 +2889,7 @@ ProcStoreNamedColor (register ClientPtr client)
RT_COLORMAP, DixWriteAccess); RT_COLORMAP, DixWriteAccess);
if (pcmp) if (pcmp)
{ {
xColorItem def; xColorItem def = {0};
int retval; int retval;
if(OsLookupColor(pcmp->pScreen->myNum, (char *)&stuff[1], if(OsLookupColor(pcmp->pScreen->myNum, (char *)&stuff[1],
...@@ -2933,7 +2925,7 @@ ProcQueryColors(register ClientPtr client) ...@@ -2933,7 +2925,7 @@ ProcQueryColors(register ClientPtr client)
{ {
int count, retval; int count, retval;
xrgb *prgbs; xrgb *prgbs;
xQueryColorsReply qcr; xQueryColorsReply qcr = {0};
count = ((client->req_len << 2) - sizeof(xQueryColorsReq)) >> 2; count = ((client->req_len << 2) - sizeof(xQueryColorsReq)) >> 2;
prgbs = (xrgb *)malloc(count * sizeof(xrgb)); prgbs = (xrgb *)malloc(count * sizeof(xrgb));
...@@ -2985,7 +2977,7 @@ ProcLookupColor(register ClientPtr client) ...@@ -2985,7 +2977,7 @@ ProcLookupColor(register ClientPtr client)
RT_COLORMAP, DixReadAccess); RT_COLORMAP, DixReadAccess);
if (pcmp) if (pcmp)
{ {
xLookupColorReply lcr; xLookupColorReply lcr = {0};
if(OsLookupColor(pcmp->pScreen->myNum, (char *)&stuff[1], stuff->nbytes, if(OsLookupColor(pcmp->pScreen->myNum, (char *)&stuff[1], stuff->nbytes,
&lcr.exactRed, &lcr.exactGreen, &lcr.exactBlue)) &lcr.exactRed, &lcr.exactGreen, &lcr.exactBlue))
...@@ -3023,7 +3015,7 @@ ProcCreateCursor (register ClientPtr client) ...@@ -3023,7 +3015,7 @@ ProcCreateCursor (register ClientPtr client)
unsigned char * mskbits; unsigned char * mskbits;
unsigned short width, height; unsigned short width, height;
long n; long n;
CursorMetricRec cm; CursorMetricRec cm = {0};
REQUEST(xCreateCursorReq); REQUEST(xCreateCursorReq);
...@@ -3150,7 +3142,7 @@ ProcFreeCursor (register ClientPtr client) ...@@ -3150,7 +3142,7 @@ ProcFreeCursor (register ClientPtr client)
int int
ProcQueryBestSize (register ClientPtr client) ProcQueryBestSize (register ClientPtr client)
{ {
xQueryBestSizeReply reply; xQueryBestSizeReply reply = {0};
register DrawablePtr pDraw; register DrawablePtr pDraw;
ScreenPtr pScreen; ScreenPtr pScreen;
REQUEST(xQueryBestSizeReq); REQUEST(xQueryBestSizeReq);
...@@ -3242,7 +3234,7 @@ ProcSetScreenSaver (register ClientPtr client) ...@@ -3242,7 +3234,7 @@ ProcSetScreenSaver (register ClientPtr client)
int int
ProcGetScreenSaver(register ClientPtr client) ProcGetScreenSaver(register ClientPtr client)
{ {
xGetScreenSaverReply rep; xGetScreenSaverReply rep = {0};
REQUEST_SIZE_MATCH(xReq); REQUEST_SIZE_MATCH(xReq);
rep.type = X_Reply; rep.type = X_Reply;
...@@ -3283,7 +3275,7 @@ ProcChangeHosts(register ClientPtr client) ...@@ -3283,7 +3275,7 @@ ProcChangeHosts(register ClientPtr client)
int int
ProcListHosts(register ClientPtr client) ProcListHosts(register ClientPtr client)
{ {
xListHostsReply reply; xListHostsReply reply = {0};
int len, nHosts, result; int len, nHosts, result;
void * pdata; void * pdata;
/* REQUEST(xListHostsReq); */ /* REQUEST(xListHostsReq); */
...@@ -3399,7 +3391,7 @@ ProcSetFontPath(register ClientPtr client) ...@@ -3399,7 +3391,7 @@ ProcSetFontPath(register ClientPtr client)
int int
ProcGetFontPath(register ClientPtr client) ProcGetFontPath(register ClientPtr client)
{ {
xGetFontPathReply reply; xGetFontPathReply reply = {0};
int stringLens, numpaths; int stringLens, numpaths;
unsigned char *bufferStart; unsigned char *bufferStart;
/* REQUEST (xReq); */ /* REQUEST (xReq); */
...@@ -3742,7 +3734,7 @@ ClientPtr NextAvailableClient(void * ospriv) ...@@ -3742,7 +3734,7 @@ ClientPtr NextAvailableClient(void * ospriv)
if (ClientStateCallback) if (ClientStateCallback)
{ {
NewClientInfoRec clientinfo; NewClientInfoRec clientinfo = {0};
clientinfo.client = client; clientinfo.client = client;
clientinfo.prefix = (xConnSetupPrefix *)NULL; clientinfo.prefix = (xConnSetupPrefix *)NULL;
...@@ -3796,9 +3788,8 @@ SendConnSetup(register ClientPtr client, char *reason) ...@@ -3796,9 +3788,8 @@ SendConnSetup(register ClientPtr client, char *reason)
if (reason) if (reason)
{ {
xConnSetupPrefix csp; xConnSetupPrefix csp = {0};;
memset(&csp, 0, sizeof(xConnSetupPrefix));
csp.success = xFalse; csp.success = xFalse;
csp.lengthReason = strlen(reason); csp.lengthReason = strlen(reason);
csp.length = (csp.lengthReason + (unsigned)3) >> 2; csp.length = (csp.lengthReason + (unsigned)3) >> 2;
...@@ -3873,7 +3864,7 @@ SendConnSetup(register ClientPtr client, char *reason) ...@@ -3873,7 +3864,7 @@ SendConnSetup(register ClientPtr client, char *reason)
client->clientState = ClientStateRunning; client->clientState = ClientStateRunning;
if (ClientStateCallback) if (ClientStateCallback)
{ {
NewClientInfoRec clientinfo; NewClientInfoRec clientinfo = {0};
clientinfo.client = client; clientinfo.client = client;
clientinfo.prefix = lconnSetupPrefix; clientinfo.prefix = lconnSetupPrefix;
...@@ -3921,9 +3912,8 @@ void ...@@ -3921,9 +3912,8 @@ void
SendErrorToClient(ClientPtr client, unsigned majorCode, unsigned minorCode, SendErrorToClient(ClientPtr client, unsigned majorCode, unsigned minorCode,
XID resId, int errorCode) XID resId, int errorCode)
{ {
xError rep; xError rep = {0};
memset(&rep, 0, sizeof(xError));
rep.type = X_Error; rep.type = X_Error;
rep.errorCode = errorCode; rep.errorCode = errorCode;
rep.majorCode = majorCode; rep.majorCode = majorCode;
......
...@@ -126,7 +126,7 @@ AllocatePixmap(ScreenPtr pScreen, int pixDataSize) ...@@ -126,7 +126,7 @@ AllocatePixmap(ScreenPtr pScreen, int pixDataSize)
* the pixmap buffer. This may be a RENDER bug. * the pixmap buffer. This may be a RENDER bug.
*/ */
pPixmap = (PixmapPtr)malloc(pScreen->totalPixmapSize + pixDataSize + 4); pPixmap = (PixmapPtr)calloc(1, pScreen->totalPixmapSize + pixDataSize + 4);
if (!pPixmap) if (!pPixmap)
return NullPixmap; return NullPixmap;
ppriv = (DevUnion *)(pPixmap + 1); ppriv = (DevUnion *)(pPixmap + 1);
...@@ -144,7 +144,7 @@ AllocatePixmap(ScreenPtr pScreen, int pixDataSize) ...@@ -144,7 +144,7 @@ AllocatePixmap(ScreenPtr pScreen, int pixDataSize)
ppriv->ptr = (void *)NULL; ppriv->ptr = (void *)NULL;
} }
#else #else
pPixmap = (PixmapPtr)malloc(sizeof(PixmapRec) + pixDataSize); pPixmap = (PixmapPtr)calloc(1, sizeof(PixmapRec) + pixDataSize);
#endif #endif
return pPixmap; return pPixmap;
} }
...@@ -719,7 +719,7 @@ ProcSetSelectionOwner(register ClientPtr client) ...@@ -719,7 +719,7 @@ ProcSetSelectionOwner(register ClientPtr client)
i++; i++;
if (i < NumCurrentSelections) if (i < NumCurrentSelections)
{ {
xEvent event; xEvent event = {0};
/* If the timestamp in client's request is in the past relative /* If the timestamp in client's request is in the past relative
to the time stamp indicating the last time the owner of the to the time stamp indicating the last time the owner of the
......
...@@ -310,7 +310,6 @@ DeleteWindow(void * value, XID wid) ...@@ -310,7 +310,6 @@ DeleteWindow(void * value, XID wid)
{ {
register WindowPtr pParent; register WindowPtr pParent;
register WindowPtr pWin = (WindowPtr)value; register WindowPtr pWin = (WindowPtr)value;
xEvent event;
UnmapWindow(pWin, FALSE); UnmapWindow(pWin, FALSE);
...@@ -319,7 +318,7 @@ DeleteWindow(void * value, XID wid) ...@@ -319,7 +318,7 @@ DeleteWindow(void * value, XID wid)
pParent = pWin->parent; pParent = pWin->parent;
if (wid && pParent && SubStrSend(pWin, pParent)) if (wid && pParent && SubStrSend(pWin, pParent))
{ {
memset(&event, 0, sizeof(xEvent)); xEvent event = {0};
event.u.u.type = DestroyNotify; event.u.u.type = DestroyNotify;
event.u.destroyNotify.window = pWin->drawable.id; event.u.destroyNotify.window = pWin->drawable.id;
DeliverEvents(pWin, &event, 1, NullWindow); DeliverEvents(pWin, &event, 1, NullWindow);
...@@ -371,8 +370,7 @@ ResizeChildrenWinSize(register WindowPtr pWin, int dx, int dy, int dw, int dh) ...@@ -371,8 +370,7 @@ ResizeChildrenWinSize(register WindowPtr pWin, int dx, int dy, int dw, int dh)
pSib->winGravity, &cwsx, &cwsy); pSib->winGravity, &cwsx, &cwsy);
if (cwsx != pSib->origin.x || cwsy != pSib->origin.y) if (cwsx != pSib->origin.x || cwsy != pSib->origin.y)
{ {
xEvent event; xEvent event = {0};
event.u.u.type = GravityNotify; event.u.u.type = GravityNotify;
event.u.gravity.window = pSib->drawable.id; event.u.gravity.window = pSib->drawable.id;
event.u.gravity.x = cwsx - wBorderWidth (pSib); event.u.gravity.x = cwsx - wBorderWidth (pSib);
...@@ -450,7 +448,7 @@ ConfigureWindow(register WindowPtr pWin, register Mask mask, XID *vlist, ClientP ...@@ -450,7 +448,7 @@ ConfigureWindow(register WindowPtr pWin, register Mask mask, XID *vlist, ClientP
h = pWin->drawable.height, h = pWin->drawable.height,
bw = pWin->borderWidth; bw = pWin->borderWidth;
int action, smode = Above; int action, smode = Above;
xEvent event; xEvent event = {0};
if ((pWin->drawable.class == InputOnly) && (mask & IllegalInputOnlyConfigureMask)) if ((pWin->drawable.class == InputOnly) && (mask & IllegalInputOnlyConfigureMask))
return(BadMatch); return(BadMatch);
...@@ -607,8 +605,7 @@ ConfigureWindow(register WindowPtr pWin, register Mask mask, XID *vlist, ClientP ...@@ -607,8 +605,7 @@ ConfigureWindow(register WindowPtr pWin, register Mask mask, XID *vlist, ClientP
|| (h != pWin->drawable.height); || (h != pWin->drawable.height);
if (size_change && ((pWin->eventMask|wOtherEventMasks(pWin)) & ResizeRedirectMask)) if (size_change && ((pWin->eventMask|wOtherEventMasks(pWin)) & ResizeRedirectMask))
{ {
xEvent eventT; xEvent eventT = {0};
memset(&eventT, 0, sizeof(xEvent));
eventT.u.u.type = ResizeRequest; eventT.u.u.type = ResizeRequest;
eventT.u.resizeRequest.window = pWin->drawable.id; eventT.u.resizeRequest.window = pWin->drawable.id;
eventT.u.resizeRequest.width = w; eventT.u.resizeRequest.width = w;
...@@ -723,7 +720,7 @@ ReparentWindow(register WindowPtr pWin, register WindowPtr pParent, ...@@ -723,7 +720,7 @@ ReparentWindow(register WindowPtr pWin, register WindowPtr pParent,
{ {
WindowPtr pPrev, pPriorParent; WindowPtr pPrev, pPriorParent;
Bool WasMapped = (Bool)(pWin->mapped); Bool WasMapped = (Bool)(pWin->mapped);
xEvent event; xEvent event = {0};
int bw = wBorderWidth (pWin); int bw = wBorderWidth (pWin);
register ScreenPtr pScreen; register ScreenPtr pScreen;
...@@ -736,7 +733,6 @@ ReparentWindow(register WindowPtr pWin, register WindowPtr pParent, ...@@ -736,7 +733,6 @@ ReparentWindow(register WindowPtr pWin, register WindowPtr pParent,
if (WasMapped) if (WasMapped)
UnmapWindow(pWin, FALSE); UnmapWindow(pWin, FALSE);
memset(&event, 0, sizeof(xEvent));
event.u.u.type = ReparentNotify; event.u.u.type = ReparentNotify;
event.u.reparent.window = pWin->drawable.id; event.u.reparent.window = pWin->drawable.id;
event.u.reparent.parent = pParent->drawable.id; event.u.reparent.parent = pParent->drawable.id;
...@@ -949,7 +945,6 @@ int ...@@ -949,7 +945,6 @@ int
UnmapWindow(register WindowPtr pWin, Bool fromConfigure) UnmapWindow(register WindowPtr pWin, Bool fromConfigure)
{ {
register WindowPtr pParent; register WindowPtr pParent;
xEvent event;
Bool wasRealized = (Bool)pWin->realized; Bool wasRealized = (Bool)pWin->realized;
Bool wasViewable = (Bool)pWin->viewable; Bool wasViewable = (Bool)pWin->viewable;
ScreenPtr pScreen = pWin->drawable.pScreen; ScreenPtr pScreen = pWin->drawable.pScreen;
...@@ -967,7 +962,7 @@ UnmapWindow(register WindowPtr pWin, Bool fromConfigure) ...@@ -967,7 +962,7 @@ UnmapWindow(register WindowPtr pWin, Bool fromConfigure)
return(Success); return(Success);
if (SubStrSend(pWin, pParent)) if (SubStrSend(pWin, pParent))
{ {
memset(&event, 0, sizeof(xEvent)); xEvent event = {0};
event.u.u.type = UnmapNotify; event.u.u.type = UnmapNotify;
event.u.unmapNotify.window = pWin->drawable.id; event.u.unmapNotify.window = pWin->drawable.id;
event.u.unmapNotify.fromConfigure = fromConfigure; event.u.unmapNotify.fromConfigure = fromConfigure;
......
...@@ -395,7 +395,7 @@ miSendGraphicsExpose (client, pRgn, drawable, major, minor) ...@@ -395,7 +395,7 @@ miSendGraphicsExpose (client, pRgn, drawable, major, minor)
numRects = RegionNumRects(pRgn); numRects = RegionNumRects(pRgn);
pBox = RegionRects(pRgn); pBox = RegionRects(pRgn);
if(!(pEvent = (xEvent *)malloc(numRects * sizeof(xEvent)))) if(!(pEvent = (xEvent *)calloc(numRects, sizeof(xEvent))))
return; return;
pe = pEvent; pe = pEvent;
...@@ -417,8 +417,7 @@ miSendGraphicsExpose (client, pRgn, drawable, major, minor) ...@@ -417,8 +417,7 @@ miSendGraphicsExpose (client, pRgn, drawable, major, minor)
} }
else else
{ {
xEvent event; xEvent event = {0};
memset(&event, 0, sizeof(xEvent));
event.u.u.type = NoExpose; event.u.u.type = NoExpose;
event.u.noExposure.drawable = drawable; event.u.noExposure.drawable = drawable;
event.u.noExposure.majorEvent = major; event.u.noExposure.majorEvent = major;
...@@ -442,9 +441,8 @@ miSendExposures(pWin, pRgn, dx, dy) ...@@ -442,9 +441,8 @@ miSendExposures(pWin, pRgn, dx, dy)
pBox = RegionRects(pRgn); pBox = RegionRects(pRgn);
numRects = RegionNumRects(pRgn); numRects = RegionNumRects(pRgn);
if(!(pEvent = (xEvent *) malloc(numRects * sizeof(xEvent)))) if(!(pEvent = (xEvent *) calloc(numRects, sizeof(xEvent))))
return; return;
memset(pEvent, 0, numRects * sizeof(xEvent));
for (i=numRects, pe = pEvent; --i >= 0; pe++, pBox++) for (i=numRects, pe = pEvent; --i >= 0; pe++, pBox++)
{ {
...@@ -658,7 +656,7 @@ int what; ...@@ -658,7 +656,7 @@ int what;
BITS32 gcmask, index, mask; BITS32 gcmask, index, mask;
RegionRec prgnWin; RegionRec prgnWin;
DDXPointRec oldCorner; DDXPointRec oldCorner;
BoxRec box; BoxRec box = {0};
WindowPtr pBgWin; WindowPtr pBgWin;
GCPtr pGC; GCPtr pGC;
register int i; register int i;
...@@ -705,8 +703,7 @@ int what; ...@@ -705,8 +703,7 @@ int what;
} }
} }
prect = (xRectangle *)malloc(RegionNumRects(prgn) * prect = (xRectangle *)calloc(RegionNumRects(prgn), sizeof(xRectangle));
sizeof(xRectangle));
if (!prect) if (!prect)
return; return;
...@@ -892,8 +889,7 @@ miClearDrawable(pDraw, pGC) ...@@ -892,8 +889,7 @@ miClearDrawable(pDraw, pGC)
{ {
XID fg = pGC->fgPixel; XID fg = pGC->fgPixel;
XID bg = pGC->bgPixel; XID bg = pGC->bgPixel;
xRectangle rect; xRectangle rect = {0};
rect.x = 0; rect.x = 0;
rect.y = 0; rect.y = 0;
rect.width = pDraw->width; rect.width = pDraw->width;
......
...@@ -600,7 +600,7 @@ ProcXkbLatchLockState(ClientPtr client) ...@@ -600,7 +600,7 @@ ProcXkbLatchLockState(ClientPtr client)
int int
ProcXkbGetControls(ClientPtr client) ProcXkbGetControls(ClientPtr client)
{ {
xkbGetControlsReply rep; xkbGetControlsReply rep = {0};
XkbControlsPtr xkb; XkbControlsPtr xkb;
DeviceIntPtr dev; DeviceIntPtr dev;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment