Skip to content

Commit a758717

Browse files
fix(docs): correct typos found during code review (#761)
Non-functional changes only: - Fixed minor spelling mistakes in comments - Corrected typos in user-facing strings - No variables, logic, or functional code was modified. Signed-off-by: Marcel Petrick <[email protected]>
1 parent f18d2c0 commit a758717

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

linux/hid.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ static __u32 get_hid_report_bytes(const __u8 *rpt, size_t len, size_t num_bytes,
282282
* Skips all nested Collection, i.e. iterates until the end of current level Collection.
283283
*
284284
* The return value is non-0 when an end of current Collection is found,
285-
* 0 when error is occured (broken Descriptor, end of a Collection is found before its begin,
285+
* 0 when error is occurred (broken Descriptor, end of a Collection is found before its begin,
286286
* or no Collection is found at all).
287287
*/
288288
static int hid_iterate_over_collection(const __u8 *report_descriptor, __u32 size, unsigned int *pos, int *data_len, int *key_size)

netbsd/hid.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ static uint32_t get_hid_report_bytes(const uint8_t *rpt, size_t len, size_t num_
247247
* Skips all nested Collection, i.e. iterates until the end of current level Collection.
248248
*
249249
* The return value is non-0 when an end of current Collection is found,
250-
* 0 when error is occured (broken Descriptor, end of a Collection is found before its begin,
250+
* 0 when error is occurred (broken Descriptor, end of a Collection is found before its begin,
251251
* or no Collection is found at all).
252252
*/
253253
static int hid_iterate_over_collection(const uint8_t *report_descriptor, uint32_t size, unsigned int *pos, int *data_len, int *key_size)

windows/hidapi_descriptor_reconstruct.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -400,11 +400,11 @@ int hid_winapi_descriptor_reconstruct_pp_data(void *preparsed_data, unsigned cha
400400
collection_node_idx = coll_child_order[collection_node_idx][0];
401401

402402
// In a HID Report Descriptor, the first usage declared is the most preferred usage for the control.
403-
// While the order in the WIN32 capabiliy strutures is the opposite:
403+
// While the order in the WIN32 capabiliy structures is the opposite:
404404
// Here the preferred usage is the last aliased usage in the sequence.
405405

406406
if (link_collection_nodes[collection_node_idx].IsAlias && (firstDelimiterNode == NULL)) {
407-
// Alliased Collection (First node in link_collection_nodes -> Last entry in report descriptor output)
407+
// Aliased Collection (First node in link_collection_nodes -> Last entry in report descriptor output)
408408
firstDelimiterNode = main_item_list;
409409
coll_begin_lookup[collection_node_idx] = rd_append_main_item_node(0, 0, rd_item_node_collection, 0, collection_node_idx, rd_delimiter_usage, 0, &main_item_list);
410410
coll_begin_lookup[collection_node_idx] = rd_append_main_item_node(0, 0, rd_item_node_collection, 0, collection_node_idx, rd_delimiter_close, 0, &main_item_list);
@@ -430,7 +430,7 @@ int hid_winapi_descriptor_reconstruct_pp_data(void *preparsed_data, unsigned cha
430430
collection_node_idx = coll_child_order[collection_node_idx][nextChild];
431431

432432
if (link_collection_nodes[collection_node_idx].IsAlias && (firstDelimiterNode == NULL)) {
433-
// Alliased Collection (First node in link_collection_nodes -> Last entry in report descriptor output)
433+
// Aliased Collection (First node in link_collection_nodes -> Last entry in report descriptor output)
434434
firstDelimiterNode = main_item_list;
435435
coll_begin_lookup[collection_node_idx] = rd_append_main_item_node(0, 0, rd_item_node_collection, 0, collection_node_idx, rd_delimiter_usage, 0, &main_item_list);
436436
coll_begin_lookup[collection_node_idx] = rd_append_main_item_node(0, 0, rd_item_node_collection, 0, collection_node_idx, rd_delimiter_close, 0, &main_item_list);
@@ -490,11 +490,11 @@ int hid_winapi_descriptor_reconstruct_pp_data(void *preparsed_data, unsigned cha
490490
list_node = rd_search_main_item_list_for_bit_position(first_bit, (rd_main_items) rt_idx, pp_data->caps[caps_idx].ReportID, &coll_begin);
491491

492492
// In a HID Report Descriptor, the first usage declared is the most preferred usage for the control.
493-
// While the order in the WIN32 capabiliy strutures is the opposite:
493+
// While the order in the WIN32 capabiliy structures is the opposite:
494494
// Here the preferred usage is the last aliased usage in the sequence.
495495

496496
if (pp_data->caps[caps_idx].IsAlias && (firstDelimiterNode == NULL)) {
497-
// Alliased Usage (First node in pp_data->caps -> Last entry in report descriptor output)
497+
// Aliased Usage (First node in pp_data->caps -> Last entry in report descriptor output)
498498
firstDelimiterNode = list_node;
499499
rd_insert_main_item_node(first_bit, last_bit, rd_item_node_cap, caps_idx, pp_data->caps[caps_idx].LinkCollection, rd_delimiter_usage, pp_data->caps[caps_idx].ReportID, &list_node);
500500
rd_insert_main_item_node(first_bit, last_bit, rd_item_node_cap, caps_idx, pp_data->caps[caps_idx].LinkCollection, rd_delimiter_close, pp_data->caps[caps_idx].ReportID, &list_node);
@@ -503,7 +503,7 @@ int hid_winapi_descriptor_reconstruct_pp_data(void *preparsed_data, unsigned cha
503503
rd_insert_main_item_node(first_bit, last_bit, rd_item_node_cap, caps_idx, pp_data->caps[caps_idx].LinkCollection, rd_delimiter_usage, pp_data->caps[caps_idx].ReportID, &list_node);
504504
}
505505
else if (!pp_data->caps[caps_idx].IsAlias && (firstDelimiterNode != NULL)) {
506-
// Alliased Collection (Last node in pp_data->caps -> First entry in report descriptor output)
506+
// Aliased Collection (Last node in pp_data->caps -> First entry in report descriptor output)
507507
rd_insert_main_item_node(first_bit, last_bit, rd_item_node_cap, caps_idx, pp_data->caps[caps_idx].LinkCollection, rd_delimiter_usage, pp_data->caps[caps_idx].ReportID, &list_node);
508508
rd_insert_main_item_node(first_bit, last_bit, rd_item_node_cap, caps_idx, pp_data->caps[caps_idx].LinkCollection, rd_delimiter_open, pp_data->caps[caps_idx].ReportID, &list_node);
509509
firstDelimiterNode = NULL;
@@ -561,7 +561,7 @@ int hid_winapi_descriptor_reconstruct_pp_data(void *preparsed_data, unsigned cha
561561
}
562562
}
563563
if (list->next->MainItemType == rd_collection_end) {
564-
// Store the node before the collection end - the last occurence is the end of the top level collection
564+
// Store the node before the collection end - the last occurrence is the end of the top level collection
565565
node_before_top_level_coll_end = list;
566566
}
567567
list = list->next;

windows/hidapi_winapi.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ extern "C" {
8080
*
8181
* When the timeout is set to 0, hid_write function becomes non-blocking and would exit immediately.
8282
* When the timeout is set to INFINITE ((DWORD)-1), the function will not exit,
83-
* until the write operation is performed or an error occured.
83+
* until the write operation is performed or an error occurred.
8484
* See dwMilliseconds parameter documentation of WaitForSingleObject function.
8585
*
8686
* @param timeout New timeout value in milliseconds.

windows/pp_data_dump/pp_data_dump.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ void dump_hidp_link_collection_node(FILE* file, phid_pp_link_collection_node pco
8585
fprintf(file, "pp_data->LinkCollectionArray[%u]->NumberOfChildren = %hu\n", coll_idx, pcoll->NumberOfChildren);
8686
fprintf(file, "pp_data->LinkCollectionArray[%u]->NextSibling = %hu\n", coll_idx, pcoll->NextSibling);
8787
fprintf(file, "pp_data->LinkCollectionArray[%u]->FirstChild = %hu\n", coll_idx, pcoll->FirstChild);
88-
// The compilers are not consistent on ULONG-bit-fields: They lose the unsinged or define them as int.
89-
// Thus just always cast them to unsinged int, which should be fine, as the biggest bit-field is 28 bit
88+
// The compilers are not consistent on ULONG-bit-fields: They lose the unsigned or define them as int.
89+
// Thus just always cast them to unsigned int, which should be fine, as the biggest bit-field is 28 bit
9090
fprintf(file, "pp_data->LinkCollectionArray[%u]->CollectionType = %u\n", coll_idx, (unsigned int)(pcoll->CollectionType));
9191
fprintf(file, "pp_data->LinkCollectionArray[%u]->IsAlias = %u\n", coll_idx, (unsigned int)(pcoll->IsAlias));
9292
fprintf(file, "pp_data->LinkCollectionArray[%u]->Reserved = 0x%08X\n", coll_idx, (unsigned int)(pcoll->Reserved));

0 commit comments

Comments
 (0)