From: Nayan Deshmukh Date: Sun, 4 Aug 2019 11:58:56 +0000 (+0900) Subject: doc: add a note regarding truncation of id_* fields X-Git-Tag: libevdev-1.8.0~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a2bb53262f6a1922ae3333dad680395c799c316c;p=platform%2Fupstream%2Flibevdev.git doc: add a note regarding truncation of id_* fields The id_* fields are 16 bits in linux/input.h and we mirror the kernel API here. Even though we accept an int for this fields in ABI the value is truncated at 16 bits. Signed-off-by: Nayan Deshmukh Signed-off-by: Peter Hutterer --- diff --git a/libevdev/libevdev.h b/libevdev/libevdev.h index 32a4317..8fd8a5b 100644 --- a/libevdev/libevdev.h +++ b/libevdev/libevdev.h @@ -1272,7 +1272,9 @@ int libevdev_get_id_product(const struct libevdev *dev); * @param product_id The product ID to assign to this device * * @note This function may be called before libevdev_set_fd(). A call to - * libevdev_set_fd() will overwrite any previously set value. + * libevdev_set_fd() will overwrite any previously set value. Even though + * the function accepts an int for product_id the value is truncated at 16 + * bits. */ void libevdev_set_id_product(struct libevdev *dev, int product_id); @@ -1294,7 +1296,9 @@ int libevdev_get_id_vendor(const struct libevdev *dev); * @param vendor_id The vendor ID to assign to this device * * @note This function may be called before libevdev_set_fd(). A call to - * libevdev_set_fd() will overwrite any previously set value. + * libevdev_set_fd() will overwrite any previously set value. Even though + * the function accepts an int for vendor_id the value is truncated at 16 + * bits. */ void libevdev_set_id_vendor(struct libevdev *dev, int vendor_id); @@ -1316,7 +1320,9 @@ int libevdev_get_id_bustype(const struct libevdev *dev); * @param bustype The bustype to assign to this device * * @note This function may be called before libevdev_set_fd(). A call to - * libevdev_set_fd() will overwrite any previously set value. + * libevdev_set_fd() will overwrite any previously set value. Even though + * the function accepts an int for bustype the value is truncated at 16 + * bits. */ void libevdev_set_id_bustype(struct libevdev *dev, int bustype); @@ -1338,7 +1344,9 @@ int libevdev_get_id_version(const struct libevdev *dev); * @param version The version to assign to this device * * @note This function may be called before libevdev_set_fd(). A call to - * libevdev_set_fd() will overwrite any previously set value. + * libevdev_set_fd() will overwrite any previously set value. Even though + * the function accepts an int for version the value is truncated at 16 + * bits. */ void libevdev_set_id_version(struct libevdev *dev, int version);