Fix typos detected by codespell and manual inspection

Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
diff --git a/examples/hotplugtest.c b/examples/hotplugtest.c
index 4d0db5e..94f7e56 100644
--- a/examples/hotplugtest.c
+++ b/examples/hotplugtest.c
@@ -95,7 +95,7 @@
 	}
 
 	if (!libusb_has_capability (LIBUSB_CAP_HAS_HOTPLUG)) {
-		printf ("Hotplug capabilites are not supported on this platform\n");
+		printf ("Hotplug capabilities are not supported on this platform\n");
 		libusb_exit (NULL);
 		return EXIT_FAILURE;
 	}
diff --git a/examples/sam3u_benchmark.c b/examples/sam3u_benchmark.c
index b362106..68c157d 100644
--- a/examples/sam3u_benchmark.c
+++ b/examples/sam3u_benchmark.c
@@ -132,7 +132,7 @@
 	diff_msec = (tv_stop.tv_sec - tv_start.tv_sec) * 1000L;
 	diff_msec += (tv_stop.tv_usec - tv_start.tv_usec) / 1000L;
 
-	printf("%lu transfers (total %lu bytes) in %lu miliseconds => %lu bytes/sec\n",
+	printf("%lu transfers (total %lu bytes) in %lu milliseconds => %lu bytes/sec\n",
 		num_xfer, num_bytes, diff_msec, (num_bytes * 1000L) / diff_msec);
 }
 
diff --git a/libusb/core.c b/libusb/core.c
index 4218496..58d43fa 100644
--- a/libusb/core.c
+++ b/libusb/core.c
@@ -53,7 +53,7 @@
  * \section intro Introduction
  *
  * libusb is an open source library that allows you to communicate with USB
- * devices from userspace. For more info, see the
+ * devices from user space. For more info, see the
  * <a href="http://libusb.info">libusb homepage</a>.
  *
  * This documentation is aimed at application developers wishing to
@@ -213,12 +213,12 @@
  * you when this has happened, so if someone else resets your device it will
  * not be clear to your own program why the device state has changed.
  *
- * Ultimately, this is a limitation of writing drivers in userspace.
+ * Ultimately, this is a limitation of writing drivers in user space.
  * Separation from the USB stack in the underlying kernel makes it difficult
  * for the operating system to deliver such notifications to your program.
  * The Linux kernel USB stack allows such reset notifications to be delivered
  * to in-kernel USB drivers, but it is not clear how such notifications could
- * be delivered to second-class drivers that live in userspace.
+ * be delivered to second-class drivers that live in user space.
  *
  * \section blockonly Blocking-only functionality
  *
@@ -1927,7 +1927,7 @@
  * the same cache lines) when a transfer is in progress, although it is legal
  * to have several transfers going on within the same memory block.
  *
- * Will return NULL on failure. Many systems do not support such zerocopy
+ * Will return NULL on failure. Many systems do not support such zero-copy
  * and will always return NULL. Memory allocated with this function must be
  * freed with \ref libusb_dev_mem_free. Specifically, this means that the
  * flag \ref LIBUSB_TRANSFER_FREE_BUFFER cannot be used to free memory allocated
