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/XKBMAlloc.c | |
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/XKBMAlloc.c')
-rw-r--r-- | xkb/XKBMAlloc.c | 40 |
1 files changed, 20 insertions, 20 deletions
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; } |