[PATCH 03/19] input: Remove unused SetKeySymsMap
Adam Jackson
ajax at redhat.com
Thu Sep 25 10:37:19 PDT 2014
Signed-off-by: Adam Jackson <ajax at redhat.com>
---
dix/devices.c | 57 ---------------------------------------------------------
include/input.h | 3 ---
2 files changed, 60 deletions(-)
diff --git a/dix/devices.c b/dix/devices.c
index f17a3ac..3fb7ca0 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)
diff --git a/include/input.h b/include/input.h
index 1b2102f..35ceafa 100644
--- a/include/input.h
+++ b/include/input.h
@@ -287,9 +287,6 @@ extern _X_EXPORT int dixLookupDevice(DeviceIntPtr * /* dev */ ,
extern _X_EXPORT void QueryMinMaxKeyCodes(KeyCode * /*minCode */ ,
KeyCode * /*maxCode */ );
-extern _X_EXPORT Bool SetKeySymsMap(KeySymsPtr /*dst */ ,
- KeySymsPtr /*src */ );
-
extern _X_EXPORT Bool InitButtonClassDeviceStruct(DeviceIntPtr /*device */ ,
int /*numButtons */ ,
Atom * /* labels */ ,
--
1.9.3
More information about the xorg-devel
mailing list