summaryrefslogtreecommitdiff
path: root/dix
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2014-10-09 15:08:31 +0200
committerKeith Packard <keithp@keithp.com>2014-10-09 15:08:31 +0200
commitd634ecdf82f244ff8ce75d351fc175792d254e5c (patch)
treefba698f6ead9f73c54a76e894221270979251b5c /dix
parent6622f0cb1761501f3287ffa8d3cbca3fd30f9f0c (diff)
parent7ebf480f5eb75e06271ec924769e51bdcbbdc69c (diff)
Merge remote-tracking branch 'ajax/dead-code'
Diffstat (limited to 'dix')
-rw-r--r--dix/devices.c57
1 files changed, 0 insertions, 57 deletions
diff --git a/dix/devices.c b/dix/devices.c
index f17a3ac65..3fb7ca0fb 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -1214,63 +1214,6 @@ QueryMinMaxKeyCodes(KeyCode *minCode, KeyCode *maxCode)
}
}
-/* Notably, this function does not expand the destination's keycode range, or
- * notify clients. */
-Bool
-SetKeySymsMap(KeySymsPtr dst, KeySymsPtr src)
-{
- int i, j;
- KeySym *tmp;
- int rowDif = src->minKeyCode - dst->minKeyCode;
-
- /* if keysym map size changes, grow map first */
- if (src->mapWidth < dst->mapWidth) {
- for (i = src->minKeyCode; i <= src->maxKeyCode; i++) {
-#define SI(r, c) (((r - src->minKeyCode) * src->mapWidth) + (c))
-#define DI(r, c) (((r - dst->minKeyCode) * dst->mapWidth) + (c))
- for (j = 0; j < src->mapWidth; j++)
- dst->map[DI(i, j)] = src->map[SI(i, j)];
- for (j = src->mapWidth; j < dst->mapWidth; j++)
- dst->map[DI(i, j)] = NoSymbol;
-#undef SI
-#undef DI
- }
- return TRUE;
- }
- else if (src->mapWidth > dst->mapWidth) {
- i = sizeof(KeySym) * src->mapWidth *
- (dst->maxKeyCode - dst->minKeyCode + 1);
- tmp = calloc(sizeof(KeySym), i);
- if (!tmp)
- return FALSE;
-
- if (dst->map) {
- for (i = 0; i <= dst->maxKeyCode - dst->minKeyCode; i++)
- memmove(&tmp[i * src->mapWidth], &dst->map[i * dst->mapWidth],
- dst->mapWidth * sizeof(KeySym));
- free(dst->map);
- }
- dst->mapWidth = src->mapWidth;
- dst->map = tmp;
- }
- else if (!dst->map) {
- i = sizeof(KeySym) * src->mapWidth *
- (dst->maxKeyCode - dst->minKeyCode + 1);
- tmp = calloc(sizeof(KeySym), i);
- if (!tmp)
- return FALSE;
-
- dst->map = tmp;
- dst->mapWidth = src->mapWidth;
- }
-
- memmove(&dst->map[rowDif * dst->mapWidth], src->map,
- (src->maxKeyCode - src->minKeyCode + 1) *
- dst->mapWidth * sizeof(KeySym));
-
- return TRUE;
-}
-
Bool
InitButtonClassDeviceStruct(DeviceIntPtr dev, int numButtons, Atom *labels,
CARD8 *map)