diff options
author | Mikhail Gusarov <dottedmag@dottedmag.net> | 2010-06-04 15:35:31 +0700 |
---|---|---|
committer | Mikhail Gusarov <dottedmag@dottedmag.net> | 2010-06-06 15:07:27 +0700 |
commit | 5a0fc0ad21d562612676ef88ef2d533b2391810a (patch) | |
tree | 6a88d6c9f6194165e08c934f50ac490d8c381ac6 /xkb | |
parent | f9810ba914877b379cb36f1b9755f7923ceca14c (diff) |
Replace deprecated bzero with memset
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Marcin BaczyĆski <marbacz@gmail.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Diffstat (limited to 'xkb')
-rw-r--r-- | xkb/XKBAlloc.c | 4 | ||||
-rw-r--r-- | xkb/XKBGAlloc.c | 18 | ||||
-rw-r--r-- | xkb/XKBMAlloc.c | 40 | ||||
-rw-r--r-- | xkb/XKBMisc.c | 4 | ||||
-rw-r--r-- | xkb/maprules.c | 22 | ||||
-rw-r--r-- | xkb/xkb.c | 52 | ||||
-rw-r--r-- | xkb/xkbActions.c | 2 | ||||
-rw-r--r-- | xkb/xkbLEDs.c | 24 | ||||
-rw-r--r-- | xkb/xkbUtils.c | 10 | ||||
-rw-r--r-- | xkb/xkmread.c | 6 |
10 files changed, 91 insertions, 91 deletions
diff --git a/xkb/XKBAlloc.c b/xkb/XKBAlloc.c index 0e3c6f4bd..c52e091da 100644 --- a/xkb/XKBAlloc.c +++ b/xkb/XKBAlloc.c @@ -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); diff --git a/xkb/XKBGAlloc.c b/xkb/XKBGAlloc.c index 7a3659f54..f155cc867 100644 --- a/xkb/XKBGAlloc.c +++ b/xkb/XKBGAlloc.c @@ -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= §ion->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; diff --git a/xkb/XKBMAlloc.c b/xkb/XKBMAlloc.c index 27151b8b1..abe001856 100644 --- a/xkb/XKBMAlloc.c +++ b/xkb/XKBMAlloc.c @@ -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; } diff --git a/xkb/XKBMisc.c b/xkb/XKBMisc.c index ee3dfcca3..efe291103 100644 --- a/xkb/XKBMisc.c +++ b/xkb/XKBMisc.c @@ -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]]; diff --git a/xkb/maprules.c b/xkb/maprules.c index 3b15a4749..5aabd1c8e 100644 --- a/xkb/maprules.c +++ b/xkb/maprules.c @@ -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; - bzero((char *)&remap,sizeof(RemapSpec)); - bzero((char *)&tgroup,sizeof(XkbRF_GroupRec)); + memset((char *)&remap, 0, sizeof(RemapSpec)); + memset((char *)&tgroup, 0, sizeof(XkbRF_GroupRec)); InitInputLine(&line); while (GetInputLine(file,&line,TRUE)) { if (CheckLine(&line,&remap,&trule,&tgroup)) { if (tgroup.number) { if ((group= XkbRF_AddGroup(rules))!=NULL) { *group= tgroup; - bzero((char *)&tgroup,sizeof(XkbRF_GroupRec)); + memset((char *)&tgroup, 0, sizeof(XkbRF_GroupRec)); } } else { if ((rule= XkbRF_AddRule(rules))!=NULL) { *rule= trule; - bzero((char *)&trule,sizeof(XkbRF_RuleRec)); + memset((char *)&trule, 0, sizeof(XkbRF_RuleRec)); } } } @@ -997,7 +997,7 @@ XkbRF_GroupPtr group; if (rule->types) free(rule->types); if (rule->compat) free(rule->compat); if (rule->geometry) free(rule->geometry); - bzero((char *)rule,sizeof(XkbRF_RuleRec)); + memset((char *)rule, 0, sizeof(XkbRF_RuleRec)); } free(rules->rules); rules->num_rules= rules->sz_rules= 0; @@ -557,7 +557,7 @@ ProcXkbGetState(ClientPtr client) CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixGetAttrAccess); xkb= &dev->key->xkbInfo->state; - bzero(&rep,sizeof(xkbGetStateReply)); + memset(&rep, 0, sizeof(xkbGetStateReply)); rep.type= X_Reply; rep.sequenceNumber= client->sequence; rep.length = 0; @@ -1429,7 +1429,7 @@ ProcXkbGetMap(ClientPtr client) CHK_MASK_LEGAL(0x03,stuff->partial,XkbAllMapComponentsMask); xkb= dev->key->xkbInfo->desc; - bzero(&rep,sizeof(xkbGetMapReply)); + memset(&rep, 0, sizeof(xkbGetMapReply)); rep.type= X_Reply; rep.sequenceNumber= client->sequence; rep.length = (SIZEOF(xkbGetMapReply)-SIZEOF(xGenericReply))>>2; @@ -2172,7 +2172,7 @@ unsigned first,last; first= req->firstKeyBehavior; last= req->firstKeyBehavior+req->nKeyBehaviors-1; - bzero(&server->behaviors[first],req->nKeyBehaviors*sizeof(XkbBehavior)); + memset(&server->behaviors[first], 0, req->nKeyBehaviors*sizeof(XkbBehavior)); for (i=0;i<req->totalKeyBehaviors;i++) { if ((server->behaviors[wire->key].type&XkbKB_Permanent)==0) { server->behaviors[wire->key].type= wire->type; @@ -2190,7 +2190,7 @@ unsigned first,last; else xkbi->radioGroups= calloc(1, sz); if (xkbi->radioGroups) { if (xkbi->nRadioGroups) - bzero(&xkbi->radioGroups[xkbi->nRadioGroups], + memset(&xkbi->radioGroups[xkbi->nRadioGroups], 0, (maxRG-xkbi->nRadioGroups)*sizeof(XkbRadioGroupRec)); xkbi->nRadioGroups= maxRG; } @@ -2245,7 +2245,7 @@ CARD8 * start; start= wire; first= req->firstKeyExplicit; last= req->firstKeyExplicit+req->nKeyExplicit-1; - bzero(&xkb->explicit[first],req->nKeyExplicit); + memset(&xkb->explicit[first], 0, req->nKeyExplicit); for (i=0;i<req->totalKeyExplicit;i++,wire+= 2) { xkb->explicit[wire[0]]= wire[1]; } @@ -2279,7 +2279,7 @@ CARD8 * start; start= wire; first= req->firstModMapKey; last= req->firstModMapKey+req->nModMapKeys-1; - bzero(&xkb->modmap[first],req->nModMapKeys); + memset(&xkb->modmap[first], 0, req->nModMapKeys); for (i=0;i<req->totalModMapKeys;i++,wire+= 2) { xkb->modmap[wire[0]]= wire[1]; } @@ -2311,7 +2311,7 @@ XkbServerMapPtr srv = xkbi->desc->server; first= req->firstVModMapKey; last= req->firstVModMapKey+req->nVModMapKeys-1; - bzero(&srv->vmodmap[first],req->nVModMapKeys*sizeof(unsigned short)); + memset(&srv->vmodmap[first], 0, req->nVModMapKeys*sizeof(unsigned short)); for (i=0;i<req->totalVModMapKeys;i++,wire++) { srv->vmodmap[wire->key]= wire->vmods; } @@ -2438,7 +2438,7 @@ _XkbSetMap(ClientPtr client, DeviceIntPtr dev, xkbSetMapReq *req, char *values) xkb = xkbi->desc; XkbSetCauseXkbReq(&cause,X_kbSetMap,client); - bzero(&change, sizeof(change)); + memset(&change, 0, sizeof(change)); sentNKN = FALSE; if ((xkb->min_key_code!=req->minKeyCode)|| (xkb->max_key_code!=req->maxKeyCode)) { @@ -2851,7 +2851,7 @@ _XkbSetCompatMap(ClientPtr client, DeviceIntPtr dev, XkbEventCauseRec cause; XkbSetCauseXkbReq(&cause,X_kbSetCompatMap,client); - bzero(&change,sizeof(XkbChangesRec)); + memset(&change, 0, sizeof(XkbChangesRec)); XkbUpdateActions(dev,xkb->min_key_code,XkbNumKeys(xkb),&change,&check, &cause); if (check) @@ -3384,8 +3384,8 @@ _XkbSetNamedIndicator(ClientPtr client, DeviceIntPtr dev, statec |= ((sli->effectiveState ^ sli->explicitState) & (1 << led)); } - bzero((char *)&ed,sizeof(xkbExtensionDeviceNotify)); - bzero((char *)&changes,sizeof(XkbChangesRec)); + memset((char *)&ed, 0, sizeof(xkbExtensionDeviceNotify)); + memset((char *)&changes, 0, sizeof(XkbChangesRec)); XkbSetCauseXkbReq(&cause,X_kbSetNamedIndicator,client); if (namec) XkbApplyLedNameChanges(dev,sli,namec,&ed,&changes,&cause); @@ -4038,7 +4038,7 @@ _XkbSetNames(ClientPtr client, DeviceIntPtr dev, xkbSetNamesReq *stuff) return BadAlloc; } - bzero(&nn,sizeof(xkbNamesNotify)); + memset(&nn, 0, sizeof(xkbNamesNotify)); nn.changed= stuff->which; tmp = (CARD32 *)&stuff[1]; if (stuff->which&XkbKeycodesNameMask) @@ -4160,7 +4160,7 @@ _XkbSetNames(ClientPtr client, DeviceIntPtr dev, xkbSetNamesReq *stuff) if (names->indicators[i]!=None) sli->namesPresent|= bit; } - bzero(&edev,sizeof(xkbExtensionDeviceNotify)); + memset(&edev, 0, sizeof(xkbExtensionDeviceNotify)); edev.reason= XkbXI_IndicatorNamesMask; edev.ledClass= KbdFeedbackClass; edev.ledID= dev->kbdfeed->ctrl.id; @@ -4478,7 +4478,7 @@ xkbDoodadWireDesc * doodadWire; for (i=0;i<num_doodads;i++,doodad++) { doodadWire= (xkbDoodadWireDesc *)wire; wire= (char *)&doodadWire[1]; - bzero(doodadWire,SIZEOF(xkbDoodadWireDesc)); + memset(doodadWire, 0, SIZEOF(xkbDoodadWireDesc)); doodadWire->any.name= doodad->any.name; doodadWire->any.type= doodad->any.type; doodadWire->any.priority= doodad->any.priority; @@ -5290,7 +5290,7 @@ _XkbSetGeometry(ClientPtr client, DeviceIntPtr dev, xkbSetGeometryReq *stuff) XkbFreeGeometry(old,XkbGeomAllMask,TRUE); if (new_name) { xkbNamesNotify nn; - bzero(&nn,sizeof(xkbNamesNotify)); + memset(&nn, 0, sizeof(xkbNamesNotify)); nn.changed= XkbGeometryNameMask; XkbSendNamesNotify(dev,&nn); } @@ -5497,7 +5497,7 @@ ProcXkbListComponents(ClientPtr client) status= Success; str= (unsigned char *)&stuff[1]; - bzero(&list,sizeof(XkbSrvListInfoRec)); + memset(&list, 0, sizeof(XkbSrvListInfoRec)); list.maxRtrn= stuff->maxNames; list.pattern[_XkbListKeycodes]= GetComponentSpec(&str,FALSE,&status); list.pattern[_XkbListTypes]= GetComponentSpec(&str,FALSE,&status); @@ -5516,7 +5516,7 @@ ProcXkbListComponents(ClientPtr client) } return status; } - bzero(&rep,sizeof(xkbListComponentsReply)); + memset(&rep, 0, sizeof(xkbListComponentsReply)); rep.type= X_Reply; rep.deviceID = dev->id; rep.sequenceNumber = client->sequence; @@ -5622,7 +5622,7 @@ ProcXkbGetKbdByName(ClientPtr client) geom_changed= FALSE; } - bzero(mapFile,PATH_MAX); + memset(mapFile, 0, PATH_MAX); rep.type= X_Reply; rep.deviceID = dev->id; rep.sequenceNumber = client->sequence; @@ -5657,7 +5657,7 @@ ProcXkbGetKbdByName(ClientPtr client) if (stuff->load || ((rep.reported&XkbGBN_SymbolsMask) && (new->compat))) { XkbChangesRec changes; - bzero(&changes,sizeof(changes)); + memset(&changes, 0, sizeof(changes)); XkbUpdateDescActions(new, new->min_key_code,XkbNumKeys(new), &changes); @@ -6121,7 +6121,7 @@ char * str; wanted&= ~XkbXI_IndicatorsMask; nameLen= XkbSizeCountedString(dev->name); - bzero((char *)&rep,SIZEOF(xkbGetDeviceInfoReply)); + memset((char *)&rep, 0, SIZEOF(xkbGetDeviceInfoReply)); rep.type = X_Reply; rep.deviceID= dev->id; rep.sequenceNumber = client->sequence; @@ -6329,8 +6329,8 @@ xkbExtensionDeviceNotify ed; XkbChangesRec changes; DeviceIntPtr kbd; - bzero((char *)&ed,sizeof(xkbExtensionDeviceNotify)); - bzero((char *)&changes,sizeof(XkbChangesRec)); + memset((char *)&ed, 0, sizeof(xkbExtensionDeviceNotify)); + memset((char *)&changes, 0, sizeof(XkbChangesRec)); XkbSetCauseXkbReq(&cause,X_kbSetDeviceInfo,client); ledWire= (xkbDeviceLedsWireDesc *)wire; for (i=0;i<num;i++) { @@ -6351,11 +6351,11 @@ DeviceIntPtr kbd; atomWire= (CARD32 *)&ledWire[1]; if (changed&XkbXI_IndicatorNamesMask) { namec= sli->namesPresent|ledWire->namesPresent; - bzero((char *)sli->names,XkbNumIndicators*sizeof(Atom)); + memset((char *)sli->names, 0, XkbNumIndicators*sizeof(Atom)); } if (ledWire->namesPresent) { sli->namesPresent= ledWire->namesPresent; - bzero((char *)sli->names,XkbNumIndicators*sizeof(Atom)); + memset((char *)sli->names, 0, XkbNumIndicators*sizeof(Atom)); for (n=0,bit=1;n<XkbNumIndicators;n++,bit<<=1) { if (ledWire->namesPresent&bit) { sli->names[n]= (Atom)*atomWire; @@ -6369,7 +6369,7 @@ DeviceIntPtr kbd; if (changed&XkbXI_IndicatorMapsMask) { mapc= sli->mapsPresent|ledWire->mapsPresent; sli->mapsPresent= ledWire->mapsPresent; - bzero((char*)sli->maps,XkbNumIndicators*sizeof(XkbIndicatorMapRec)); + memset((char*)sli->maps, 0, XkbNumIndicators*sizeof(XkbIndicatorMapRec)); } if (ledWire->mapsPresent) { for (n=0,bit=1;n<XkbNumIndicators;n++,bit<<=1) { @@ -6448,7 +6448,7 @@ _XkbSetDeviceInfoCheck(ClientPtr client, DeviceIntPtr dev, char *wire; xkbExtensionDeviceNotify ed; - bzero((char *)&ed,SIZEOF(xkbExtensionDeviceNotify)); + memset((char *)&ed, 0, SIZEOF(xkbExtensionDeviceNotify)); ed.deviceID= dev->id; wire= (char *)&stuff[1]; if (stuff->change&XkbXI_ButtonActionsMask) { diff --git a/xkb/xkbActions.c b/xkb/xkbActions.c index 3f0b766db..afc44ac44 100644 --- a/xkb/xkbActions.c +++ b/xkb/xkbActions.c @@ -1032,7 +1032,7 @@ register int i; xkbi->filters= realloc(xkbi->filters, xkbi->szFilters * sizeof(XkbFilterRec)); /* 6/21/93 (ef) -- XXX! deal with allocation failure */ - bzero(&xkbi->filters[xkbi->szFilters/2], + memset(&xkbi->filters[xkbi->szFilters/2], 0, (xkbi->szFilters/2)*sizeof(XkbFilterRec)); return &xkbi->filters[xkbi->szFilters/2]; } diff --git a/xkb/xkbLEDs.c b/xkb/xkbLEDs.c index 6097f8576..d75f92093 100644 --- a/xkb/xkbLEDs.c +++ b/xkb/xkbLEDs.c @@ -263,7 +263,7 @@ unsigned oldState; if (ed==NULL) { ed= &my_ed; - bzero((char *)ed,sizeof(xkbExtensionDeviceNotify)); + memset((char *)ed, 0, sizeof(xkbExtensionDeviceNotify)); } else if ((ed->reason&XkbXI_IndicatorsMask)&& ((ed->ledClass!=sli->class)||(ed->ledID!=sli->id))) { @@ -273,7 +273,7 @@ unsigned oldState; if ((kbd==dev)&&(sli->flags&XkbSLI_IsDefault)) { if (changes==NULL) { changes= &my_changes; - bzero((char *)changes,sizeof(XkbChangesRec)); + memset((char *)changes, 0, sizeof(XkbChangesRec)); } changes->indicators.state_changes|= affected; } @@ -362,8 +362,8 @@ XkbChangesRec changes; xkbExtensionDeviceNotify ed; unsigned side_affected; - bzero((char *)&changes,sizeof(XkbChangesRec)); - bzero((char *)&ed,sizeof(xkbExtensionDeviceNotify)); + memset((char *)&changes, 0, sizeof(XkbChangesRec)); + memset((char *)&ed, 0, sizeof(xkbExtensionDeviceNotify)); sli= XkbFindSrvLedInfo(dev,XkbDfltXIClass,XkbDfltXIId,0); sli->explicitState&= ~affect; sli->explicitState|= (affect&values); @@ -735,7 +735,7 @@ XkbFlushLedEvents( DeviceIntPtr dev, if (changes->indicators.state_changes) XkbDDXUpdateDeviceIndicators(dev,sli,sli->effectiveState); XkbSendNotification(kbd,changes,cause); - bzero((char *)changes,sizeof(XkbChangesRec)); + memset((char *)changes, 0, sizeof(XkbChangesRec)); if (XkbAX_NeedFeedback(kbd->key->xkbInfo->desc->ctrls, XkbAX_IndicatorFBMask)) { if (sli->effectiveState) @@ -751,7 +751,7 @@ XkbFlushLedEvents( DeviceIntPtr dev, XkbDDXUpdateDeviceIndicators(dev,sli,sli->effectiveState); XkbSendExtensionDeviceNotify(dev,cause->client,ed); } - bzero((char *)ed,sizeof(XkbExtensionDeviceNotify)); + memset((char *)ed, 0, sizeof(XkbExtensionDeviceNotify)); } return; } @@ -778,7 +778,7 @@ xkbExtensionDeviceNotify my_ed; if (ed==NULL) { ed= &my_ed; - bzero((char *)ed,sizeof(xkbExtensionDeviceNotify)); + memset((char *)ed, 0, sizeof(xkbExtensionDeviceNotify)); } else if ((ed->reason&XkbXI_IndicatorsMask)&& ((ed->ledClass!=sli->class)||(ed->ledID!=sli->id))) { @@ -788,7 +788,7 @@ xkbExtensionDeviceNotify my_ed; if ((kbd==dev)&&(sli->flags&XkbSLI_IsDefault)) { if (changes==NULL) { changes= &my_changes; - bzero((char *)changes,sizeof(XkbChangesRec)); + memset((char *)changes, 0, sizeof(XkbChangesRec)); } changes->names.changed|= XkbIndicatorNamesMask; changes->names.changed_indicators|= changed_names; @@ -855,7 +855,7 @@ xkbExtensionDeviceNotify my_ed; if (ed==NULL) { ed= &my_ed; - bzero((char *)ed,sizeof(xkbExtensionDeviceNotify)); + memset((char *)ed, 0, sizeof(xkbExtensionDeviceNotify)); } else if ((ed->reason&XkbXI_IndicatorsMask)&& ((ed->ledClass!=sli->class)||(ed->ledID!=sli->id))) { @@ -865,7 +865,7 @@ xkbExtensionDeviceNotify my_ed; if ((kbd==dev)&&(sli->flags&XkbSLI_IsDefault)) { if (changes==NULL) { changes= &my_changes; - bzero((char *)changes,sizeof(XkbChangesRec)); + memset((char *)changes, 0, sizeof(XkbChangesRec)); } changes->indicators.map_changes|= changed_maps; } @@ -917,7 +917,7 @@ Bool kb_changed; if (changes==NULL) { changes= &my_changes; - bzero((char *)changes,sizeof(XkbChangesRec)); + memset((char *)changes, 0, sizeof(XkbChangesRec)); } kb_changed= FALSE; @@ -943,7 +943,7 @@ Bool kb_changed; if (ed==NULL) { ed= &my_ed; - bzero((char *)ed,sizeof(xkbExtensionDeviceNotify)); + memset((char *)ed, 0, sizeof(xkbExtensionDeviceNotify)); } else if (affected&&(ed->reason&XkbXI_IndicatorsMask)&& ((ed->ledClass!=sli->class)||(ed->ledID!=sli->id))) { diff --git a/xkb/xkbUtils.c b/xkb/xkbUtils.c index 87f7a0c0d..72dd546d4 100644 --- a/xkb/xkbUtils.c +++ b/xkb/xkbUtils.c @@ -282,7 +282,7 @@ register unsigned key; register unsigned bit,i; unsigned present; - bzero(newVMods,XkbNumVirtualMods); + memset(newVMods, 0, XkbNumVirtualMods); present= 0; for (key=xkb->min_key_code;key<=xkb->max_key_code;key++) { if (xkb->server->vmodmap[key]==0) @@ -588,7 +588,7 @@ XkbSrvInfoPtr xkbi = dev->key->xkbInfo; xkbMapNotify mn; xkbi->desc->server->explicit[key]|= XkbExplicitAutoRepeatMask; - bzero(&mn,sizeof(mn)); + memset(&mn, 0, sizeof(mn)); mn.changed= XkbExplicitComponentsMask; mn.firstKeyExplicit= key; mn.nKeyExplicit= 1; @@ -961,7 +961,7 @@ _XkbCopyClientMap(XkbDescPtr src, XkbDescPtr dst) if (!tmp) return FALSE; dst->map->types = tmp; - bzero(dst->map->types + dst->map->num_types, + memset(dst->map->types + dst->map->num_types, 0, (src->map->num_types - dst->map->num_types) * sizeof(XkbKeyTypeRec)); } @@ -1426,7 +1426,7 @@ _XkbCopyGeom(XkbDescPtr src, XkbDescPtr dst) dst->geom->sz_properties = src->geom->num_properties; if (dst->geom->sz_properties > dst->geom->num_properties) { - bzero(dst->geom->properties + dst->geom->num_properties, + memset(dst->geom->properties + dst->geom->num_properties, 0, (dst->geom->sz_properties - dst->geom->num_properties) * sizeof(XkbPropertyRec)); } @@ -1504,7 +1504,7 @@ _XkbCopyGeom(XkbDescPtr src, XkbDescPtr dst) dst->geom->sz_colors = src->geom->num_colors; if (dst->geom->sz_colors > dst->geom->num_colors) { - bzero(dst->geom->colors + dst->geom->num_colors, + memset(dst->geom->colors + dst->geom->num_colors, 0, (dst->geom->sz_colors - dst->geom->num_colors) * sizeof(XkbColorRec)); } diff --git a/xkb/xkmread.c b/xkb/xkmread.c index 5d3372da2..814bb1d41 100644 --- a/xkb/xkmread.c +++ b/xkb/xkmread.c @@ -80,7 +80,7 @@ int newCount= *newCountRtrn; oldPtr= realloc(oldPtr,newCount*elemSize); if (oldPtr!=NULL) { char *tmp= (char *)oldPtr; - bzero(&tmp[oldCount*elemSize],(newCount-oldCount)*elemSize); + memset(&tmp[oldCount*elemSize], 0, (newCount-oldCount)*elemSize); } } else if (newCount<oldCount) { @@ -725,8 +725,8 @@ int nRead=0; return -1; } nRead+= tmp*SIZEOF(xkmKeySymMapDesc); - bzero((char *)typeName,XkbNumKbdGroups*sizeof(Atom)); - bzero((char *)type,XkbNumKbdGroups*sizeof(XkbKeyTypePtr)); + memset((char *)typeName, 0, XkbNumKbdGroups*sizeof(Atom)); + memset((char *)type, 0, XkbNumKbdGroups*sizeof(XkbKeyTypePtr)); if (wireMap.flags&XkmKeyHasTypes) { register int g; for (g=0;g<XkbNumKbdGroups;g++) { |