From 4cfd2c98f39af74a297315ed6606becba2a53987 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 5 Jan 2011 10:09:22 +1000 Subject: De-duplicate event code+value printing. The only difference for EV_MSC is that the value is printed in hex, the rest of the code is identical. Signed-off-by: Peter Hutterer --- evtest.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/evtest.c b/evtest.c index 410efbc..a5525bf 100644 --- a/evtest.c +++ b/evtest.c @@ -451,20 +451,16 @@ int main (int argc, char **argv) if (ev[i].type == EV_SYN) { printf("-------------- %s ------------\n", syns[ev[i].code]); - } else if (ev[i].type == EV_MSC && (ev[i].code == MSC_RAW || ev[i].code == MSC_SCAN)) { - printf("type %d (%s), code %d (%s), value %02x\n", - ev[i].type, - events[ev[i].type] ? events[ev[i].type] : "?", - ev[i].code, - names[ev[i].type] ? (names[ev[i].type][ev[i].code] ? names[ev[i].type][ev[i].code] : "?") : "?", - ev[i].value); } else { - printf("type %d (%s), code %d (%s), value %d\n", + printf("type %d (%s), code %d (%s), ", ev[i].type, events[ev[i].type] ? events[ev[i].type] : "?", ev[i].code, - names[ev[i].type] ? (names[ev[i].type][ev[i].code] ? names[ev[i].type][ev[i].code] : "?") : "?", - ev[i].value); + names[ev[i].type] ? (names[ev[i].type][ev[i].code] ? names[ev[i].type][ev[i].code] : "?") : "?"); + if (ev[i].type == EV_MSC && (ev[i].code == MSC_RAW || ev[i].code == MSC_SCAN)) + printf("value %02x\n", ev[i].value); + else + printf("value %d\n", ev[i].value); } } -- cgit v1.2.3