Commit 5a0fc0ad authored by Mikhail Gusarov's avatar Mikhail Gusarov

Replace deprecated bzero with memset

Signed-off-by: default avatarMikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: default avatarMarcin Baczyński <marbacz@gmail.com>
Reviewed-by: default avatarDaniel Stone <daniel@fooishbar.org>
Reviewed-by: default avatarAlan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: default avatarMatt Turner <mattst88@gmail.com>
parent f9810ba9
......@@ -1897,7 +1897,7 @@ int PanoramiXGetImage(ClientPtr client)
nlines = min(linesPerBuf, h - linesDone);
if(pDraw->depth == 1)
bzero(pBuf, nlines * widthBytesLine);
memset(pBuf, 0, nlines * widthBytesLine);
XineramaGetImageData(drawables, x, y + linesDone, w, nlines,
format, planemask, pBuf, widthBytesLine, isRoot);
......@@ -1914,7 +1914,7 @@ int PanoramiXGetImage(ClientPtr client)
while (h - linesDone > 0) {
nlines = min(linesPerBuf, h - linesDone);
bzero(pBuf, nlines * widthBytesLine);
memset(pBuf, 0, nlines * widthBytesLine);
XineramaGetImageData(drawables, x, y + linesDone, w,
nlines, format, plane, pBuf,
......
......@@ -321,7 +321,7 @@ XaceCensorImage(
/* Censoring was not completed above. To be safe, wipe out
* all the image data so that nothing trusted gets out.
*/
bzero(pBuf, (int)(widthBytesLine * h));
memset(pBuf, 0, (int)(widthBytesLine * h));
}
if (pRects) free(pRects);
if (pScratchGC) FreeScratchGC(pScratchGC);
......
......@@ -309,8 +309,8 @@ CreateColormap (Colormap mid, ScreenPtr pScreen, VisualPtr pVisual,
if ((class | DynamicClass) == DirectColor)
size = NUMRED(pVisual);
pmap->freeRed = size;
bzero ((char *) pmap->red, (int)sizebytes);
bzero((char *) pmap->numPixelsRed, MAXCLIENTS * sizeof(int));
memset((char *) pmap->red, 0, (int)sizebytes);
memset((char *) pmap->numPixelsRed, 0, MAXCLIENTS * sizeof(int));
for (pptr = &pmap->clientPixelsRed[MAXCLIENTS]; --pptr >= pmap->clientPixelsRed; )
*pptr = (Pixel *)NULL;
if (alloc == AllocAll)
......@@ -347,8 +347,8 @@ CreateColormap (Colormap mid, ScreenPtr pScreen, VisualPtr pVisual,
pmap->numPixelsBlue = (int *)((char *)pmap->clientPixelsBlue +
(MAXCLIENTS * sizeof(Pixel *)));
bzero ((char *) pmap->green, (int)sizebytes);
bzero ((char *) pmap->blue, (int)sizebytes);
memset((char *) pmap->green, 0, (int)sizebytes);
memset((char *) pmap->blue, 0, (int)sizebytes);
memmove((char *) pmap->clientPixelsGreen,
(char *) pmap->clientPixelsRed,
......@@ -356,8 +356,8 @@ CreateColormap (Colormap mid, ScreenPtr pScreen, VisualPtr pVisual,
memmove((char *) pmap->clientPixelsBlue,
(char *) pmap->clientPixelsRed,
MAXCLIENTS * sizeof(Pixel *));
bzero((char *) pmap->numPixelsGreen, MAXCLIENTS * sizeof(int));
bzero((char *) pmap->numPixelsBlue, MAXCLIENTS * sizeof(int));
memset((char *) pmap->numPixelsGreen, 0, MAXCLIENTS * sizeof(int));
memset((char *) pmap->numPixelsBlue, 0, MAXCLIENTS * sizeof(int));
/* If every cell is allocated, mark its refcnt */
if (alloc == AllocAll)
......
......@@ -2971,7 +2971,7 @@ ProcCreateCursor (ClientPtr client)
else
{
/* zeroing the (pad) bits helps some ddx cursor handling */
bzero((char *)mskbits, n);
memset((char *)mskbits, 0, n);
(* msk->drawable.pScreen->GetImage)( (DrawablePtr)msk, 0, 0, width,
height, XYPixmap, 1, (pointer)mskbits);
}
......
......@@ -1093,7 +1093,7 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c)
}
finish:
length = sizeof(xListFontsWithInfoReply);
bzero((char *) &finalReply, sizeof(xListFontsWithInfoReply));
memset((char *) &finalReply, 0, sizeof(xListFontsWithInfoReply));
finalReply.type = X_Reply;
finalReply.sequenceNumber = client->sequence;
finalReply.length = bytes_to_int32(sizeof(xListFontsWithInfoReply)
......
......@@ -4310,7 +4310,7 @@ CoreEnterLeaveEvent(
xKeymapEvent ke;
ClientPtr client = grab ? rClient(grab) : wClient(pWin);
if (XaceHook(XACE_DEVICE_ACCESS, client, keybd, DixReadAccess))
bzero((char *)&ke.map[0], 31);
memset((char *)&ke.map[0], 0, 31);
else
memmove((char *)&ke.map[0], (char *)&keybd->key->down[1], 31);
......@@ -4420,7 +4420,7 @@ CoreFocusEvent(DeviceIntPtr dev, int type, int mode, int detail, WindowPtr pWin)
xKeymapEvent ke;
ClientPtr client = wClient(pWin);
if (XaceHook(XACE_DEVICE_ACCESS, client, dev, DixReadAccess))
bzero((char *)&ke.map[0], 31);
memset((char *)&ke.map[0], 0, 31);
else
memmove((char *)&ke.map[0], (char *)&dev->key->down[1], 31);
......
......@@ -570,7 +570,7 @@ vfbAllocateMmappedFramebuffer(vfbScreenInfoPtr pvfb)
/* Extend the file to be the proper size */
bzero(dummyBuffer, DUMMY_BUFFER_SIZE);
memset(dummyBuffer, 0, DUMMY_BUFFER_SIZE);
for (currentFileSize = 0;
currentFileSize < pvfb->sizeInBytes;
currentFileSize += writeThisTime)
......
......@@ -654,7 +654,7 @@ xf86AllocateEntityPrivateIndex(void)
nprivs = xnfrealloc(pEnt->entityPrivates,
xf86EntityPrivateCount * sizeof(DevUnion));
/* Zero the new private */
bzero(&nprivs[idx], sizeof(DevUnion));
memset(&nprivs[idx], 0, sizeof(DevUnion));
pEnt->entityPrivates = nprivs;
}
return idx;
......
......@@ -1252,7 +1252,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
/* 5. Built-in default. */
if (!foundPointer && !xf86Info.allowEmptyInput) {
bzero(&defPtr, sizeof(defPtr));
memset(&defPtr, 0, sizeof(defPtr));
defPtr.inp_identifier = strdup("<default pointer>");
defPtr.inp_driver = strdup("mouse");
confInput = &defPtr;
......@@ -1303,7 +1303,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
}
if (!found && !xf86Info.allowEmptyInput) {
xf86Msg(X_INFO, "No default mouse found, adding one\n");
bzero(&defPtr, sizeof(defPtr));
memset(&defPtr, 0, sizeof(defPtr));
defPtr.inp_identifier = strdup("<default pointer>");
defPtr.inp_driver = strdup("mouse");
confInput = &defPtr;
......@@ -1392,7 +1392,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
/* 5. Built-in default. */
if (!foundKeyboard && !xf86Info.allowEmptyInput) {
bzero(&defKbd, sizeof(defKbd));
memset(&defKbd, 0, sizeof(defKbd));
defKbd.inp_identifier = strdup("<default keyboard>");
defKbd.inp_driver = strdup("kbd");
confInput = &defKbd;
......@@ -1851,7 +1851,7 @@ configScreen(confScreenPtr screenp, XF86ConfScreenPtr conf_screen, int scrnum,
if (!conf_screen->scrn_monitor) {
XF86ConfMonitorRec defMon;
bzero(&defMon, sizeof(defMon));
memset(&defMon, 0, sizeof(defMon));
defMon.mon_identifier = "<default monitor>";
if (!configMonitor(screenp->monitor, &defMon))
return FALSE;
......
......@@ -590,7 +590,7 @@ xf86InitOrigins(void)
/* need to have this set up with a config file option */
HardEdges = FALSE;
bzero(xf86ScreenLayout, MAXSCREENS * sizeof(xf86ScreenLayoutRec));
memset(xf86ScreenLayout, 0, MAXSCREENS * sizeof(xf86ScreenLayoutRec));
screensLeft = prevScreensLeft = (1 << xf86NumScreens) - 1;
......
......@@ -269,7 +269,7 @@ xf86AllocateScrnInfoPrivateIndex(void)
nprivs = xnfrealloc(pScr->privates,
xf86ScrnInfoPrivateCount * sizeof(DevUnion));
/* Zero the new private */
bzero(&nprivs[idx], sizeof(DevUnion));
memset(&nprivs[idx], 0, sizeof(DevUnion));
pScr->privates = nprivs;
}
return idx;
......
......@@ -203,8 +203,8 @@ xf86PrintBanner(void)
struct tm t;
char buf[100];
bzero(&t, sizeof(t));
bzero(buf, sizeof(buf));
memset(&t, 0, sizeof(t));
memset(buf, 0, sizeof(buf));
t.tm_mday = BUILD_DATE % 100;
t.tm_mon = (BUILD_DATE / 100) % 100 - 1;
t.tm_year = BUILD_DATE / 10000 - 1900;
......
......@@ -64,7 +64,7 @@ xf86OSRingBell(int loudness, int pitch, int duration)
}
lastFreq = 0;
bzero(silence, sizeof(silence));
memset(silence, 0, sizeof(silence));
audioFD = open(AUDIO_DEVICE, O_WRONLY | O_NONBLOCK);
if (audioFD == -1) {
......
......@@ -345,7 +345,7 @@ VBEGetVBEInfo(vbeInfoPtr pVbe)
char *str;
CARD16 major, *modes;
bzero(pVbe->memory, sizeof(VbeInfoBlock));
memset(pVbe->memory, 0, sizeof(VbeInfoBlock));
/*
Input:
......@@ -504,7 +504,7 @@ VBEGetModeInfo(vbeInfoPtr pVbe, int mode)
{
VbeModeInfoBlock *block = NULL;
bzero(pVbe->memory, sizeof(VbeModeInfoBlock));
memset(pVbe->memory, 0, sizeof(VbeModeInfoBlock));
/*
Input:
......
......@@ -3135,9 +3135,9 @@ realFindSpan (int y)
free(finalSpans);
}
if ((i = finalMiny - newMiny) > 0)
bzero ((char *)newSpans, i * sizeof (struct finalSpan *));
memset((char *)newSpans, 0, i * sizeof (struct finalSpan *));
if ((i = newMaxy - finalMaxy) > 0)
bzero ((char *)(newSpans + newSize - i),
memset((char *)(newSpans + newSize - i), 0,
i * sizeof (struct finalSpan *));
finalSpans = newSpans;
finalMaxy = newMaxy;
......
......@@ -325,7 +325,7 @@ cwCreateGC(GCPtr pGC)
ScreenPtr pScreen = pGC->pScreen;
Bool ret;
bzero(pPriv, sizeof(cwGCRec));
memset(pPriv, 0, sizeof(cwGCRec));
SCREEN_PROLOGUE(pScreen, CreateGC);
if ( (ret = (*pScreen->CreateGC)(pGC)) )
......
......@@ -311,7 +311,7 @@ ifioctl (int fd, int cmd, char *arg)
struct strioctl ioc;
int ret;
bzero((char *) &ioc, sizeof(ioc));
memset((char *) &ioc, 0, sizeof(ioc));
ioc.ic_cmd = cmd;
ioc.ic_timout = 0;
if (cmd == SIOCGIFCONF)
......@@ -1038,7 +1038,7 @@ ResetHosts (char *display)
len = sizeof(saddr.sa);
if (ConvertAddr (&saddr.sa, &len, (pointer *)&addr) == FamilyDECnet)
{
bzero ((char *) &dnaddr, sizeof (dnaddr));
memset((char *) &dnaddr, 0, sizeof (dnaddr));
dnaddr.a_len = np->n_length;
acopy (np->n_addr, dnaddr.a_addr, np->n_length);
dnaddrp = &dnaddr;
......
......@@ -183,7 +183,7 @@ struct _ct_node *ct_head[256];
void InitConnectionTranslation(void)
{
bzero(ct_head, sizeof(ct_head));
memset(ct_head, 0, sizeof(ct_head));
}
int GetConnectionTranslation(int conn)
......
......@@ -979,7 +979,7 @@ set_font_authorizations(char **authorizations, int *authlen, pointer client)
gethostname(hname, 1024);
#if defined(IPv6) && defined(AF_INET6)
bzero(&hints, sizeof(hints));
memset(&hints, 0, sizeof(hints));
hints.ai_flags = AI_CANONNAME;
if (getaddrinfo(hname, NULL, &hints, &ai) == 0) {
hnameptr = ai->ai_canonname;
......@@ -1178,7 +1178,7 @@ SmartScheduleInit (void)
if (SmartScheduleDisable)
return TRUE;
bzero ((char *) &act, sizeof(struct sigaction));
memset((char *) &act, 0, sizeof(struct sigaction));
/* Set up the timer signal function */
act.sa_handler = SmartScheduleTimer;
......
......@@ -139,7 +139,7 @@ HexToBinary (const char *in, char *out, int len)
void
XdmAuthenticationInit (const char *cookie, int cookie_len)
{
bzero (privateKey.data, 8);
memset(privateKey.data, 0, 8);
if (!strncmp (cookie, "0x", 2) || !strncmp (cookie, "0X", 2))
{
if (cookie_len > 2 + 2 * 8)
......
......@@ -338,7 +338,7 @@ XdmcpRegisterBroadcastAddress (const struct sockaddr_in *addr)
if (NumBroadcastAddresses >= MAX_BROADCAST)
return;
bcast = &BroadcastAddresses[NumBroadcastAddresses++];
bzero (bcast, sizeof (struct sockaddr_in));
memset(bcast, 0, sizeof (struct sockaddr_in));
#ifdef BSD44SOCKETS
bcast->sin_len = addr->sin_len;
#endif
......@@ -1483,7 +1483,7 @@ get_addr_by_name(
char *pport = portstr;
int gaierr;
bzero(&hints, sizeof(hints));
memset(&hints, 0, sizeof(hints));
hints.ai_socktype = socktype;
if (port == 0) {
......@@ -1616,7 +1616,7 @@ get_mcast_options(int argc, char **argv, int i)
} else {
FatalError("Xserver: port out of range: %d\n", xdm_udp_port);
}
bzero(&hints, sizeof(hints));
memset(&hints, 0, sizeof(hints));
hints.ai_socktype = SOCK_DGRAM;
if ((gaierr = getaddrinfo(address, portstr, &hints, &firstai)) == 0) {
......
......@@ -1495,7 +1495,7 @@ RecordAllocIntervals(SetInfoPtr psi, int nIntervals)
malloc(nIntervals * sizeof(RecordSetInterval));
if (!psi->intervals)
return BadAlloc;
bzero(psi->intervals, nIntervals * sizeof(RecordSetInterval));
memset(psi->intervals, 0, nIntervals * sizeof(RecordSetInterval));
psi->size = nIntervals;
return Success;
} /* end RecordAllocIntervals */
......@@ -1669,7 +1669,7 @@ RecordRegisterClients(RecordContextPtr pContext, ClientPtr client, xRecordRegist
err = BadAlloc;
goto bailout;
}
bzero(si, sizeof(SetInfoRec) * maxSets);
memset(si, 0, sizeof(SetInfoRec) * maxSets);
/* theoretically you must do this because NULL may not be all-bits-zero */
for (i = 0; i < maxSets; i++)
......@@ -2053,7 +2053,7 @@ RecordAllocRanges(GetContextRangeInfoPtr pri, int nRanges)
pri->pRanges = pNewRange;
pri->size = newsize;
bzero(&pri->pRanges[pri->size - SZINCR], SZINCR * sizeof(xRecordRange));
memset(&pri->pRanges[pri->size - SZINCR], 0, SZINCR * sizeof(xRecordRange));
if (pri->nRanges < nRanges)
pri->nRanges = nRanges;
return Success;
......
......@@ -82,7 +82,7 @@ XkbSymInterpretRec *prev_interpret;
}
compat->size_si= nSI;
compat->num_si= 0;
bzero((char *)&compat->groups[0],XkbNumKbdGroups*sizeof(XkbModsRec));
memset((char *)&compat->groups[0], 0, XkbNumKbdGroups*sizeof(XkbModsRec));
xkb->compat= compat;
return Success;
}
......@@ -99,7 +99,7 @@ register XkbCompatMapPtr compat;
if (freeMap)
which= XkbAllCompatMask;
if (which&XkbGroupCompatMask)
bzero((char *)&compat->groups[0],XkbNumKbdGroups*sizeof(XkbModsRec));
memset((char *)&compat->groups[0], 0, XkbNumKbdGroups*sizeof(XkbModsRec));
if (which&XkbSymInterpMask) {
if ((compat->sym_interpret)&&(compat->size_si>0))
free(compat->sym_interpret);
......
......@@ -478,7 +478,7 @@ _XkbGeomAlloc( void ** old,
if (*num>0) {
char *tmp= (char *)(*old);
bzero(&tmp[sz_elem*(*num)],(num_new*sz_elem));
memset(&tmp[sz_elem*(*num)], 0, (num_new*sz_elem));
}
return Success;
}
......@@ -701,7 +701,7 @@ register XkbKeyAliasPtr alias;
return NULL;
for (i=0,alias=geom->key_aliases;i<geom->num_key_aliases;i++,alias++) {
if (strncmp(alias->alias,aliasStr,XkbKeyNameLength)==0) {
bzero(alias->real,XkbKeyNameLength);
memset(alias->real, 0, XkbKeyNameLength);
strncpy(alias->real,realStr,XkbKeyNameLength);
return alias;
}
......@@ -711,7 +711,7 @@ register XkbKeyAliasPtr alias;
return NULL;
}
alias= &geom->key_aliases[geom->num_key_aliases];
bzero(alias,sizeof(XkbKeyAliasRec));
memset(alias, 0, sizeof(XkbKeyAliasRec));
strncpy(alias->alias,aliasStr,XkbKeyNameLength);
strncpy(alias->real,realStr,XkbKeyNameLength);
geom->num_key_aliases++;
......@@ -758,7 +758,7 @@ XkbOutlinePtr outline;
return NULL;
}
outline= &shape->outlines[shape->num_outlines];
bzero(outline,sizeof(XkbOutlineRec));
memset(outline, 0, sizeof(XkbOutlineRec));
if ((sz_points>0)&&(_XkbAllocPoints(outline,sz_points)!=Success))
return NULL;
shape->num_outlines++;
......@@ -783,7 +783,7 @@ register int i;
(_XkbAllocShapes(geom,1)!=Success))
return NULL;
shape= &geom->shapes[geom->num_shapes];
bzero(shape,sizeof(XkbShapeRec));
memset(shape, 0, sizeof(XkbShapeRec));
if ((sz_outlines>0)&&(_XkbAllocOutlines(shape,sz_outlines)!=Success))
return NULL;
shape->name= name;
......@@ -801,7 +801,7 @@ XkbKeyPtr key;
if ((row->num_keys>=row->sz_keys)&&(_XkbAllocKeys(row,1)!=Success))
return NULL;
key= &row->keys[row->num_keys++];
bzero(key,sizeof(XkbKeyRec));
memset(key, 0, sizeof(XkbKeyRec));
return key;
}
......@@ -816,7 +816,7 @@ XkbRowPtr row;
(_XkbAllocRows(section,1)!=Success))
return NULL;
row= &section->rows[section->num_rows];
bzero(row,sizeof(XkbRowRec));
memset(row, 0, sizeof(XkbRowRec));
if ((sz_keys>0)&&(_XkbAllocKeys(row,sz_keys)!=Success))
return NULL;
section->num_rows++;
......@@ -896,7 +896,7 @@ register int i,nDoodads;
return NULL;
doodad= &geom->doodads[geom->num_doodads++];
}
bzero(doodad,sizeof(XkbDoodadRec));
memset(doodad, 0, sizeof(XkbDoodadRec));
doodad->any.name= name;
return doodad;
}
......@@ -960,7 +960,7 @@ XkbOverlayRowPtr row;
(_XkbAllocOverlayRows(overlay,1)!=Success))
return NULL;
row= &overlay->rows[overlay->num_rows];
bzero(row,sizeof(XkbOverlayRowRec));
memset(row, 0, sizeof(XkbOverlayRowRec));
if ((sz_keys>0)&&(_XkbAllocOverlayKeys(row,sz_keys)!=Success))
return NULL;
row->row_under= row_under;
......
......@@ -84,7 +84,7 @@ XkbClientMapPtr map;
return BadAlloc;
}
map->size_types= nTotalTypes;
bzero(&map->types[map->num_types],
memset(&map->types[map->num_types], 0,
((map->size_types-map->num_types)*sizeof(XkbKeyTypeRec)));
}
}
......@@ -177,7 +177,7 @@ XkbServerMapPtr map;
return BadAlloc;
}
map->size_acts= need;
bzero(&map->acts[map->num_acts],
memset(&map->acts[map->num_acts], 0,
((map->size_acts-map->num_acts)*sizeof(XkbAction)));
}
if (map->key_acts==NULL) {
......@@ -368,7 +368,7 @@ KeyCode matchingKeys[XkbMaxKeyCount],nMatchingKeys;
* The possibilities marked with '+' require us to examine the key types
* associated with each group for the key.
*/
bzero(matchingKeys,XkbMaxKeyCount*sizeof(KeyCode));
memset(matchingKeys, 0, XkbMaxKeyCount*sizeof(KeyCode));
nMatchingKeys= 0;
if (new_num_lvls>type->num_levels) {
int nTotal;
......@@ -461,7 +461,7 @@ KeyCode matchingKeys[XkbMaxKeyCount],nMatchingKeys;
for (g=XkbKeyNumGroups(xkb,key)-1;g>=0;g--) {
if (XkbKeyKeyTypeIndex(xkb,key,g)==type_ndx) {
if (nClear>0)
bzero(&pSyms[g*width+firstClear],nClear*sizeof(KeySym));
memset(&pSyms[g*width+firstClear], 0, nClear*sizeof(KeySym));
}
}
}
......@@ -491,8 +491,8 @@ KeySym *newSyms;
nOldSyms*sizeof(KeySym));
}
if ((needed-nOldSyms)>0) {
bzero(&xkb->map->syms[xkb->map->num_syms+XkbKeyNumSyms(xkb,key)],
(needed-nOldSyms)*sizeof(KeySym));
memset(&xkb->map->syms[xkb->map->num_syms+XkbKeyNumSyms(xkb, key)],
0, (needed-nOldSyms)*sizeof(KeySym));
}
xkb->map->key_sym_map[key].offset = xkb->map->num_syms;
xkb->map->num_syms+= needed;
......@@ -515,7 +515,7 @@ KeySym *newSyms;
if (nCopy!=0)
memcpy(&newSyms[nSyms],XkbKeySymsPtr(xkb,i),nCopy*sizeof(KeySym));
if (nKeySyms>nCopy)
bzero(&newSyms[nSyms+nCopy],(nKeySyms-nCopy)*sizeof(KeySym));
memset(&newSyms[nSyms+nCopy], 0, (nKeySyms-nCopy)*sizeof(KeySym));
xkb->map->key_sym_map[i].offset = nSyms;
nSyms+= nKeySyms;
}
......@@ -568,7 +568,7 @@ int tmp;
tmp= xkb->min_key_code-minKC;
if (xkb->map) {
if (xkb->map->key_sym_map) {
bzero((char *)&xkb->map->key_sym_map[minKC],
memset((char *)&xkb->map->key_sym_map[minKC], 0,
tmp*sizeof(XkbSymMapRec));
if (changes) {
changes->map.changed= _ExtendRange(changes->map.changed,
......@@ -578,7 +578,7 @@ int tmp;
}
}
if (xkb->map->modmap) {
bzero((char *)&xkb->map->modmap[minKC],tmp);
memset((char *)&xkb->map->modmap[minKC], 0, tmp);
if (changes) {
changes->map.changed= _ExtendRange(changes->map.changed,
XkbModifierMapMask,minKC,
......@@ -589,7 +589,7 @@ int tmp;
}
if (xkb->server) {
if (xkb->server->behaviors) {
bzero((char *)&xkb->server->behaviors[minKC],
memset((char *)&xkb->server->behaviors[minKC], 0,
tmp*sizeof(XkbBehavior));
if (changes) {
changes->map.changed= _ExtendRange(changes->map.changed,
......@@ -599,7 +599,7 @@ int tmp;
}
}
if (xkb->server->key_acts) {
bzero((char *)&xkb->server->key_acts[minKC],
memset((char *)&xkb->server->key_acts[minKC], 0,
tmp*sizeof(unsigned short));
if (changes) {
changes->map.changed= _ExtendRange(changes->map.changed,
......@@ -609,7 +609,7 @@ int tmp;
}
}
if (xkb->server->vmodmap) {
bzero((char *)&xkb->server->vmodmap[minKC],
memset((char *)&xkb->server->vmodmap[minKC], 0,
tmp*sizeof(unsigned short));
if (changes) {
changes->map.changed= _ExtendRange(changes->map.changed,
......@@ -620,7 +620,7 @@ int tmp;
}
}
if ((xkb->names)&&(xkb->names->keys)) {
bzero((char *)&xkb->names->keys[minKC],tmp*sizeof(XkbKeyNameRec));
memset((char *)&xkb->names->keys[minKC], 0, tmp*sizeof(XkbKeyNameRec));
if (changes) {
changes->names.changed= _ExtendRange(changes->names.changed,
XkbKeyNamesMask,minKC,
......@@ -644,7 +644,7 @@ int tmp;
free(prev_key_sym_map);
return BadAlloc;
}
bzero((char *)&xkb->map->key_sym_map[xkb->max_key_code],
memset((char *)&xkb->map->key_sym_map[xkb->max_key_code], 0,
tmp*sizeof(XkbSymMapRec));
if (changes) {
changes->map.changed= _ExtendRange(changes->map.changed,
......@@ -662,7 +662,7 @@ int tmp;
free(prev_modmap);
return BadAlloc;
}
bzero((char *)&xkb->map->modmap[xkb->max_key_code],tmp);
memset((char *)&xkb->map->modmap[xkb->max_key_code], 0, tmp);
if (changes) {
changes->map.changed= _ExtendRange(changes->map.changed,
XkbModifierMapMask,maxKC,
......@@ -681,7 +681,7 @@ int tmp;
free(prev_behaviors);
return BadAlloc;
}
bzero((char *)&xkb->server->behaviors[xkb->max_key_code],
memset((char *)&xkb->server->behaviors[xkb->max_key_code], 0,
tmp*sizeof(XkbBehavior));
if (changes) {
changes->map.changed= _ExtendRange(changes->map.changed,
......@@ -699,7 +699,7 @@ int tmp;
free(prev_key_acts);
return BadAlloc;
}
bzero((char *)&xkb->server->key_acts[xkb->max_key_code],
memset((char *)&xkb->server->key_acts[xkb->max_key_code], 0,
tmp*sizeof(unsigned short));
if (changes) {
changes->map.changed= _ExtendRange(changes->map.changed,
......@@ -717,7 +717,7 @@ int tmp;
free(prev_vmodmap);
return BadAlloc;
}
bzero((char *)&xkb->server->vmodmap[xkb->max_key_code],
memset((char *)&xkb->server->vmodmap[xkb->max_key_code], 0,
tmp*sizeof(unsigned short));
if (changes) {
changes->map.changed= _ExtendRange(changes->map.changed,
......@@ -736,7 +736,7 @@ int tmp;
free(prev_keys);
return BadAlloc;
}
bzero((char *)&xkb->names->keys[xkb->max_key_code],
memset((char *)&xkb->names->keys[xkb->max_key_code], 0,
tmp*sizeof(XkbKeyNameRec));
if (changes) {
changes->names.changed= _ExtendRange(changes->names.changed,
......@@ -790,7 +790,7 @@ XkbAction *newActs;
memcpy(&newActs[nActs],XkbKeyActionsPtr(xkb,i),
nCopy*sizeof(XkbAction));
if (nCopy<nKeyActs)
bzero(&newActs[nActs+nCopy],(nKeyActs-nCopy)*sizeof(XkbAction));
memset(&newActs[nActs+nCopy], 0, (nKeyActs-nCopy)*sizeof(XkbAction));
xkb->server->key_acts[i]= nActs;
nActs+= nKeyActs;
}
......
......@@ -580,7 +580,7 @@ int width,nOldGroups,oldWidth,newTypes[XkbNumKbdGroups];
pSyms= XkbResizeKeySyms(xkb,key,width*nGroups);
if (pSyms==NULL)
return BadAlloc;
bzero(pSyms,width*nGroups*sizeof(KeySym));
memset(pSyms, 0, width*nGroups*sizeof(KeySym));
for (i=0;(i<nGroups)&&(i<nOldGroups);i++) {
pOldType= XkbKeyKeyType(xkb,key,i);
pNewType= &xkb->map->types[newTypes[i]];
......@@ -596,7 +596,7 @@ int width,nOldGroups,oldWidth,newTypes[XkbNumKbdGroups];
pActs= XkbResizeKeyActions(xkb,key,width*nGroups);
if (pActs==NULL)
return BadAlloc;
bzero(pActs,width*nGroups*sizeof(XkbAction));
memset(pActs, 0, width*nGroups*sizeof(XkbAction));
for (i=0;(i<nGroups)&&(i<nOldGroups);i++) {
pOldType= XkbKeyKeyType(xkb,key,i);
pNewType= &xkb->map->types[newTypes[i]];
......
......@@ -270,7 +270,7 @@ Bool found;
l_ndx_present = v_ndx_present = present= 0;
str= &line->line[1];
len = remap->number;
bzero((char *)remap,sizeof(RemapSpec));
memset((char *)remap, 0, sizeof(RemapSpec));
remap->number = len;
while ((tok=_XStrtok(str," ",strtok_buf))!=NULL) {
found= FALSE;
......@@ -412,7 +412,7 @@ Bool append = FALSE;
DebugF("Illegal line of data ignored\n");
return FALSE;
}
bzero((char *)&tmp,sizeof(FileSpec));
memset((char *)&tmp, 0, sizeof(FileSpec));
str= line->line;
for (nread= 0;(tok=_XStrtok(str," ",strtok_buf))!=NULL;nread++) {
str= NULL;
......@@ -495,7 +495,7 @@ static Bool
MakeMultiDefs(XkbRF_MultiDefsPtr mdefs, XkbRF_VarDefsPtr defs)
{
bzero((char *)mdefs,sizeof(XkbRF_MultiDefsRec));
memset((char *)mdefs, 0, sizeof(XkbRF_MultiDefsRec));
mdefs->model = defs->model;
mdefs->options = _XkbDupString(defs->options);
if (mdefs->options) squeeze_spaces(mdefs->options);
......@@ -834,7 +834,7 @@ XkbRF_GetComponents( XkbRF_RulesPtr rules,
MakeMultiDefs(&mdefs, defs);
bzero((char *)names,sizeof(XkbComponentNamesRec));
memset((char *)names, 0, sizeof(XkbComponentNamesRec));
XkbRF_ClearPartialMatches(rules);
XkbRF_CheckApplyRules(rules, &mdefs, names, XkbRF_Normal);
XkbRF_ApplyPartialMatches(rules, names);
......@@ -876,7 +876,7 @@ XkbRF_AddRule(XkbRF_RulesPtr rules)
DebugF("Allocation failure in XkbRF_AddRule\n");
return NULL;
}
bzero((char *)&rules->rules[rules->num_rules],sizeof(XkbRF_RuleRec));
memset((char *)&rules->rules[rules->num_rules], 0, sizeof(XkbRF_RuleRec));
return &rules->rules[rules->num_rules++];
}
......@@ -898,7 +898,7 @@ XkbRF_AddGroup(XkbRF_RulesPtr rules)
return NULL;
}
bzero((char *)&rules->groups[rules->num_groups],sizeof(XkbRF_GroupRec));
memset((char *)&rules->groups[rules->num_groups], 0, sizeof(XkbRF_GroupRec));
return &rules->groups[rules->num_groups++];
}
......@@ -912,20 +912,20 @@ XkbRF_GroupRec tgroup,*group;
if (!(rules && file))
return FALSE;