hidapi: sync with mainstream (typo fixes)

main
Ozkan Sezer 2023-07-19 00:40:10 +03:00
parent 2bf05f38ad
commit 40ac818bf8
10 changed files with 18 additions and 18 deletions

View File

@ -11,7 +11,7 @@ Ludovic Rousseau <rousseau@debian.org>:
Correctness fixes Correctness fixes
libusb/hidapi Team: 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: For a comprehensive list of contributions, see the commit list at github:
https://github.com/libusb/hidapi/graphs/contributors https://github.com/libusb/hidapi/graphs/contributors

View File

@ -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, 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/). 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`. 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), On Windows CMake could be provided by your development environment (e.g. by Visual Studio Installer or MinGW installer),

View File

@ -66,7 +66,7 @@ else()
else() else()
# otherwise there is 2 options: # otherwise there is 2 options:
# 1) iconv is provided by Standard C library and the build will be just fine # 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() endif()
# check for error: "conflicting types for 'iconv'" # check for error: "conflicting types for 'iconv'"

View File

@ -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; expected_report_descriptor_size = HID_API_MAX_REPORT_DESCRIPTOR_SIZE;
/* Get the HID Report Descriptor. /* 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); 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) { if (res >= 0) {

View File

@ -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. * 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) 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; 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) { while (cur_dev->next != NULL) {
cur_dev = cur_dev->next; cur_dev = cur_dev->next;
} }

View File

@ -814,7 +814,7 @@ struct hid_device_info HID_API_EXPORT *hid_enumerate(unsigned short vendor_id,
} }
cur_dev = tmp; 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) { while (cur_dev->next != NULL) {
cur_dev = cur_dev->next; cur_dev = cur_dev->next;
} }

View File

@ -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 # Once done, optionally rename this file for your application, and drop it into
# /etc/udev/rules.d/. # /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: # (Small discussion/explanation in systemd repo:
# https://github.com/systemd/systemd/issues/4288#issuecomment-348166161) # https://github.com/systemd/systemd/issues/4288#issuecomment-348166161)
# for example, name the file /etc/udev/rules.d/70-my-application-hid.rules. # for example, name the file /etc/udev/rules.d/70-my-application-hid.rules.

View File

@ -233,7 +233,7 @@ static hid_device *new_hid_device()
memset(&dev->ol, 0, sizeof(dev->ol)); memset(&dev->ol, 0, sizeof(dev->ol));
dev->ol.hEvent = CreateEvent(NULL, FALSE, FALSE /*initial state f=nonsignaled*/, NULL); dev->ol.hEvent = CreateEvent(NULL, FALSE, FALSE /*initial state f=nonsignaled*/, NULL);
memset(&dev->write_ol, 0, sizeof(dev->write_ol)); 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; dev->device_info = NULL;
return dev; return dev;

View File

@ -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] // coll_levels[COLLECTION_INDEX]
// -Determine number of direct childs of each collections and store it in: // -Determine number of direct childs of each collections and store it in:
// coll_number_of_direct_childs[COLLECTION_INDEX] // 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] // and store it this index coll_child_order[COLLECTION_INDEX][DIRECT_CHILD_INDEX]
// ************************************************************************************************* // **************************************************************************************************
USHORT **coll_child_order; USHORT **coll_child_order;
coll_child_order = malloc(pp_data->NumberLinkCollectionNodes * sizeof(*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 // Create list of child collection indices
// sorted reverse to the order returned to HidP_GetLinkCollectionNodeschild // 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; USHORT child_idx = link_collection_nodes[collection_node_idx].FirstChild;
int child_count = coll_number_of_direct_childs[collection_node_idx] - 1; int child_count = coll_number_of_direct_childs[collection_node_idx] - 1;
coll_child_order[collection_node_idx][child_count] = child_idx; coll_child_order[collection_node_idx][child_count] = child_idx;

View File

@ -129,7 +129,7 @@ static hidp_preparsed_data * alloc_preparsed_data_from_file(char* filename)
pp_data->caps_info[rt_idx].ReportByteLength = temp_ushort; pp_data->caps_info[rt_idx].ReportByteLength = temp_ushort;
continue; continue;
} }
fprintf(stderr, "Ignorring unimplemented caps_info field: %s", line); fprintf(stderr, "Ignoring unimplemented caps_info field: %s", line);
continue; 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; pp_data->caps[caps_idx].UnknownTokens[token_idx].BitField = temp_ulong;
continue; 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; 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]; pp_data->caps[caps_idx].Reserved1[2] = temp_uchar[2];
continue; continue;
} }
fprintf(stderr, "Ignorring unimplemented cap field: %s", line); fprintf(stderr, "Ignoring unimplemented cap field: %s", line);
continue; continue;
} }
@ -433,7 +433,7 @@ static hidp_preparsed_data * alloc_preparsed_data_from_file(char* filename)
pcoll[coll_idx].Reserved = temp_ulong; pcoll[coll_idx].Reserved = temp_ulong;
continue; continue;
} }
fprintf(stderr, "Ignorring unimplemented LinkCollectionArray field: %s", line); fprintf(stderr, "Ignoring unimplemented LinkCollectionArray field: %s", line);
continue; continue;
} }
} }