Commit d616218c authored by Peter Hutterer's avatar Peter Hutterer

tools: fix a bunch of format conversion complaints

Fixes #137Signed-off-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
parent 14e47ed2
......@@ -379,8 +379,8 @@ buffer_key_event(struct record_context *ctx,
snprintf(event->u.libinput.msg,
sizeof(event->u.libinput.msg),
"{time: %ld.%06ld, type: %s, key: %d, state: %s}",
time / (int)1e6,
time % (int)1e6,
(long)(time / (int)1e6),
(long)(time % (int)1e6),
type,
key,
state == LIBINPUT_KEY_STATE_PRESSED ? "pressed" : "released");
......@@ -414,8 +414,8 @@ buffer_motion_event(struct record_context *ctx,
snprintf(event->u.libinput.msg,
sizeof(event->u.libinput.msg),
"{time: %ld.%06ld, type: %s, delta: [%6.2f, %6.2f], unaccel: [%6.2f, %6.2f]}",
time / (int)1e6,
time % (int)1e6,
(long)(time / (int)1e6),
(long)(time % (int)1e6),
type,
x, y,
uax, uay);
......@@ -449,8 +449,8 @@ buffer_absmotion_event(struct record_context *ctx,
snprintf(event->u.libinput.msg,
sizeof(event->u.libinput.msg),
"{time: %ld.%06ld, type: %s, point: [%6.2f, %6.2f], transformed: [%6.2f, %6.2f]}",
time / (int)1e6,
time % (int)1e6,
(long)(time / (int)1e6),
(long)(time % (int)1e6),
type,
x, y,
tx, ty);
......@@ -484,8 +484,8 @@ buffer_pointer_button_event(struct record_context *ctx,
snprintf(event->u.libinput.msg,
sizeof(event->u.libinput.msg),
"{time: %ld.%06ld, type: %s, button: %d, state: %s, seat_count: %u}",
time / (int)1e6,
time % (int)1e6,
(long)(time / (int)1e6),
(long)(time % (int)1e6),
type,
button,
state == LIBINPUT_BUTTON_STATE_PRESSED ? "pressed" : "released",
......@@ -541,8 +541,8 @@ buffer_pointer_axis_event(struct record_context *ctx,
snprintf(event->u.libinput.msg,
sizeof(event->u.libinput.msg),
"{time: %ld.%06ld, type: %s, axes: [%2.2f, %2.2f], discrete: [%d, %d], source: %s}",
time / (int)1e6,
time % (int)1e6,
(long)(time / (int)1e6),
(long)(time % (int)1e6),
type,
h, v,
hd, vd,
......@@ -596,8 +596,8 @@ buffer_touch_event(struct record_context *ctx,
snprintf(event->u.libinput.msg,
sizeof(event->u.libinput.msg),
"{time: %ld.%06ld, type: %s}",
time / (int)1e6,
time % (int)1e6,
(long)(time / (int)1e6),
(long)(time % (int)1e6),
type);
break;
case LIBINPUT_EVENT_TOUCH_DOWN:
......@@ -609,8 +609,8 @@ buffer_touch_event(struct record_context *ctx,
snprintf(event->u.libinput.msg,
sizeof(event->u.libinput.msg),
"{time: %ld.%06ld, type: %s, slot: %d, seat_slot: %d, point: [%6.2f, %6.2f], transformed: [%6.2f, %6.2f]}",
time / (int)1e6,
time % (int)1e6,
(long)(time / (int)1e6),
(long)(time % (int)1e6),
type,
slot,
seat_slot,
......@@ -622,8 +622,8 @@ buffer_touch_event(struct record_context *ctx,
snprintf(event->u.libinput.msg,
sizeof(event->u.libinput.msg),
"{time: %ld.%06ld, type: %s, slot: %d, seat_slot: %d}",
time / (int)1e6,
time % (int)1e6,
(long)(time / (int)1e6),
(long)(time % (int)1e6),
type,
slot,
seat_slot);
......@@ -679,8 +679,8 @@ buffer_gesture_event(struct record_context *ctx,
"{time: %ld.%06ld, type: %s, nfingers: %d, "
"delta: [%6.2f, %6.2f], unaccel: [%6.2f, %6.2f], "
"angle_delta: %6.2f, scale: %6.2f}",
time / (int)1e6,
time % (int)1e6,
(long)(time / (int)1e6),
(long)(time % (int)1e6),
type,
libinput_event_gesture_get_finger_count(g),
libinput_event_gesture_get_dx(g),
......@@ -698,8 +698,8 @@ buffer_gesture_event(struct record_context *ctx,
sizeof(event->u.libinput.msg),
"{time: %ld.%06ld, type: %s, nfingers: %d, "
"delta: [%6.2f, %6.2f], unaccel: [%6.2f, %6.2f]}",
time / (int)1e6,
time % (int)1e6,
(long)(time / (int)1e6),
(long)(time % (int)1e6),
type,
libinput_event_gesture_get_finger_count(g),
libinput_event_gesture_get_dx(g),
......@@ -875,8 +875,8 @@ buffer_tablet_tool_proximity_event(struct record_context *ctx,
snprintf(event->u.libinput.msg,
sizeof(event->u.libinput.msg),
"{time: %ld.%06ld, type: %s, proximity: %s, tool-type: %s, serial: %" PRIu64 ", axes: %s, %s}",
time / (int)1e6,
time % (int)1e6,
(long)(time / (int)1e6),
(long)(time % (int)1e6),
type,
prox ? "in" : "out",
tool_type,
......@@ -917,8 +917,8 @@ buffer_tablet_tool_button_event(struct record_context *ctx,
snprintf(event->u.libinput.msg,
sizeof(event->u.libinput.msg),
"{time: %ld.%06ld, type: %s, button: %d, state: %s}",
time / (int)1e6,
time % (int)1e6,
(long)(time / (int)1e6),
(long)(time % (int)1e6),
type,
button,
state ? "pressed" : "released");
......@@ -974,8 +974,8 @@ buffer_tablet_tool_event(struct record_context *ctx,
snprintf(event->u.libinput.msg,
sizeof(event->u.libinput.msg),
"{time: %ld.%06ld, type: %s%s, tip: %s, %s}",
time / (int)1e6,
time % (int)1e6,
(long)(time / (int)1e6),
(long)(time % (int)1e6),
type,
btn_buffer, /* may be empty string */
tip ? "down" : "up",
......@@ -1016,8 +1016,8 @@ buffer_tablet_pad_button_event(struct record_context *ctx,
snprintf(event->u.libinput.msg,
sizeof(event->u.libinput.msg),
"{time: %ld.%06ld, type: %s, button: %d, state: %s, mode: %d, is-toggle: %s}",
time / (int)1e6,
time % (int)1e6,
(long)(time / (int)1e6),
(long)(time % (int)1e6),
type,
button,
state == LIBINPUT_BUTTON_STATE_PRESSED ? "pressed" : "released",
......@@ -1083,8 +1083,8 @@ buffer_tablet_pad_ringstrip_event(struct record_context *ctx,
snprintf(event->u.libinput.msg,
sizeof(event->u.libinput.msg),
"{time: %ld.%06ld, type: %s, number: %d, position: %.2f, source: %s, mode: %d}",
time / (int)1e6,
time % (int)1e6,
(long)(time / (int)1e6),
(long)(time % (int)1e6),
type,
number,
pos,
......@@ -1121,8 +1121,8 @@ buffer_switch_event(struct record_context *ctx,
snprintf(event->u.libinput.msg,
sizeof(event->u.libinput.msg),
"{time: %ld.%06ld, type: %s, switch: %d, state: %s}",
time / (int)1e6,
time % (int)1e6,
(long)(time / (int)1e6),
(long)(time % (int)1e6),
type,
sw,
state == LIBINPUT_SWITCH_STATE_ON ? "on" : "off");
......
......@@ -697,7 +697,7 @@ tools_list_device_quirks(struct quirks_context *ctx,
case QUIRK_ATTR_SIZE_HINT:
case QUIRK_ATTR_RESOLUTION_HINT:
quirks_get_dimensions(quirks, *q, &dim);
snprintf(buf, sizeof(buf), "%s=%ldx%ld", name, dim.x, dim.y);
snprintf(buf, sizeof(buf), "%s=%zdx%zd", name, dim.x, dim.y);
callback(userdata, buf);
break;
case QUIRK_ATTR_TOUCH_SIZE_RANGE:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment