File 0180-Fix-typos-in-erts-lib_src.patch of Package erlang
From 18cc15bcb502b25ffb9771ee8b38a328d03bda54 Mon Sep 17 00:00:00 2001
From: "Kian-Meng, Ang" <kianmeng@cpan.org>
Date: Wed, 17 Nov 2021 10:59:45 +0800
Subject: [PATCH] Fix typos in erts/lib_src
---
erts/lib_src/common/erl_memory_trace_parser.c | 6 +++---
erts/lib_src/common/ethr_atomics.c | 2 +-
erts/lib_src/common/ethr_cbf.c | 2 +-
erts/lib_src/common/ethr_mutex.c | 2 +-
erts/lib_src/pthread/ethread.c | 4 ++--
erts/lib_src/utils/make_atomics_api | 2 +-
erts/lib_src/yielding_c_fun/lib/tiny_regex_c/README.md | 2 +-
.../test/examples/sha256_erlang_nif/c_src/sha-2/README.md | 2 +-
.../test/examples/sha256_erlang_nif/c_src/sha-2/sha-256.c | 2 +-
.../sha256_erlang_nif/c_src/sha-2/sha-256_orginal.c | 2 +-
.../test/examples/sha256_erlang_nif/c_src/sha256_nif.c | 2 +-
erts/lib_src/yielding_c_fun/ycf_lexer.c | 2 +-
erts/lib_src/yielding_c_fun/ycf_node.c | 2 +-
erts/lib_src/yielding_c_fun/ycf_printers.c | 2 +-
erts/lib_src/yielding_c_fun/ycf_yield_fun.c | 4 ++--
15 files changed, 19 insertions(+), 19 deletions(-)
diff --git a/erts/lib_src/common/erl_memory_trace_parser.c b/erts/lib_src/common/erl_memory_trace_parser.c
index 0232708ad1..ffcb9749c4 100644
--- a/erts/lib_src/common/erl_memory_trace_parser.c
+++ b/erts/lib_src/common/erl_memory_trace_parser.c
@@ -357,13 +357,13 @@ emtp_state_destroy(emtp_state *statep)
* and parse_header.
*
* Note that some of them depend on function local variable names
- * and lables:
+ * and labels:
*
* Variables:
* * result -> the result to return
* * statep -> pointer to the state
*
- * Lables:
+ * Labels:
* * restore_return -> restore then return result
*/
@@ -1681,7 +1681,7 @@ emtp_parse(emtp_state *statep,
statep->force_return = 0;
- if (statep->overflow_size) { /* Overflow from prevoius parse */
+ if (statep->overflow_size) { /* Overflow from previous parse */
sgnd_int_32 tsz;
sgnd_int_32 sz;
diff --git a/erts/lib_src/common/ethr_atomics.c b/erts/lib_src/common/ethr_atomics.c
index 1594d78f5e..6da9e76cfb 100644
--- a/erts/lib_src/common/ethr_atomics.c
+++ b/erts/lib_src/common/ethr_atomics.c
@@ -62,7 +62,7 @@
* - read
* - init
*
- * Appart from a function implementing the atomic operation
+ * Apart from a function implementing the atomic operation
* with unspecified memory barrier semantics, there are
* functions implementing each operation with the following
* implied memory barrier semantics:
diff --git a/erts/lib_src/common/ethr_cbf.c b/erts/lib_src/common/ethr_cbf.c
index 037559be22..3f4a16dbfb 100644
--- a/erts/lib_src/common/ethr_cbf.c
+++ b/erts/lib_src/common/ethr_cbf.c
@@ -21,7 +21,7 @@
/*
* We keep this function alone in a separate file so the
- * compiler wont optimize it away.
+ * compiler won't optimize it away.
*/
#ifdef HAVE_CONFIG_H
diff --git a/erts/lib_src/common/ethr_mutex.c b/erts/lib_src/common/ethr_mutex.c
index acc7cb2da2..d8d8cde8e8 100644
--- a/erts/lib_src/common/ethr_mutex.c
+++ b/erts/lib_src/common/ethr_mutex.c
@@ -1905,7 +1905,7 @@ rwmutex_freqread_rdrs_dec_chk_wakeup(ethr_rwmutex *rwmtx,
* A writer that just enqueued (not seen by us
* in flag field) may depend on someone else
* completing the runlock. We just took over
- * that responsibilty since we modified reader
+ * that responsibility since we modified reader
* groups.
*/
rwmutex_try_complete_runlock(rwmtx, act, tse, 1, 0, 0);
diff --git a/erts/lib_src/pthread/ethread.c b/erts/lib_src/pthread/ethread.c
index 2a7f6aa18a..95587d73b4 100644
--- a/erts/lib_src/pthread/ethread.c
+++ b/erts/lib_src/pthread/ethread.c
@@ -146,7 +146,7 @@ ppc_init__(void)
{
int pid;
- /* If anything what so ever failes we assume no lwsync for safety */
+ /* If anything what so ever fails we assume no lwsync for safety */
ethr_runtime__.conf.have_lwsync = 0;
/*
@@ -219,7 +219,7 @@ ethr_x86_cpuid__(int *eax, int *ebx, int *ecx, int *edx)
#endif
#if ETHR_SIZEOF_PTR == 4 && defined(__PIC__) && __PIC__
/*
- * When position independet code is used in 32-bit mode, the B register
+ * When position independent code is used in 32-bit mode, the B register
* is used for storage of global offset table address, and we may not
* use it as input or output in an asm. We need to save and restore the
* B register explicitly (for some reason gcc doesn't provide this
diff --git a/erts/lib_src/utils/make_atomics_api b/erts/lib_src/utils/make_atomics_api
index f960b97c87..4bb1880c23 100755
--- a/erts/lib_src/utils/make_atomics_api
+++ b/erts/lib_src/utils/make_atomics_api
@@ -1463,7 +1463,7 @@ comments() ->
end,
?DW_ATOMIC_OPS),
" *
- * Appart from a function implementing the atomic operation
+ * Apart from a function implementing the atomic operation
* with unspecified memory barrier semantics, there are
* functions implementing each operation with the following
* implied memory barrier semantics:",
diff --git a/erts/lib_src/yielding_c_fun/test/examples/sha256_erlang_nif/c_src/sha-2/README.md b/erts/lib_src/yielding_c_fun/test/examples/sha256_erlang_nif/c_src/sha-2/README.md
index 167a69d08c..f3d2e8e49a 100644
--- a/erts/lib_src/yielding_c_fun/test/examples/sha256_erlang_nif/c_src/sha-2/README.md
+++ b/erts/lib_src/yielding_c_fun/test/examples/sha256_erlang_nif/c_src/sha-2/README.md
@@ -13,7 +13,7 @@ At the moment, only SHA-256 is implemented.
- ANSI C with as little specific C99 as possible (e.g. extended
integer types are used, but not bool).
-- Portable. Makes no assumptions on the target system's endianess or
+- Portable. Makes no assumptions on the target system's endianness or
word size.
- The SHA-256 implementation is a straightforward implementation of
diff --git a/erts/lib_src/yielding_c_fun/test/examples/sha256_erlang_nif/c_src/sha-2/sha-256.c b/erts/lib_src/yielding_c_fun/test/examples/sha256_erlang_nif/c_src/sha-2/sha-256.c
index 4338531d7e..c485596e1b 100644
--- a/erts/lib_src/yielding_c_fun/test/examples/sha256_erlang_nif/c_src/sha-2/sha-256.c
+++ b/erts/lib_src/yielding_c_fun/test/examples/sha256_erlang_nif/c_src/sha-2/sha-256.c
@@ -93,7 +93,7 @@ static int calc_chunk(uint8_t chunk[CHUNK_SIZE], struct buffer_state * state)
* Now:
* - either there is enough space left for the total length, and we can conclude,
* - or there is too little space left, and we have to pad the rest of this chunk with zeroes.
- * In the latter case, we will conclude at the next invokation of this function.
+ * In the latter case, we will conclude at the next invocation of this function.
*/
if (space_in_chunk >= TOTAL_LEN_LEN) {
const size_t left = space_in_chunk - TOTAL_LEN_LEN;
diff --git a/erts/lib_src/yielding_c_fun/test/examples/sha256_erlang_nif/c_src/sha-2/sha-256_orginal.c b/erts/lib_src/yielding_c_fun/test/examples/sha256_erlang_nif/c_src/sha-2/sha-256_orginal.c
index 53d6ff2e2a..f706429fc6 100644
--- a/erts/lib_src/yielding_c_fun/test/examples/sha256_erlang_nif/c_src/sha-2/sha-256_orginal.c
+++ b/erts/lib_src/yielding_c_fun/test/examples/sha256_erlang_nif/c_src/sha-2/sha-256_orginal.c
@@ -89,7 +89,7 @@ static int calc_chunk(uint8_t chunk[CHUNK_SIZE], struct buffer_state * state)
* Now:
* - either there is enough space left for the total length, and we can conclude,
* - or there is too little space left, and we have to pad the rest of this chunk with zeroes.
- * In the latter case, we will conclude at the next invokation of this function.
+ * In the latter case, we will conclude at the next invocation of this function.
*/
if (space_in_chunk >= TOTAL_LEN_LEN) {
const size_t left = space_in_chunk - TOTAL_LEN_LEN;
diff --git a/erts/lib_src/yielding_c_fun/test/examples/sha256_erlang_nif/c_src/sha256_nif.c b/erts/lib_src/yielding_c_fun/test/examples/sha256_erlang_nif/c_src/sha256_nif.c
index 6ad22c1dcd..a7c6746806 100644
--- a/erts/lib_src/yielding_c_fun/test/examples/sha256_erlang_nif/c_src/sha256_nif.c
+++ b/erts/lib_src/yielding_c_fun/test/examples/sha256_erlang_nif/c_src/sha256_nif.c
@@ -105,7 +105,7 @@ sha256_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
{
return enif_make_badarg(env);
}
- /* Copy the input binary to the work environemnt so it will be kept when we are yielding */
+ /* Copy the input binary to the work environment so it will be kept when we are yielding */
ERL_NIF_TERM input_bin_term = enif_make_copy(work_env, argv[0]);
ErlNifBinary input_bin;
enif_inspect_binary(work_env, input_bin_term, &input_bin);
diff --git a/erts/lib_src/yielding_c_fun/ycf_node.c b/erts/lib_src/yielding_c_fun/ycf_node.c
index 74a1483208..f8d499703a 100644
--- a/erts/lib_src/yielding_c_fun/ycf_node.c
+++ b/erts/lib_src/yielding_c_fun/ycf_node.c
@@ -897,7 +897,7 @@ void ycf_node_normalize_function(ycf_node* fun){
ycf_node_insert_scopes_in_complex_statements(&fun->u.function.body);
/* Move out declarations from for loops */
ycf_node_normalize_for_var_declarations(&fun->u.function.body);
- /* Move in code declations to top of scope */
+ /* Move in code declarations to top of scope */
ycf_node_move_in_code_var_declarations_to_top(&fun->u.function.body);
/* Normalize declarations */
ycf_node_normalize_init_definitions_in_scope(&fun->u.function.body);
diff --git a/erts/lib_src/yielding_c_fun/ycf_printers.c b/erts/lib_src/yielding_c_fun/ycf_printers.c
index 90ede8fe56..9a265b1e26 100644
--- a/erts/lib_src/yielding_c_fun/ycf_printers.c
+++ b/erts/lib_src/yielding_c_fun/ycf_printers.c
@@ -348,7 +348,7 @@ void print_definition(ycf_node_definition d){
void print_scope(ycf_node_code_scope node){
printf("NODE: scope\n");
printf(">>>>>>>>>>>>>>>>>>>>>>>\n");
- printf("Defenition Nodes:\n");
+ printf("Definition Nodes:\n");
struct ycf_node* n = node.definition_nodes.head;
while(n != NULL){
print_abstract_syntax_tree(n);
diff --git a/erts/lib_src/yielding_c_fun/ycf_yield_fun.c b/erts/lib_src/yielding_c_fun/ycf_yield_fun.c
index 37bb3b385b..86027895f1 100644
--- a/erts/lib_src/yielding_c_fun/ycf_yield_fun.c
+++ b/erts/lib_src/yielding_c_fun/ycf_yield_fun.c
@@ -994,7 +994,7 @@ void ast_add_yield_code_generated_define(ycf_node* source_out_tree/*Will be chan
" * static int test(){ return 0;}\n"
" * YCF_GCC_DIAG_ON(unused-function)\n"
" *\n"
- " * These macros were orginally authored by Jonathan Wakely and has\n"
+ " * These macros were originally authored by Jonathan Wakely and has\n"
" * been modified by Patrick Horgan.\n"
" *\n"
" * Source: http://dbp-consulting.com/tutorials/SuppressingGCCWarnings.html\n"
@@ -1653,7 +1653,7 @@ ycf_node* ast_get_ast_with_yieldified_function(ycf_node* source_tree,
ycf_node_rename_function(&fun_change->u.function,
ycf_string_new("%s_ycf_gen_yielding",
yielding_function_name));
- /* Remove unecessary scopes */
+ /* Remove unnecessary scopes */
ycf_node_remove_unecessary_scopes(&fun_change->u.function.body);
/* Exit with error message if a function call to a yielding function
is not transformed */
--
2.31.1