File 0748-Fix-typos-in-erts-emulator-sys.patch of Package erlang
From 8550bdf507535ddbd1bcfddd15cd626f11a7a28b Mon Sep 17 00:00:00 2001
From: "Kian-Meng, Ang" <kianmeng@cpan.org>
Date: Tue, 30 Nov 2021 06:03:54 +0800
Subject: [PATCH] Fix typos in erts/emulator/sys
---
erts/emulator/sys/common/erl_mmap.c | 6 +++---
erts/emulator/sys/common/erl_poll.c | 2 +-
erts/emulator/sys/unix/driver_int.h | 2 +-
erts/emulator/sys/unix/sys_float.c | 2 +-
erts/emulator/sys/unix/sys_time.c | 2 +-
erts/emulator/sys/win32/driver_int.h | 2 +-
erts/emulator/sys/win32/erl_poll.c | 10 +++++-----
erts/emulator/sys/win32/erl_win_dyn_driver.h | 2 +-
erts/emulator/sys/win32/erl_win_sys.h | 4 ++--
erts/emulator/sys/win32/sys.c | 16 ++++++++--------
erts/emulator/sys/win32/sys_float.c | 2 +-
11 files changed, 25 insertions(+), 25 deletions(-)
diff --git a/erts/emulator/sys/common/erl_mmap.c b/erts/emulator/sys/common/erl_mmap.c
index 03e673dcf1..4cd92756a3 100644
--- a/erts/emulator/sys/common/erl_mmap.c
+++ b/erts/emulator/sys/common/erl_mmap.c
@@ -327,7 +327,7 @@ struct ErtsMemMapper_ {
* Super unaligned area is located above super aligned
* area. That is, `sa.bot` is beginning of the super
* carrier, `sua.top` is the end of the super carrier,
- * and sa.top and sua.bot moves towards eachother.
+ * and sa.top and sua.bot moves towards each other.
*/
struct {
char *top;
@@ -2587,10 +2587,10 @@ static void print_tree(enum SortOrder order, RBTNode*);
/*
* Checks that the order between parent and children are correct,
- * and that the Red-Black Tree properies are satisfied. if size > 0,
+ * and that the Red-Black Tree properties are satisfied. if size > 0,
* check_tree() returns the node that satisfies "address order first fit"
*
- * The Red-Black Tree properies are:
+ * The Red-Black Tree properties are:
* 1. Every node is either red or black.
* 2. Every leaf (NIL) is black.
* 3. If a node is red, then both its children are black.
diff --git a/erts/emulator/sys/common/erl_poll.c b/erts/emulator/sys/common/erl_poll.c
index b7f7d295c4..3eb4f2a8c9 100644
--- a/erts/emulator/sys/common/erl_poll.c
+++ b/erts/emulator/sys/common/erl_poll.c
@@ -1965,7 +1965,7 @@ ERTS_POLL_EXPORT(erts_poll_wait)(ErtsPollSet *ps,
/*
* This may have happened because another thread deselected
* a fd in our poll set and then closed it, i.e. the driver
- * behaved correctly. We wan't to avoid looking for a bad
+ * behaved correctly. We want to avoid looking for a bad
* fd, that may even not exist anymore. Therefore, handle
* update requests and try again. This behaviour should only
* happen when using SELECT as the polling mechanism.
diff --git a/erts/emulator/sys/unix/driver_int.h b/erts/emulator/sys/unix/driver_int.h
index 840b832878..4e46c164c7 100644
--- a/erts/emulator/sys/unix/driver_int.h
+++ b/erts/emulator/sys/unix/driver_int.h
@@ -18,7 +18,7 @@
* %CopyrightEnd%
*/
/*
- * System dependant driver declarations
+ * System dependent driver declarations
*/
#ifndef __DRIVER_INT_H__
diff --git a/erts/emulator/sys/unix/sys_float.c b/erts/emulator/sys/unix/sys_float.c
index 730293d032..28018c2748 100644
--- a/erts/emulator/sys/unix/sys_float.c
+++ b/erts/emulator/sys/unix/sys_float.c
@@ -56,7 +56,7 @@ sys_double_to_chars_ext(double fp, char *buffer, size_t buffer_size, size_t deci
if (erts_snprintf(buffer, buffer_size, "%.*e", decimals, fp) >= buffer_size)
return -1;
- /* Search upto decimal point */
+ /* Search up to decimal point */
if (*s == '+' || *s == '-') s++;
while (ISDIGIT(*s)) s++;
if (*s == ',') *s++ = '.'; /* Replace ',' with '.' */
diff --git a/erts/emulator/sys/unix/sys_time.c b/erts/emulator/sys/unix/sys_time.c
index 5fd48b793c..b91ae725bf 100644
--- a/erts/emulator/sys/unix/sys_time.c
+++ b/erts/emulator/sys/unix/sys_time.c
@@ -89,7 +89,7 @@ get_tick_count(void)
/*
* init timers, chose a tick length, and return it.
- * Unix is priviliged when it comes to time, as erl_time_sup.c
+ * Unix is privileged when it comes to time, as erl_time_sup.c
* does almost everything. Other platforms have to
* emulate Unix in this sense.
*/
diff --git a/erts/emulator/sys/win32/driver_int.h b/erts/emulator/sys/win32/driver_int.h
index 50097d3fd2..dbe067c59b 100644
--- a/erts/emulator/sys/win32/driver_int.h
+++ b/erts/emulator/sys/win32/driver_int.h
@@ -18,7 +18,7 @@
* %CopyrightEnd%
*/
/*----------------------------------------------------------------------
-** Purpose : System dependant driver declarations
+** Purpose : System dependent driver declarations
**---------------------------------------------------------------------- */
#ifndef __DRIVER_INT_H__
diff --git a/erts/emulator/sys/win32/erl_poll.c b/erts/emulator/sys/win32/erl_poll.c
index 3843a27a6e..fa0bc6c4d3 100644
--- a/erts/emulator/sys/win32/erl_poll.c
+++ b/erts/emulator/sys/win32/erl_poll.c
@@ -320,7 +320,7 @@ static void *threaded_waiter(void *param);
static void *break_waiter(void *param);
/*
- * Sychronization macros and functions
+ * Synchronization macros and functions
*/
#define START_WAITER(PS, w) \
SetEvent((w)->go_ahead)
@@ -435,7 +435,7 @@ wake_poller(ErtsPollSet *ps, int io_ready)
/*
* Since we don't know the internals of SetEvent() we issue
* a memory barrier as a safety precaution ensuring that
- * the store we just made to wakeup_state wont be reordered
+ * the store we just made to wakeup_state won't be reordered
* with loads in SetEvent().
*/
ERTS_THR_MEMORY_BARRIER;
@@ -769,7 +769,7 @@ event_happened:
notify_io_ready(ps);
/*
- * The main thread wont start working on our arrays until we're
+ * The main thread won't start working on our arrays until we're
* stopped, so we can work in peace although the main thread runs
*/
ASSERT(i >= WAIT_OBJECT_0+1);
@@ -1044,7 +1044,7 @@ int erts_poll_wait(ErtsPollSet *ps,
/*
* Since we don't know the internals of ResetEvent() we issue
* a memory barrier as a safety precaution ensuring that
- * the load of wakeup_state wont be reordered with stores made
+ * the load of wakeup_state won't be reordered with stores made
* by ResetEvent().
*/
ERTS_THR_MEMORY_BARRIER;
@@ -1287,7 +1287,7 @@ void erts_poll_late_init(void)
}
/*
- * Non windows friendly interface, not used when fd's are not continous
+ * Non windows friendly interface, not used when fd's are not continuous
*/
void erts_poll_get_selected_events(ErtsPollSet *ps,
ErtsPollEvents ev[],
diff --git a/erts/emulator/sys/win32/erl_win_dyn_driver.h b/erts/emulator/sys/win32/erl_win_dyn_driver.h
index c683e8cf49..d7c5e50679 100644
--- a/erts/emulator/sys/win32/erl_win_dyn_driver.h
+++ b/erts/emulator/sys/win32/erl_win_dyn_driver.h
@@ -262,7 +262,7 @@ typedef struct {
/* Add new calls here */
} TWinDynDriverCallbacks;
-/* This header is included explicitly by the ddll static driver, it musn't define things then */
+/* This header is included explicitly by the ddll static driver, it mustn't define things then */
#ifndef STATIC_ERLANG_DRIVER
extern TWinDynDriverCallbacks WinDynDriverCallbacks;
diff --git a/erts/emulator/sys/win32/erl_win_sys.h b/erts/emulator/sys/win32/erl_win_sys.h
index 881fb1f2fc..82db78d717 100644
--- a/erts/emulator/sys/win32/erl_win_sys.h
+++ b/erts/emulator/sys/win32/erl_win_sys.h
@@ -95,7 +95,7 @@
#define ERTS_HAVE_ERTS_SYS_ALIGNED_ALLOC 1
/*
- * Practial Windows specific macros.
+ * Practical Windows specific macros.
*/
#define CreateAutoEvent(state) CreateEvent(NULL, FALSE, state, NULL)
@@ -273,7 +273,7 @@ extern volatile int erl_fp_exception;
#include <float.h>
/* I suspect this test isn't right, it might depend on the version of GCC
- rather than if it's a MINGW gcc, but I havent been able to pinpoint the
+ rather than if it's a MINGW gcc, but I haven't been able to pinpoint the
exact point where _finite was added to the headers in cygwin... */
#if defined (__GNUC__) && !defined(__MINGW32__)
int _finite(double x);
diff --git a/erts/emulator/sys/win32/sys.c b/erts/emulator/sys/win32/sys.c
index c673619a5b..58ed43d106 100644
--- a/erts/emulator/sys/win32/sys.c
+++ b/erts/emulator/sys/win32/sys.c
@@ -704,8 +704,8 @@ release_driver_data(DriverData* dp)
else
#endif
{
- /* This is a workaround for the fact that CancelIo cant cancel
- requests issued by another thread and that we cant use
+ /* This is a workaround for the fact that CancelIo can't cancel
+ requests issued by another thread and that we can't use
CancelIoEx as that's only available in Vista etc.
R14: Avoid scheduler deadlock by only wait for 10ms, and then spawn
a thread that will keep waiting in in order to close handles. */
@@ -1020,7 +1020,7 @@ async_read_file(AsyncIo* aio, LPVOID buf, DWORD numToRead)
aio->async_io_active = 1; /* Will get 0 when the event actually happened */
if (ReadFile(aio->fd, buf, numToRead,
&aio->bytesTransferred, &aio->ov)) {
- DEBUGF(("async_read_file: ReadFile() suceeded: %d bytes\n",
+ DEBUGF(("async_read_file: ReadFile() succeeded: %d bytes\n",
aio->bytesTransferred));
#ifdef HARD_POLL_DEBUG
poll_debug_async_immediate(aio->ov.hEvent, aio->bytesTransferred);
@@ -1068,7 +1068,7 @@ async_write_file(AsyncIo* aio, /* Pointer to async control block. */
aio->async_io_active = 1; /* Will get 0 when the event actually happened */
if (WriteFile(aio->fd, buf, numToWrite,
&aio->bytesTransferred, &aio->ov)) {
- DEBUGF(("async_write_file: WriteFile() suceeded: %d bytes\n",
+ DEBUGF(("async_write_file: WriteFile() succeeded: %d bytes\n",
aio->bytesTransferred));
aio->async_io_active = 0; /* The event will not be signalled */
ResetEvent(aio->ov.hEvent);
@@ -1137,7 +1137,7 @@ get_overlapped_result(AsyncIo* aio, /* Pointer to async control block. */
DEBUGF(("get_overlapped_result: pending error: %s\n",
win32_errorstr(error)));
return error;
- } else if (aio->flags & DF_OVR_READY) { /* Operation succeded. */
+ } else if (aio->flags & DF_OVR_READY) { /* Operation succeeded. */
aio->flags &= ~DF_OVR_READY;
*pBytesRead = aio->bytesTransferred;
ResetEvent(aio->ov.hEvent);
@@ -1749,7 +1749,7 @@ static int create_pipe(HANDLE *phRead, HANDLE *phWrite, BOOL inheritRead, BOOL o
Uint calls;
/*
- * If we should't use named pipes, create anonmous pipes.
+ * If we shouldn't use named pipes, create anonmous pipes.
*/
if (!use_named_pipes) {
@@ -2052,7 +2052,7 @@ threaded_writer(LPVOID param)
aio->pendingError = 0;
aio->bytesTransferred = numToWrite;
} else if (aio->pendingError == ERROR_NOT_ENOUGH_MEMORY) {
- /* This could be a console, which limits utput to 64kbytes,
+ /* This could be a console, which limits output to 64kbytes,
which might translate to less on a unicode system.
Try 16k chunks and see if it works before giving up. */
int done = 0;
@@ -2215,7 +2215,7 @@ static void fd_stop(ErlDrvData data)
/*
* There's no way we can terminate an fd port in a consistent way.
* Instead we let it live until it's opened again (which it is,
- * as the only FD-drivers are for 0,1 and 2 adn the only time they
+ * as the only FD-drivers are for 0,1 and 2 and the only time they
* get closed is by init:reboot).
* So - just deselect them and let everything be as is.
* They get woken up in fd_start again, where the DriverData is
diff --git a/erts/emulator/sys/win32/sys_float.c b/erts/emulator/sys/win32/sys_float.c
index bc518be78e..e2f6e3321c 100644
--- a/erts/emulator/sys/win32/sys_float.c
+++ b/erts/emulator/sys/win32/sys_float.c
@@ -113,7 +113,7 @@ sys_double_to_chars_ext(double fp, char *buffer, size_t buffer_size, size_t deci
if (erts_snprintf(buffer, buffer_size, "%.*e", decimals, fp) >= buffer_size)
return -1;
- /* Search upto decimal point */
+ /* Search up to decimal point */
if (*s == '+' || *s == '-') s++;
while (isdigit(*s)) s++;
if (*s == ',') *s++ = '.'; /* Replace ',' with '.' */
--
2.31.1