diff --git a/libusb/descriptor.c b/libusb/descriptor.c
index bae201d..cda3afd 100644
--- a/libusb/descriptor.c
+++ b/libusb/descriptor.c
@@ -735,7 +735,7 @@
 		header = (struct usbi_descriptor_header *)buffer;
 		if (header->bDescriptorType != LIBUSB_DT_SS_ENDPOINT_COMPANION) {
 			if (header->bLength < DESC_HEADER_LENGTH) {
-				usbi_err(ctx, "invalid desciptor length %u",
+				usbi_err(ctx, "invalid descriptor length %u",
 					 header->bLength);
 				return LIBUSB_ERROR_IO;
 			}
diff --git a/libusb/hotplug.c b/libusb/hotplug.c
index 1b654e3..e3e5e76 100644
--- a/libusb/hotplug.c
+++ b/libusb/hotplug.c
@@ -50,8 +50,8 @@
  * expecting additional events. Returning 0 will rearm the callback and 1 will cause
  * the callback to be deregistered. Note that when callbacks are called from
  * libusb_hotplug_register_callback() because of the \ref LIBUSB_HOTPLUG_ENUMERATE
- * flag, the callback return value is ignored, iow you cannot cause a callback
- * to be deregistered by returning 1 when it is called from
+ * flag, the callback return value is ignored. In other words, you cannot cause a
+ * callback to be deregistered by returning 1 when it is called from
  * libusb_hotplug_register_callback().
  *
  * Callbacks for a particular context are automatically deregistered by libusb_exit().
diff --git a/libusb/io.c b/libusb/io.c
index 54bef8a..48e964d 100644
--- a/libusb/io.c
+++ b/libusb/io.c
@@ -75,7 +75,7 @@
  * a single function call. When the function call returns, the transfer has
  * completed and you can parse the results.
  *
- * If you have used the libusb-0.1 before, this I/O style will seem familar to
+ * If you have used the libusb-0.1 before, this I/O style will seem familiar to
  * you. libusb-0.1 only offered a synchronous interface.
  *
  * In our input device example, to read button presses you might write code
@@ -101,7 +101,7 @@
  * sleeping for that long. Execution will be tied up inside the library -
  * the entire thread will be useless for that duration.
  *
- * Another issue is that by tieing up the thread with that single transaction
+ * Another issue is that by tying up the thread with that single transaction
  * there is no possibility of performing I/O with multiple endpoints and/or
  * multiple devices simultaneously, unless you resort to creating one thread
  * per transaction.
@@ -410,7 +410,7 @@
  * wLength of the setup packet, rather than the size of the data buffer. So,
  * if your wLength was 4, your transfer's <tt>length</tt> was 12, then you
  * should expect an <tt>actual_length</tt> of 4 to indicate that the data was
- * transferred in entirity.
+ * transferred in entirety.
  *
  * To simplify parsing of setup packets and obtaining the data from the
  * correct offset, you may wish to use the libusb_control_transfer_get_data()
@@ -572,7 +572,7 @@
  *
  * Lets begin with stating the obvious: If you're going to use a separate
  * thread for libusb event handling, your callback functions MUST be
- * threadsafe.
+ * thread-safe.
  *
  * Other then that doing event handling from a separate thread, is mostly
  * simple. You can use an event thread function as follows:
@@ -812,7 +812,7 @@
  * system calls. This is directly exposed at the
  * \ref libusb_asyncio "asynchronous interface" but it is important to note that the
  * \ref libusb_syncio "synchronous interface" is implemented on top of the
- * asynchonrous interface, therefore the same considerations apply.
+ * asynchronous interface, therefore the same considerations apply.
  *
  * The issue is that if two or more threads are concurrently calling poll()
  * or select() on libusb's file descriptors then only one of those threads
@@ -1022,7 +1022,7 @@
  * event handling), because the event waiter seems to have taken the event
  * waiters lock while waiting for an event. However, the system does support
  * multiple event waiters, because libusb_wait_for_event() actually drops
- * the lock while waiting, and reaquires it before continuing.
+ * the lock while waiting, and reacquires it before continuing.
  *
  * We have now implemented code which can dynamically handle situations where
  * nobody is handling events (so we should do it ourselves), and it can also
@@ -1954,7 +1954,7 @@
  *
  * You only need to use this lock if you are developing an application
  * which calls poll() or select() on libusb's file descriptors directly,
- * <b>and</b> may potentially be handling events from 2 threads simultaenously.
+ * <b>and</b> may potentially be handling events from 2 threads simultaneously.
  * If you stick to libusb's event handling loop functions (e.g.
  * libusb_handle_events()) then you do not need to be concerned with this
  * locking.
@@ -2399,7 +2399,7 @@
 
 /** \ingroup libusb_poll
  * Handle any pending events in blocking mode. There is currently a timeout
- * hardcoded at 60 seconds but we plan to make it unlimited in future. For
+ * hard-coded at 60 seconds but we plan to make it unlimited in future. For
  * finer control over whether this function is blocking or non-blocking, or
  * for control over the timeout, use libusb_handle_events_timeout_completed()
  * instead.
@@ -2561,7 +2561,7 @@
 		if (itransfer->timeout_flags & (USBI_TRANSFER_TIMEOUT_HANDLED | USBI_TRANSFER_OS_HANDLES_TIMEOUT))
 			continue;
 
-		/* if we've reached transfers of infinte timeout, we're done looking */
+		/* if we've reached transfers of infinite timeout, we're done looking */
 		if (!TIMESPEC_IS_SET(&itransfer->timeout))
 			break;
 
