diff --git a/repos/dde_linux/src/drivers/usb_hid/main.cc b/repos/dde_linux/src/drivers/usb_hid/main.cc index 9b071d22dc..b205d08fd6 100644 --- a/repos/dde_linux/src/drivers/usb_hid/main.cc +++ b/repos/dde_linux/src/drivers/usb_hid/main.cc @@ -281,7 +281,7 @@ void Driver::input_callback(Input_event type, unsigned code, case EVENT_TYPE_WHEEL: submit(Wheel{rx, ry}); break; case EVENT_TYPE_TOUCH: { - Touch_id const id { (int)code }; + Touch_id const id { code }; if (rx == -1 && ry == -1) submit(Touch_release{id}); diff --git a/repos/os/include/input/event.h b/repos/os/include/input/event.h index 55111d847c..e0b453543f 100644 --- a/repos/os/include/input/event.h +++ b/repos/os/include/input/event.h @@ -23,7 +23,7 @@ namespace Input { typedef Genode::Codepoint Codepoint; - struct Touch_id { int value; }; + struct Touch_id { unsigned value; }; /* * Event attributes diff --git a/repos/os/src/drivers/touch/synaptics_dsx/main.cc b/repos/os/src/drivers/touch/synaptics_dsx/main.cc index 4553e73ed1..1df0f820e2 100644 --- a/repos/os/src/drivers/touch/synaptics_dsx/main.cc +++ b/repos/os/src/drivers/touch/synaptics_dsx/main.cc @@ -77,7 +77,7 @@ struct Synaptics _i2c.send(I2C_ADDR, _buf, 1); _i2c.recv(I2C_ADDR, (uint8_t *)fingers, sizeof(fingers)); - for (int i = 0; i < FINGERS; i++) { + for (unsigned i = 0; i < FINGERS; i++) { Finger_data ¤t = fingers[i]; Input::Touch_id id { i }; diff --git a/repos/os/src/lib/genode_c_api/event.cc b/repos/os/src/lib/genode_c_api/event.cc index ac21372685..2be248ef39 100644 --- a/repos/os/src/lib/genode_c_api/event.cc +++ b/repos/os/src/lib/genode_c_api/event.cc @@ -75,7 +75,7 @@ namespace { static void _touch(struct genode_event_submit *myself, struct genode_event_touch_args const *args) { - Input::Touch_id id { (int)args->finger }; + Input::Touch_id id { args->finger }; _with_batch(myself, [&] (Event::Session_client::Batch &batch) { batch.submit(Input::Touch { id, (float)args->xpos, (float)args->ypos }); }); @@ -84,7 +84,7 @@ namespace { static void _touch_release(struct genode_event_submit *myself, unsigned finger) { - Input::Touch_id id { (int)finger }; + Input::Touch_id id { finger }; _with_batch(myself, [&] (Event::Session_client::Batch &batch) { batch.submit(Input::Touch_release { id }); });