From 66e63d68eb4351c1220a11186a073491ca2c03db Mon Sep 17 00:00:00 2001 From: Sean McBride Date: Thu, 28 Dec 2023 14:21:13 -0500 Subject: [PATCH] Correct some spelling and add codespell config file In one case, renamed a variable from `larg` which codespell thought was a typo for `large`. Closes #1411 --- .codespellrc | 3 +++ README.git | 2 +- libusb/libusb.h | 2 +- libusb/os/sunos_usb.c | 14 +++++++------- libusb/version_nano.h | 2 +- tests/init_context.c | 2 +- tests/macos.c | 2 +- tests/set_option.c | 2 +- tests/umockdev.c | 6 +++--- 9 files changed, 19 insertions(+), 16 deletions(-) create mode 100644 .codespellrc diff --git a/.codespellrc b/.codespellrc new file mode 100644 index 00000000..dba3ab7b --- /dev/null +++ b/.codespellrc @@ -0,0 +1,3 @@ +[codespell] +skip = strerror.c,AUTHORS +ignore-words-list = numer,ser,xwindows diff --git a/README.git b/README.git index d67d3749..b845138e 100644 --- a/README.git +++ b/README.git @@ -11,7 +11,7 @@ configure with a default set of options, and will therefore generate a Makefile, whereas the latter does not invoke configure at all. If using autogen.sh, note that you can also append options, that will be passed as is to configure. -OS X-specific notes: +macOS-specific notes: ------------------- Starting with Xcode 4.3, neither Xcode.app nor the Xcode 'command line tools' diff --git a/libusb/libusb.h b/libusb/libusb.h index e416f091..038e5f36 100644 --- a/libusb/libusb.h +++ b/libusb/libusb.h @@ -1501,7 +1501,7 @@ enum libusb_option { #define LIBUSB_OPTION_WEAK_AUTHORITY LIBUSB_OPTION_NO_DEVICE_DISCOVERY - /** Set the context log callback functon. + /** Set the context log callback function. * * Set the log callback function either on a context or globally. This * option must be provided an argument of type libusb_log_cb. Using this diff --git a/libusb/os/sunos_usb.c b/libusb/os/sunos_usb.c index 9c08f7e4..6c8250c6 100644 --- a/libusb/os/sunos_usb.c +++ b/libusb/os/sunos_usb.c @@ -82,7 +82,7 @@ static int sunos_usb_ioctl(struct libusb_device *dev, int cmd); static int sunos_get_link(di_devlink_t devlink, void *arg) { - walk_link_t *larg = (walk_link_t *)arg; + walk_link_t *link_arg = (walk_link_t *)arg; const char *p; const char *q; @@ -112,21 +112,21 @@ static int sunos_get_link(di_devlink_t devlink, void *arg) static int sunos_physpath_to_devlink( const char *node_path, const char *match, char **link_path) { - walk_link_t larg; + walk_link_t link_arg; di_devlink_handle_t hdl; *link_path = NULL; - larg.linkpp = link_path; + link_arg.linkpp = link_path; if ((hdl = di_devlink_init(NULL, 0)) == NULL) { usbi_dbg(NULL, "di_devlink_init failure"); return (-1); } - larg.len = strlen(node_path); - larg.path = (char *)node_path; + link_arg.len = strlen(node_path); + link_arg.path = (char *)node_path; (void) di_devlink_walk(hdl, match, NULL, DI_PRIMARY_LINK, - (void *)&larg, sunos_get_link); + (void *)&link_arg, sunos_get_link); (void) di_devlink_fini(&hdl); @@ -624,7 +624,7 @@ sunos_add_devices(di_devlink_t link, void *arg) } if (usbi_sanitize_device(dev) < 0) { libusb_unref_device(dev); - usbi_dbg(NULL, "sanatize failed: "); + usbi_dbg(NULL, "sanitize failed: "); return (DI_WALK_TERMINATE); } } else { diff --git a/libusb/version_nano.h b/libusb/version_nano.h index b4ca6bb9..644de2d0 100644 --- a/libusb/version_nano.h +++ b/libusb/version_nano.h @@ -1 +1 @@ -#define LIBUSB_NANO 11870 +#define LIBUSB_NANO 11871 diff --git a/tests/init_context.c b/tests/init_context.c index 80b93fd5..004848c8 100644 --- a/tests/init_context.c +++ b/tests/init_context.c @@ -58,7 +58,7 @@ static int unsetenv(const char *env) { } while (0) /** - * Use relational operatator to compare two values and fail the test if the + * Use relational operator to compare two values and fail the test if the * comparison is false. Intended to compare integer or pointer types. * * Example: LIBUSB_EXPECT(==, 0, 1) -> fail, LIBUSB_EXPECT(==, 0, 0) -> ok. diff --git a/tests/macos.c b/tests/macos.c index 5a7bc20f..a7b1231c 100644 --- a/tests/macos.c +++ b/tests/macos.c @@ -51,7 +51,7 @@ } while (0) /** - * Use relational operatator to compare two values and fail the test if the + * Use relational operator to compare two values and fail the test if the * comparison is false. Intended to compare integer or pointer types. * * Example: LIBUSB_EXPECT(==, 0, 1) -> fail, LIBUSB_EXPECT(==, 0, 0) -> ok. diff --git a/tests/set_option.c b/tests/set_option.c index defa3cf1..d7786a15 100644 --- a/tests/set_option.c +++ b/tests/set_option.c @@ -66,7 +66,7 @@ static int setenv(const char *env, const char *value, int overwrite) { } while (0) /** - * Use relational operatator to compare two values and fail the test if the + * Use relational operator to compare two values and fail the test if the * comparison is false. Intended to compare integer or pointer types. * * Example: LIBUSB_EXPECT(==, 0, 1) -> fail, LIBUSB_EXPECT(==, 0, 0) -> ok. diff --git a/tests/umockdev.c b/tests/umockdev.c index ec0a07b3..a2d457ee 100644 --- a/tests/umockdev.c +++ b/tests/umockdev.c @@ -89,7 +89,7 @@ typedef struct { GList *flying_urbs; GList *discarded_urbs; - /* GMutex confuses tsan unecessarily */ + /* GMutex confuses TSan unnecessarily */ pthread_mutex_t mutex; } UMockdevTestbedFixture; @@ -245,7 +245,7 @@ handle_ioctl_cb (UMockdevIoctlBase *handler, UMockdevIoctlClient *client, UMockd ioctl_arg = umockdev_ioctl_client_get_arg (client); /* NOTE: We share the address space, dereferencing pointers *will* work. - * However, to make tsan work, we still stick to the API that resolves + * However, to make TSan work, we still stick to the API that resolves * the data into a local copy! */ switch (request) { @@ -432,7 +432,7 @@ test_fixture_setup_libusb(UMockdevTestbedFixture * fixture, int devcount) libusb_init_context(/*ctx=*/&fixture->ctx, /*options=*/NULL, /*num_options=*/0); - /* Supress global log messages completely + /* Suppress global log messages completely * (though, in some tests it might be interesting to check there are no real ones). */ libusb_set_log_cb (NULL, log_handler_null, LIBUSB_LOG_CB_GLOBAL);