diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2022-12-10 14:07:18 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2022-12-11 15:36:06 -0800 |
commit | 8d85bd1e2f9473958b235caf7af9913b518f73dd (patch) | |
tree | 3348aa708638b6dbe31e9b1ca17d49465df85e8d /symbols.c | |
parent | e02e32f71f6c24fcc69bdaf58f6f9e973a017896 (diff) |
Replace uTypedRecalloc() with direct recallocarray() calls
Retains uRecalloc() as a fallback for platforms without recallocarray()
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'symbols.c')
-rw-r--r-- | symbols.c | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -297,18 +297,18 @@ ResizeKeyGroup(KeyInfo * key, if ((key->syms[group] == NULL) || tooSmall) { - key->syms[group] = uTypedRecalloc(key->syms[group], - key->numLevels[group], newWidth, - KeySym); + key->syms[group] = recallocarray(key->syms[group], + key->numLevels[group], newWidth, + sizeof(KeySym)); if (!key->syms[group]) return False; } if (((forceActions) && (tooSmall || (key->acts[group] == NULL))) || (tooSmall && (key->acts[group] != NULL))) { - key->acts[group] = uTypedRecalloc(key->acts[group], - key->numLevels[group], newWidth, - XkbAction); + key->acts[group] = recallocarray(key->acts[group], + key->numLevels[group], newWidth, + sizeof(XkbAction)); if (!key->acts[group]) return False; } @@ -607,8 +607,8 @@ AddKeySymbols(SymbolsInfo * info, KeyInfo * key, XkbDescPtr xkb) if (info->nKeys >= info->szKeys) { info->szKeys += SYMBOLS_CHUNK; - info->keys = - uTypedRecalloc(info->keys, info->nKeys, info->szKeys, KeyInfo); + info->keys = recallocarray(info->keys, info->nKeys, info->szKeys, + sizeof(KeyInfo)); if (!info->keys) { WSGO("Could not allocate key symbols descriptions\n"); |