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,
ClientPtr client = cl->client;
DrawablePtr pDraw;
DrawablePtr pRead;
xGLXMakeCurrentReply reply;
xGLXMakeCurrentReply reply = {0};
__GLXpixmap *drawPixmap = NULL;
__GLXpixmap *readPixmap = NULL;
__GLXcontext *glxc, *prevglxc;
......@@ -745,7 +745,7 @@ int __glXIsDirect(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXIsDirectReq *req = (xGLXIsDirectReq *) pc;
xGLXIsDirectReply reply;
xGLXIsDirectReply reply = {0};
__GLXcontext *glxc;
/*
......@@ -775,7 +775,7 @@ int __glXQueryVersion(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXQueryVersionReq *req = (xGLXQueryVersionReq *) pc;
xGLXQueryVersionReply reply;
xGLXQueryVersionReply reply = {0};
GLuint major, minor;
major = req->majorVersion;
......@@ -921,10 +921,10 @@ int DoGetVisualConfigs(__GLXclientState *cl, unsigned screen,
GLboolean do_swap)
{
ClientPtr client = cl->client;
xGLXGetVisualConfigsReply reply;
xGLXGetVisualConfigsReply reply = {0};
__GLXscreenInfo *pGlxScreen;
__GLcontextModes *modes;
CARD32 buf[__GLX_TOTAL_CONFIG];
CARD32 buf[__GLX_TOTAL_CONFIG] = {0};
int p;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_DECLARE_SWAP_ARRAY_VARIABLES;
......@@ -1029,7 +1029,7 @@ int __glXGetVisualConfigs(__GLXclientState *cl, GLbyte *pc)
int DoGetFBConfigs(__GLXclientState *cl, unsigned screen, GLboolean do_swap)
{
ClientPtr client = cl->client;
xGLXGetFBConfigsReply reply;
xGLXGetFBConfigsReply reply = {0};
__GLXscreenInfo *pGlxScreen;
CARD32 buf[__GLX_FBCONFIG_ATTRIBS_LENGTH];
int p;
......@@ -1365,7 +1365,7 @@ int __glXQueryContextInfoEXT(__GLXclientState *cl, GLbyte *pc)
ClientPtr client = cl->client;
__GLXcontext *ctx;
xGLXQueryContextInfoEXTReq *req;
xGLXQueryContextInfoEXTReply reply;
xGLXQueryContextInfoEXTReply reply = {0};
int nProps;
int *sendBuf, *pSendBuf;
int nReplyBytes;
......@@ -1780,7 +1780,7 @@ static int __glXQueryMaxSwapBarriersSGIX(__GLXclientState *cl, GLbyte *pc)
ClientPtr client = cl->client;
xGLXQueryMaxSwapBarriersSGIXReq *req =
(xGLXQueryMaxSwapBarriersSGIXReq *) pc;
xGLXQueryMaxSwapBarriersSGIXReply reply;
xGLXQueryMaxSwapBarriersSGIXReply reply = {0};
int screen = req->screen;
if (__glXSwapBarrierFuncs &&
......@@ -1810,7 +1810,7 @@ static int __glxQueryHyperpipeNetworkSGIX(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXQueryHyperpipeNetworkSGIXReq * req = (xGLXQueryHyperpipeNetworkSGIXReq *) pc;
xGLXQueryHyperpipeNetworkSGIXReply reply;
xGLXQueryHyperpipeNetworkSGIXReply reply = {0};
int screen = req->screen;
void *rdata = NULL;
......@@ -1851,7 +1851,7 @@ static int __glxDestroyHyperpipeConfigSGIX (__GLXclientState *cl, GLbyte *pc)
ClientPtr client = cl->client;
xGLXDestroyHyperpipeConfigSGIXReq * req =
(xGLXDestroyHyperpipeConfigSGIXReq *) pc;
xGLXDestroyHyperpipeConfigSGIXReply reply;
xGLXDestroyHyperpipeConfigSGIXReply reply = {0};
int screen = req->screen;
int success = GLX_BAD_HYPERPIPE_SGIX;
int hpId ;
......@@ -1886,7 +1886,7 @@ static int __glxQueryHyperpipeConfigSGIX(__GLXclientState *cl, GLbyte *pc)
ClientPtr client = cl->client;
xGLXQueryHyperpipeConfigSGIXReq * req =
(xGLXQueryHyperpipeConfigSGIXReq *) pc;
xGLXQueryHyperpipeConfigSGIXReply reply;
xGLXQueryHyperpipeConfigSGIXReply reply = {0};
int screen = req->screen;
void *rdata = NULL;
int length;
......@@ -1930,7 +1930,7 @@ static int __glxHyperpipeConfigSGIX(__GLXclientState *cl, GLbyte *pc)
ClientPtr client = cl->client;
xGLXHyperpipeConfigSGIXReq * req =
(xGLXHyperpipeConfigSGIXReq *) pc;
xGLXHyperpipeConfigSGIXReply reply;
xGLXHyperpipeConfigSGIXReply reply = {0};
int screen = req->screen;
void *rdata;
......@@ -2059,7 +2059,7 @@ int __glXQueryExtensionsString(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXQueryExtensionsStringReq *req = (xGLXQueryExtensionsStringReq *) pc;
xGLXQueryExtensionsStringReply reply;
xGLXQueryExtensionsStringReply reply = {0};
GLuint screen;
size_t n, length;
const char *ptr;
......@@ -2104,7 +2104,7 @@ int __glXQueryServerString(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXQueryServerStringReq *req = (xGLXQueryServerStringReq *) pc;
xGLXQueryServerStringReply reply;
xGLXQueryServerStringReply reply = {0};
int name;
GLuint screen;
size_t n, length;
......
......@@ -101,7 +101,7 @@ ProcDPMSGetVersion(client)
register ClientPtr client;
{
/* REQUEST(xDPMSGetVersionReq); */
xDPMSGetVersionReply rep;
xDPMSGetVersionReply rep = {0};
REQUEST_SIZE_MATCH(xDPMSGetVersionReq);
......@@ -123,7 +123,7 @@ static int
ProcDPMSCapable(register ClientPtr client)
{
/* REQUEST(xDPMSCapableReq); */
xDPMSCapableReply rep;
xDPMSCapableReply rep = {0};
REQUEST_SIZE_MATCH(xDPMSCapableReq);
......@@ -144,7 +144,7 @@ ProcDPMSGetTimeouts(client)
register ClientPtr client;
{
/* REQUEST(xDPMSGetTimeoutsReq); */
xDPMSGetTimeoutsReply rep;
xDPMSGetTimeoutsReply rep = {0};
REQUEST_SIZE_MATCH(xDPMSGetTimeoutsReq);
......@@ -258,7 +258,7 @@ static int
ProcDPMSInfo(register ClientPtr client)
{
/* REQUEST(xDPMSInfoReq); */
xDPMSInfoReply rep;
xDPMSInfoReply rep = {0};
REQUEST_SIZE_MATCH(xDPMSInfoReq);
......
......@@ -266,7 +266,7 @@ RegionPtr
CreateBoundingShape (pWin)
WindowPtr pWin;
{
BoxRec extents;
BoxRec extents = {0};
extents.x1 = -wBorderWidth (pWin);
extents.y1 = -wBorderWidth (pWin);
......@@ -279,7 +279,7 @@ RegionPtr
CreateClipShape (pWin)
WindowPtr pWin;
{
BoxRec extents;
BoxRec extents = {0};
extents.x1 = 0;
extents.y1 = 0;
......@@ -292,7 +292,7 @@ static int
ProcShapeQueryVersion (client)
register ClientPtr client;
{
xShapeQueryVersionReply rep;
xShapeQueryVersionReply rep = {0};
REQUEST_SIZE_MATCH (xShapeQueryVersionReq);
memset(&rep, 0, sizeof(xShapeQueryVersionReply));
......@@ -713,8 +713,8 @@ ProcShapeQueryExtents (client)
{
REQUEST(xShapeQueryExtentsReq);
WindowPtr pWin;
xShapeQueryExtentsReply rep;
BoxRec extents, *pExtents;
xShapeQueryExtentsReply rep = {0};
BoxRec extents = {0}, *pExtents;
RegionPtr region;
REQUEST_SIZE_MATCH (xShapeQueryExtentsReq);
......@@ -919,8 +919,8 @@ SendShapeNotify (pWin, which)
int which;
{
ShapeEventPtr *pHead, pShapeEvent;
xShapeNotifyEvent se;
BoxRec extents;
xShapeNotifyEvent se = {0};
BoxRec extents = {0};
RegionPtr region;
BYTE shaped;
......@@ -992,7 +992,7 @@ ProcShapeInputSelected (client)
WindowPtr pWin;
ShapeEventPtr pShapeEvent, *pHead;
int enabled;
xShapeInputSelectedReply rep;
xShapeInputSelectedReply rep = {0};
REQUEST_SIZE_MATCH (xShapeInputSelectedReq);
pWin = LookupWindow (stuff->window, client);
......@@ -1030,7 +1030,7 @@ ProcShapeGetRectangles (client)
{
REQUEST(xShapeGetRectanglesReq);
WindowPtr pWin;
xShapeGetRectanglesReply rep;
xShapeGetRectanglesReply rep = {0};
xRectangle *rects;
int nrects, i;
RegionPtr region;
......
......@@ -111,7 +111,7 @@ static int
ProcXTestGetVersion(client)
register ClientPtr client;
{
xXTestGetVersionReply rep;
xXTestGetVersionReply rep = {0};
REQUEST_SIZE_MATCH(xXTestGetVersionReq);
rep.type = X_Reply;
......@@ -132,7 +132,7 @@ ProcXTestCompareCursor(client)
register ClientPtr client;
{
REQUEST(xXTestCompareCursorReq);
xXTestCompareCursorReply rep;
xXTestCompareCursorReply rep = {0};
WindowPtr pWin;
CursorPtr pCursor;
......
......@@ -474,7 +474,7 @@ FreeColormap (void * value, XID mid)
static int
TellNoMap (WindowPtr pwin, Colormap *pmid)
{
xEvent xE;
xEvent xE = {0};
if (wColormap(pwin) == *pmid)
{
......@@ -502,7 +502,7 @@ int
TellLostMap (WindowPtr pwin, void * value)
{
Colormap *pmid = (Colormap *)value;
xEvent xE;
xEvent xE = {0};
#ifdef PANORAMIX
if(!noPanoramiXExtension && pwin->drawable.pScreen->myNum)
......@@ -527,7 +527,7 @@ int
TellGainedMap (WindowPtr pwin, void * value)
{
Colormap *pmid = (Colormap *)value;
xEvent xE;
xEvent xE = {0};
#ifdef PANORAMIX
if(!noPanoramiXExtension && pwin->drawable.pScreen->myNum)
......
......@@ -1158,7 +1158,8 @@ ProcGetKeyboardMapping(ClientPtr client)
int
ProcGetPointerMapping(ClientPtr client)
{
xGetPointerMappingReply rep;
xGetPointerMappingReply rep = {0};
ButtonClassPtr butc = inputInfo.pointer->button;
REQUEST_SIZE_MATCH(xReq);
......@@ -1168,7 +1169,7 @@ ProcGetPointerMapping(ClientPtr client)
rep.length = ((unsigned)rep.nElts + (4-1))/4;
WriteReplyToClient(client, sizeof(xGetPointerMappingReply), &rep);
WriteToClient(client, (int)rep.nElts, &butc->map[1]);
return Success;
return Success;
}
void
......
......@@ -126,7 +126,7 @@ AllocatePixmap(ScreenPtr pScreen, int pixDataSize)
* 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)
return NullPixmap;
ppriv = (DevUnion *)(pPixmap + 1);
......@@ -144,7 +144,7 @@ AllocatePixmap(ScreenPtr pScreen, int pixDataSize)
ppriv->ptr = (void *)NULL;
}
#else
pPixmap = (PixmapPtr)malloc(sizeof(PixmapRec) + pixDataSize);
pPixmap = (PixmapPtr)calloc(1, sizeof(PixmapRec) + pixDataSize);
#endif
return pPixmap;
}
......@@ -719,7 +719,7 @@ ProcSetSelectionOwner(register ClientPtr client)
i++;
if (i < NumCurrentSelections)
{
xEvent event;
xEvent event = {0};
/* If the timestamp in client's request is in the past relative
to the time stamp indicating the last time the owner of the
......
......@@ -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;
......
......@@ -395,7 +395,7 @@ miSendGraphicsExpose (client, pRgn, drawable, major, minor)
numRects = RegionNumRects(pRgn);
pBox = RegionRects(pRgn);
if(!(pEvent = (xEvent *)malloc(numRects * sizeof(xEvent))))
if(!(pEvent = (xEvent *)calloc(numRects, sizeof(xEvent))))
return;
pe = pEvent;
......@@ -417,8 +417,7 @@ miSendGraphicsExpose (client, pRgn, drawable, major, minor)
}
else
{
xEvent event;
memset(&event, 0, sizeof(xEvent));
xEvent event = {0};
event.u.u.type = NoExpose;
event.u.noExposure.drawable = drawable;
event.u.noExposure.majorEvent = major;
......@@ -442,9 +441,8 @@ miSendExposures(pWin, pRgn, dx, dy)
pBox = RegionRects(pRgn);
numRects = RegionNumRects(pRgn);
if(!(pEvent = (xEvent *) malloc(numRects * sizeof(xEvent))))
if(!(pEvent = (xEvent *) calloc(numRects, sizeof(xEvent))))
return;
memset(pEvent, 0, numRects * sizeof(xEvent));
for (i=numRects, pe = pEvent; --i >= 0; pe++, pBox++)
{
......@@ -658,7 +656,7 @@ int what;
BITS32 gcmask, index, mask;
RegionRec prgnWin;
DDXPointRec oldCorner;
BoxRec box;
BoxRec box = {0};
WindowPtr pBgWin;
GCPtr pGC;
register int i;
......@@ -705,8 +703,7 @@ int what;
}
}
prect = (xRectangle *)malloc(RegionNumRects(prgn) *
sizeof(xRectangle));
prect = (xRectangle *)calloc(RegionNumRects(prgn), sizeof(xRectangle));
if (!prect)
return;
......@@ -892,8 +889,7 @@ miClearDrawable(pDraw, pGC)
{
XID fg = pGC->fgPixel;
XID bg = pGC->bgPixel;
xRectangle rect;
xRectangle rect = {0};
rect.x = 0;
rect.y = 0;
rect.width = pDraw->width;
......
......@@ -600,7 +600,7 @@ ProcXkbLatchLockState(ClientPtr client)
int
ProcXkbGetControls(ClientPtr client)
{
xkbGetControlsReply rep;
xkbGetControlsReply rep = {0};
XkbControlsPtr xkb;
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