diff --git a/libusb/libusb-1.0.rc b/libusb/libusb-1.0.rc
index 9cdecd0..bcb10fa 100644
--- a/libusb/libusb-1.0.rc
+++ b/libusb/libusb-1.0.rc
@@ -1,5 +1,5 @@
 /*
- * For Windows: input this file to the Resoure Compiler to produce a binary
+ * For Windows: input this file to the Resource Compiler to produce a binary
  * .res file. This is then embedded in the resultant library (like any other
  * compilation object).
  * The information can then be queried using standard APIs and can also be
diff --git a/libusb/libusb.h b/libusb/libusb.h
index e9f5253..3931d60 100644
--- a/libusb/libusb.h
+++ b/libusb/libusb.h
@@ -1325,10 +1325,10 @@
  * \see libusb_set_log_cb()
  */
 enum libusb_log_cb_mode {
-	/** Callback function handling all log mesages. */
+	/** Callback function handling all log messages. */
 	LIBUSB_LOG_CB_GLOBAL = (1 << 0),
 
-	/** Callback function handling context related log mesages. */
+	/** Callback function handling context related log messages. */
 	LIBUSB_LOG_CB_CONTEXT = (1 << 1)
 };
 
@@ -1921,7 +1921,7 @@
  * Callbacks handles are generated by libusb_hotplug_register_callback()
  * and can be used to deregister callbacks. Callback handles are unique
  * per libusb_context and it is safe to call libusb_hotplug_deregister_callback()
- * on an already deregisted callback.
+ * on an already deregistered callback.
  *
  * Since version 1.0.16, \ref LIBUSB_API_VERSION >= 0x01000102
  *
diff --git a/libusb/libusbi.h b/libusb/libusbi.h
index 4a3e9d5..b5b4a2a 100644
--- a/libusb/libusbi.h
+++ b/libusb/libusbi.h
@@ -1081,7 +1081,7 @@
 	 * completes, assuming that the device descriptors did not change during
 	 * reset and all previous interface state can be restored.
 	 *
-	 * If something changes, or you cannot easily locate/verify the resetted
+	 * If something changes, or you cannot easily locate/verify the reset
 	 * device, return LIBUSB_ERROR_NOT_FOUND. This prompts the application
 	 * to close the old handle and re-enumerate the device.
 	 *
