From 40ac818bf8a04a0ae51cef1fc38011a38d56d5ff Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Wed, 19 Jul 2023 00:40:10 +0300
Subject: [PATCH] hidapi: sync with mainstream (typo fixes)
---
src/hidapi/AUTHORS.txt | 2 +-
src/hidapi/BUILD.cmake.md | 2 +-
src/hidapi/libusb/CMakeLists.txt | 2 +-
src/hidapi/libusb/hid.c | 2 +-
src/hidapi/linux/hid.c | 4 ++--
src/hidapi/mac/hid.c | 2 +-
src/hidapi/udev/69-hid.rules | 2 +-
src/hidapi/windows/hid.c | 2 +-
src/hidapi/windows/hidapi_descriptor_reconstruct.c | 10 +++++-----
.../windows/test/hid_report_reconstructor_test.c | 8 ++++----
10 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/src/hidapi/AUTHORS.txt b/src/hidapi/AUTHORS.txt
index 7193d71e0b0f..7c2a03584206 100644
--- a/src/hidapi/AUTHORS.txt
+++ b/src/hidapi/AUTHORS.txt
@@ -11,7 +11,7 @@ Ludovic Rousseau <rousseau@debian.org>:
Correctness fixes
libusb/hidapi Team:
- Development/maintainance since June 4th 2019
+ Development/maintenance since June 4th 2019
For a comprehensive list of contributions, see the commit list at github:
https://github.com/libusb/hidapi/graphs/contributors
diff --git a/src/hidapi/BUILD.cmake.md b/src/hidapi/BUILD.cmake.md
index 9c51d0ce0b20..aa5ba740d07d 100644
--- a/src/hidapi/BUILD.cmake.md
+++ b/src/hidapi/BUILD.cmake.md
@@ -16,7 +16,7 @@ most of this document may not be of interest for you; just check variables names
CMake can be installed either using your system's package manager,
or by downloading an installer/prebuilt version from the [official website](https://cmake.org/download/).
-On most \*nix systems, the prefered way to install CMake is via package manager,
+On most \*nix systems, the preferred way to install CMake is via package manager,
e.g. `sudo apt install cmake`.
On Windows CMake could be provided by your development environment (e.g. by Visual Studio Installer or MinGW installer),
diff --git a/src/hidapi/libusb/CMakeLists.txt b/src/hidapi/libusb/CMakeLists.txt
index 6cd48c4f70f6..617cd551a159 100644
--- a/src/hidapi/libusb/CMakeLists.txt
+++ b/src/hidapi/libusb/CMakeLists.txt
@@ -66,7 +66,7 @@ else()
else()
# otherwise there is 2 options:
# 1) iconv is provided by Standard C library and the build will be just fine
- # 2) The _user_ has to provide additiona compilation options for this project/target
+ # 2) The _user_ has to provide additional compilation options for this project/target
endif()
# check for error: "conflicting types for 'iconv'"
diff --git a/src/hidapi/libusb/hid.c b/src/hidapi/libusb/hid.c
index 0d3b4726d4b4..d6b73801c7ca 100644
--- a/src/hidapi/libusb/hid.c
+++ b/src/hidapi/libusb/hid.c
@@ -624,7 +624,7 @@ static int hid_get_report_descriptor_libusb(libusb_device_handle *handle, int in
expected_report_descriptor_size = HID_API_MAX_REPORT_DESCRIPTOR_SIZE;
/* Get the HID Report Descriptor.
- See USB HID Specificatin, sectin 7.1.1
+ See USB HID Specification, section 7.1.1
*/
int res = libusb_control_transfer(handle, LIBUSB_ENDPOINT_IN|LIBUSB_RECIPIENT_INTERFACE, LIBUSB_REQUEST_GET_DESCRIPTOR, (LIBUSB_DT_REPORT << 8), interface_num, tmp, expected_report_descriptor_size, 5000);
if (res >= 0) {
diff --git a/src/hidapi/linux/hid.c b/src/hidapi/linux/hid.c
index 00e44a5f090e..50f85f3b3fd7 100644
--- a/src/hidapi/linux/hid.c
+++ b/src/hidapi/linux/hid.c
@@ -365,7 +365,7 @@ static int get_next_hid_usage(__u8 *report_descriptor, __u32 size, unsigned int
/*
* Retrieves the hidraw report descriptor from a file.
- * When using this form, <sysfs_path>/device/report_descriptor, elevated priviledges are not required.
+ * When using this form, <sysfs_path>/device/report_descriptor, elevated privileges are not required.
*/
static int get_hid_report_descriptor(const char *rpt_path, struct hidraw_report_descriptor *rpt_desc)
{
@@ -1003,7 +1003,7 @@ struct hid_device_info HID_API_EXPORT *hid_enumerate(unsigned short vendor_id,
}
cur_dev = tmp;
- /* move the pointer to the tail of returnd list */
+ /* move the pointer to the tail of returned list */
while (cur_dev->next != NULL) {
cur_dev = cur_dev->next;
}
diff --git a/src/hidapi/mac/hid.c b/src/hidapi/mac/hid.c
index a6719824c548..20731186c354 100644
--- a/src/hidapi/mac/hid.c
+++ b/src/hidapi/mac/hid.c
@@ -814,7 +814,7 @@ struct hid_device_info HID_API_EXPORT *hid_enumerate(unsigned short vendor_id,
}
cur_dev = tmp;
- /* move the pointer to the tail of returnd list */
+ /* move the pointer to the tail of returned list */
while (cur_dev->next != NULL) {
cur_dev = cur_dev->next;
}
diff --git a/src/hidapi/udev/69-hid.rules b/src/hidapi/udev/69-hid.rules
index a27113ca873b..02d6a2cf0c06 100644
--- a/src/hidapi/udev/69-hid.rules
+++ b/src/hidapi/udev/69-hid.rules
@@ -17,7 +17,7 @@ KERNEL=="hidraw*", ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="003f", TAG+="uacc
# Once done, optionally rename this file for your application, and drop it into
# /etc/udev/rules.d/.
-# NOTE: these rules must have priorty before 73-seat-late.rules.
+# NOTE: these rules must have priority before 73-seat-late.rules.
# (Small discussion/explanation in systemd repo:
# https://github.com/systemd/systemd/issues/4288#issuecomment-348166161)
# for example, name the file /etc/udev/rules.d/70-my-application-hid.rules.
diff --git a/src/hidapi/windows/hid.c b/src/hidapi/windows/hid.c
index 740cbbbefb9b..e8b6ee987014 100644
--- a/src/hidapi/windows/hid.c
+++ b/src/hidapi/windows/hid.c
@@ -233,7 +233,7 @@ static hid_device *new_hid_device()
memset(&dev->ol, 0, sizeof(dev->ol));
dev->ol.hEvent = CreateEvent(NULL, FALSE, FALSE /*initial state f=nonsignaled*/, NULL);
memset(&dev->write_ol, 0, sizeof(dev->write_ol));
- dev->write_ol.hEvent = CreateEvent(NULL, FALSE, FALSE /*inital state f=nonsignaled*/, NULL);
+ dev->write_ol.hEvent = CreateEvent(NULL, FALSE, FALSE /*initial state f=nonsignaled*/, NULL);
dev->device_info = NULL;
return dev;
diff --git a/src/hidapi/windows/hidapi_descriptor_reconstruct.c b/src/hidapi/windows/hidapi_descriptor_reconstruct.c
index 32e4419e2c45..f6e693f69151 100644
--- a/src/hidapi/windows/hidapi_descriptor_reconstruct.c
+++ b/src/hidapi/windows/hidapi_descriptor_reconstruct.c
@@ -235,7 +235,7 @@ int hid_winapi_descriptor_reconstruct_pp_data(void *preparsed_data, unsigned cha
}
// *************************************************************************
- // -Determine hierachy levels of each collections and store it in:
+ // -Determine hierarchy levels of each collections and store it in:
// coll_levels[COLLECTION_INDEX]
// -Determine number of direct childs of each collections and store it in:
// coll_number_of_direct_childs[COLLECTION_INDEX]
@@ -303,10 +303,10 @@ int hid_winapi_descriptor_reconstruct_pp_data(void *preparsed_data, unsigned cha
}
}
- // *************************************************************************************************
- // Determine child collection order of the whole hierachy, based on previously determined bit ranges
+ // **************************************************************************************************
+ // Determine child collection order of the whole hierarchy, based on previously determined bit ranges
// and store it this index coll_child_order[COLLECTION_INDEX][DIRECT_CHILD_INDEX]
- // *************************************************************************************************
+ // **************************************************************************************************
USHORT **coll_child_order;
coll_child_order = malloc(pp_data->NumberLinkCollectionNodes * sizeof(*coll_child_order));
{
@@ -326,7 +326,7 @@ int hid_winapi_descriptor_reconstruct_pp_data(void *preparsed_data, unsigned cha
{
// Create list of child collection indices
// sorted reverse to the order returned to HidP_GetLinkCollectionNodeschild
- // which seems to match teh original order, as long as no bit position needs to be considered
+ // which seems to match the original order, as long as no bit position needs to be considered
USHORT child_idx = link_collection_nodes[collection_node_idx].FirstChild;
int child_count = coll_number_of_direct_childs[collection_node_idx] - 1;
coll_child_order[collection_node_idx][child_count] = child_idx;
diff --git a/src/hidapi/windows/test/hid_report_reconstructor_test.c b/src/hidapi/windows/test/hid_report_reconstructor_test.c
index bcd7cd4ce4b5..4c94fd9766db 100644
--- a/src/hidapi/windows/test/hid_report_reconstructor_test.c
+++ b/src/hidapi/windows/test/hid_report_reconstructor_test.c
@@ -129,7 +129,7 @@ static hidp_preparsed_data * alloc_preparsed_data_from_file(char* filename)
pp_data->caps_info[rt_idx].ReportByteLength = temp_ushort;
continue;
}
- fprintf(stderr, "Ignorring unimplemented caps_info field: %s", line);
+ fprintf(stderr, "Ignoring unimplemented caps_info field: %s", line);
continue;
}
@@ -259,7 +259,7 @@ static hidp_preparsed_data * alloc_preparsed_data_from_file(char* filename)
pp_data->caps[caps_idx].UnknownTokens[token_idx].BitField = temp_ulong;
continue;
}
- fprintf(stderr, "Ignorring unimplemented pp_data->cap[]->pp_cap->UnknownTokens field: %s", line);
+ fprintf(stderr, "Ignoring unimplemented pp_data->cap[]->pp_cap->UnknownTokens field: %s", line);
continue;
}
@@ -383,7 +383,7 @@ static hidp_preparsed_data * alloc_preparsed_data_from_file(char* filename)
pp_data->caps[caps_idx].Reserved1[2] = temp_uchar[2];
continue;
}
- fprintf(stderr, "Ignorring unimplemented cap field: %s", line);
+ fprintf(stderr, "Ignoring unimplemented cap field: %s", line);
continue;
}
@@ -433,7 +433,7 @@ static hidp_preparsed_data * alloc_preparsed_data_from_file(char* filename)
pcoll[coll_idx].Reserved = temp_ulong;
continue;
}
- fprintf(stderr, "Ignorring unimplemented LinkCollectionArray field: %s", line);
+ fprintf(stderr, "Ignoring unimplemented LinkCollectionArray field: %s", line);
continue;
}
}