Skip to content

Commit

Permalink
Fix some spelling issues (#3385)
Browse files Browse the repository at this point in the history
Fix some of the spelling issues found by CSpell.
  • Loading branch information
bnason-nf authored May 5, 2024
1 parent c0e33f0 commit ca61184
Show file tree
Hide file tree
Showing 31 changed files with 102 additions and 99 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_llvm_libraries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
run: /usr/bin/env python3 -m pip install -r requirements.txt --break-system-packages
working-directory: build-scripts

- name: retrive the last commit ID
- name: retrieve the last commit ID
id: get_last_commit
run: echo "last_commit=$(GH_TOKEN=${{ secrets.GITHUB_TOKEN }} /usr/bin/env python3 ./build_llvm.py --llvm-ver)" >> $GITHUB_OUTPUT
working-directory: build-scripts
Expand Down
4 changes: 2 additions & 2 deletions ci/coding_guidelines_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def pre_flight_check(root: pathlib) -> bool:
def check_aspell(root):
return True

def check_clang_foramt(root: pathlib) -> bool:
def check_clang_format(root: pathlib) -> bool:
if not locate_command(CLANG_FORMAT_CMD):
return False

Expand All @@ -74,7 +74,7 @@ def check_clang_foramt(root: pathlib) -> bool:
def check_git_clang_format() -> bool:
return locate_command(GIT_CLANG_FORMAT_CMD)

return check_aspell(root) and check_clang_foramt(root) and check_git_clang_format()
return check_aspell(root) and check_clang_format(root) and check_git_clang_format()


def run_clang_format(file_path: pathlib, root: pathlib) -> bool:
Expand Down
8 changes: 4 additions & 4 deletions core/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@
#define WASM_DISABLE_STACK_HW_BOUND_CHECK 0
#endif

/* Disable SIMD unless it is manualy enabled somewhere */
/* Disable SIMD unless it is manually enabled somewhere */
#ifndef WASM_ENABLE_SIMD
#define WASM_ENABLE_SIMD 0
#endif
Expand Down Expand Up @@ -445,7 +445,7 @@
#endif

/* Reserved bytes to the native thread stack boundary, throw native
* stack overflow exception if the guard boudary is reached
* stack overflow exception if the guard boundary is reached
*
* WASM_STACK_GUARD_SIZE needs to be large enough for:
*
Expand All @@ -461,7 +461,7 @@
* - aot runtime functions
* eg. aot_enlarge_memory.
*
* - w/o hw bound check, the intepreter loop
* - w/o hw bound check, the interpreter loop
*
* the stack consumption heavily depends on compiler settings,
* especially for huge functions like the classic interpreter's
Expand Down Expand Up @@ -514,7 +514,7 @@
/*
* Use a larger default for platforms like macOS/Linux.
*
* For example, the classic intepreter loop which ended up with a trap
* For example, the classic interpreter loop which ended up with a trap
* (wasm_runtime_set_exception) would consume about 2KB stack on x86-64
* macOS. On Ubuntu amd64 20.04, it seems to consume a bit more.
*
Expand Down
14 changes: 7 additions & 7 deletions core/iwasm/aot/aot_loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ check_buf(const uint8 *buf, const uint8 *buf_end, uint32 length,
{
if ((uintptr_t)buf + length < (uintptr_t)buf
|| (uintptr_t)buf + length > (uintptr_t)buf_end) {
set_error_buf(error_buf, error_buf_size, "unexpect end");
set_error_buf(error_buf, error_buf_size, "unexpected end");
return false;
}
return true;
Expand Down Expand Up @@ -323,13 +323,13 @@ load_string(uint8 **p_buf, const uint8 *buf_end, AOTModule *module,
#endif
else if (is_load_from_file_buf) {
/* The string is always terminated with '\0', use it directly.
* In this case, the file buffer can be reffered to after loading.
* In this case, the file buffer can be referred to after loading.
*/
bh_assert(p[str_len - 1] == '\0');
str = (char *)p;
}
else {
/* Load from sections, the file buffer cannot be reffered to
/* Load from sections, the file buffer cannot be referred to
after loading, we must create another string and insert it
into const string set */
bh_assert(p[str_len - 1] == '\0');
Expand Down Expand Up @@ -2518,7 +2518,7 @@ load_function_section(const uint8 *buf, const uint8 *buf_end, AOTModule *module,
#if defined(BUILD_TARGET_XTENSA)
/*
* For Xtensa XIP, real func_count is doubled, including aot_func and
* aot_func_internal, so need to multipy func_count by 2 here.
* aot_func_internal, so need to multiply func_count by 2 here.
*/
if (module->is_indirect_mode) {
func_count *= 2;
Expand Down Expand Up @@ -3912,7 +3912,7 @@ resolve_execute_mode(const uint8 *buf, uint32 size, bool *p_mode,
p += 8;
while (p < p_end) {
read_uint32(p, p_end, section_type);
if (section_type <= AOT_SECTION_TYPE_SIGANATURE) {
if (section_type <= AOT_SECTION_TYPE_SIGNATURE) {
read_uint32(p, p_end, section_size);
CHECK_BUF(p, p_end, section_size);
if (section_type == AOT_SECTION_TYPE_TARGET_INFO) {
Expand All @@ -3927,7 +3927,7 @@ resolve_execute_mode(const uint8 *buf, uint32 size, bool *p_mode,
break;
}
}
else { /* section_type > AOT_SECTION_TYPE_SIGANATURE */
else { /* section_type > AOT_SECTION_TYPE_SIGNATURE */
set_error_buf(error_buf, error_buf_size,
"resolve execute mode failed");
break;
Expand Down Expand Up @@ -3966,7 +3966,7 @@ create_sections(AOTModule *module, const uint8 *buf, uint32 size,
p += 8;
while (p < p_end) {
read_uint32(p, p_end, section_type);
if (section_type < AOT_SECTION_TYPE_SIGANATURE
if (section_type < AOT_SECTION_TYPE_SIGNATURE
|| section_type == AOT_SECTION_TYPE_CUSTOM) {
read_uint32(p, p_end, section_size);
CHECK_BUF(p, p_end, section_size);
Expand Down
16 changes: 8 additions & 8 deletions core/iwasm/aot/aot_runtime.c
Original file line number Diff line number Diff line change
Expand Up @@ -1119,7 +1119,7 @@ init_func_ptrs(AOTModuleInstance *module_inst, AOTModule *module,
#if defined(BUILD_TARGET_XTENSA)
/*
* For Xtensa XIP, real func_count is doubled, including aot_func and
* aot_func_internal, so need to multipy func_count by 2 here.
* aot_func_internal, so need to multiply func_count by 2 here.
*/
if (module->is_indirect_mode) {
func_count *= 2;
Expand Down Expand Up @@ -1166,7 +1166,7 @@ init_func_type_indexes(AOTModuleInstance *module_inst, AOTModule *module,
#if defined(BUILD_TARGET_XTENSA)
/*
* For Xtensa XIP, real func_count is doubled, including aot_func and
* aot_func_internal, so need to multipy func_count by 2 here.
* aot_func_internal, so need to multiply func_count by 2 here.
*/
if (module->is_indirect_mode) {
func_count *= 2;
Expand Down Expand Up @@ -1394,7 +1394,7 @@ execute_post_instantiate_functions(AOTModuleInstance *module_inst,
}
#endif

/* Execute start function for both main insance and sub instance */
/* Execute start function for both main instance and sub instance */
if (module->start_function) {
AOTFunctionInstance start_func = { 0 };
uint32 func_type_idx;
Expand Down Expand Up @@ -2221,8 +2221,8 @@ aot_call_function(WASMExecEnv *exec_env, AOTFunctionInstance *function,

#if WASM_ENABLE_AOT_STACK_FRAME != 0
/* Free all frames allocated, note that some frames
may be allocated in AOT code and havent' been
freed if exception occured */
may be allocated in AOT code and haven't been
freed if exception occurred */
while (exec_env->cur_frame != prev_frame)
aot_free_frame(exec_env);
#endif
Expand Down Expand Up @@ -2291,8 +2291,8 @@ aot_call_function(WASMExecEnv *exec_env, AOTFunctionInstance *function,

#if WASM_ENABLE_AOT_STACK_FRAME != 0
/* Free all frames allocated, note that some frames
may be allocated in AOT code and havent' been
freed if exception occured */
may be allocated in AOT code and haven't been
freed if exception occurred */
while (exec_env->cur_frame != prev_frame)
aot_free_frame(exec_env);
#endif
Expand Down Expand Up @@ -4296,7 +4296,7 @@ aot_dump_pgo_prof_data_to_buf(AOTModuleInstance *module_inst, char *buf,
LLVMProfileData_64 *prof_data_64 = (LLVMProfileData_64 *)buf;

/* Convert LLVMProfileData to LLVMProfileData_64, the pointer width
in the output file is alawys 8 bytes */
in the output file is always 8 bytes */
prof_data = (LLVMProfileData *)module->data_sections[i].data;
prof_data_64->func_md5 = prof_data->func_md5;
prof_data_64->func_hash = prof_data->func_hash;
Expand Down
4 changes: 2 additions & 2 deletions core/iwasm/aot/aot_runtime.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ typedef enum AOTSectionType {
AOT_SECTION_TYPE_FUNCTION = 3,
AOT_SECTION_TYPE_EXPORT = 4,
AOT_SECTION_TYPE_RELOCATION = 5,
AOT_SECTION_TYPE_SIGANATURE = 6,
AOT_SECTION_TYPE_SIGNATURE = 6,
AOT_SECTION_TYPE_CUSTOM = 100,
} AOTSectionType;

Expand Down Expand Up @@ -420,7 +420,7 @@ typedef struct LLVMProfileData {
uint16 num_value_sites[2];
} LLVMProfileData;

/* The profiling data for writting to the output file, the width of
/* The profiling data for writing to the output file, the width of
pointer is 8 bytes suppose we always use wamrc and llvm-profdata
with 64-bit mode */
typedef struct LLVMProfileData_64 {
Expand Down
4 changes: 2 additions & 2 deletions core/iwasm/common/gc/gc_object.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ extern "C" {
#endif

/**
* Object header of a WASM object, as the adddress of allocated memory
* Object header of a WASM object, as the address of allocated memory
* must be 8-byte aligned, the lowest 3 bits are zero, we use them to
* mark the object:
* bits[0] is 1: the object is an externref object
Expand Down Expand Up @@ -85,7 +85,7 @@ typedef struct WASMArrayObject {
/* Must be pointer of WASMRttObject of array type */
WASMObjectHeader header;
/* (<array length> << 2) | <array element size>,
* elem_count = lenght >> 2
* elem_count = length >> 2
* elem_size = 2 ^ (length & 0x3)
*/
uint32 length;
Expand Down
6 changes: 3 additions & 3 deletions core/iwasm/common/wasm_application.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ execute_main(WASMModuleInstanceCommon *module_inst, int32 argc, char *argv[])
#if WASM_ENABLE_THREAD_MGR != 0
if (ret) {
/* On a successful return from the `_start` function,
we terminate other threads by mimicing wasi:proc_exit(0).
we terminate other threads by mimicking wasi:proc_exit(0).
Note:
- A return from the `main` function is an equivalent of
Expand Down Expand Up @@ -516,11 +516,11 @@ execute_func(WASMModuleInstanceCommon *module_inst, const char *name,
case VALUE_TYPE_V128:
{
/* it likes 0x123\0x234 or 123\234 */
/* retrive first i64 */
/* retrieve first i64 */
*(uint64 *)(argv1 + p) = strtoull(argv[i], &endptr, 0);
/* skip \ */
endptr++;
/* retrive second i64 */
/* retrieve second i64 */
*(uint64 *)(argv1 + p + 2) = strtoull(endptr, &endptr, 0);
p += 4;
break;
Expand Down
14 changes: 7 additions & 7 deletions core/iwasm/common/wasm_c_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ search_thread_local_store_num(Vector *stores_by_tid, korp_tid tid,
#endif

static unsigned
retrive_thread_local_store_num(Vector *stores_by_tid, korp_tid tid)
retrieve_thread_local_store_num(Vector *stores_by_tid, korp_tid tid)
{
#ifndef os_thread_local_attribute
unsigned i = 0;
Expand Down Expand Up @@ -664,8 +664,8 @@ wasm_store_new(wasm_engine_t *engine)
if (!engine || singleton_engine != engine)
return NULL;

if (!retrive_thread_local_store_num(&engine->stores_by_tid,
os_self_thread())) {
if (!retrieve_thread_local_store_num(&engine->stores_by_tid,
os_self_thread())) {
if (!wasm_runtime_init_thread_env()) {
LOG_ERROR("init thread environment failed");
return NULL;
Expand Down Expand Up @@ -734,8 +734,8 @@ wasm_store_delete(wasm_store_t *store)

if (decrease_thread_local_store_num(&singleton_engine->stores_by_tid,
os_self_thread())) {
if (!retrive_thread_local_store_num(&singleton_engine->stores_by_tid,
os_self_thread())) {
if (!retrieve_thread_local_store_num(&singleton_engine->stores_by_tid,
os_self_thread())) {
wasm_runtime_destroy_thread_env();
}
}
Expand Down Expand Up @@ -2263,7 +2263,7 @@ wasm_module_new_ex(wasm_store_t *store, const wasm_byte_vec_t *binary,
result = result || (pkg_type == Wasm_Module_AoT);
#endif
if (!result) {
LOG_VERBOSE("current building isn't compatiable with the module,"
LOG_VERBOSE("current building isn't compatible with the module,"
"may need recompile");
goto quit;
}
Expand Down Expand Up @@ -3386,7 +3386,7 @@ wasm_func_call(const wasm_func_t *func, const wasm_val_vec_t *params,
}
}

/* copy parametes */
/* copy parameters */
if (param_count
&& !params_to_argv(params, wasm_functype_params(func->type), argv,
&argc)) {
Expand Down
4 changes: 2 additions & 2 deletions core/iwasm/common/wasm_c_api_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ struct wasm_memorytype_t {

struct wasm_externtype_t {
uint32 extern_kind;
/* reservered space */
/* reserved space */
uint8 data[1];
};

Expand Down Expand Up @@ -205,7 +205,7 @@ struct wasm_extern_t {
wasm_name_t *module_name;
wasm_name_t *name;
wasm_externkind_t kind;
/* reservered space */
/* reserved space */
uint8 data[1];
};

Expand Down
2 changes: 1 addition & 1 deletion core/iwasm/common/wasm_exec_env.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ wasm_exec_env_destroy(WASMExecEnv *exec_env)
wasm_cluster_wait_for_all_except_self(cluster, exec_env);
#if WASM_ENABLE_DEBUG_INTERP != 0
/* Must fire exit event after other threads exits, otherwise
the stopped thread will be overrided by other threads */
the stopped thread will be overriden by other threads */
wasm_cluster_thread_exited(exec_env);
#endif
/* We have waited for other threads, this is the only alive thread, so
Expand Down
8 changes: 4 additions & 4 deletions core/iwasm/common/wasm_native.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ uint32
get_lib_rats_export_apis(NativeSymbol **p_lib_rats_apis);

static bool
compare_type_with_signautre(uint8 type, const char signature)
compare_type_with_signature(uint8 type, const char signature)
{
const char num_sig_map[] = { 'F', 'f', 'I', 'i' };

Expand Down Expand Up @@ -122,10 +122,10 @@ check_symbol_signature(const WASMFuncType *type, const char *signature)
sig = *p++;

/* a f64/f32/i64/i32/externref parameter */
if (compare_type_with_signautre(type->types[i], sig))
if (compare_type_with_signature(type->types[i], sig))
continue;

/* a pointer/string paramter */
/* a pointer/string parameter */
if (type->types[i] != VALUE_TYPE_I32)
/* pointer and string must be i32 type */
return false;
Expand Down Expand Up @@ -156,7 +156,7 @@ check_symbol_signature(const WASMFuncType *type, const char *signature)
return false;

/* result types includes: f64,f32,i64,i32,externref */
if (!compare_type_with_signautre(type->types[i], *p))
if (!compare_type_with_signature(type->types[i], *p))
return false;

p++;
Expand Down
Loading

0 comments on commit ca61184

Please sign in to comment.