diff --git a/libusb/os/darwin_usb.c b/libusb/os/darwin_usb.c
index 5f5e71b..13d7218 100644
--- a/libusb/os/darwin_usb.c
+++ b/libusb/os/darwin_usb.c
@@ -381,7 +381,7 @@
         if (old_device->in_reenumerate) {
           /* device is re-enumerating. do not dereference the device at this time. libusb_reset_device()
            * will deref if needed. */
-          usbi_dbg ("detected device detatched due to re-enumeration");
+          usbi_dbg ("detected device detached due to re-enumeration");
 
           /* the device object is no longer usable so go ahead and release it */
           if (old_device->device) {
@@ -2215,7 +2215,7 @@
   uint8_t pipeRef;
   int rc, i;
 
-  /* find the mimimum number of supported streams on the endpoint list */
+  /* find the minimum number of supported streams on the endpoint list */
   for (i = 0 ; i < num_endpoints ; ++i) {
     if (0 != (rc = ep_to_pipeRef (dev_handle, endpoints[i], &pipeRef, NULL, &cInterface))) {
       return rc;
diff --git a/libusb/os/linux_usbfs.c b/libusb/os/linux_usbfs.c
index c2980d0..61b5b18 100644
--- a/libusb/os/linux_usbfs.c
+++ b/libusb/os/linux_usbfs.c
@@ -1846,7 +1846,7 @@
 	 * a time, but there is a big performance gain doing it this way.
 	 *
 	 * Newer versions lift the 16k limit (USBFS_CAP_NO_PACKET_SIZE_LIM),
-	 * using arbritary large transfers can still be a bad idea though, as
+	 * using arbitrary large transfers can still be a bad idea though, as
 	 * the kernel needs to allocate physical contiguous memory for this,
 	 * which may fail for large buffers.
 	 *
diff --git a/libusb/os/sunos_usb.c b/libusb/os/sunos_usb.c
index 73b96da..42a8254 100644
--- a/libusb/os/sunos_usb.c
+++ b/libusb/os/sunos_usb.c
@@ -620,7 +620,7 @@
 
 			if (sunos_fill_in_dev_info(dn, dev) != LIBUSB_SUCCESS) {
 				libusb_unref_device(dev);
-				usbi_dbg("get infomation fail");
+				usbi_dbg("get information fail");
 				continue;
 			}
 			if (usbi_sanitize_device(dev) < 0) {
diff --git a/libusb/os/windows_common.c b/libusb/os/windows_common.c
index 2f79928..917d24d 100644
--- a/libusb/os/windows_common.c
+++ b/libusb/os/windows_common.c
@@ -125,7 +125,7 @@
 static bool htab_create(struct libusb_context *ctx)
 {
 	if (htab_table != NULL) {
-		usbi_err(ctx, "program assertion falied - hash table already allocated");
+		usbi_err(ctx, "program assertion failed - hash table already allocated");
 		return true;
 	}
 
@@ -459,7 +459,7 @@
 	}
 
 	// A successful wait gives this thread ownership of the mutex
-	// => any concurent wait stalls until the mutex is released
+	// => any concurrent wait stalls until the mutex is released
 	if (WaitForSingleObject(mutex, INFINITE) != WAIT_OBJECT_0) {
 		usbi_err(ctx, "failure to access mutex: %s", windows_error_str(0));
 		CloseHandle(mutex);
@@ -553,7 +553,7 @@
 		return;
 
 	// A successful wait gives this thread ownership of the mutex
-	// => any concurent wait stalls until the mutex is released
+	// => any concurrent wait stalls until the mutex is released
 	if (WaitForSingleObject(mutex, INFINITE) != WAIT_OBJECT_0) {
 		usbi_err(ctx, "failed to access mutex: %s", windows_error_str(0));
 		CloseHandle(mutex);
diff --git a/libusb/os/windows_winusb.c b/libusb/os/windows_winusb.c
index 39ba3e7..1b982ed 100644
--- a/libusb/os/windows_winusb.c
+++ b/libusb/os/windows_winusb.c
@@ -1243,7 +1243,7 @@
 
 			// MULTI_SZ is a pain to work with. Turn it into something much more manageable
 			// NB: none of the driver names we check against contain LIST_SEPARATOR,
-			// (currently ';'), so even if an unsuported one does, it's not an issue
+			// (currently ';'), so even if an unsupported one does, it's not an issue
 			for (l = 0; (lookup[k].list[l] != 0) || (lookup[k].list[l + 1] != 0); l++) {
 				if (lookup[k].list[l] == 0)
 					lookup[k].list[l] = LIST_SEPARATOR;
@@ -2932,7 +2932,7 @@
 		}
 
 		// Important note: the WinUSB_Read/WriteIsochPipeAsap API requires a ContinueStream parameter that tells whether the isochronous
-		// stream must be continued or if the WinUSB driver can schedule the transfer at its conveniance. Profiling subsequent transfers
+		// stream must be continued or if the WinUSB driver can schedule the transfer at its convenience. Profiling subsequent transfers
 		// with ContinueStream = FALSE showed that 5 frames, i.e. about 5 milliseconds, were left empty between each transfer. This
 		// is critical as this greatly diminish the achievable isochronous bandwidth. We solved the problem using the following strategy:
 		// - Transfers are first scheduled with ContinueStream = TRUE and with winusbx_iso_transfer_continue_stream_callback as user callback.
@@ -3645,7 +3645,7 @@
 	CHECK_HID_AVAILABLE;
 
 	if (priv->hid == NULL) {
-		usbi_err(HANDLE_CTX(dev_handle), "program assertion failed - private HID structure is unitialized");
+		usbi_err(HANDLE_CTX(dev_handle), "program assertion failed - private HID structure is uninitialized");
 		return LIBUSB_ERROR_NOT_FOUND;
 	}
 
diff --git a/libusb/sync.c b/libusb/sync.c
index 95be3d9..adc95b4 100644
--- a/libusb/sync.c
+++ b/libusb/sync.c
@@ -81,7 +81,7 @@
  * (depending on direction bits within bmRequestType)
  * \param wLength the length field for the setup packet. The data buffer should
  * be at least this size.
- * \param timeout timeout (in millseconds) that this function should wait
+ * \param timeout timeout (in milliseconds) that this function should wait
  * before giving up due to no response being received. For an unlimited
  * timeout, use value 0.
  * \returns on success, the number of bytes actually transferred
@@ -255,7 +255,7 @@
  * transferred. Since version 1.0.21 (\ref LIBUSB_API_VERSION >= 0x01000105),
  * it is legal to pass a NULL pointer if you do not wish to receive this
  * information.
- * \param timeout timeout (in millseconds) that this function should wait
+ * \param timeout timeout (in milliseconds) that this function should wait
  * before giving up due to no response being received. For an unlimited
  * timeout, use value 0.
  *
@@ -310,7 +310,7 @@
  * transferred. Since version 1.0.21 (\ref LIBUSB_API_VERSION >= 0x01000105),
  * it is legal to pass a NULL pointer if you do not wish to receive this
  * information.
- * \param timeout timeout (in millseconds) that this function should wait
+ * \param timeout timeout (in milliseconds) that this function should wait
  * before giving up due to no response being received. For an unlimited
  * timeout, use value 0.
  *
diff --git a/libusb/version_nano.h b/libusb/version_nano.h
index 0ffc182..b9b5917 100644
--- a/libusb/version_nano.h
+++ b/libusb/version_nano.h
@@ -1 +1 @@
-#define LIBUSB_NANO 11547
+#define LIBUSB_NANO 11548