From fdf6455900c27f5ae75fa3c38f372db9baf984a3 Mon Sep 17 00:00:00 2001 From: Heejin Ahn Date: Wed, 24 Dec 2025 01:06:25 +0000 Subject: [PATCH 1/7] Fix typos in the codebase This fixes various typos in the codebase. The work is done using Gemini and manually checked and fixed by me. This does not touch third party code or files with external licenses. --- ChangeLog.md | 104 +++++++++--------- embuilder.py | 4 +- emcc.py | 14 +-- emconfigure.py | 2 +- emrun.py | 18 +-- emsize.py | 2 +- .../docs/api_reference/Filesystem-API.rst | 2 +- site/source/docs/api_reference/console.h.rst | 2 +- .../docs/api_reference/emscripten.h.rst | 2 +- site/source/docs/api_reference/html5.h.rst | 24 ++-- site/source/docs/api_reference/index.rst | 2 +- .../source/docs/api_reference/preamble.js.rst | 6 +- .../docs/api_reference/wasm_workers.rst | 4 +- .../configuring_emscripten_settings.rst | 2 +- .../docs/building_from_source/index.rst | 2 +- .../verify_emscripten_environment.rst | 2 +- .../docs/compiling/Building-Projects.rst | 2 +- .../source/docs/compiling/Dynamic-Linking.rst | 8 +- .../docs/compiling/Modularized-Output.rst | 14 +-- .../Running-html-files-with-emrun.rst | 2 +- site/source/docs/compiling/WebAssembly.rst | 2 +- .../docs/contributing/developers_guide.rst | 2 +- site/source/docs/getting_started/Tutorial.rst | 2 +- .../source/docs/getting_started/downloads.rst | 4 +- .../docs/introducing_emscripten/community.rst | 2 +- .../emscripten_license.rst | 2 +- .../docs/optimizing/Optimizing-Code.rst | 2 +- site/source/docs/porting/Debugging.rst | 4 +- site/source/docs/porting/asyncify.rst | 2 +- .../Interacting-with-code.rst | 4 +- .../connecting_cpp_and_javascript/embind.rst | 2 +- .../guidelines/function_pointer_issues.rst | 2 +- .../EGL-Support-in-Emscripten.rst | 2 +- site/source/docs/porting/simd.rst | 2 +- site/source/docs/tools_reference/emcc.rst | 4 +- site/source/docs/tools_reference/emsdk.rst | 4 +- .../tools_reference/settings_reference.rst | 82 +++++++------- src/audio_worklet.js | 4 +- src/closure-externs/closure-externs.js | 2 +- src/emrun_postjs.js | 2 +- src/emrun_prejs.js | 2 +- src/lib/libaddfunction.js | 2 +- src/lib/libasync.js | 4 +- src/lib/libatomic.js | 2 +- src/lib/libautodebug.js | 2 +- src/lib/libccall.js | 2 +- src/lib/libcore.js | 12 +- src/lib/libdylink.js | 18 +-- src/lib/libembind.js | 6 +- src/lib/libembind_gen.js | 2 +- src/lib/libeventloop.js | 6 +- src/lib/libexceptions.js | 4 +- src/lib/libfs.js | 2 +- src/lib/libfs_shared.js | 4 +- src/lib/libglemu.js | 4 +- src/lib/libglfw.js | 12 +- src/lib/libglut.js | 6 +- src/lib/libhtml5.js | 4 +- src/lib/libhtml5_webgl.js | 2 +- src/lib/libidbstore.js | 4 +- src/lib/libint53.js | 2 +- src/lib/liblegacy.js | 2 +- src/lib/libmemfs.js | 4 +- src/lib/libnodefs.js | 4 +- src/lib/libnoderawfs.js | 2 +- src/lib/libopenal.js | 8 +- src/lib/libpthread.js | 36 +++--- src/lib/libsdl.js | 12 +- src/lib/libsockfs.js | 10 +- src/lib/libstack_trace.js | 2 +- src/lib/libwasi.js | 4 +- src/lib/libwasm_worker.js | 2 +- src/lib/libwebgl.js | 14 +-- src/lib/libwebgl2.js | 2 +- src/lib/libwebsocket.js | 2 +- src/modularize.js | 2 +- src/parseTools.mjs | 2 +- src/polyfill/bigint64array.js | 2 +- src/postamble_modularize.js | 2 +- src/preamble.js | 6 +- src/pthread_esm_startup.mjs | 2 +- src/runtime_asan.js | 2 +- src/runtime_init_memory.js | 2 +- src/runtime_pthread.js | 2 +- src/runtime_safe_heap.js | 2 +- src/settings.js | 78 ++++++------- src/settings_internal.js | 8 +- src/shell.js | 2 +- src/shell_minimal.js | 2 +- src/threadprofiler.js | 2 +- src/wasm_worker.js | 4 +- system/include/emscripten/bind.h | 6 +- system/include/emscripten/console.h | 4 +- system/include/emscripten/em_asm.h | 4 +- system/include/emscripten/em_js.h | 2 +- system/include/emscripten/em_macros.h | 2 +- system/include/emscripten/emscripten.h | 2 +- system/include/emscripten/heap.h | 2 +- system/include/emscripten/html5_webgl.h | 2 +- system/include/emscripten/proxying.h | 4 +- system/include/emscripten/val.h | 6 +- system/include/emscripten/wasm_worker.h | 2 +- system/include/wasi/api.h | 4 +- system/include/webgl/webgl2_ext.h | 2 +- system/lib/README.md | 2 +- system/lib/compiler-rt/__c_longjmp.S | 2 +- system/lib/compiler-rt/emscripten_setjmp.c | 2 +- .../lib/lsan/lsan_common_emscripten.cpp | 2 +- .../sanitizer_common/sanitizer_emscripten.cpp | 2 +- system/lib/compiler-rt/readme.txt | 4 +- system/lib/compiler-rt/stack_limits.S | 4 +- system/lib/dlmalloc.c | 10 +- system/lib/emmalloc.c | 12 +- system/lib/gl/webgl2.c | 2 +- system/lib/gl/webgl_internal_funcs.h | 2 +- system/lib/html5/offscreencanvas.c | 8 +- system/lib/libc/README.md | 2 +- system/lib/libc/compat/aligned_alloc.c | 2 +- system/lib/libc/dynlink.c | 14 +-- system/lib/libc/emscripten_internal.h | 2 +- system/lib/libc/emscripten_syscall_stubs.c | 2 +- system/lib/libc/emscripten_time.c | 2 +- system/lib/libc/lookup_name.c | 4 +- .../libc/musl/arch/emscripten/syscall_arch.h | 4 +- system/lib/libc/sbrk.c | 2 +- system/lib/libcxx/readme.txt | 4 +- system/lib/libcxxabi/readme.txt | 4 +- system/lib/libcxxabi/src/cxa_exception.h | 2 +- .../src/cxa_exception_emscripten.cpp | 6 +- system/lib/libunwind/readme.txt | 4 +- system/lib/libunwind/src/Unwind-wasm.c | 6 +- .../src/__support/threads/linux/thread.cpp | 2 +- .../lib/mimalloc/src/prim/emscripten/prim.c | 2 +- system/lib/pthread/emscripten_tls_init.c | 6 +- system/lib/pthread/proxying.c | 2 +- system/lib/pthread/pthread_create.c | 6 +- system/lib/pthread/thread_mailbox.c | 2 +- system/lib/pthread/threading_internal.h | 6 +- system/lib/push_llvm_changes.py | 2 +- system/lib/push_musl_changes.py | 2 +- system/lib/standalone/__main_void.c | 2 +- system/lib/standalone/standalone.c | 2 +- system/lib/update_llvm_libc.py | 8 +- system/lib/update_musl.py | 4 +- system/lib/wasm_worker/library_wasm_worker.c | 2 +- system/lib/wasmfs/js_impl_backend.h | 2 +- system/lib/wasmfs/syscalls.cpp | 2 +- system/lib/wasmfs/thread_utils.h | 2 +- system/lib/wasmfs/wasmfs.cpp | 2 +- test/benchmark/benchmark_sse.h | 2 +- test/browser/test_glfw.c | 2 +- test/browser/test_glfw3.c | 6 +- test/browser/test_sdl2_canvas_palette_2.c | 12 +- test/browser/test_sdl2_gl_read.c | 2 +- test/browser/test_sdl_canvas_palette_2.c | 12 +- test/browser/test_sdl_gl_mapbuffers.c | 2 +- test/browser/test_sdl_gl_read.c | 2 +- test/browser/test_sdl_set_clip_rect.c | 4 +- test/browser/test_sdl_togglefullscreen.c | 2 +- .../webgl_draw_triangle_with_uniform_color.c | 2 +- test/browser/webgl_with_closure.c | 2 +- test/browser_common.py | 2 +- test/clang_native.py | 4 +- test/cmake/find_stuff/CMakeLists.txt | 2 +- test/cocos2d_hello.cpp | 6 +- test/common.py | 14 +-- test/core/FS_exports.cpp | 2 +- test/core/pthread/test_pthread_dlopen.c | 2 +- test/core/test_em_asm_2.cpp | 2 +- test/core/test_em_asm_2.out | 2 +- test/core/test_emscripten_async_call.c | 2 +- test/core/test_exceptions_convert.cpp | 2 +- test/core/test_exceptions_rethrow.cpp | 2 +- test/core/test_externref.c | 4 +- test/core/test_externref.out | 4 +- test/core/test_gl_get_proc_address.c | 2 +- test/core/test_promise_await.c | 4 +- test/core/test_signals.c | 6 +- test/core/test_sscanf_other_whitespace.c | 2 +- test/core/test_stack_get_free.c | 4 +- test/core/test_varargs.c | 10 +- test/core/test_wrap_malloc.c | 2 +- test/cube_explosion.c | 2 +- test/decorators.py | 2 +- test/embind/test_val.cpp | 4 +- test/emscripten_set_timeout_loop.c | 6 +- test/fetch/test_fetch_progress.c | 2 +- test/freetype/main_2.c | 2 +- test/freetype/main_3.c | 2 +- test/fs/test_fs_bad_lookup.c | 6 +- test/fs/test_fs_js_api.c | 2 +- test/fs/test_fs_symlink_resolution.c | 2 - test/fs/test_lz4fs.c | 2 +- test/fs/test_workerfs.c | 2 +- test/jsrun.py | 2 +- test/module/test_stdin.c | 2 +- test/openal/test_openal_capture.c | 4 +- test/openal/test_openal_capture_sanity.c | 2 +- test/other/embind_tsgen_main.ts | 4 +- test/other/test_dlopen_promise.c | 4 +- test/other/test_em_asm_i64.cpp | 2 +- test/other/test_em_js_main_module_address.c | 2 +- test/other/test_gmtime_noleak.c | 2 +- test/other/test_lto_atexit.c | 2 +- test/other/test_mmap_and_munmap.c | 4 +- test/other/test_mmap_and_munmap_anonymous.cpp | 2 +- test/other/test_mmap_empty.c | 2 +- test/other/test_parseTools.js | 4 +- test/other/test_proxy_to_pthread_stack.c | 2 +- test/other/test_pthread_self_join_detach.c | 4 +- test/other/test_pthread_set_main_loop.c | 2 +- test/other/test_pthread_set_main_loop.out | 2 +- test/other/test_pthread_stub.c | 2 +- test/other/test_syscall_stubs.c | 2 +- test/other/test_syslog.c | 2 +- test/parallel_testsuite.py | 10 +- .../pthread/test_pthread_busy_wait_atexit.cpp | 2 +- test/pthread/test_pthread_cancel_async.c | 4 +- test/pthread/test_pthread_cancel_cond_wait.c | 2 +- test/pthread/test_pthread_tls_dylink.c | 4 +- test/runner.py | 4 +- test/sockets/test_enet_client.c | 4 +- test/sockets/test_enet_server.c | 4 +- test/sockets/test_sockets_partial_client.c | 4 +- test/sqlite/speedtest1.c | 8 +- test/stdio/test_rename.c | 2 +- test/test_browser.py | 24 ++-- test/test_c_preprocessor.c | 2 +- test/test_codesize.py | 6 +- test/test_core.py | 56 +++++----- test/test_emscripten_async_wget2.cpp | 20 ++-- test/test_emscripten_async_wget2_data.cpp | 2 +- test/test_emscripten_log.cpp | 2 +- test/test_gles2_conformance.c | 2 +- test/test_jslib_override_system_symbol.js | 2 +- test/test_other.py | 56 +++++----- test/test_stress.py | 4 +- test/unistd/access.c | 4 +- test/unistd/pipe.c | 2 +- test/unistd/unlink.c | 2 +- test/utime/test_futimens.c | 2 +- .../shared_memory_preprocessor_flags.c | 2 +- test/wasm_worker/thread_stack.c | 4 +- test/webaudio/audioworklet_emscripten_locks.c | 16 +-- test/webaudio/audioworklet_post_function.c | 2 +- test/webgpu_required_limits.c | 2 +- test/worker_api_2_main.cpp | 2 +- tools/acorn-optimizer.mjs | 4 +- tools/building.py | 8 +- tools/cmdline.py | 2 +- tools/colored_logger.py | 2 +- tools/compile.py | 2 +- tools/config.py | 2 +- tools/diagnostics.py | 2 +- tools/empath-split.py | 6 +- tools/emscripten.py | 12 +- tools/emsymbolizer.py | 2 +- tools/file_packager.py | 2 +- tools/filelock.py | 10 +- tools/link.py | 22 ++-- tools/maint/check_struct_info.py | 6 +- tools/maint/create_entry_points.py | 6 +- tools/maint/find_unused_settings.py | 2 +- tools/maint/post-checkout | 2 +- tools/maint/simde_update.py | 2 +- tools/maint/update_settings_docs.py | 6 +- tools/ports/sdl3.py | 2 +- tools/response_file.py | 2 +- tools/shared.py | 2 +- tools/system_libs.py | 12 +- tools/wasm-sourcemap.py | 2 +- tools/webidl_binder.py | 2 +- .../src/websocket_to_posix_proxy.c | 6 +- 273 files changed, 745 insertions(+), 749 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index 8bddb07e46308..cb31869484a70 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -61,7 +61,7 @@ See docs/process.md for more on how version tagging works. separately. (#18820) - A new `-sFAKE_DYLIBS` setting was added. When enabled you get the current emscripten behavior of the `-shared` flag, which is to produce regular object - files instead of actual shared shared libraries (side modules). Because this + files instead of actual shared libraries (side modules). Because this setting is enabled by default this doesn't change the default behavior of the compiler. If you want to experiment with real shared libraries you can explicitly disable this setting. (#25826) @@ -82,7 +82,7 @@ See docs/process.md for more on how version tagging works. ----------------- - The `RETAIN_COMPILER_SETTINGS` setting and the corresponding `emscripten_get_compiler_setting` API no longer store or report internal - compiler settings (those listed in `setttings_internal.js`). We made an + compiler settings (those listed in `settings_internal.js`). We made an exception here for `EMSCRIPTEN_VERSION` which is the only internal setting where we could find usage of `emscripten_get_compiler_setting` (in a global GitHub search). (#25667) @@ -138,7 +138,7 @@ See docs/process.md for more on how version tagging works. 4.0.15 - 09/17/25 ----------------- -- The `RELOCATABLE` and `LINKABLE` settings were deprecated in favor the higher +- The `RELOCATABLE` and `LINKABLE` settings were deprecated in favor of the higher level and better supported `MAIN_MODULE` / `SIDE_MODULE` settings. (#25265) - The `-gsource-map` flag has been updated to be independent of other types of debugging effects (in particular it no longer causes the wasm binary to have @@ -345,7 +345,7 @@ See docs/process.md for more on how version tagging works. deprecated for more than year: - SUPPORT_ERRNO: Instead, export `__errno_location` if needed. - EXTRA_EXPORTED_RUNTIME_METHODS: Instead use EXPORTED_RUNTIME_METHODS. - - DEMANGLE_SUPPORT: Instead use the `$demangle` JS libary function. + - DEMANGLE_SUPPORT: Instead use the `$demangle` JS library function. (#23975) 4.0.5 - 03/12/25 @@ -407,7 +407,7 @@ See docs/process.md for more on how version tagging works. this should not be a user-visible change. (#23348) - When using cmake the emscripten toolchain will no longer skip the toolchain detection stages. This means the initial cmake run will be slower, but will - result in more accruate information. If cmake is running too slow for you, + result in more accurate information. If cmake is running too slow for you, you can revert to the previous behaviour with `-DEMSCRIPTEN_FORCE_COMPILERS=ON`. 4.0.1 - 01/17/25 @@ -481,7 +481,7 @@ See docs/process.md for more on how version tagging works. when linking in debug mode (`-O0` and/or `-sASSERTIONS`). This means that things like double-free will be detected in these builds. Previously this was only true with `-sASSERTIONS=2`. (#23330) -- The code geneated in `--proxy-to-worker` no longer contains support for +- The code generated in `--proxy-to-worker` no longer contains support for reading the `?noProxy` URL parameter (this was not documented or tested). (#23297) @@ -497,7 +497,7 @@ See docs/process.md for more on how version tagging works. support for `std::basic_string` was removed from embind. (#23070) - The minimum supported versions of browser engines that we support were updated - to versions that support Promise, Fetch and Object.asign APIs, allowing the + to versions that support Promise, Fetch and Object.assign APIs, allowing the polyfills for these to be removed. Chrome 32 -> 45, Firefox 34 -> 40, Safari 9.0 -> 10.1. These browser engines version are all over 8 years old now. (#23077, #23118) @@ -549,7 +549,7 @@ See docs/process.md for more on how version tagging works. - embind no longer exports any library functions by default. Previously we would export getInheritedInstanceCount, getLiveInheritedInstances, flushPendingDeletes and setDelayFunction. If you need these library function - exprted they can be added to `EXPORTED_RUNTIME_METHODS`. (#22705) + exported they can be added to `EXPORTED_RUNTIME_METHODS`. (#22705) 3.1.68 - 09/30/24 ----------------- @@ -584,7 +584,7 @@ See docs/process.md for more on how version tagging works. 3.1.65 - 08/22/24 ----------------- - A new `--emit-minification-map` command line flag was added, which can be used - to emit a minifiction map in the case that import/export minification is + to emit a minification map in the case that import/export minification is performed (this happens at higher optimization levels). (#22428) - Remove `Module['quit']` handling. This could be used to override the internal method for shutting down the program, but it was neither documented nor @@ -660,7 +660,7 @@ See docs/process.md for more on how version tagging works. 3.1.58 - 04/23/24 ----------------- - The `-sMAIN_MODULE=1` mode no longer exports all the main module symbols on - `Module` object. This saves a huge about of generated JS code due the fact + `Module` object. This saves a huge amount of generated JS code due the fact that `-sMAIN_MODULE=1` includes *all* native symbols in your program as well is from the standard library. The generated JS code for a simple program in this mode is reduced from from 3.3mb to 0.5mb. The current implementation @@ -674,10 +674,10 @@ See docs/process.md for more on how version tagging works. - In multi-threaded builds `--extern-pre-js` and `--extern-post-js` code is now only run on the main thread, and not on each of the workers. (#21750) - Fix crash when throwing exceptions in dynamically linked int64 functions (#21759) -- Multi-threaded builds no depend on a separate `.worker.js` file. This saves - on code size and network requests. In order to make this change go smoothly, - without breaking build systems that expect a `worker.js`, emscripten will - generate an empty `.worker.js` to give folks time to transition their +- Multi-threaded builds no longer depend on a separate `.worker.js` file. This + saves on code size and network requests. In order to make this change go + smoothly, without breaking build systems that expect a `worker.js`, emscripten + will generate an empty `.worker.js` to give folks time to transition their deployment scripts. In `-sSTRICT` mode, this empty file will not be generated. (#21701) @@ -729,7 +729,7 @@ See docs/process.md for more on how version tagging works. - In `STRICT` mode the `HEAPXX` symbols (such as `HEAP8` and `HEAP32`) are now only exported on demand. This means that they must be added to `EXPORTED_RUNTIME_METHODS` for them to appear on the `Module` object. For - now, this only effects users of `STRICT` mode. (#21439) + now, this only affects users of `STRICT` mode. (#21439) - Emscripten no longer supports `--memory-init-file` (i.e. extracting static data into an external .mem file). This feature was only available under wasm2js (`-sWASM=0`) anyway so this change will only affect users of this @@ -899,7 +899,7 @@ See docs/process.md for more on how version tagging works. which doesn't use `#if ASSERTIONS` guards around their `assert` calls. This behaviour matches that of `MINIMAL_RUNTIME`. (#20592) - The minimum version of node required run the compiler was updated from - 10.19 to 16.20. This does not effect the node requirements of the generated + 10.19 to 16.20. This does not affect the node requirements of the generated JavaScript code. (#20551) - A new top-level `bootstrap` script was added. This script is for emscripten developers and helps take a care of post-checkout tasks such as `npm install`. @@ -990,7 +990,7 @@ See docs/process.md for more on how version tagging works. long-deprecated JS API. (#19820) - The internal `read_` and `readAsync` functions no longer handle data URIs. (Higher-level functions are expected to handle that themselves, before calling.) - This only effects builds that use `-sSINGLE_FILE` or `--memory-init-file`. + This only affects builds that use `-sSINGLE_FILE` or `--memory-init-file`. (#19792) - The `asm` property of the Module object (which held the raw exports of the wasm module) has been removed. Internally, this is now accessed via the @@ -1373,7 +1373,7 @@ See docs/process.md for more on how version tagging works. ------------------- - The `getTempRet0`/`setTempRet0` helper functions are now implemented directly in WebAssembly, rather than supplied by the JS host. This simplifies the - wasm/JS interface. These function are no longer exported in all cases. If + wasm/JS interface. These functions are no longer exported in all cases. If your code directly calls these functions from JS, you can add them to `-sEXPORTED_RUNTIME_METHODS`. - Several linux-specific headers were removed from the emscripten sysroot. None @@ -1388,7 +1388,7 @@ See docs/process.md for more on how version tagging works. 3.1.18 - 08/01/2022 ------------------- - The tests/ directory was renamed to just test/ to match other project close - emscripten (llvm, wabt, binaryen). This should not effect any users of + emscripten (llvm, wabt, binaryen). This should not affect any users of emscripten, only developers. (#17502) - The llvm version that emscripten uses was updated to 16.0.0 (#17534) - worker.js now propagates unhandled promise rejections to the main thread the @@ -1398,7 +1398,7 @@ See docs/process.md for more on how version tagging works. ------------------- - Add support for dynamic linking with Asyncify. (#15893) - A source map file and DWARF info in the wasm can now be emitted at the same if - the user gives the both options: `-g -gsource-map`. (#17484) + the user gives both options: `-g -gsource-map`. (#17484) - The `align` argument to the makeGetValue/makeSetValue JS library macros was removed (and replaced with an assert) as it had no uses internally and was removed (and replaced with an assert) as it had now uses internally and was @@ -1415,7 +1415,7 @@ See docs/process.md for more on how version tagging works. - When JS library functions are included as part of `EXPORTED_RUNTIME_METHODS` it is no longer necessary to also add them to `DEFAULT_LIBRARY_FUNCS_TO_INCLUDE`. This change allows us to transition - runtime functions to JS library functions without the need to folks to add + runtime functions to JS library functions without the need for folks to add `DEFAULT_LIBRARY_FUNCS_TO_INCLUDE`. (#17369) - The following function, which were previously part of the default runtime, are now JS library functions: @@ -1445,7 +1445,7 @@ See docs/process.md for more on how version tagging works. disabled (which it may be in the future) these symbols would only be included if there were explicitly exported via `EXPORTED_RUNTIME_METHODS` or added to `DEFAULT_LIBRARY_FUNCS_TO_INCLUDE`. `LEGACY_RUNTIME` is disabled by default - in `STRICT` mode so this change only effects users of `STRICT` mode. (#17370, + in `STRICT` mode so this change only affects users of `STRICT` mode. (#17370, #17403) - The `run` runtime function is no longer exported by default. It can be added to `EXPORTED_RUNTIME_METHODS` if needed. @@ -1482,9 +1482,9 @@ See docs/process.md for more on how version tagging works. same way as with other wasm targets. This means that within the wasm module the name of the main function can now be `__main_argc_argv`, but, since we still export this to JS as `_main`, this should not be a user-visible change. -- Use of pkg-config from cmake not longer causes the C++ include path to be +- Use of pkg-config from cmake no longer causes the C++ include path to be broken. (#17137) -- `emscripten_runtime_keeplive_push()` and `emscripten_runtime_keeplive_push()` +- `emscripten_runtime_keeplive_push()` and `emscripten_runtime_keeplive_pop()` are now exposed to native code and can be used to keep the runtime alive without immediately unwinding the event loop (as `emscripten_exit_with_live_runtime()` does). (#17160) @@ -1508,7 +1508,7 @@ See docs/process.md for more on how version tagging works. to `long` so that it is compatible with `MEMORY64`. The return value of this function sometimes contains a pointer value so `int` is not sufficiently wide under `wasm64`. (#16938) -- The `EM_BUILD_VERBOSE` environment variable only effects test code these days +- The `EM_BUILD_VERBOSE` environment variable only affects test code these days and therefore was renamed to `EMTEST_BUILD_VERBOSE`. (#16904) - compiler-rt updated to LLVM 14. (#16991) - libc++ updated to LLVM 14. (#17000) @@ -1675,7 +1675,7 @@ See docs/process.md for more on how version tagging works. - The example `shell.html` and `shell_minimal.html` templates no longer override `printErr` on the module object. This means error message from emscripten and stderr from the application will go to the default location of `console.warn` - rather than `console.error`. This only effects application that use the + rather than `console.error`. This only affects applications that use the example shell html files. - The version of musl libc used by emscripten was upgraded from v1.1.15 to v1.2.2. There could be some minor size regressions (or gains) due to changes @@ -1796,7 +1796,7 @@ See docs/process.md for more on how version tagging works. the library is loaded and then continue on as if dlopen was blocking. For users who don't want to use `ASYNCIFY` (which has a size and runtime cost) there is a async (callback-based) version of the dlopen API available as - `emscripten_dlopen()` declared in `emscropten/emscripten.h`. See + `emscripten_dlopen()` declared in `emscripten/emscripten.h`. See `docs/api_reference/emscripten.h.rst` (or the online version) for more details. - Constructors, functions and methods bound with Embind can now be `await`ed. @@ -1828,19 +1828,19 @@ See docs/process.md for more on how version tagging works. - Drop support for node versions older than v5.10.0. We now assume the existence of `Buffer.from` which was added in v5.10.0. If it turns out there is still a need to support these older node versions we can - add a polyfil under LEGACY_VM_SUPPORT (#14447). + add a polyfill under LEGACY_VM_SUPPORT (#14447). 2.0.24 - 06/10/2021 ------------------- - Support `--preload-file` in Node.js. (#11785) - System libraries are now passed to the linker internally via `-lfoo` rather than using their full path. This is in line with how gcc and clang pass system - libraries to the linker. This should not effect any builds unless a project a + libraries to the linker. This should not affect any builds unless a project a happens to have, for example, a file called `libc.a` in one of its library paths. This would have the effect of overriding the system library (as it would with gcc or clang) (#14342). - CMake projects (those that either use emcmake or use Emscripten.cmake - directly) are new configured to install (by default) directly into the + directly) are now configured to install (by default) directly into the emscripten sysroot. This means that running `cmake --install` (or running the install target, via `make install` for example) will install resources into the sysroot such that they can later be found and used by `find_path`, @@ -1926,7 +1926,7 @@ See docs/process.md for more on how version tagging works. compile-only (`-c`) mode. Just like with clang itself, this warning can be disabled using the flag: `-Wno-unused-command-line-argument`. - When building with `-s MAIN_MODULE` emscripten will now error on undefined - symbol by default. This matches the behvious of clang/gcc/msvc. This + symbol by default. This matches the behaviour of clang/gcc/msvc. This requires that your side modules be present on the command line. If you do not specify your side modules on the command line (either directly or via `RUNTIME_LINKED_LIBS`) you may need to add `-s WARN_ON_UNDEFINED_SYMBOLS=0` to @@ -2024,7 +2024,7 @@ See docs/process.md for more on how version tagging works. due to the code size that it adds. (MINIMAL_RUNTIME=1 implies SUPPORT_ERRNO=0 by default) Pass -s SUPPORT_ERRNO=1 to enable errno support if necessary. - Using EM_ASM and EM_JS in a side module will now result in an error (since - this is not implemented yet). This could effect users were previously + this is not implemented yet). This could affect users were previously inadvertently including (but not actually using) EM_ASM or EM_JS functions in side modules (#13649). - Remove dependency on Uglify by finishing the rewrite of passes to acorn @@ -2081,10 +2081,10 @@ See docs/process.md for more on how version tagging works. - The system for linking native libraries on demand (based on the symbols present in input object files) has been removed. Libraries such as libgl, libal, and libhtml5 are now included on the link line by default unless - `-s AUTO_NATIVE_LIBRARIES=0` is used. This should not effect most builds + `-s AUTO_NATIVE_LIBRARIES=0` is used. This should not affect most builds in any way since wasm-ld ignores unreferenced library files. Only users of the `--whole-archive` linker flag (which is used when `MAIN_MODULE=1` is - set) should be effected. + set) should be affected. 2.0.12: 01/09/2021 ------------------ @@ -2116,16 +2116,16 @@ See docs/process.md for more on how version tagging works. Breaking change: This new setting is required if you provide a runtime value for `wasmMemory` or `INITIAL_MEMORY` on the Module object. - Internally, emscripten now uses the `--sysroot` argument to point clang at - it headers. This should not effect most projects but has a minor effect the + it headers. This should not affect most projects but has a minor effect the order of the system include paths: The root include path - (`/system/include`) is now always last in the include path. + (`/system/include`) is now always last in the include path. - Fix JS pthreads proxying + WASM_BIGINT (#12935) - Optimize makeDynCall to use dynCall_xx function directly where needed (#12741) 2.0.9: 11/16/2020 ----------------- -- dlopen, in conformace with the spec, now checks that one of either RTDL_LAZY - or RTDL_NOW flags ar set. Previously, it was possible set nether of these +- dlopen, in conformance with the spec, now checks that one of either RTDL_LAZY + or RTDL_NOW flags are set. Previously, it was possible set neither of these without generating an error. - Allow `-lSDL2_mixer` to just work. (Others like `-lSDL2` always worked, but for `SDL2_mixer` things were broken because we build multiple variations of @@ -2288,7 +2288,7 @@ See docs/process.md for more on how version tagging works. - The default output format is now executable JavaScript. Previously we would default to output objecting files unless, for example, the output name ended in `.js`. This is contrary to behaviour of clang and gcc. Now emscripten - will always produce and executable unless the `-c`, `-r` or `-shared` flags + will always produce an executable unless the `-c`, `-r` or `-shared` flags are given. This is true even when the name of the output file ends in `.o`. e.g, `emcc foo.c -o foo.o` will produce a JavaScript file called `foo.o`. This might surprise some users (although it matches the behavior of existing @@ -2376,7 +2376,7 @@ See docs/process.md for more on how version tagging works. - It is now an error if a function listed in the `EXPORTED_FUNCTIONS` list is missing from the build (can be disabled via `-Wno-undefined`) (ERROR_ON_UNDEFINED_SYMBOLS and WARN_ON_UNDEFINED_SYMBOLS no longer apply - to these symbols which are explicly exported). + to these symbols which are explicitly exported). - Support for pthreads with wasm2js (`WASM=0`; #11505). - Rename `emscripten/math.h` to `emscripten/em_math.h` because if a user adds `emscripten/` as an include path with `-I`, that can override libc math.h, @@ -2424,7 +2424,7 @@ See docs/process.md for more on how version tagging works. the sample config will still be written there in the case that the emscripten root is read-only. - The default location for downloaded ports is now a directory called "ports" - within the cache directory. In practice these means by default they live + within the cache directory. In practice this means by default they live in `cache/ports` inside the emscripten source directory. This can be controlled by setting the location of the cache directory, or for even more fine grained control the `EM_PORTS` environment variable and the `PORTS` @@ -2637,7 +2637,7 @@ v1.39.9: 03/05/2020 - Updated of libc++abi and libc++ to llvm 9.0.0 (#10510) - Refactor syscall interface: Syscalls are no longer variadic (except those that are inherently such as open) and no longer take the syscall number as - arg0. This should be invisible to most users but will effect any external + arg0. This should be invisible to most users but will affect any external projects that try to implement/emulate the emscripten syscall interface. See #10474 - Removed src/library_vr.js, as it was outdated and nonfunctional, and the WebVR @@ -2678,7 +2678,7 @@ v1.39.7: 02/03/2020 - The checked-in copy of the Closure compiler was removed in favor of getting it from npm. This means that developers now need to run `npm install` after checking out emscripten if they want to use closure (--closure). emsdk users - are not effected because emsdk runs this as a post install step (#9989). + are not affected because emsdk runs this as a post install step (#9989). - Added support for specifying JSDoc minification annotations for Closure in JS library, pre and post files. See https://github.com/google/closure-compiler/wiki/Annotating-JavaScript-for-the-Closure-Compiler @@ -2747,7 +2747,7 @@ v1.39.4: 12/03/2019 - Remove deprecated `requestFullScreen` method from `library_browser.js`, please use `requestFullscreen` (without the capital S). - Remove deprecated `requestFullScreen` and `cancelFullScreen` from `library_glut.js` -- Remove deprecated `requestFullScreen` and `cancelFullScreen`from `library_glfw.js` +- Remove deprecated `requestFullScreen` and `cancelFullScreen` from `library_glfw.js` - Fix SDL2_mixer support for ogg vorbis. See #9849 - Various source maps fixes, see #9926 #9882 #9837 #9814 @@ -3529,7 +3529,7 @@ v1.36.12: 10/20/2016 - Improved asm.js -s USE_PTHREADS=2 build mode compatibility when multithreading is not supported. - Improved WebGL support with closure compiler (#4619) - - Improved Bianaryen WebAssembly support + - Improved Binaryen WebAssembly support - Added support for GL_disjoint_timer_query extension (#4575) - Improved Emscripten compiler detection with CMake (#4129, #4314, #4318) - Added support for int64 in wasm. @@ -4111,7 +4111,7 @@ v1.34.10: 9/25/2015 - Removed the deprecated --compression option. - Fixed an issue with asm.js validation for pthreads being broken since v1.34.7 (#3719) - Added built-in cpu performance profiler, which is enabled with linker flag --cpuprofiler. (#3781) - - Added build-in memory usage profiler, which is enabled with linker flag --memoryprofiler. (#3781) + - Added built-in memory usage profiler, which is enabled with linker flag --memoryprofiler. (#3781) - Fixed multiple arities per EM_ASM block (#3804) - Fixed issues with SSE2 an NaN bit patterns. (emscripten-fastcomp #116) - Full list of changes: @@ -4215,7 +4215,7 @@ v1.34.4: 8/4/2015 - Fixed a memory allocation bug in pthreads code (#3636) - Cleaned up some debug assertion messages behind #ifdef ASSERTIONS (#3639) - Fixed umask syscall (#3637) - - Fixed double alignment issue with formatStrind and emscripten_log (#3647) + - Fixed double alignment issue with formatString and emscripten_log (#3647) - Added new EXTRA_EXPORTED_RUNTIME_METHODS build option - Updated emrun to latest version - Full list of changes: @@ -4660,7 +4660,7 @@ v1.29.4: 1/21/2015 - Notice async state in emterpreter trampolines (#3129) - Optimize SDL1 pixel copying to the screen. - Fixed an issue with emterpreter parsing. (#3141) - - Fixed an issue with native optimizer and -s PPRECISE_F32=1. + - Fixed an issue with native optimizer and -s PRECISE_F32=1. - Full list of changes: - Emscripten: https://github.com/emscripten-core/emscripten/compare/1.29.3...1.29.4 - Emscripten-LLVM: https://github.com/emscripten-core/emscripten-fastcomp/compare/1.29.3...1.29.4 @@ -5238,7 +5238,7 @@ v1.21.4: 7/17/2014 to compiled applications (#2343) - Fixed a bug where emrun did not properly capture the exit code when exit runtime via not calling exit(). - - Fixed an error message when symlinkin invalid filenams at runtime. + - Fixed an error message when symlinking invalid filenames at runtime. - Fixed a bug in EGL context creation that parsed the input context creation parameters with wrong terminator. - Improved ffdb.py to be smarter when to attempt port forwarding to connect to @@ -5501,7 +5501,7 @@ v1.16.0: 4/16/2014 v1.15.1: 4/15/2014 ------------------ - Added support for SDL2 touch api. - - Added new user-controllable emdind-related define #define + - Added new user-controllable embind-related define #define EMSCRIPTEN_HAS_UNBOUND_TYPE_NAMES, which allows optimizing embind for minimal size when std::type_info is not needed. - Fixed issues with CMake support where CMAKE_AR and CMAKE_RANLIB were not @@ -5612,7 +5612,7 @@ v1.13.0: 3/3/2014 - Fixed a buffer overflow issue in emscripten_get_callstack (#2171). - Added support for -Os (optimize for size) and -Oz (aggressively optimize for size) arguments to emcc. - - Fixed a typo that broko the call signature of glCompressedTexSubImage2D() + - Fixed a typo that broke the call signature of glCompressedTexSubImage2D() function (#2173). - Added new browser fullscreen resize logic that always retains aspect ratio and adds support for IE11. @@ -6062,7 +6062,7 @@ v1.6.4: 9/30/2013 v1.6.3: 9/26/2013 ------------------ - Emscripten CMake toolchain now generates archive files with .a suffix when - project target type is static library, instead of generatic .bc files + project target type is static library, instead of generating .bc files (#1648). - Adds iconv library from the musl project to implement wide functions in C library (#1670). diff --git a/embuilder.py b/embuilder.py index 005fd5b6f2418..7a9aad78279b9 100755 --- a/embuilder.py +++ b/embuilder.py @@ -204,7 +204,7 @@ def main(): parser.add_argument('--lto', action='store_const', const='full', help='build bitcode object for LTO') parser.add_argument('--lto=thin', dest='lto', action='store_const', const='thin', help='build bitcode object for ThinLTO') parser.add_argument('--pic', action='store_true', - help='build relocatable objects for suitable for dynamic linking') + help='build relocatable objects suitable for dynamic linking') parser.add_argument('-f', '--force', action='store_true', help='force rebuild of target (by removing it first)') parser.add_argument('-v', '--verbose', action='store_true', @@ -277,7 +277,7 @@ def main(): tasks.append(name) else: # There are some ports that we don't want to build as part - # of ALL since the are not well tested or widely used: + # of ALL since they are not well tested or widely used: if 'cocos2d' in targets: targets.remove('cocos2d') diff --git a/emcc.py b/emcc.py index 0b3498e837c0e..3418bd1aabaee 100644 --- a/emcc.py +++ b/emcc.py @@ -94,10 +94,10 @@ class Mode(Enum): class LinkFlag: """Used to represent a linker flag. - The flag value is stored along with a bool that distingingishes input + The flag value is stored along with a bool that distinguishes input files from non-files. - A list of these is return by separate_linker_flags. + A list of these is returned by separate_linker_flags. """ value: str is_file: int @@ -281,7 +281,7 @@ def main(args): if 'EMCC_REPRODUCE' in os.environ: options.reproduce = os.environ['EMCC_REPRODUCE'] - # For internal consistency, ensure we don't attempt or read or write any link time + # For internal consistency, ensure we don't attempt to read or write any link time # settings until we reach the linking phase. settings.limit_settings(COMPILE_TIME_SETTINGS) @@ -353,7 +353,7 @@ def get_next_arg(): return newargs[i + 1] if not arg.startswith('-') or arg == '-': - # os.devnul should always be reported as existing but there is bug in windows + # os.devnull should always be reported as existing but there is bug in windows # python before 3.8: # https://bugs.python.org/issue1311 if not os.path.exists(arg) and arg not in (os.devnull, '-'): @@ -513,13 +513,13 @@ def get_clang_command_asm(): compile_args, linker_args = separate_linker_flags(newargs) # Map of file basenames to how many times we've seen them. We use this to generate - # unique `_NN` suffix for object files in cases when we are compiling multiple soures that + # unique `_NN` suffix for object files in cases when we are compiling multiple sources that # have the same basename. e.g. `foo/utils.c` and `bar/utils.c` on the same command line. seen_names = {} def uniquename(name): if name not in seen_names: - # No suffix needed the firt time we see given name. + # No suffix needed the first time we see given name. seen_names[name] = 1 return name @@ -550,7 +550,7 @@ def compile_source_file(input_file): # but we want the `.dwo` file to be generated in the current working directory, # like it is under clang. We could avoid this hack if we use the clang driver # to generate the temporary files, but that would also involve using the clang - # driver to perform linking which would be big change. + # driver to perform linking which would be a big change. cmd += ['-Xclang', '-split-dwarf-file', '-Xclang', unsuffixed_basename(input_file) + '.dwo'] cmd += ['-Xclang', '-split-dwarf-output', '-Xclang', unsuffixed_basename(input_file) + '.dwo'] shared.check_call(cmd) diff --git a/emconfigure.py b/emconfigure.py index a9e9706ba1bf5..aecdd3baa50cd 100755 --- a/emconfigure.py +++ b/emconfigure.py @@ -40,7 +40,7 @@ def run(): args = sys.argv[1:] if 'cmake' in args: - print('error: use `emcmake` rather then `emconfigure` for cmake projects', file=sys.stderr) + print('error: use `emcmake` rather than `emconfigure` for cmake projects', file=sys.stderr) return 1 env = building.get_building_env() diff --git a/emrun.py b/emrun.py index bcc46ae881124..cba96d8bf456f 100644 --- a/emrun.py +++ b/emrun.py @@ -415,7 +415,7 @@ def kill_browser_process(): # Heuristic that attempts to search for the browser process IDs that emrun spawned. # This depends on the assumption that no other browser process IDs have been spawned -# during the short time perioed between the time that emrun started, and the browser +# during the short time period between the time that emrun started, and the browser # process navigated to the page. # This heuristic is needed because all modern browsers are multiprocess systems - # starting a browser process from command line generally launches just a "stub" spawner @@ -443,7 +443,7 @@ def pid_existed(pid): logv('Was unable to detect the browser process that was spawned by emrun. This may occur if the target page was opened in a tab on a browser process that already existed before emrun started up.') -# Our custom HTTP web server that will server the target page to run via .html. +# Our custom HTTP web server that will serve the target page to run via .html. # This is used so that we can load the page via a http:// URL instead of a # file:// URL, since those wouldn't work too well unless user allowed XHR # without CORS rules. Also, the target page will route its stdout and stderr @@ -477,7 +477,7 @@ def handle_incoming_message(self, seq_num, log, data): if len(self.http_message_queue) > 16: self.print_next_message() - # If it's been too long since we we got a message, prints out the oldest + # If it's been too long since we got a message, prints out the oldest # queued message, ignoring the proper order. This ensures that if any # messages are actually lost, that the message queue will be orderly flushed. def print_timed_out_messages(self): @@ -832,12 +832,12 @@ def find_gpu_model(model): VideoCardString = winreg.QueryValueEx(hVideoReg, '\\Device\\Video' + str(i))[0] # Get Rid of Registry/Machine from the string VideoCardStringSplit = VideoCardString.split('\\') - ClearnVideoCardString = "\\".join(VideoCardStringSplit[3:]) + CleanVideoCardString = "\\".join(VideoCardStringSplit[3:]) # Go up one level for detailed # VideoCardStringRoot = "\\".join(VideoCardStringSplit[3:len(VideoCardStringSplit)-1]) # Get the graphics card information - hVideoCardReg = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, ClearnVideoCardString) + hVideoCardReg = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, CleanVideoCardString) try: VideoCardDescription = winreg.QueryValueEx(hVideoCardReg, 'Device Description')[0] except WindowsError: @@ -1005,7 +1005,7 @@ def win_get_file_properties(fname): props = {'FixedFileInfo': None, 'StringFileInfo': None, 'FileVersion': None} import win32api - # backslash as parm returns dictionary of numeric info corresponding to VS_FIXEDFILEINFO struct + # backslash as param returns dictionary of numeric info corresponding to VS_FIXEDFILEINFO struct fixedInfo = win32api.GetFileVersionInfo(fname, '\\') props['FixedFileInfo'] = fixedInfo props['FileVersion'] = "%d.%d.%d.%d" % (fixedInfo['FileVersionMS'] / 65536, @@ -1017,7 +1017,7 @@ def win_get_file_properties(fname): # pairs that can be used to retrieve string info. We are using only the first pair. lang, codepage = win32api.GetFileVersionInfo(fname, '\\VarFileInfo\\Translation')[0] - # any other must be of the form \StringfileInfo\%04X%04X\parm_name, middle + # any other must be of the form \StringfileInfo\%04X%04X\param_name, middle # two are language/codepage pair returned from above strInfo = {} @@ -1558,7 +1558,7 @@ def parse_args(args): parser.add_argument('--json', action='store_true', help='If specified, --system-info and --browser-info are ' - 'outputted in JSON format.') + 'output in JSON format.') parser.add_argument('--safe-firefox-profile', action='store_true', help='If true, the browser is launched into a new clean ' @@ -1577,7 +1577,7 @@ def parse_args(args): parser.add_argument('cmdlineparams', nargs='*') # Support legacy argument names with `_` in them (but don't - # advertize these in the --help message). + # advertise these in the --help message). for i, a in enumerate(args): if a == '--': break diff --git a/emsize.py b/emsize.py index ce46649f6f3aa..935c237c9d224 100755 --- a/emsize.py +++ b/emsize.py @@ -46,7 +46,7 @@ def parse_args(argv): def print_sizes(js_file): if not os.path.isfile(js_file): - return error('Input JS file %s not foune' % js_file) + return error('Input JS file %s not found' % js_file) if not js_file.endswith('.js'): return error('Input file %s does not have a JS extension' % js_file) diff --git a/site/source/docs/api_reference/Filesystem-API.rst b/site/source/docs/api_reference/Filesystem-API.rst index 99c5e23ffb78a..1c5985e5a67c7 100644 --- a/site/source/docs/api_reference/Filesystem-API.rst +++ b/site/source/docs/api_reference/Filesystem-API.rst @@ -171,7 +171,7 @@ The device node acts as an interface between the device and the file system. Any Setting up standard I/O devices =============================== -Emscripten standard I/O works by going though the virtual ``/dev/stdin``, ``/dev/stdout`` and ``/dev/stderr`` devices. You can set them up using your own I/O functions by calling :js:func:`FS.init`. +Emscripten standard I/O works by going through the virtual ``/dev/stdin``, ``/dev/stdout`` and ``/dev/stderr`` devices. You can set them up using your own I/O functions by calling :js:func:`FS.init`. By default: diff --git a/site/source/docs/api_reference/console.h.rst b/site/source/docs/api_reference/console.h.rst index 109d69ddf6cb6..076f8b16bdfde 100644 --- a/site/source/docs/api_reference/console.h.rst +++ b/site/source/docs/api_reference/console.h.rst @@ -51,6 +51,6 @@ Functions Prints the string using the `dbg()` JS function, which by will write to the console (or stdout). Just like the `dbg()` JS function this symbol is only available in debug builds (i.e. when linking with `-sASSERTIONS` or - equivelently `-O0`). + equivalently `-O0`). :param utf8String: A string encoded as UTF-8. diff --git a/site/source/docs/api_reference/emscripten.h.rst b/site/source/docs/api_reference/emscripten.h.rst index f1cbb1ffed2cf..fdb9567ffcd86 100644 --- a/site/source/docs/api_reference/emscripten.h.rst +++ b/site/source/docs/api_reference/emscripten.h.rst @@ -789,7 +789,7 @@ Functions :param int flags: See dlopen flags. :param void* user_data: User data passed to onsuccess, and onerror callbacks. :param em_dlopen_callback onsuccess: Called if the library was loaded successfully. - :param em_arg_callback_func onerror: Called if there as an error loading the library. + :param em_arg_callback_func onerror: Called if there is an error loading the library. Asynchronous IndexedDB API diff --git a/site/source/docs/api_reference/html5.h.rst b/site/source/docs/api_reference/html5.h.rst index fee237551da37..caef9b5c95a75 100644 --- a/site/source/docs/api_reference/html5.h.rst +++ b/site/source/docs/api_reference/html5.h.rst @@ -338,7 +338,7 @@ Struct A system and implementation dependent numeric code identifying the unmodified value of the pressed key; this is usually the same as ``keyCode``. - .. warning:: This attribute is deprecated, you should use the field ``key`` instead, if available. Note thought that while this field is deprecated, the cross-browser support for ``which`` may be better than for the other fields, so experimentation is recommended. Read issue https://github.com/emscripten-core/emscripten/issues/2817 for more information. + .. warning:: This attribute is deprecated, you should use the field ``key`` instead, if available. Note though that while this field is deprecated, the cross-browser support for ``which`` may be better than for the other fields, so experimentation is recommended. Read issue https://github.com/emscripten-core/emscripten/issues/2817 for more information. Callback functions @@ -458,7 +458,7 @@ Struct .. c:member:: int canvasX int canvasY - These fields give the mouse coordinates mapped to the Emscripten canvas client area (Emscripten-specific extension; coordinates are rounded down the nearest integer). + These fields give the mouse coordinates mapped to the Emscripten canvas client area (Emscripten-specific extension; coordinates are rounded down to the nearest integer). .. c:member:: int padding @@ -515,7 +515,7 @@ Functions Returns the most recently received mouse event state. - Note that for this function call to succeed, :c:func:`emscripten_set_xxx_callback ` must have first been called with one of the mouse event types and a non-zero callback function pointer to enable the Mouse state capture. + Note that for this function call to succeed, :c:func:`emscripten_set_xxx_callback ` must have first been called with one of the mouse event types and a non-zero callback function pointer to enable the mouse state capture. :param EmscriptenMouseEvent* mouseState: The most recently received mouse event state. :returns: :c:data:`EMSCRIPTEN_RESULT_SUCCESS`, or one of the other result values. @@ -561,7 +561,7 @@ Struct double deltaY double deltaZ - Movement of the wheel on each of the axis. Note that these values may be fractional, so you should avoid simply casting them to integer, or it might result + Movement of the wheel on each of the axes. Note that these values may be fractional, so you should avoid simply casting them to integer, or it might result in scroll values of 0. The positive Y scroll direction is when scrolling the page downwards (page CSS pixel +Y direction), which corresponds to scrolling the mouse wheel downwards (away from the screen) on Windows, Linux, and also on macOS when the 'natural scroll' option is disabled. @@ -794,7 +794,7 @@ Struct The `orientation `_ of the device in terms of the transformation from a coordinate frame fixed on the Earth to a coordinate frame fixed in the device. - The image (source: `dev.opera.com `_) and definitions below illustrate the co-ordinate frame: + The image (source: `dev.opera.com `_) and definitions below illustrate the coordinate frame: - :c:type:`~EmscriptenDeviceOrientationEvent.alpha`: the rotation of the device around the Z axis. - :c:type:`~EmscriptenDeviceOrientationEvent.beta`: the rotation of the device around the X axis. @@ -1767,7 +1767,7 @@ Functions .. note:: Gamepad API uses an array of gamepad state objects to return the state of - each device. The devices are identified via the index they are present in in + each device. The devices are identified via the index they are present in this array. Because of that, if one first connects gamepad A, then gamepad B, and then disconnects gamepad A, the gamepad B shall not take the place of gamepad A, so in this scenario, this function will still keep returning two @@ -1803,7 +1803,7 @@ Defines .. c:macro:: EMSCRIPTEN_EVENT_BATTERYCHARGINGCHANGE EMSCRIPTEN_EVENT_BATTERYLEVELCHANGE - Emscripten `batterymanager `_ events. + Emscripten `BatteryManager `_ events. Struct @@ -1811,7 +1811,7 @@ Struct .. c:type:: EmscriptenBatteryEvent - The event structure passed in the `batterymanager `_ events: ``chargingchange`` and ``levelchange``. + The event structure passed in the `BatteryManager `_ events: ``chargingchange`` and ``levelchange``. .. c:member:: double chargingTime @@ -1836,14 +1836,14 @@ Callback functions .. c:type:: em_battery_callback_func - Function pointer for the :c:func:`batterymanager event callback functions `, defined as: + Function pointer for the :c:func:`BatteryManager event callback functions `, defined as: .. code-block:: cpp typedef bool (*em_battery_callback_func)(int eventType, const EmscriptenBatteryEvent *batteryEvent, void *userData); - :param int eventType: The type of ``batterymanager`` event (:c:data:`EMSCRIPTEN_EVENT_BATTERYCHARGINGCHANGE`). - :param batteryEvent: Information about the ``batterymanager`` event that occurred. + :param int eventType: The type of ``BatteryManager`` event (:c:data:`EMSCRIPTEN_EVENT_BATTERYCHARGINGCHANGE`). + :param batteryEvent: Information about the ``BatteryManager`` event that occurred. :type batteryEvent: const EmscriptenBatteryEvent* :param void* userData: The ``userData`` originally passed to the registration function. :returns: |callback-handler-return-value-doc| @@ -1857,7 +1857,7 @@ Functions .. c:function:: EMSCRIPTEN_RESULT emscripten_set_batterychargingchange_callback(void *userData, em_battery_callback_func callback) EMSCRIPTEN_RESULT emscripten_set_batterylevelchange_callback(void *userData, em_battery_callback_func callback) - Registers a callback function for receiving the `batterymanager `_ events: ``chargingchange`` and ``levelchange``. + Registers a callback function for receiving the `BatteryManager `_ events: ``chargingchange`` and ``levelchange``. :param void* userData: |userData-parameter-doc| :param em_battery_callback_func callback: |callback-function-parameter-doc| diff --git a/site/source/docs/api_reference/index.rst b/site/source/docs/api_reference/index.rst index 944c8fe1c0308..983cbaa97e1cc 100644 --- a/site/source/docs/api_reference/index.rst +++ b/site/source/docs/api_reference/index.rst @@ -14,7 +14,7 @@ high level it consists of: Low level glue bindings for interfacing with HTML5 APIs from native code. - :ref:`console-h`: - Functions to writing to the console and stdout/stderr. + Functions for writing to the console and stdout/stderr. - :ref:`preamble-js`: APIs for working with compiled code from JavaScript. diff --git a/site/source/docs/api_reference/preamble.js.rst b/site/source/docs/api_reference/preamble.js.rst index c2bd9829f95f5..5819f72286946 100644 --- a/site/source/docs/api_reference/preamble.js.rst +++ b/site/source/docs/api_reference/preamble.js.rst @@ -81,7 +81,7 @@ Calling compiled C functions from JavaScript Returns a native JavaScript wrapper for a C function. - This is similar to :js:func:`ccall`, but returns a JavaScript function that can be reused as many time as needed. The C function can be defined in a C file, or be a C-compatible C++ function defined using ``extern "C"`` (to prevent name mangling). + This is similar to :js:func:`ccall`, but returns a JavaScript function that can be reused as many times as needed. The C function can be defined in a C file, or be a C-compatible C++ function defined using ``extern "C"`` (to prevent name mangling). .. code-block:: javascript @@ -239,7 +239,7 @@ Conversion functions — strings, pointers and arrays .. js:function:: intArrayFromString(stringy, dontAddNull[, length]) - This converts a JavaScript string into a C-line array of numbers, 0-terminated. + This converts a JavaScript string into a C-like array of numbers, 0-terminated. :param stringy: The string to be converted. :type stringy: String @@ -251,7 +251,7 @@ Conversion functions — strings, pointers and arrays .. js:function:: intArrayToString(array) - This creates a JavaScript string from a zero-terminated C-line array of numbers. + This creates a JavaScript string from a zero-terminated C-like array of numbers. :param array: The array to convert. :returns: A ``String``, containing the content of ``array``. diff --git a/site/source/docs/api_reference/wasm_workers.rst b/site/source/docs/api_reference/wasm_workers.rst index ee94bdd56ed88..2cfcaae186cc6 100644 --- a/site/source/docs/api_reference/wasm_workers.rst +++ b/site/source/docs/api_reference/wasm_workers.rst @@ -117,8 +117,6 @@ If you need to synchronously wait for the posted function to finish from within the ``emscripten_wasm_worker_*()`` thread synchronization functions to sleep the calling thread until the callee has finished the operation. -Note that Wasm Workers cannot - Pthreads have cancellation points ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -371,7 +369,7 @@ Both APIs allow one to spawn Web Workers from the main thread, though the semant With the Worker API, the user will be able to spawn a Web Worker from a custom URL. This URL can point to a completely separate JS file that was not compiled with Emscripten, to load up Workers from arbitrary URLs. With Wasm Workers, a custom URL is not specified: Wasm Workers will always spawn a Web Worker that computes in the same WebAssembly+JavaScript context as the main program. -The Worker API does not integrate with SharedArrayBuffer, so interaction with the loaded Worker will always be asynchronous. Wasm Workers howerer is built on top of SharedArrayBuffer, and each Wasm Worker shares and computes in the same WebAssembly Memory address space of the main thread. +The Worker API does not integrate with SharedArrayBuffer, so interaction with the loaded Worker will always be asynchronous. Wasm Workers however is built on top of SharedArrayBuffer, and each Wasm Worker shares and computes in the same WebAssembly Memory address space of the main thread. Both the Worker API and Wasm Workers API provide the user with ability to postMessage() function calls to the Worker. In Worker API, this message posting is restricted to need to originate/initiate from the main thread towards the Worker (using the API ``emscripten_call_worker()`` and ``emscripten_worker_respond()`` in ````). With Wasm Workers however one can also postMessage() function calls to their parent (owning) thread. diff --git a/site/source/docs/building_from_source/configuring_emscripten_settings.rst b/site/source/docs/building_from_source/configuring_emscripten_settings.rst index df24418b6b0e5..80ebe6fc88930 100644 --- a/site/source/docs/building_from_source/configuring_emscripten_settings.rst +++ b/site/source/docs/building_from_source/configuring_emscripten_settings.rst @@ -45,7 +45,7 @@ Locating the compiler configuration file (.emscripten) ====================================================== The settings file (``.emscripten``) is created by default within the emscripten -directory (alongsize ``emcc`` itself). In cases where the emscripten directory +directory (alongside ``emcc`` itself). In cases where the emscripten directory is read-only the user's home directory will be used: - On Linux and macOS this file is named **~/.emscripten**, where ~ is the diff --git a/site/source/docs/building_from_source/index.rst b/site/source/docs/building_from_source/index.rst index af98f2a9cdfee..118c7d5c10184 100644 --- a/site/source/docs/building_from_source/index.rst +++ b/site/source/docs/building_from_source/index.rst @@ -13,7 +13,7 @@ before it can be used (e.g. ``npm install``). The ``bootstrap`` script in the top level of the repository takes care of running these steps and ``emcc`` will error out if it detects that ``bootstrap`` needs to be run. -Emscripten comes with its own versions some C/C++ system libaries which ``emcc`` +Emscripten comes with its own versions of some C/C++ system libraries which ``emcc`` builds automatically as and when needed (in the emsdk builds, these are precompiled). You can also build them manually with the ``embuilder`` tool - see ``embuilder --help`` for more information. diff --git a/site/source/docs/building_from_source/verify_emscripten_environment.rst b/site/source/docs/building_from_source/verify_emscripten_environment.rst index 208d97a996d07..30bef9734a0bd 100644 --- a/site/source/docs/building_from_source/verify_emscripten_environment.rst +++ b/site/source/docs/building_from_source/verify_emscripten_environment.rst @@ -31,7 +31,7 @@ could not be found: shared:INFO: (Emscripten: Running sanity checks) emcc: warning: LLVM version for clang executable "/usr/bin/clang" appears incorrect (seeing "16.0", expected "18") [-Wversion-check] -At this point you need to :ref:`Install and activate ` any missing components. When everything is set up properly, ``emcc ---check`` should give no warnings, and if you just enter ``emcc`` (without any input files), it will give an error :: +At this point you need to :ref:`Install and activate ` any missing components. When everything is set up properly, ``emcc --check`` should give no warnings, and if you just enter ``emcc`` (without any input files), it will give an error :: emcc: error: no input files diff --git a/site/source/docs/compiling/Building-Projects.rst b/site/source/docs/compiling/Building-Projects.rst index 72fdc611c3ad8..d2432fa55cfdf 100644 --- a/site/source/docs/compiling/Building-Projects.rst +++ b/site/source/docs/compiling/Building-Projects.rst @@ -101,7 +101,7 @@ This list is not exhaustive, but illustrates most commonly used combinations. .. note:: Regardless of the name of the output file ``emcc`` will always perform linking and produce a final executable, unless a specific flags (e.g. ``-c``) - direct it do something else. This differs to previous behaviour where + direct it to do something else. This differs to previous behaviour where ``emcc`` would default to combining object files (essentially assuming ``-r``) unless given a specific executable extension (e.g. ``.js`` or ``.html``). diff --git a/site/source/docs/compiling/Dynamic-Linking.rst b/site/source/docs/compiling/Dynamic-Linking.rst index 2732cfc50b6fc..81487447de38e 100644 --- a/site/source/docs/compiling/Dynamic-Linking.rst +++ b/site/source/docs/compiling/Dynamic-Linking.rst @@ -12,7 +12,7 @@ with little or no changes (see :ref:`Building-Projects`). In addition, Emscripten also has support for a form of **dynamic** linking of WebAssembly modules. This can add overhead, so for best performance static -linking should still be preferred. However, this overhead can can be reduced +linking should still be preferred. However, this overhead can be reduced with the use of certain command line flags. See below for details. Background @@ -127,7 +127,7 @@ the command line when you link the main module. e.g. emcc -sMAIN_MODULE main.c libsomething.wasm -At runtime, the JavaScript loading code will load ``libsomthing.wasm`` (along +At runtime, the JavaScript loading code will load ``libsomething.wasm`` (along with any other side modules) along with the main module before the application starts to run. The running application then can access code from any of the modules linked together. @@ -218,7 +218,7 @@ Limitations Pthreads support ---------------- -Dynamic linking + pthreads is is still experimental. As such, linking with both +Dynamic linking + pthreads is still experimental. As such, linking with both :ref:`MAIN_MODULE` and ``-pthread`` will produce a warning. While load-time dynamic linking works without any complications, runtime dynamic @@ -238,6 +238,6 @@ However, there there is one class of application that currently may require modification. If your applications busy waits, or directly uses the ``atomic.waitXX`` instructions (or the clang ``__builtin_wasm_memory_atomic_waitXX`` builtins) you maybe need to switch it -to use ``emscripten_futex_wait`` or order avoid deadlocks. If you don't use +to use ``emscripten_futex_wait`` in order to avoid deadlocks. If you don't use ``emscripten_futex_wait`` while you block, you could potentially block other threads that are calling ``dlopen`` and/or ``dlsym``. diff --git a/site/source/docs/compiling/Modularized-Output.rst b/site/source/docs/compiling/Modularized-Output.rst index a4a2bc7b5ad8d..2e14c84252130 100644 --- a/site/source/docs/compiling/Modularized-Output.rst +++ b/site/source/docs/compiling/Modularized-Output.rst @@ -35,7 +35,7 @@ separate and isolated instances of the same program. By default, the factory function is called ``Module``, but it can be given a unique name via the ``-sEXPORT_NAME`` setting. -For example, a program is built using ``-sMODULARIZE -sEXPORT_NAME=Foo`` can +For example, a program built using ``-sMODULARIZE -sEXPORT_NAME=Foo`` can be instantiated using: :: @@ -113,11 +113,11 @@ Limitations ----------- Some major features still do not work in this mode. Many of these we hope to -fix in future releses. Current limitations include: +fix in future releases. Current limitations include: -* Internal usage (e.g. usage within EM_JS / JS libary code) of the ``Module`` +* Internal usage (e.g. usage within EM_JS / JS library code) of the ``Module`` global does not work. This is because symbols are exported directly using - ES6 module syntax rathar than using the ``Module`` global. + ES6 module syntax rather than using the ``Module`` global. * The ``wasmExports`` internal global does not exist. @@ -133,7 +133,7 @@ Source Phase Imports (experimental) =================================== `Source phase imports`_ is a JavaScript proposal that adds support for importing -Wasm modules via ES import statements. This allows emscripten to elide some of +Wasm modules via ES import statements. This allows Emscripten to elide some of the auto-generated code for finding and fetching the Wasm binary. See :ref:`source_phase_imports`. @@ -146,7 +146,7 @@ ES Module Integration (experimental) ==================================== `Wasm ESM integration`_ is a WebAssembly proposal that allows Wasm instances to -be imported directly as ES modules. This allows emscripten to elide a lot of +be imported directly as ES modules. This allows Emscripten to elide a lot of boilerplate code for linking up Wasm and JavaScript. See :ref:`wasm_esm_integration`. @@ -156,7 +156,7 @@ Limitations This setting implicitly enables :ref:`export_es6` and sets :ref:`MODULARIZE` to ``instance``. Because of this all the same limitations mentioned above for -``-sMODULARIZE=intance`` apply. +``-sMODULARIZE=instance`` apply. Some additional limitations are: diff --git a/site/source/docs/compiling/Running-html-files-with-emrun.rst b/site/source/docs/compiling/Running-html-files-with-emrun.rst index 7324d3a000a26..8fa5aa56813a4 100644 --- a/site/source/docs/compiling/Running-html-files-with-emrun.rst +++ b/site/source/docs/compiling/Running-html-files-with-emrun.rst @@ -110,7 +110,7 @@ The following command line flags affect logging output: - ``--verbose``: Print detailed information about *emrun* internal steps. - ``--log_stdout ``: Write all ``stdout`` messages from the application to the named file (instead of printing to terminal). -- ``--lot_stderr ``: Write all ``stderr`` messages from the application to the named file (instead of printing to terminal). +- ``--log_stderr ``: Write all ``stderr`` messages from the application to the named file (instead of printing to terminal). - ``--system_info``: Print detailed information about the current system before launching. This is useful during automated runs when you want to capture hardware information to logs. - ``--browser_info``: Print information about which browser is about to be launched. - ``--no_emrun_detect``: Hide the warning message that is launched if a target **.html** file is detected to not have been built with ``--emrun``. diff --git a/site/source/docs/compiling/WebAssembly.rst b/site/source/docs/compiling/WebAssembly.rst index 8e6b3953be8a3..c7b939edbb2af 100644 --- a/site/source/docs/compiling/WebAssembly.rst +++ b/site/source/docs/compiling/WebAssembly.rst @@ -97,7 +97,7 @@ WebAssembly feature extensions ============================== Since its original launch, WebAssembly has been expanded with various feature -extensions, which have been implmented in browsers. A list of features +extensions, which have been implemented in browsers. A list of features (including already-shipped and in-progress) and details about browser versions that support them can be found on `webassembly.org `_. diff --git a/site/source/docs/contributing/developers_guide.rst b/site/source/docs/contributing/developers_guide.rst index 7fe05e8c6744f..0f00b0bf54a8d 100644 --- a/site/source/docs/contributing/developers_guide.rst +++ b/site/source/docs/contributing/developers_guide.rst @@ -26,7 +26,7 @@ get using the emsdk: emsdk install tot emsdk activate tot -This with install the latest "tip-of-tree" binaries needed to run Emscripten. +This will install the latest "tip-of-tree" binaries needed to run Emscripten. You can use these emsdk-provided binaries with a git checkout of the Emscripten repository. To do this, you can either edit your local ``.emscripten`` config file, or set ``EM_CONFIG=/path/to/emsdk/.emscripten`` in your environment. diff --git a/site/source/docs/getting_started/Tutorial.rst b/site/source/docs/getting_started/Tutorial.rst index 256bab304cbdf..8ac56e1418e07 100644 --- a/site/source/docs/getting_started/Tutorial.rst +++ b/site/source/docs/getting_started/Tutorial.rst @@ -13,7 +13,7 @@ First things first ====================== Make sure you have :ref:`downloaded and installed ` -Emscripten (the exact approach for doing this will depend your operating system: +Emscripten (the exact approach for doing this will depend on your operating system: Linux, Windows, or Mac). Emscripten is accessed using the :ref:`emccdoc`. This script invokes all the diff --git a/site/source/docs/getting_started/downloads.rst b/site/source/docs/getting_started/downloads.rst index 3ef3796a2e2aa..845e2bf74495c 100644 --- a/site/source/docs/getting_started/downloads.rst +++ b/site/source/docs/getting_started/downloads.rst @@ -60,7 +60,7 @@ GitHub and set them as :term:`active `: .. note:: ``git pull`` will fetch the current list of tags, but very recent ones may not yet be present there. You can run ``./emsdk update-tags`` to update the list of tags directly. -If you change the location of the SDK (e.g. take it to another computer on an +If you change the location of the SDK (e.g. take it to another computer on a USB), re-run the ``./emsdk activate latest`` and ``source ./emsdk_env.sh`` commands. @@ -92,7 +92,7 @@ using a more careful procedure). Tip-of-tree builds may be useful for continuous integration that uses the emsdk (as Emscripten's GitHub CI does), and you may want to use it in your own CI as well, so that if you find a regression on your project you can report it and prevent it from reaching a tagged release. -Tip-of-builds may also be useful if you want to test a feature that just landed +Tip-of-tree builds may also be useful if you want to test a feature that just landed but didn't reach a release yet. To use a tip-of-tree build, use the ``tot`` target, and note that you must specify the backend explicitly, diff --git a/site/source/docs/introducing_emscripten/community.rst b/site/source/docs/introducing_emscripten/community.rst index 791520be2b3e9..f6eed6967722c 100644 --- a/site/source/docs/introducing_emscripten/community.rst +++ b/site/source/docs/introducing_emscripten/community.rst @@ -12,7 +12,7 @@ Welcome to the Emscripten community! Get in touch ============ -The best ways contact the community are: +The best ways to contact the community are: - The GitHub `Issue Tracker `_ - Mailing list: `emscripten-discuss `_ diff --git a/site/source/docs/introducing_emscripten/emscripten_license.rst b/site/source/docs/introducing_emscripten/emscripten_license.rst index 6971453752c03..9af8232340e0d 100644 --- a/site/source/docs/introducing_emscripten/emscripten_license.rst +++ b/site/source/docs/introducing_emscripten/emscripten_license.rst @@ -11,7 +11,7 @@ There is little, if any, practical difference between the licenses. They are bot - *MIT license* is well known and understood. - *University of Illinois/NCSA Open Source License* allows Emscripten's code to be integrated upstream into LLVM, should the opportunity arise. -The license for Emscripten |release| is reproduced below. The `current full licence `_ can be found on GitHub (and is also present in the root of the SDK). +The license for Emscripten |release| is reproduced below. The `current full license `_ can be found on GitHub (and is also present in the root of the SDK). .. include:: ../../../../LICENSE :literal: diff --git a/site/source/docs/optimizing/Optimizing-Code.rst b/site/source/docs/optimizing/Optimizing-Code.rst index 987b876390a49..cc6a8f63bd916 100644 --- a/site/source/docs/optimizing/Optimizing-Code.rst +++ b/site/source/docs/optimizing/Optimizing-Code.rst @@ -124,7 +124,7 @@ Link Time Optimization (LTO) lets the compiler do more optimizations, as it can inline across separate compilation units, and even with system libraries. LTO is enabled by compiling objects files with ``-flto``. The effect of this flag is to emit LTO object files (technically this means emitting bitcode). The -linker can handle a mix Wasm object files and LTO object files. Passing +linker can handle a mix of Wasm object files and LTO object files. Passing ``-flto`` at link time will also trigger LTO system libraries to be used. Thus, to allow maximal LTO opportunities with the LLVM Wasm backend, build all diff --git a/site/source/docs/porting/Debugging.rst b/site/source/docs/porting/Debugging.rst index 8573de6f3af75..2d47526b61b21 100644 --- a/site/source/docs/porting/Debugging.rst +++ b/site/source/docs/porting/Debugging.rst @@ -86,7 +86,7 @@ function names, and variable names, which makes the JavaScript debuggable). The ``-g`` flag can also be specified with integer levels: :ref:`-g0 `, :ref:`-g1 `, :ref:`-g2 `, and :ref:`-g3 ` (equivalent to ``-g``). At compile time these flags control the amount of DWARF in the -object files. At link time, each adds sucessively more kinds of information in +object files. At link time, each adds successively more kinds of information in the wasm and JS files (DWARF is only retained after linking when using ``-g`` or ``-g3``). @@ -140,7 +140,7 @@ is also passed at link time. DWARF can also be used for this purpose. Typically a binary containing DWARF would be generated at build time, and then stripped. The stripped copy would be served to users, and the original would be saved for symbolication purposes. For -this use case, full information about about types and variables from the sources +this use case, full information about types and variables from the sources isn't needed; the `-gline-tables-only `_ compile-time flag causes clang to generate only the line table information, diff --git a/site/source/docs/porting/asyncify.rst b/site/source/docs/porting/asyncify.rst index 0891e5e7041d6..3ab48444d526f 100644 --- a/site/source/docs/porting/asyncify.rst +++ b/site/source/docs/porting/asyncify.rst @@ -480,7 +480,7 @@ later callback, when nothing else is on the stack. Migrating from older Asyncify APIs ################################## -If you have code uses the old Emterpreter-Async API, or the old Asyncify, then +If you have code that uses the old Emterpreter-Async API, or the old Asyncify, then almost everything should just work when you replace ``-sEMTERPRETIFY`` usage with ``-sASYNCIFY``. In particular all the things like ``emscripten_wget`` should just work as they did before. diff --git a/site/source/docs/porting/connecting_cpp_and_javascript/Interacting-with-code.rst b/site/source/docs/porting/connecting_cpp_and_javascript/Interacting-with-code.rst index 7676b1ab28528..9a0fa631c0e0b 100644 --- a/site/source/docs/porting/connecting_cpp_and_javascript/Interacting-with-code.rst +++ b/site/source/docs/porting/connecting_cpp_and_javascript/Interacting-with-code.rst @@ -436,7 +436,7 @@ that you can't use a closure directly, for example, as ``toString`` isn't compatible with that - just like when using a string to create a Web Worker, where you also can't pass a closure. (Note that this limitation is just for the values for the keys of the object -passes to ``addToLibrary`` in the JS library, that is, the toplevel +passed to ``addToLibrary`` in the JS library, that is, the toplevel key-value pairs are special. Interior code inside a function can have arbitrary JS, of course). @@ -667,7 +667,7 @@ a 53 bit (double) and returns an integer error code: Using ``-sWASM_BIGINT`` when linking is an alternative method of handling 64-bit types in libraries. ```Number()``` may be needed on the JavaScript -side to convert it to a useable value. See `settings reference `_. +side to convert it to a usable value. See `settings reference `_. .. _interacting-with-code-access-memory: diff --git a/site/source/docs/porting/connecting_cpp_and_javascript/embind.rst b/site/source/docs/porting/connecting_cpp_and_javascript/embind.rst index b697a996bda38..8fe77a59405a6 100644 --- a/site/source/docs/porting/connecting_cpp_and_javascript/embind.rst +++ b/site/source/docs/porting/connecting_cpp_and_javascript/embind.rst @@ -379,7 +379,7 @@ JavaScript and C++ have very different memory models which can lead to it being unclear which language owns and is responsible for deleting an object when it moves between languages. To make object ownership more explicit, *embind* supports smart pointers and return value policies. Return value -polices dictate what happens to a C++ object when it is returned to JavaScript. +policies dictate what happens to a C++ object when it is returned to JavaScript. To use a return value policy, pass the desired policy into function, method, or property bindings. For example: diff --git a/site/source/docs/porting/guidelines/function_pointer_issues.rst b/site/source/docs/porting/guidelines/function_pointer_issues.rst index 8853679e0cd6d..b3e0182f38d4c 100644 --- a/site/source/docs/porting/guidelines/function_pointer_issues.rst +++ b/site/source/docs/porting/guidelines/function_pointer_issues.rst @@ -45,7 +45,7 @@ There are three solutions to this problem (the second is preferred): - Cast the function pointer back to the correct type before it is called. This is problematic because it requires that the caller knows the original type. - Manually write an adapter function that does not need to be cast, and calls the original function. For example, it might ignore a parameter, and in that way bridge between the different function pointer types. - - Use ``EMULATE_FUNCTION_POINTER_CASTS``. When you build with ``-sEMULATE_FUNCTION_POINTER_CASTS``, Emscripten emits code to emulate function pointer casts at runtime, adding extra arguments/dropping them/changing their type/adding or dropping a return type/etc. This can add significant runtime overhead, so it is not recommended, but is be worth trying. + - Use ``EMULATE_FUNCTION_POINTER_CASTS``. When you build with ``-sEMULATE_FUNCTION_POINTER_CASTS``, Emscripten emits code to emulate function pointer casts at runtime, adding extra arguments/dropping them/changing their type/adding or dropping a return type/etc. This can add significant runtime overhead, so it is not recommended, but is worth trying. For a real-world example, consider the code below: diff --git a/site/source/docs/porting/multimedia_and_graphics/EGL-Support-in-Emscripten.rst b/site/source/docs/porting/multimedia_and_graphics/EGL-Support-in-Emscripten.rst index 043d11dd2aa86..fd52a94dd9bd0 100644 --- a/site/source/docs/porting/multimedia_and_graphics/EGL-Support-in-Emscripten.rst +++ b/site/source/docs/porting/multimedia_and_graphics/EGL-Support-in-Emscripten.rst @@ -118,4 +118,4 @@ Currently, Emscripten does not implement any extensions in the `EGL Extension Re EGL-related bugs and todos --------------------------- -The `Emscripten issue tracker `_ lists EGL-relates issues using the label EGL. Check that page to report or find issues in Emscripten related to EGL. +The `Emscripten issue tracker `_ lists EGL-related issues using the label EGL. Check that page to report or find issues in Emscripten related to EGL. diff --git a/site/source/docs/porting/simd.rst b/site/source/docs/porting/simd.rst index bb8dfed807ae5..48c574c010ce1 100644 --- a/site/source/docs/porting/simd.rst +++ b/site/source/docs/porting/simd.rst @@ -1534,7 +1534,7 @@ status `` [link] - In cases where emscripten performs import/export minificiton this option can + In cases where emscripten performs import/export minification this option can be used to output a file that maps minified names back to their original names. The format of this file is single line per import/export of the form ``:``. diff --git a/site/source/docs/tools_reference/emsdk.rst b/site/source/docs/tools_reference/emsdk.rst index 3e077332d26c9..eaa4f51cea63b 100644 --- a/site/source/docs/tools_reference/emsdk.rst +++ b/site/source/docs/tools_reference/emsdk.rst @@ -229,7 +229,7 @@ particular tool: :: On Windows, calling ``activate`` automatically sets up the required paths and environment variables. -.. note:: If you add ``./emsdk_env.sh`` to you default shell config emsdk tools (including the emsdk version of node) will be added to your PATH and this could effect the default version of node used on your system. +.. note:: If you add ``./emsdk_env.sh`` to you default shell config emsdk tools (including the emsdk version of node) will be added to your PATH and this could affect the default version of node used on your system. .. _emsdk-install-old-tools: @@ -287,7 +287,7 @@ It is also possible to use your own fork of the Emscripten repository via the SDK. This is useful in the case when you want to make your own modifications to the Emscripten toolchain, but still keep using the SDK environment and tools. -To to this all you need to do is set the ``EM_CONFIG`` environment variable to +To do this all you need to do is set the ``EM_CONFIG`` environment variable to point to the emsdk emscripten config and then put your own checkout of emscripten first in the ``PATH``: diff --git a/site/source/docs/tools_reference/settings_reference.rst b/site/source/docs/tools_reference/settings_reference.rst index f499f319a6596..c7a2bc4c9ad22 100644 --- a/site/source/docs/tools_reference/settings_reference.rst +++ b/site/source/docs/tools_reference/settings_reference.rst @@ -36,7 +36,7 @@ Chooses what kind of stack smash checks to emit to generated code: Building with ASSERTIONS=1 causes STACK_OVERFLOW_CHECK default to 1. Since ASSERTIONS=1 is the default at -O0, which itself is the default optimization level this means that this setting also effectively -defaults 1, absent any other settings: +defaults to 1, absent any other settings: - 0: Stack overflows are not checked. - 1: Adds a security cookie at the top of the stack, which is checked at end @@ -134,7 +134,7 @@ What malloc()/free() to use, out of: - emmalloc-verbose - use emmalloc with assertions + verbose logging. - emmalloc-memvalidate-verbose - use emmalloc with assertions + heap consistency checking + verbose logging. - - mimalloc - a powerful mulithreaded allocator. This is recommended in + - mimalloc - a powerful multithreaded allocator. This is recommended in large applications that have malloc() contention, but it is larger and uses more memory. - none - no malloc() implementation is provided, but you must implement @@ -189,7 +189,7 @@ The initial amount of heap memory available to the program. This is the memory region available for dynamic allocations via `sbrk`, `malloc` and `new`. Unlike INITIAL_MEMORY, this setting allows the static and dynamic regions of -your programs memory to independently grow. In most cases we recommend using +your program's memory to independently grow. In most cases we recommend using this setting rather than `INITIAL_MEMORY`. However, this setting does not work for imported memories (e.g. when dynamic linking is used). @@ -322,7 +322,7 @@ Default value: 0 INITIAL_TABLE ============= -Sets the initial size of the table when MAIN_MODULE or SIDE_MODULE is use +Sets the initial size of the table when MAIN_MODULE or SIDE_MODULE is used (and not otherwise). Normally Emscripten can determine the size of the table at link time, but in SPLIT_MODULE mode, wasm-split often needs to grow the table, so the table size baked into the JS for the instrumented build will be @@ -432,7 +432,7 @@ Default value: false SUPPORT_BIG_ENDIAN ================== -If set to 1, perform acorn pass that converts each HEAP access into a +If set to 1, perform an acorn pass that converts each HEAP access into a function call that uses DataView to enforce LE byte order for HEAP buffer; This makes generated JavaScript run on BE as well as LE machines. (If 0, only LE systems are supported). Does not affect generated wasm. @@ -478,8 +478,8 @@ best it can. We use 64 bits (i64) to represent values, as if we wrote the sent value to memory and loaded the received type from the same memory (using truncs/extends/ reinterprets). This means that when types do not match the emulated values may not match (this is true of native too, for that matter - -this is all undefined behavior). This approaches appears good enough to -support Python (the original motiviation for this feature) and Glib (the +this is all undefined behavior). This approach appears good enough to +support Python (the original motivation for this feature) and Glib (the continued motivation). Default value: false @@ -552,10 +552,10 @@ SOCKET_WEBRTC As well as being configurable at compile time via the "-s" option the WEBSOCKET_URL and WEBSOCKET_SUBPROTOCOL -settings may configured at run time via the Module object e.g. +settings may be configured at run time via the Module object e.g. Module['websocket'] = {subprotocol: 'base64, binary, text'}; Module['websocket'] = {url: 'wss://', subprotocol: 'base64'}; -You can set 'subprotocol' to null, if you don't want to specify it +You can set 'subprotocol' to null, if you don't want to specify it. Run time configuration may be useful as it lets an application select multiple different services. @@ -566,7 +566,7 @@ Default value: false WEBSOCKET_URL ============= -A string containing either a WebSocket URL prefix (ws:// or wss://) or a' +A string containing either a WebSocket URL prefix (ws:// or wss://) or a complete RFC 6455 URL - "ws[s]:" "//" host [ ":" port ] path [ "?" query ]. In the (default) case of only a prefix being specified the URL will be constructed from prefix + addr + ':' + port @@ -701,7 +701,7 @@ Default value: true GL_EXTENSIONS_IN_PREFIXED_FORMAT ================================ -If true, all GL extensions are advertised in both unprefixed WebGL extension +If true, all GL extensions are advertised in unprefixed WebGL extension format, but also in desktop/mobile GLES/GL extension format with ``GL_`` prefix. @@ -838,7 +838,7 @@ If true, emulates some WebGL 1 features on WebGL 2 contexts, meaning that applications that use WebGL 1/GLES 2 can initialize a WebGL 2/GLES3 context, but still keep using WebGL1/GLES 2 functionality that no longer is supported in WebGL2/GLES3. Currently this emulates GL_EXT_shader_texture_lod extension -in GLSLES 1.00 shaders, support for unsized internal texture formats, and the +in GLSL ES 1.00 shaders, support for unsized internal texture formats, and the GL_HALF_FLOAT_OES != GL_HALF_FLOAT mixup. Default value: false @@ -985,9 +985,9 @@ ENVIRONMENT =========== Specify which runtime environments the JS output will be capable of running -in. For maximum portability this can configured to support all environments -or it can be limited to reduce overall code size. The supported environments -are: +in. For maximum portability this can be configured to support all +environments or it can be limited to reduce overall code size. The supported +environments are: - 'web' - the normal web environment. - 'webview' - just like web, but in a webview like Cordova; considered to be @@ -1189,12 +1189,12 @@ Default value: false NODEJS_CATCH_REJECTION ====================== -Catch unhandled rejections in node. This only effect versions of node older +Catch unhandled rejections in node. This only affects versions of node older than 15. Without this, old version node will print a warning, but exit with a zero return code. With this setting enabled, we handle any unhandled -rejection and throw an exception, which will cause the process exit +rejection and throw an exception, which will cause the process to exit immediately with a non-0 return code. -This not needed in Node 15+ so this setting will default to false if +This is not needed in Node 15+ so this setting will default to false if MIN_NODE_VERSION is 150000 or above. Default value: true @@ -1379,7 +1379,7 @@ JSPI Use VM support for the JavaScript Promise Integration proposal. This allows async operations to happen without the overhead of modifying the wasm. This -is experimental atm while spec discussion is ongoing, see +is experimental at the moment while spec discussion is ongoing, see https://github.com/WebAssembly/js-promise-integration/ TODO: document which of the following flags are still relevant in this mode (e.g. IGNORE_INDIRECT etc. are not needed) @@ -1443,8 +1443,8 @@ you have this:: preRun: [() => console.log('pre run')] }; -Then MODULE_JS_API must contain 'print' and 'preRun'; if it does not then -we may not emit code to read and use that value. In other words, this +Then INCOMING_MODULE_JS_API must contain 'print' and 'preRun'; if it does not +then we may not emit code to read and use that value. In other words, this option lets you set, statically at compile time, the list of which Module JS values you will be providing at runtime, so the compiler can better optimize. @@ -1462,7 +1462,7 @@ Default value: (multi-line value, see settings.js) CASE_INSENSITIVE_FS =================== -If set to nonzero, the provided virtual filesystem if treated +If set to nonzero, the provided virtual filesystem is treated case-insensitive, like Windows and macOS do. If set to 0, the VFS is case-sensitive, like on Linux. @@ -1804,7 +1804,7 @@ implement everything, when you know what is not going to actually be called (and don't want to mess with the existing buildsystem), and functions might be implemented later on, say in --pre-js, so you may want to build with -s WARN_ON_UNDEFINED_SYMBOLS=0 to disable the warnings if they annoy you. See -also ERROR_ON_UNDEFINED_SYMBOLS. Any undefined symbols that are listed in- +also ERROR_ON_UNDEFINED_SYMBOLS. Any undefined symbols that are listed in EXPORTED_FUNCTIONS will also be reported. Default value: true @@ -2098,7 +2098,7 @@ Default value: false BINARYEN_EXTRA_PASSES ===================== -A comma-separated list of extra passes to run in the binaryen optimizer, +A comma-separated list of extra passes to run in the binaryen optimizer. Setting this does not override/replace the default passes. It is appended at the end of the list of passes. @@ -2922,7 +2922,7 @@ MIN_FIREFOX_VERSION Specifies the oldest major version of Firefox to target. I.e. all Firefox versions >= MIN_FIREFOX_VERSION are desired to work. Pass -sMIN_FIREFOX_VERSION=majorVersion to drop support -for Firefox versions older than < majorVersion. +for Firefox versions older than majorVersion. Firefox 79 was released on 2020-07-28. MAX_INT (0x7FFFFFFF, or -1) specifies that target is not supported. Minimum supported value is 68 which was released on 2019-07-09 (see @@ -2974,7 +2974,7 @@ MIN_NODE_VERSION ================ Specifies minimum node version to target for the generated code. This is -distinct from the minimum version required run the emscripten compiler. +distinct from the minimum version required to run the emscripten compiler. Version is encoded in MMmmVV, e.g. 181401 denotes Node 18.14.01. Minimum supported value is 122209, which was released 2022-01-11 (see feature_matrix.py). This version aligns with the Ubuntu TLS 22.04 (Jammy). @@ -3084,11 +3084,11 @@ HTML5_SUPPORT_DEFERRING_USER_SENSITIVE_REQUESTS Certain browser DOM API operations, such as requesting fullscreen mode transition or pointer lock require that the request originates from within -an user initiated event, such as mouse click or keyboard press. Refactoring +a user initiated event, such as mouse click or keyboard press. Refactoring an application to follow this kind of program structure can be difficult, so HTML5_SUPPORT_DEFERRING_USER_SENSITIVE_REQUESTS allows transparent emulation of this by deferring such requests until a suitable event callback is -generated. Set this to 0 to disable support for deferring to on save code +generated. Set this to 0 to disable support for deferring to save code size if your application does not need support for deferred calls. Default value: true @@ -3138,9 +3138,9 @@ Default value: [] DEFAULT_TO_CXX ============== -Default to c++ mode even when run as ``emcc`` rather then ``emc++``. -When this is disabled ``em++`` is required linking C++ programs. Disabling -this will match the behaviour of gcc/g++ and clang/clang++. +Default to c++ mode even when run as ``emcc`` rather than ``emc++``. +When this is disabled ``em++`` is required when linking C++ programs. +Disabling this will match the behaviour of gcc/g++ and clang/clang++. Default value: true @@ -3193,7 +3193,7 @@ Default value: false ABORT_ON_WASM_EXCEPTIONS ======================== -Abort on unhandled excptions that occur when calling exported WebAssembly +Abort on unhandled exceptions that occur when calling exported WebAssembly functions. This makes the program behave more like a native program where the OS would terminate the process and no further code can be executed when an unhandled exception (e.g. out-of-bounds memory access) happens. @@ -3206,7 +3206,7 @@ overhead for the extra instrumented function indirection. Enable this if you want Emscripten to handle unhandled exceptions nicely at the cost of a few bytes extra. Exceptions that occur within the ``main`` function are already handled via an -alternative mechanimsm. +alternative mechanism. Default value: false @@ -3249,13 +3249,13 @@ Default value: false SPLIT_MODULE ============ -Generate code to loading split wasm modules. +Generate code to load split wasm modules. This option will automatically generate two wasm files as output, one with the ``.orig`` suffix and one without. The default file (without -the suffix) when run will generate instrumentation data can later be +the suffix) when run will generate instrumentation data that can later be fed into wasm-split (the binaryen tool). -As well as this the generated JS code will contains helper functions -to loading split modules. +As well as this the generated JS code will contain helper functions +to load split modules. .. note:: This is an experimental setting @@ -3444,7 +3444,7 @@ FAKE_DYLIBS This setting changes the behaviour of the ``-shared`` flag. The default setting of ``true`` means the ``-shared`` flag actually produces a normal object file (i.e. ``ld -r``). Setting this to false will cause ``-shared`` -to behave like :ref:`SIDE_MODULE` and produce and dynamically linked +to behave like :ref:`SIDE_MODULE` and produce a dynamically linked library. Default value: true @@ -3456,8 +3456,8 @@ Deprecated Settings =================== The following settings have been proposed for removal from emscripten. These settings -still function but may be removed in a future version. If your project is using of -the these settings please open a bug (or reply to one of the existing bugs). +still function but may be removed in a future version. If your project is using one of +these settings please open a bug (or reply to one of the existing bugs). - ``RUNTIME_LINKED_LIBS``: you can simply list the libraries directly on the commandline now - ``CLOSURE_WARNINGS``: use -Wclosure/-Wno-closure instead @@ -3473,7 +3473,7 @@ Legacy Settings =============== The following settings no longer have any effect but are still accepted by emscripten -for backwards compatbility with older versions: +for backwards compatibility with older versions: - ``BINARYEN``: Valid values: WASM - ``TOTAL_STACK``: Valid values: STACK_SIZE diff --git a/src/audio_worklet.js b/src/audio_worklet.js index 26dfa5d3ad823..8114b2e8a4fae 100644 --- a/src/audio_worklet.js +++ b/src/audio_worklet.js @@ -46,7 +46,7 @@ function createWasmAudioWorkletProcessor() { // Prepare the output views; see createOutputViews(). The 'STACK_ALIGN' // deduction stops the STACK_OVERFLOW_CHECK failing (since the stack will // be full if we allocate all the available space) leaving room for a - // single AudioSampleFrame as a minumum. There's an arbitrary maximum of + // single AudioSampleFrame as a minimum. There's an arbitrary maximum of // 64 frames, for the case where a multi-MB stack is passed. this.outputViews = new Array(Math.min(((wwParams.stackSize - {{{ STACK_ALIGN }}}) / this.bytesPerChannel) | 0, /*sensible limit*/ 64)); #if ASSERTIONS @@ -210,7 +210,7 @@ function createWasmAudioWorkletProcessor() { #if ASSERTIONS // If all the maths worked out, we arrived at the original stack address - console.assert(dataPtr == oldStackPtr, `AudioWorklet stack missmatch (audio data finishes at ${dataPtr} instead of ${oldStackPtr})`); + console.assert(dataPtr == oldStackPtr, `AudioWorklet stack mismatch (audio data finishes at ${dataPtr} instead of ${oldStackPtr})`); // Sanity checks. If these trip the most likely cause, beyond unforeseen // stack shenanigans, is that the 'render quantum size' changed after diff --git a/src/closure-externs/closure-externs.js b/src/closure-externs/closure-externs.js index dbb17a89417aa..774f46f847460 100644 --- a/src/closure-externs/closure-externs.js +++ b/src/closure-externs/closure-externs.js @@ -244,7 +244,7 @@ var moduleRtn; /** * This was removed from upstream closure compiler in * https://github.com/google/closure-compiler/commit/f83322c1b. - * Perhaps we should remove it do? + * Perhaps we should remove it too? * * @param {MediaStreamConstraints} constraints A MediaStreamConstraints object. * @param {function(!MediaStream)} successCallback diff --git a/src/emrun_postjs.js b/src/emrun_postjs.js index 97e1ad116be9e..b2ede002e796f 100644 --- a/src/emrun_postjs.js +++ b/src/emrun_postjs.js @@ -3,7 +3,7 @@ * Copyright 2013 The Emscripten Authors * SPDX-License-Identifier: MIT * - * This file gets implicatly injected as a `--post-js` file when + * This file gets implicitly injected as a `--post-js` file when * emcc is run with `--emrun` */ diff --git a/src/emrun_prejs.js b/src/emrun_prejs.js index 1637ff420b499..c23e589562580 100644 --- a/src/emrun_prejs.js +++ b/src/emrun_prejs.js @@ -3,7 +3,7 @@ * Copyright 2013 The Emscripten Authors * SPDX-License-Identifier: MIT * - * This file gets implicatly injected as a `--pre-js` file when + * This file gets implicitly injected as a `--pre-js` file when * emcc is run with `--emrun` */ diff --git a/src/lib/libaddfunction.js b/src/lib/libaddfunction.js index 4f2cde4089bb9..ea6efd267d3f0 100644 --- a/src/lib/libaddfunction.js +++ b/src/lib/libaddfunction.js @@ -227,7 +227,7 @@ addToLibrary({ #else // Set the new value. try { - // Attempting to call this with JS function will cause of table.set() to fail + // Attempting to call this with JS function will cause table.set() to fail setWasmTableEntry(ret, func); } catch (err) { if (!(err instanceof TypeError)) { diff --git a/src/lib/libasync.js b/src/lib/libasync.js index 965e8ce8809ec..096386a14daad 100644 --- a/src/lib/libasync.js +++ b/src/lib/libasync.js @@ -320,7 +320,7 @@ addToLibrary({ {{{ runtimeKeepalivePop(); }}} #if MEMORY64 // When re-winding, the arguments to a function are ignored. For i32 arguments we - // can just call the function with no args at all since and the engine will produce zeros + // can just call the function with no args at all since the engine will produce zeros // for all arguments. However, for i64 arguments we get `undefined cannot be converted to // BigInt`. return func(...Asyncify.restoreRewindArguments(original)); @@ -392,7 +392,7 @@ addToLibrary({ // `Asyncify.handleSleepReturnValue`. // `Asyncify.handleSleepReturnValue` contains the return // value of the last C function to have executed - // `Asyncify.handleSleep()`, where as `asyncWasmReturnValue` + // `Asyncify.handleSleep()`, whereas `asyncWasmReturnValue` // contains the return value of the exported WASM function // that may have called C functions that // call `Asyncify.handleSleep()`. diff --git a/src/lib/libatomic.js b/src/lib/libatomic.js index f83f8c635c1ae..595d9cf2ae795 100644 --- a/src/lib/libatomic.js +++ b/src/lib/libatomic.js @@ -85,7 +85,7 @@ addToLibrary({ // Increment waitAsync generation counter, account for wraparound in case // application does huge amounts of waitAsyncs per second (not sure if // possible?) - // Valid counterrange: 0...2^31-1 + // Valid counter range: 0...2^31-1 let counter = liveAtomicWaitAsyncCounter; liveAtomicWaitAsyncCounter = Math.max(0, (liveAtomicWaitAsyncCounter+1)|0); liveAtomicWaitAsyncs[counter] = addr; diff --git a/src/lib/libautodebug.js b/src/lib/libautodebug.js index dafdb6a9056c5..461201c02d184 100644 --- a/src/lib/libautodebug.js +++ b/src/lib/libautodebug.js @@ -64,7 +64,7 @@ addToLibrary({ return value; }, $set_funcref: (loc, index, value) => { - dbg('set_afuncef ' + [loc, index, value]); + dbg('set_funcref ' + [loc, index, value]); return value; }, $set_externref: (loc, index, value) => { diff --git a/src/lib/libccall.js b/src/lib/libccall.js index 6bd6ce8a85e4c..9803fbe26808f 100644 --- a/src/lib/libccall.js +++ b/src/lib/libccall.js @@ -105,7 +105,7 @@ addToLibrary({ // either. The only valid combination is to have no change in the async // data (so we either had one in flight and left it alone, or we didn't have // one), or to have nothing in flight and to start one. - assert(!(previousAsync && Asyncify.currData), 'We cannot start an async operation when one is already flight'); + assert(!(previousAsync && Asyncify.currData), 'We cannot start an async operation when one is already in flight'); assert(!(previousAsync && !Asyncify.currData), 'We cannot stop an async operation in flight'); #endif // This is a new async operation. The wasm is paused and has unwound its stack. diff --git a/src/lib/libcore.js b/src/lib/libcore.js index d774ed139d044..6af513ccece46 100644 --- a/src/lib/libcore.js +++ b/src/lib/libcore.js @@ -463,7 +463,7 @@ addToLibrary({ }, #elif !SUPPORT_LONGJMP #if !INCLUDE_FULL_LIBRARY - // These are in order to print helpful error messages when either longjmp of + // These are in order to print helpful error messages when either longjmp or // setjmp is used. longjmp__deps: [() => { error('longjmp support was disabled (SUPPORT_LONGJMP=0), but it is required by the code (either set SUPPORT_LONGJMP=1, or remove uses of it in the project)'); @@ -666,7 +666,7 @@ addToLibrary({ } if (str.indexOf(".") > 0) { - // parse IPv4 embedded stress + // parse IPv4 embedded address str = str.replace(new RegExp('[.]', 'g'), ":"); words = str.split(":"); words[words.length-4] = Number(words[words.length-4]) + Number(words[words.length-3])*256; @@ -686,7 +686,7 @@ addToLibrary({ } offset = z-1; } else { - // parse hex to field to 16-bit value and write it in network byte-order + // parse hex field to 16-bit value and write it in network byte-order parts[w+offset] = _htons(parseInt(words[w],16)); } } else { @@ -1592,7 +1592,7 @@ addToLibrary({ // is a stack allocation that LLVM made, which may go away before the main // thread gets the message. For that reason we handle proxying *after* the // call to readEmAsmArgs, and therefore we do that manually here instead - // of using __proxy. (And dor simplicity, do the same in the sync + // of using __proxy. (And for simplicity, do the same in the sync // case as well, even though it's not strictly necessary, to keep the two // code paths as similar as possible on both sides.) return proxyToMainThread(0, emAsmAddr, sync, ...args); @@ -1615,8 +1615,8 @@ addToLibrary({ #endif #if !DECLARE_ASM_MODULE_EXPORTS - // When DECLARE_ASM_MODULE_EXPORTS is set, this function is programatically - // ceated during linking. See `create_receiving` in `emscripten.py`. + // When DECLARE_ASM_MODULE_EXPORTS is set, this function is programmatically + // created during linking. See `create_receiving` in `emscripten.py`. // When DECLARE_ASM_MODULE_EXPORTS=0 is set, `assignWasmExports` is instead // defined here as a normal JS library function. $assignWasmExports__deps: ['$asmjsMangle', diff --git a/src/lib/libdylink.js b/src/lib/libdylink.js index a06bdb422785d..128bbcd11458d 100644 --- a/src/lib/libdylink.js +++ b/src/lib/libdylink.js @@ -117,7 +117,7 @@ var LibraryDylink = { // Resolve a global symbol by name. This is used during module loading to // resolve imports, and by `dlsym` when used with `RTLD_DEFAULT`. // Returns both the resolved symbol (i.e. a function or a global) along with - // the canonical name of the symbol (in some cases is modify the symbol as + // the canonical name of the symbol (in some cases modifying the symbol as // part of the loop process, so that actual symbol looked up has a different // name). $resolveGlobalSymbol__deps: ['$isSymbolDefined', '$createNamedFunction', @@ -166,7 +166,7 @@ var LibraryDylink = { $GOT: {}, // Proxy handler used for GOT.mem and GOT.func imports. Each of these - // imports is fullfilled dynamically via the `get` method of this proxy + // imports is fulfilled dynamically via the `get` method of this proxy // handler. We abuse the `target` of the Proxy in order to pass the set of // weak imports to the handler. $GOTHandler__internal: true, @@ -303,7 +303,7 @@ var LibraryDylink = { return value; } #endif - // Detect immuable wasm global exports. These represent data addresses + // Detect immutable wasm global exports. These represent data addresses // which are relative to `memoryBase` if (isImmutableGlobal(value)) { return new WebAssembly.Global({'value': '{{{ POINTER_WASM_TYPE }}}'}, value.value + {{{ to64('memoryBase') }}}); @@ -682,7 +682,7 @@ var LibraryDylink = { // table and memory regions. Later threads re-use the same table region // and can ignore the memory region (since memory is shared between // threads already). - // If `handle` is specified than it is assumed that the calling thread has + // If `handle` is specified then it is assumed that the calling thread has // exclusive access to it for the duration of this function. See the // locking in `dynlink.c`. var firstLoad = !handle || !{{{ makeGetValue('handle', C_STRUCTS.dso.mem_allocated, 'i8') }}}; @@ -728,7 +728,7 @@ var LibraryDylink = { // This is the export map that we ultimately return. We declare it here // so it can be used within resolveSymbol. We resolve symbols against - // this local symbol map in the case there they are not present on the + // this local symbol map in the case where they are not present on the // global Module object. We need this fallback because Modules sometime // need to import their own symbols var moduleExports; @@ -857,7 +857,7 @@ var LibraryDylink = { {{{ makeEval('ASM_CONSTS[start] = eval(func)') }}}; } - // Add any EM_ASM function that exist in the side module + // Add any EM_ASM functions that exist in the side module if ('__start_em_asm' in moduleExports) { var start = moduleExports['__start_em_asm'].value; var stop = moduleExports['__stop_em_asm'].value; @@ -1132,7 +1132,7 @@ var LibraryDylink = { registerDynCallSymbols(dso.exports); #endif } else if (!dso.global) { - // The library was previously loaded only locally but not + // The library was previously loaded only locally but now // we have a request with global=true. dso.global = true; mergeLibSymbols(dso.exports, libName) @@ -1422,8 +1422,8 @@ var LibraryDylink = { #endif result = addr; } else { - // Insert the function into the wasm table. If its a direct wasm - // function the second argument will not be needed. If its a JS + // Insert the function into the wasm table. If it's a direct wasm + // function the second argument will not be needed. If it's a JS // function we rely on the `sig` attribute being set based on the // `__sig` specified in library JS file. result = addFunction(result, result.sig); diff --git a/src/lib/libembind.js b/src/lib/libembind.js index 7ed186cacd587..0f76989e5f949 100644 --- a/src/lib/libembind.js +++ b/src/lib/libembind.js @@ -12,7 +12,7 @@ var LibraryEmbind = { $InvokerFunctions: '<<< EMBIND_AOT_INVOKERS >>>', #endif // If register_type is used, emval will be registered multiple times for - // different type id's, but only a single type object is needed on the JS side + // different type ids, but only a single type object is needed on the JS side // for all of them. Store the type for reuse. $EmValType__deps: ['_emval_decref', '$Emval', '$readPointer'], $EmValType: `{ @@ -737,7 +737,7 @@ var LibraryEmbind = { return onDone(rv); }; #else - // Builld the arguments that will be passed into the closure around the invoker + // Build the arguments that will be passed into the closure around the invoker // function. var retType = argTypes[0]; var instType = argTypes[1]; @@ -1119,7 +1119,7 @@ var LibraryEmbind = { break; default: - throwBindingError('Unsupporting sharing policy'); + throwBindingError('Unsupported sharing policy'); } } return ptr; diff --git a/src/lib/libembind_gen.js b/src/lib/libembind_gen.js index 4d797c34f8e74..23bab958f3bbe 100644 --- a/src/lib/libembind_gen.js +++ b/src/lib/libembind_gen.js @@ -752,7 +752,7 @@ var LibraryEmbind = { return []; }); }, - // Stub function. This is called a when extending an object and not needed for TS generation. + // Stub function. This is called when extending an object and not needed for TS generation. _embind_create_inheriting_constructor: (constructorName, wrapperType, properties) => {}, _embind_register_enum__deps: ['$AsciiToString', '$EnumDefinition', '$moduleDefinitions', '$getEnumValueType'], _embind_register_enum: function(rawType, name, size, isSigned, rawValueType) { diff --git a/src/lib/libeventloop.js b/src/lib/libeventloop.js index a92f1415911d8..ad59b926208bf 100644 --- a/src/lib/libeventloop.js +++ b/src/lib/libeventloop.js @@ -141,7 +141,7 @@ LibraryJSEventLoop = { // (https://stackoverflow.com/questions/8430966/is-calling-settimeout-with-a-negative-delay-ok) var remaining = n - _emscripten_get_now(); #if ENVIRONMENT_MAY_BE_NODE - // Recent revsions of node, however, give TimeoutNegativeWarning + // Recent revisions of node, however, give TimeoutNegativeWarning remaining = Math.max(0, remaining); #endif setTimeout(tick, remaining); @@ -417,10 +417,10 @@ LibraryJSEventLoop = { } // We create the loop runner here but it is not actually running until - // _emscripten_set_main_loop_timing is called (which might happen a + // _emscripten_set_main_loop_timing is called (which might happen at a // later time). This member signifies that the current runner has not // yet been started so that we can call runtimeKeepalivePush when it - // gets it timing set for the first time. + // gets its timing set for the first time. MainLoop.running = false; MainLoop.runner = function MainLoop_runner() { if (ABORT) return; diff --git a/src/lib/libexceptions.js b/src/lib/libexceptions.js index 216fc4cb4aadb..4f763f63ae80f 100644 --- a/src/lib/libexceptions.js +++ b/src/lib/libexceptions.js @@ -11,7 +11,7 @@ var LibraryExceptions = { $exceptionCaught: ' []', // This class is the exception metadata which is prepended to each thrown object (in WASM memory). - // It is allocated in one block among with a thrown object in __cxa_allocate_exception and freed + // It is allocated in one block along with a thrown object in __cxa_allocate_exception and freed // in ___cxa_free_exception. It roughly corresponds to __cxa_exception structure in libcxxabi. The // class itself is just a native pointer wrapper, and contains all the necessary accessors for the // fields in the native structure. @@ -365,7 +365,7 @@ var LibraryExceptions = { // of these functions using JS 'arguments' object. addCxaCatch = (n) => { const args = []; - // Confusingly, the actual number of asrgument is n - 2. According to the llvm + // Confusingly, the actual number of argument is n - 2. According to the llvm // code in WebAssemblyLowerEmscriptenEHSjLj.cpp: // This is because a landingpad instruction contains two more arguments, a // personality function and a cleanup bit, and __cxa_find_matching_catch_N diff --git a/src/lib/libfs.js b/src/lib/libfs.js index 272ab344d3982..da847e909bb94 100644 --- a/src/lib/libfs.js +++ b/src/lib/libfs.js @@ -1121,7 +1121,7 @@ FS.staticInit();`; } else { // node doesn't exist, try to create it // Ignore the permission bits here to ensure we can `open` this new - // file below. We use chmod below the apply the permissions once the + // file below. We use chmod below to apply the permissions once the // file is open. node = FS.mknod(path, mode | 0o777, 0); created = true; diff --git a/src/lib/libfs_shared.js b/src/lib/libfs_shared.js index c6728c753f2d6..1fe6ac4172fc1 100644 --- a/src/lib/libfs_shared.js +++ b/src/lib/libfs_shared.js @@ -27,7 +27,7 @@ addToLibrary({ return plugin['handle'](byteArray, fullname); } } - // In no plugin handled this file then return the original/unmodified + // If no plugin handled this file then return the original/unmodified // byteArray. return byteArray; }, @@ -83,7 +83,7 @@ addToLibrary({ }, #endif - // convert the 'r', 'r+', etc. to it's corresponding set of O_* flags + // convert the 'r', 'r+', etc. to its corresponding set of O_* flags $FS_modeStringToFlags: (str) => { var flagModes = { 'r': {{{ cDefs.O_RDONLY }}}, diff --git a/src/lib/libglemu.js b/src/lib/libglemu.js index ab86104449323..d910f884c8648 100644 --- a/src/lib/libglemu.js +++ b/src/lib/libglemu.js @@ -409,7 +409,7 @@ var LibraryGLEmulation = { return; } case 0x0D32: { // GL_MAX_CLIP_PLANES - {{{ makeSetValue('params', '0', 'GLEmulation.MAX_CLIP_PLANES', 'i32') }}}; // all implementations need to support atleast 6 + {{{ makeSetValue('params', '0', 'GLEmulation.MAX_CLIP_PLANES', 'i32') }}}; // all implementations need to support at least 6 return; } case 0x0BA0: { // GL_MATRIX_MODE @@ -3892,7 +3892,7 @@ var LibraryGLEmulation = { }, gluProject: (objX, objY, objZ, model, proj, view, winX, winY, winZ) => { - // The algorithm for this functions comes from Mesa + // The algorithm for this function comes from Mesa var inVec = new Float32Array(4); var outVec = new Float32Array(4); diff --git a/src/lib/libglfw.js b/src/lib/libglfw.js index b0769857f4563..bd0e4c8dc4db8 100644 --- a/src/lib/libglfw.js +++ b/src/lib/libglfw.js @@ -18,7 +18,7 @@ * * What it does not but should probably do: * - Transmit events when glfwPollEvents, glfwWaitEvents or glfwSwapBuffers is - * called. Events callbacks are called as soon as event are received. + * called. Events callbacks are called as soon as events are received. * - Input modes. * - Gamma ramps. * - Video modes. @@ -41,7 +41,7 @@ var LibraryGLFW = { this.id = id; this.x = 0; this.y = 0; - this.fullscreen = false; // Used to determine if app in fullscreen mode + this.fullscreen = false; // Used to determine if app is in fullscreen mode this.storedX = 0; // Used to store X before fullscreen this.storedY = 0; // Used to store Y before fullscreen this.width = width; @@ -900,7 +900,7 @@ var LibraryGLFW = { // As documented in GLFW2 API (http://www.glfw.org/GLFWReference27.pdf#page=22), when size // callback function is set, it will be called with the current window size before this // function returns. - // GLFW3 on the over hand doesn't have this behavior (https://github.com/glfw/glfw/issues/62). + // GLFW3 on the other hand doesn't have this behavior (https://github.com/glfw/glfw/issues/62). if (!win.windowSizeFunc) return null; {{{ makeDynCall('vii', 'win.windowSizeFunc') }}}(win.width, win.height); #endif @@ -975,7 +975,7 @@ var LibraryGLFW = { err('glfwSetInputMode called with GLFW_LOCK_KEY_MODS mode not implemented'); break; } - case 0x000330005: { // GLFW_RAW_MOUSE_MOTION + case 0x00033005: { // GLFW_RAW_MOUSE_MOTION err('glfwSetInputMode called with GLFW_RAW_MOUSE_MOTION mode not implemented'); break; } @@ -1547,7 +1547,7 @@ var LibraryGLFW = { // AFAIK there is no way to do this in javascript // Maybe with platform specific ccalls? // - // Lets report 0 now which is wrong as it can get for end user. + // Let's report 0 now which is as wrong as it can get for end user. {{{ makeSetValue('width', '0', '0', 'i32') }}}; {{{ makeSetValue('height', '0', '0', 'i32') }}}; }, @@ -1805,7 +1805,7 @@ var LibraryGLFW = { glfwGetCursorPos: (winid, x, y) => GLFW.getCursorPos(winid, x, y), - // I believe it is not possible to move the mouse with javascript + // I believe it is not possible to move the mouse with JavaScript glfwSetCursorPos: (winid, x, y) => GLFW.setCursorPos(winid, x, y), glfwSetKeyCallback: (winid, cbfun) => GLFW.setKeyCallback(winid, cbfun), diff --git a/src/lib/libglut.js b/src/lib/libglut.js index 7b405fbacbce5..4b4c740226bad 100644 --- a/src/lib/libglut.js +++ b/src/lib/libglut.js @@ -42,7 +42,7 @@ var LibraryGLUT = { onMousemove: (event) => { /* Send motion event only if the motion changed, prevents - * spamming our app with uncessary callback call. It does happen in + * spamming our app with unnecessary callback call. It does happen in * Chrome on Windows. */ var lastX = Browser.mouseX; @@ -185,14 +185,14 @@ var LibraryGLUT = { var key = GLUT.getSpecialKey(event['keyCode']); if (key !== null) { if (GLUT.specialUpFunc) { - event.preventDefault (); + event.preventDefault(); GLUT.saveModifiers(event); {{{ makeDynCall('viii', 'GLUT.specialUpFunc') }}}(key, Browser.mouseX, Browser.mouseY); } } else { key = GLUT.getASCIIKey(event); if (key !== null && GLUT.keyboardUpFunc) { - event.preventDefault (); + event.preventDefault(); GLUT.saveModifiers(event); {{{ makeDynCall('viii', 'GLUT.keyboardUpFunc') }}}(key, Browser.mouseX, Browser.mouseY); } diff --git a/src/lib/libhtml5.js b/src/lib/libhtml5.js index 142cd315afe43..d52250aab6cec 100644 --- a/src/lib/libhtml5.js +++ b/src/lib/libhtml5.js @@ -1044,7 +1044,7 @@ var LibraryHTML5 = { var eventSize = {{{ C_STRUCTS.EmscriptenFullscreenChangeEvent.__size__ }}}; JSEvents.fullscreenChangeEvent ||= _malloc(eventSize); - var fullscreenChangeEventhandlerFunc = (e) => { + var fullscreenChangeEventHandlerFunc = (e) => { var fullscreenChangeEvent = JSEvents.fullscreenChangeEvent; fillFullscreenChangeEventData(fullscreenChangeEvent); @@ -1061,7 +1061,7 @@ var LibraryHTML5 = { eventTypeId, userData, callbackfunc, - handlerFunc: fullscreenChangeEventhandlerFunc, + handlerFunc: fullscreenChangeEventHandlerFunc, useCapture }; return JSEvents.registerOrRemoveHandler(eventHandler); diff --git a/src/lib/libhtml5_webgl.js b/src/lib/libhtml5_webgl.js index dfec3518c518c..8db08e6023078 100644 --- a/src/lib/libhtml5_webgl.js +++ b/src/lib/libhtml5_webgl.js @@ -618,7 +618,7 @@ function handleWebGLProxying(funcs) { } } #else - // In single threaded mode just delete our custom __proxy addributes, otherwise + // In single threaded mode just delete our custom __proxy attributes, otherwise // they will causes errors in the JS compiler. for (const i in funcs) { delete funcs[i + '__proxy']; diff --git a/src/lib/libidbstore.js b/src/lib/libidbstore.js index b74af4fab97dc..3ecd106b4d771 100644 --- a/src/lib/libidbstore.js +++ b/src/lib/libidbstore.js @@ -9,7 +9,7 @@ var LibraryIDBStore = { // A simple IDB-backed storage mechanism. Suitable for saving and loading // large files asynchronously. This does *NOT* use the emscripten filesystem, - // intentionally, to avoid overhead. It lets you application define whatever + // intentionally, to avoid overhead. It lets your application define whatever // filesystem-like layer you want, with the overhead 100% controlled by you. // At the extremes, you could either just store large files, with almost no // extra code; or you could implement a file b-tree using posix-compliant @@ -34,7 +34,7 @@ var LibraryIDBStore = { }, emscripten_idb_async_store__deps: ['$UTF8ToString', '$callUserCallback'], emscripten_idb_async_store: (db, id, ptr, num, arg, onstore, onerror) => { - // note that we copy the data here, as these are async operatins - changes + // note that we copy the data here, as these are async operations - changes // to HEAPU8 meanwhile should not affect us! {{{ runtimeKeepalivePush() }}}; IDBStore.setFile(UTF8ToString(db), UTF8ToString(id), new Uint8Array(HEAPU8.subarray(ptr, ptr+num)), (error) => { diff --git a/src/lib/libint53.js b/src/lib/libint53.js index 0e9b54d264330..40aca59384daa 100644 --- a/src/lib/libint53.js +++ b/src/lib/libint53.js @@ -132,7 +132,7 @@ addToLibrary({ #if WASM_BIGINT $INT53_MAX: '{{{ Math.pow(2, 53) }}}', $INT53_MIN: '-{{{ Math.pow(2, 53) }}}', - // Counvert a bigint value (usually coming from Wasm->JS call) into an int53 + // Convert a bigint value (usually coming from Wasm->JS call) into an int53 // JS Number. This is used when we have an incoming i64 that we know is a // pointer or size_t and is expected to be within the int53 range. // Returns NaN if the incoming bigint is outside the range. diff --git a/src/lib/liblegacy.js b/src/lib/liblegacy.js index abf99d5c92694..7077bf8a8d0af 100644 --- a/src/lib/liblegacy.js +++ b/src/lib/liblegacy.js @@ -11,7 +11,7 @@ * Any usage of symbols in this file will result in a `-Wdeprecated` warning. * * Symbol in this file should be removed after "enough time" has passed such - * that all external users have been able to transision away. + * that all external users have been able to transition away. */ legacyFuncs = { diff --git a/src/lib/libmemfs.js b/src/lib/libmemfs.js index 87306d9d04cad..631b2ef4657fc 100644 --- a/src/lib/libmemfs.js +++ b/src/lib/libmemfs.js @@ -13,7 +13,7 @@ addToLibrary({ }, createNode(parent, name, mode, dev) { if (FS.isBlkdev(mode) || FS.isFIFO(mode)) { - // no supported + // not supported throw new FS.ErrnoError({{{ cDefs.EPERM }}}); } MEMFS.ops_table ||= { @@ -265,7 +265,7 @@ addToLibrary({ // If the buffer is located in main memory (HEAP), and if // memory can grow, we can't hold on to references of the // memory buffer, as they may get invalidated. That means we - // need to do copy its contents. + // need to copy its contents. if (buffer.buffer === HEAP8.buffer) { canOwn = false; } diff --git a/src/lib/libnodefs.js b/src/lib/libnodefs.js index a9d901e60eaa1..d3ba827f5a436 100644 --- a/src/lib/libnodefs.js +++ b/src/lib/libnodefs.js @@ -145,10 +145,10 @@ addToLibrary({ }; }, // Common code for both node and stream setattr - // For node getatrr: + // For node getattr: // - arg is a native path // - chmod, utimes, truncate are fs.chmodSync, fs.utimesSync, fs.truncateSync - // For stream getatrr: + // For stream getattr: // - arg is a native file descriptor // - chmod, utimes, truncate are fs.fchmodSync, fs.futimesSync, fs.ftruncateSync setattr(arg, node, attr, chmod, utimes, truncate, stat) { diff --git a/src/lib/libnoderawfs.js b/src/lib/libnoderawfs.js index 593343e4b0cf1..41694c7482109 100644 --- a/src/lib/libnoderawfs.js +++ b/src/lib/libnoderawfs.js @@ -47,7 +47,7 @@ addToLibrary({ return { path, node: { id: st.ino, mode, node_ops: NODERAWFS, path }}; }, createStandardStreams() { - // FIXME: tty is set to true to appease isatty(), the underlying ioctl syscalls still needs to be implemented, see issue #22264. + // FIXME: tty is set to true to appease isatty(), the underlying ioctl syscalls still need to be implemented, see issue #22264. FS.createStream({ nfd: 0, position: 0, path: '/dev/stdin', flags: 0, tty: true, seekable: false }, 0); var paths = [,'/dev/stdout', '/dev/stderr']; for (var i = 1; i < 3; i++) { diff --git a/src/lib/libopenal.js b/src/lib/libopenal.js index 500e9d07ebfb8..772ae7c8858af 100644 --- a/src/lib/libopenal.js +++ b/src/lib/libopenal.js @@ -99,7 +99,7 @@ var LibraryOpenAL = { }, // This function is the core scheduler that queues web-audio buffers for output. - // src.bufQueue represents the abstract OpenAL buffer queue, which is taversed to schedule + // src.bufQueue represents the abstract OpenAL buffer queue, which is traversed to schedule // corresponding web-audio buffers. These buffers are stored in src.audioQueue, which // represents the queue of buffers scheduled for physical playback. These two queues are // distinct because of the differing semantics of OpenAL and web audio. Some changes @@ -525,7 +525,7 @@ var LibraryOpenAL = { // WebAudio does spatialization in world-space coordinates, meaning both the buffer sources and // the listener position are in the same absolute coordinate system relative to a fixed origin. // By default, OpenAL works this way as well, but it also provides a "listener relative" mode, where - // a buffer source's coordinate are interpreted not in absolute world space, but as being relative + // a buffer source's coordinates are interpreted not in absolute world space, but as being relative // to the listener object itself, so as the listener moves the source appears to move with it // with no update required. Since web audio does not support this mode, we must transform the source // coordinates from listener-relative space to absolute world space. @@ -3778,7 +3778,7 @@ var LibraryOpenAL = { break; default: #if OPENAL_DEBUG - dbg(`alBufferData() called with invalid format ${format}`; + dbg(`alBufferData() called with invalid format ${format}`); #endif AL.currentCtx.err = {{{ cDefs.AL_INVALID_VALUE }}}; return; @@ -3787,7 +3787,7 @@ var LibraryOpenAL = { buf.audioBuf = audioBuf; } catch (e) { #if OPENAL_DEBUG - dbg(`alBufferData() upload failed with an exception ${e}`; + dbg(`alBufferData() upload failed with an exception ${e}`); #endif AL.currentCtx.err = {{{ cDefs.AL_INVALID_VALUE }}}; return; diff --git a/src/lib/libpthread.js b/src/lib/libpthread.js index 54c2f913cdc32..6ad03020f6028 100644 --- a/src/lib/libpthread.js +++ b/src/lib/libpthread.js @@ -134,7 +134,7 @@ var LibraryPThread = { #endif // !MINIMAL_RUNTIME && PTHREAD_POOL_SIZE #if MAIN_MODULE PThread.outstandingPromises = {}; - // Finished threads are threads that have finished running but we not yet + // Finished threads are threads that have finished running but we are not yet // joined. PThread.finishedThreads = new Set(); #endif @@ -176,7 +176,7 @@ var LibraryPThread = { #endif // Attempt to kill all workers. Sadly (at least on the web) there is no // way to terminate a worker synchronously, or to be notified when a - // worker in actually terminated. This means there is some risk that + // worker is actually terminated. This means there is some risk that // pthreads will continue to be executing after `worker.terminate` has // returned. For this reason, we don't call `returnWorkerToPool` here or // free the underlying pthread data structures. @@ -195,7 +195,7 @@ var LibraryPThread = { // some operations that leave the worker queue in an invalid state until // we are completely done (it would be bad if free() ends up calling a // queued pthread_create which looks at the global data structures we are - // modifying). To achieve that, defer the free() til the very end, when + // modifying). To achieve that, defer the free() until the very end, when // we are all done. var pthread_ptr = worker.pthread_ptr; delete PThread.pthreads[pthread_ptr]; @@ -458,7 +458,7 @@ var LibraryPThread = { } else #endif // We need to generate the URL with import.meta.url as the base URL of the JS file - // instead of just using new URL(import.meta.url) because bundler's only recognize + // instead of just using new URL(import.meta.url) because bundlers only recognize // the first case in their bundling step. The latter ends up producing an invalid // URL to import from the server (e.g., for webpack the file:// path). // See https://github.com/webpack/webpack/issues/12638 @@ -467,7 +467,7 @@ var LibraryPThread = { var pthreadMainJs = _scriptName; #if CROSS_ORIGIN && ENVIRONMENT_MAY_BE_WEB // In order to support cross origin loading of worker threads load the - // worker via a tiny inline `importScripts` call. For some reason its + // worker via a tiny inline `importScripts` call. For some reason it's // fine to `importScripts` across origins, in cases where new Worker // itself does not allow this. // https://github.com/emscripten-core/emscripten/issues/21937 @@ -544,9 +544,9 @@ var LibraryPThread = { worker.terminate(); // terminate() can be asynchronous, so in theory the worker can continue // to run for some amount of time after termination. However from our POV - // the worker now dead and we don't want to hear from it again, so we stub + // the worker is now dead and we don't want to hear from it again, so we stub // out its message handler here. This avoids having to check in each of - // the onmessage handlers if the message was coming from valid worker. + // the onmessage handlers if the message was coming from a valid worker. worker.onmessage = (e) => { #if ASSERTIONS var cmd = e['data'].cmd; @@ -572,7 +572,7 @@ var LibraryPThread = { // Called when a thread needs to be strongly referenced. // Currently only used for: // - keeping the "main" thread alive in PROXY_TO_PTHREAD mode; - // - crashed threads that needs to propagate the uncaught exception + // - crashed threads that need to propagate the uncaught exception // back to the main thread. #if ENVIRONMENT_MAY_BE_NODE if (ENVIRONMENT_IS_NODE) { @@ -690,7 +690,7 @@ var LibraryPThread = { }, _emscripten_init_main_thread_js: (tb) => { - // Pass the thread address to the native code where they stored in wasm + // Pass the thread address to the native code where they are stored in wasm // globals which act as a form of TLS. Global constructors trying // to access this value will read the wrong value, but that is UB anyway. __emscripten_thread_init( @@ -911,10 +911,10 @@ var LibraryPThread = { #endif }, - // This function is call by a pthread to signal that exit() was called and + // This function is called by a pthread to signal that exit() was called and // that the entire process should exit. // This function is always called from a pthread, but is executed on the - // main thread due the __proxy attribute. + // main thread due to the __proxy attribute. $exitOnMainThread__deps: ['exit'], $exitOnMainThread__proxy: 'async', $exitOnMainThread: (returnCode) => { @@ -1031,7 +1031,7 @@ var LibraryPThread = { #endif #if ASSERTIONS // Proxied functions can return any type except bigint. All other types - // cooerce to f64/double (the return type of this function in C) but not + // coerce to f64/double (the return type of this function in C) but not // bigint. assert(typeof rtn != "bigint"); #endif @@ -1103,7 +1103,7 @@ var LibraryPThread = { #if MAIN_MODULE // Before we call the thread entry point, make sure any shared libraries - // have been loaded on this there. Otherwise our table might be not be + // have been loaded on this thread. Otherwise our table might be not be // in sync and might not contain the function pointer `ptr` at all. __emscripten_dlsync_self(); #endif @@ -1143,7 +1143,7 @@ var LibraryPThread = { #if MAIN_MODULE _emscripten_thread_exit_joinable: (thread) => { // Called when a thread exits and is joinable. We mark these threads - // as finished, which means that are in state where are no longer actually + // as finished, which means they are in state where are no longer actually // running, but remain around waiting to be joined. In this state they // cannot run any more proxied work. if (!ENVIRONMENT_IS_PTHREAD) markAsFinished(thread); @@ -1164,7 +1164,7 @@ var LibraryPThread = { // This work happens asynchronously. The `callback` is called once this work // is completed, passing the ctx. // TODO(sbc): Should we make a new form of __proxy attribute for JS library - // function that run asynchronously like but blocks the caller until they are + // function that run asynchronously but blocks the caller until they are // done. Perhaps "sync_with_ctx"? _emscripten_dlsync_threads_async__deps: ['_emscripten_proxy_dlsync_async', '$makePromise'], _emscripten_dlsync_threads_async: (caller, callback, ctx) => { @@ -1213,11 +1213,11 @@ var LibraryPThread = { }); }, - // Synchronous version dlsync_threads. This is only needed for the case then - // the main thread call dlopen and in that case we have not choice but to + // Synchronous version dlsync_threads. This is only needed for the case when + // the main thread call dlopen and in that case we have no choice but to // synchronously block the main thread until all other threads are in sync. // When `dlopen` is called from a worker, the worker itself is blocked but - // the operation its waiting on (on the main thread) can be async. + // the operation it's waiting on (on the main thread) can be async. _emscripten_dlsync_threads__deps: ['_emscripten_proxy_dlsync'], _emscripten_dlsync_threads: () => { #if ASSERTIONS diff --git a/src/lib/libsdl.js b/src/lib/libsdl.js index 52d985e55d59f..7eed913a814bf 100644 --- a/src/lib/libsdl.js +++ b/src/lib/libsdl.js @@ -1461,7 +1461,7 @@ var LibrarySDL = { var size = driverName.length; if (max_size <= size) { - size = max_size - 1; //-1 cause null-terminator + size = max_size - 1; //-1 because of null-terminator } while (index < size) { @@ -1594,8 +1594,8 @@ var LibrarySDL = { if (surfData.isFlagSet({{{ cDefs.SDL_HWPALETTE }}})) { // If this is needed then // we should compact the data from 32bpp to 8bpp index. - // I think best way to implement this is use - // additional colorMap hash (color->index). + // I think the best way to implement this is to use + // an additional colorMap hash (color->index). // Something like this: // // var size = surfData.width * surfData.height; @@ -1951,9 +1951,9 @@ var LibrarySDL = { #endif if (surfData.isFlagSet({{{ cDefs.SDL_HWPALETTE }}})) { - //in SDL_HWPALETTE color is index (0..255) - //so we should translate 1 byte value to - //32 bit canvas + // in SDL_HWPALETTE color is index (0..255) + // so we should translate 1 byte value to + // 32 bit canvas color = surfData.colors32[color]; } diff --git a/src/lib/libsockfs.js b/src/lib/libsockfs.js index 493d2e749341f..c226972c9c331 100644 --- a/src/lib/libsockfs.js +++ b/src/lib/libsockfs.js @@ -22,8 +22,8 @@ addToLibrary({ }, mount(mount) { #if expectToReceiveOnModule('websocket') - // The incomming Module['websocket'] can be used for configuring - // configuring subprotocol/url, etc + // The incoming Module['websocket'] can be used for configuring + // subprotocol/url, etc SOCKFS.websocketArgs = {{{ makeModuleReceiveExpr('websocket', '{}') }}}; // Add the Event registration mechanism to the exported websocket configuration // object so we can register network callbacks from native JavaScript too. @@ -202,7 +202,7 @@ addToLibrary({ } if (subProtocols !== 'null') { - // The regex trims the string (removes spaces at the beginning and end, then splits the string by + // The regex trims the string (removes spaces at the beginning and end), then splits the string by // , into an Array. Whitespace removal is important for Websockify and ws. subProtocols = subProtocols.replace(/^ +| +$/g,"").split(/ *, */); @@ -323,7 +323,7 @@ addToLibrary({ data.length === 10 && data[0] === 255 && data[1] === 255 && data[2] === 255 && data[3] === 255 && data[4] === 'p'.charCodeAt(0) && data[5] === 'o'.charCodeAt(0) && data[6] === 'r'.charCodeAt(0) && data[7] === 't'.charCodeAt(0)) { - // update the peer's port and it's key in the peer map + // update the peer's port and its key in the peer map var newport = ((data[8] << 8) | data[9]); SOCKFS.websocket_sock_ops.removePeer(sock, peer); peer.port = newport; @@ -638,7 +638,7 @@ addToLibrary({ var data = buffer.slice(offset, offset + length); #if PTHREADS // WebSockets .send() does not allow passing a SharedArrayBuffer, so - // clone the the SharedArrayBuffer as regular ArrayBuffer before + // clone the SharedArrayBuffer as regular ArrayBuffer before // sending. if (data instanceof SharedArrayBuffer) { data = new Uint8Array(new Uint8Array(data)).buffer; diff --git a/src/lib/libstack_trace.js b/src/lib/libstack_trace.js index 73cda9afe1cc1..6f550d9af9c1b 100644 --- a/src/lib/libstack_trace.js +++ b/src/lib/libstack_trace.js @@ -134,7 +134,7 @@ var LibraryStackTrace = { } // skip this function and the caller to get caller's return address #if MEMORY64 - // MEMORY64 injects and extra wrapper within emscripten_return_address + // MEMORY64 injects an extra wrapper within emscripten_return_address // to handle BigInt conversions. var caller = callstack[level + 4]; #else diff --git a/src/lib/libwasi.js b/src/lib/libwasi.js index 71a57598103cc..d26aa31728e67 100644 --- a/src/lib/libwasi.js +++ b/src/lib/libwasi.js @@ -69,7 +69,7 @@ var WasiLibrary = { }; #if ENVIRONMENT_MAY_BE_NODE && NODE_HOST_ENV if (ENVIRONMENT_IS_NODE) { - // When NODE_HOST_ENV is enabled we mirror then entire host environment. + // When NODE_HOST_ENV is enabled we mirror the entire host environment. env = process.env; } #endif @@ -423,7 +423,7 @@ var WasiLibrary = { path_open__sig: 'iiiiiiiiii', path_open__deps: ['$wasiRightsToMuslOFlags', '$wasiOFlagsToMuslOFlags', '$preopens'], path_open: (fd, dirflags, path, path_len, oflags, - fs_rights_base, fs_rights_inherting, + fs_rights_base, fs_rights_inheriting, fdflags, opened_fd) => { if (!(fd in preopens)) { return {{{ cDefs.EBADF }}}; diff --git a/src/lib/libwasm_worker.js b/src/lib/libwasm_worker.js index 2baa491830b22..84df15266aa7b 100644 --- a/src/lib/libwasm_worker.js +++ b/src/lib/libwasm_worker.js @@ -63,7 +63,7 @@ addToLibrary({ $_wasmWorkersID: 1, // Starting up a Wasm Worker is an asynchronous operation, hence if the parent - // thread performs any postMessage()-based wasm function calls s to the + // thread performs any postMessage()-based wasm function calls to the // Worker, they must be delayed until the async startup has finished, after // which these postponed function calls can be dispatched. $_wasmWorkerDelayedMessageQueue: [], diff --git a/src/lib/libwebgl.js b/src/lib/libwebgl.js index 7b7b37089cac3..4ee2c9aacbe39 100644 --- a/src/lib/libwebgl.js +++ b/src/lib/libwebgl.js @@ -358,7 +358,7 @@ for (/**@suppress{duplicate}*/var i = 0; i <= {{{ GL_POOL_TEMP_BUFFERS_SIZE }}}; }, // The code path for creating textures, buffers, framebuffers and other - // objects the same (and not in fast path), so we merge the functions + // objects is the same (and not in fast path), so we merge the functions // together. // 'createFunction' refers to the WebGL context function name to do the actual // creation, 'objectTable' points to the GL object table where to populate the @@ -490,7 +490,7 @@ for (/**@suppress{duplicate}*/var i = 0; i <= {{{ GL_POOL_TEMP_BUFFERS_SIZE }}}; }, // Called at start of each new WebGL rendering frame. This swaps the - // doublebuffered temp VB memory pointers, so that every second frame + // double-buffered temp VB memory pointers, so that every second frame // utilizes different set of temp buffers. The aim is to keep the set of // buffers being rendered, and the set of buffers being updated disjoint. newRenderingFrameStarted: () => { @@ -1196,7 +1196,7 @@ for (/**@suppress{duplicate}*/var i = 0; i <= {{{ GL_POOL_TEMP_BUFFERS_SIZE }}}; var GLctx = context.GLctx; - // Detect the presence of a few extensions manually, ction GL interop + // Detect the presence of a few extensions manually, since the GL interop // layer itself will need to know if they exist. #if LEGACY_GL_EMULATION context.compressionExt = GLctx.getExtension('WEBGL_compressed_texture_s3tc'); @@ -1380,7 +1380,7 @@ for (/**@suppress{duplicate}*/var i = 0; i <= {{{ GL_POOL_TEMP_BUFFERS_SIZE }}}; // WebGL doesn't have GL_NUM_COMPRESSED_TEXTURE_FORMATS (it's obsolete // since GL_COMPRESSED_TEXTURE_FORMATS returns a JS array that can be // queried for length), so implement it ourselves to allow C++ GLES2 - // code get the length. + // code to get the length. var formats = GLctx.getParameter(0x86A3 /*GL_COMPRESSED_TEXTURE_FORMATS*/); ret = formats ? formats.length : 0; break; @@ -1542,7 +1542,7 @@ for (/**@suppress{duplicate}*/var i = 0; i <= {{{ GL_POOL_TEMP_BUFFERS_SIZE }}}; }, glCompressedTexImage2D: (target, level, internalFormat, width, height, border, imageSize, data) => { - // `data` may be null here, which means "allocate uniniitalized space but + // `data` may be null here, which means "allocate uninitialized space but // don't upload" in GLES parlance, but `compressedTexImage2D` requires the // final data parameter, so we simply pass a heap view starting at zero // effectively uploading whatever happens to be near address zero. See @@ -2242,7 +2242,7 @@ for (/**@suppress{duplicate}*/var i = 0; i <= {{{ GL_POOL_TEMP_BUFFERS_SIZE }}}; } }, - // Returns the index of '[' character in an uniform that represents an array + // Returns the index of '[' character in a uniform that represents an array // of uniforms (e.g. colors[10]) // Closure does counterproductive inlining: // https://github.com/google/closure-compiler/issues/3203, so prevent inlining @@ -2291,7 +2291,7 @@ for (/**@suppress{duplicate}*/var i = 0; i <= {{{ GL_POOL_TEMP_BUFFERS_SIZE }}}; // A pair [array length, GLint of the uniform location] var sizeAndId = program.uniformSizeAndIdsByName[uniformBaseName]; - // If an uniform with this name exists, and if its index is within the + // If a uniform with this name exists, and if its index is within the // array limits (if it's even an array), query the WebGLlocation, or // return an existing cached location. if (sizeAndId && arrayIndex < sizeAndId[0]) { diff --git a/src/lib/libwebgl2.js b/src/lib/libwebgl2.js index 64166b5ce1fc2..0764469c2feb4 100644 --- a/src/lib/libwebgl2.js +++ b/src/lib/libwebgl2.js @@ -947,7 +947,7 @@ var LibraryWebGL2 = { // Defined in library_glemu.js when LEGACY_GL_EMULATION is set glDrawRangeElements__deps: ['glDrawElements'], glDrawRangeElements: (mode, start, end, count, type, indices) => { - // TODO: This should be a trivial pass-though function registered at the bottom of this page as + // TODO: This should be a trivial pass-through function registered at the bottom of this page as // glFuncs[6][1] += ' drawRangeElements'; // but due to https://bugzil.la/1202427, // we work around by ignoring the range. diff --git a/src/lib/libwebsocket.js b/src/lib/libwebsocket.js index 55e50cb1f12e4..e8db191142c00 100644 --- a/src/lib/libwebsocket.js +++ b/src/lib/libwebsocket.js @@ -161,7 +161,7 @@ var LibraryWebSocket = { } #if WEBSOCKET_DEBUG - dbg(`emscripten_websocket_set_onopen_callback(socketId=${socketId},userData=${userData},callbackFunc='+callbackFunc})`); + dbg(`emscripten_websocket_set_onopen_callback(socketId=${socketId},userData=${userData},callbackFunc=${callbackFunc})`); #endif socket.onopen = function(e) { #if WEBSOCKET_DEBUG diff --git a/src/modularize.js b/src/modularize.js index b9a8414b2ce7c..26cb68a3be8f9 100644 --- a/src/modularize.js +++ b/src/modularize.js @@ -33,7 +33,7 @@ var {{{ EXPORT_NAME }}} = (() => { }; })(); #else -// When targetting node and ES6 we use `await import ..` in the generated code +// When targeting node and ES6 we use `await import ..` in the generated code // so the outer function needs to be marked as async. async function {{{ EXPORT_NAME }}}(moduleArg = {}) { var moduleRtn; diff --git a/src/parseTools.mjs b/src/parseTools.mjs index 9467135c444e4..786c028d5a902 100644 --- a/src/parseTools.mjs +++ b/src/parseTools.mjs @@ -93,7 +93,7 @@ export function preprocess(filename) { const IGNORE = 0; const SHOW = 1; // This state is entered after we have shown one of the block of an if/elif/else sequence. - // Once we enter this state we dont show any blocks or evaluate any + // Once we enter this state we don't show any blocks or evaluate any // conditions until the sequence ends. const IGNORE_ALL = 2; const showStack = []; diff --git a/src/polyfill/bigint64array.js b/src/polyfill/bigint64array.js index 64ac64c1e46cd..0a70ddf45589f 100644 --- a/src/polyfill/bigint64array.js +++ b/src/polyfill/bigint64array.js @@ -89,7 +89,7 @@ if (!globalThis.BigInt64Array) { return Reflect.set(target, idx, value, receiver); } if (typeof value !== "bigint") { - // Chrome error message, Firefox has no "a" in front if "BigInt". + // Chrome error message, Firefox has no "a" in front of "BigInt". throw new TypeError(`Cannot convert ${value} to a BigInt`); } var pair = bigIntToParts(value); diff --git a/src/postamble_modularize.js b/src/postamble_modularize.js index cc150c0a7a262..1ba64faad2955 100644 --- a/src/postamble_modularize.js +++ b/src/postamble_modularize.js @@ -2,7 +2,7 @@ // and return either the Module itself, or a promise of the module. // // We assign to the `moduleRtn` global here and configure closure to see -// this as and extern so it won't get minified. +// this as an extern so it won't get minified. if (runtimeInitialized) { moduleRtn = Module; diff --git a/src/preamble.js b/src/preamble.js index ec5dad2a59b10..ee63c96be8a17 100644 --- a/src/preamble.js +++ b/src/preamble.js @@ -55,7 +55,7 @@ var wasmModule; var ABORT = false; // set by exit() and abort(). Passed to 'onExit' handler. -// NOTE: This is also used as the process return code code in shell environments +// NOTE: This is also used as the process return code in shell environments // but only when noExitRuntime is false. var EXITSTATUS; @@ -476,7 +476,7 @@ function getBinarySync(file) { if (readBinary) { return readBinary(file); } - // Throwing a plain string here, even though it not normally adviables since + // Throwing a plain string here, even though it not normally advisable since // this gets turning into an `abort` in instantiateArrayBuffer. #if WASM_ASYNC_COMPILATION throw 'both async and sync fetching of the wasm failed'; @@ -865,7 +865,7 @@ function getWasmImports() { #if PTHREADS || WASM_WORKERS if ({{{ ENVIRONMENT_IS_WORKER_THREAD() }}}) { - // Instantiate from the module that was recieved via postMessage from + // Instantiate from the module that was received via postMessage from // the main thread. We can just use sync instantiation in the worker. #if ASSERTIONS assert(wasmModule, "wasmModule should have been received via postMessage"); diff --git a/src/pthread_esm_startup.mjs b/src/pthread_esm_startup.mjs index fe53ed6a7e5a0..ed60d5e822a90 100644 --- a/src/pthread_esm_startup.mjs +++ b/src/pthread_esm_startup.mjs @@ -6,7 +6,7 @@ // This file is used as the initial script loaded into pthread workers when // running in WASM_ESM_INTEGRATION mode. -// Tyhe point of this file is to delay the loading of the main program module +// The point of this file is to delay the loading of the main program module // until the wasm memory has been received via postMessage. #if RUNTIME_DEBUG diff --git a/src/runtime_asan.js b/src/runtime_asan.js index 952db227e8d3a..b76ca789f5bb4 100644 --- a/src/runtime_asan.js +++ b/src/runtime_asan.js @@ -5,7 +5,7 @@ */ #if !USE_ASAN -#error "should only be inclded in USE_ASAN mode" +#error "should only be included in USE_ASAN mode" #endif // C versions of asan_js_{load|store} will be used from compiled code, which have diff --git a/src/runtime_init_memory.js b/src/runtime_init_memory.js index 561dfb3adfc26..b7e7b4d233f62 100644 --- a/src/runtime_init_memory.js +++ b/src/runtime_init_memory.js @@ -6,7 +6,7 @@ // Create the wasm memory. (Note: this only applies if IMPORTED_MEMORY is defined) #if !IMPORTED_MEMORY -#error "this file should not be be included when IMPORTED_MEMORY is set" +#error "this file should not be included when IMPORTED_MEMORY is set" #endif // check for full engine support (use string 'subarray' to avoid closure compiler confusion) diff --git a/src/runtime_pthread.js b/src/runtime_pthread.js index a77b2d9bbcc38..e2e5f2375cccb 100644 --- a/src/runtime_pthread.js +++ b/src/runtime_pthread.js @@ -82,7 +82,7 @@ if (ENVIRONMENT_IS_PTHREAD) { // Use `const` here to ensure that the variable is scoped only to // that iteration, allowing safe reference from a closure. for (const handler of msgData.handlers) { - // The the main module has a handler for a certain even, but no + // If the main module has a handler for a certain event, but no // handler exists on the pthread worker, then proxy that handler // back to the main thread. if (!Module[handler] || Module[handler].proxy) { diff --git a/src/runtime_safe_heap.js b/src/runtime_safe_heap.js index 53e2469ed17e3..f497fd506a17e 100644 --- a/src/runtime_safe_heap.js +++ b/src/runtime_safe_heap.js @@ -5,7 +5,7 @@ */ #if !SAFE_HEAP -#error "should only be inclded in SAFE_HEAP mode" +#error "should only be included in SAFE_HEAP mode" #endif #if SAFE_HEAP_LOG diff --git a/src/settings.js b/src/settings.js index 99a624b1db406..fce354fe273a0 100644 --- a/src/settings.js +++ b/src/settings.js @@ -55,7 +55,7 @@ var ASSERTIONS = 1; // Building with ASSERTIONS=1 causes STACK_OVERFLOW_CHECK default to 1. // Since ASSERTIONS=1 is the default at -O0, which itself is the default // optimization level this means that this setting also effectively -// defaults 1, absent any other settings: +// defaults to 1, absent any other settings: // // - 0: Stack overflows are not checked. // - 1: Adds a security cookie at the top of the stack, which is checked at end @@ -122,7 +122,7 @@ var STACK_SIZE = 64*1024; // - emmalloc-verbose - use emmalloc with assertions + verbose logging. // - emmalloc-memvalidate-verbose - use emmalloc with assertions + heap // consistency checking + verbose logging. -// - mimalloc - a powerful mulithreaded allocator. This is recommended in +// - mimalloc - a powerful multithreaded allocator. This is recommended in // large applications that have malloc() contention, but it is // larger and uses more memory. // - none - no malloc() implementation is provided, but you must implement @@ -168,7 +168,7 @@ var ABORTING_MALLOC = true; // memory region available for dynamic allocations via `sbrk`, `malloc` and `new`. // // Unlike INITIAL_MEMORY, this setting allows the static and dynamic regions of -// your programs memory to independently grow. In most cases we recommend using +// your program's memory to independently grow. In most cases we recommend using // this setting rather than `INITIAL_MEMORY`. However, this setting does not work // for imported memories (e.g. when dynamic linking is used). // @@ -260,7 +260,7 @@ var MEMORY_GROWTH_LINEAR_STEP = -1; // [compile+link] var MEMORY64 = 0; -// Sets the initial size of the table when MAIN_MODULE or SIDE_MODULE is use +// Sets the initial size of the table when MAIN_MODULE or SIDE_MODULE is used // (and not otherwise). Normally Emscripten can determine the size of the table // at link time, but in SPLIT_MODULE mode, wasm-split often needs to grow the // table, so the table size baked into the JS for the instrumented build will be @@ -322,7 +322,7 @@ var DECLARE_ASM_MODULE_EXPORTS = true; // [compile] var INLINING_LIMIT = false; -// If set to 1, perform acorn pass that converts each HEAP access into a +// If set to 1, perform an acorn pass that converts each HEAP access into a // function call that uses DataView to enforce LE byte order for HEAP buffer; // This makes generated JavaScript run on BE as well as LE machines. (If 0, only // LE systems are supported). Does not affect generated wasm. @@ -351,8 +351,8 @@ var SAFE_HEAP_LOG = false; // sent value to memory and loaded the received type from the same memory (using // truncs/extends/ reinterprets). This means that when types do not match the // emulated values may not match (this is true of native too, for that matter - -// this is all undefined behavior). This approaches appears good enough to -// support Python (the original motiviation for this feature) and Glib (the +// this is all undefined behavior). This approach appears good enough to +// support Python (the original motivation for this feature) and Glib (the // continued motivation). // [link] var EMULATE_FUNCTION_POINTER_CASTS = false; @@ -394,16 +394,16 @@ var FS_DEBUG = false; // As well as being configurable at compile time via the "-s" option the // WEBSOCKET_URL and WEBSOCKET_SUBPROTOCOL -// settings may configured at run time via the Module object e.g. +// settings may be configured at run time via the Module object e.g. // Module['websocket'] = {subprotocol: 'base64, binary, text'}; // Module['websocket'] = {url: 'wss://', subprotocol: 'base64'}; -// You can set 'subprotocol' to null, if you don't want to specify it +// You can set 'subprotocol' to null, if you don't want to specify it. // Run time configuration may be useful as it lets an application select // multiple different services. // [link] var SOCKET_WEBRTC = false; -// A string containing either a WebSocket URL prefix (ws:// or wss://) or a' +// A string containing either a WebSocket URL prefix (ws:// or wss://) or a // complete RFC 6455 URL - "ws[s]:" "//" host [ ":" port ] path [ "?" query ]. // In the (default) case of only a prefix being specified the URL will be // constructed from prefix + addr + ':' + port @@ -473,7 +473,7 @@ var FULL_ES2 = false; // [link] var GL_EMULATE_GLES_VERSION_STRING_FORMAT = true; -// If true, all GL extensions are advertised in both unprefixed WebGL extension +// If true, all GL extensions are advertised in unprefixed WebGL extension // format, but also in desktop/mobile GLES/GL extension format with ``GL_`` // prefix. // [link] @@ -553,7 +553,7 @@ var MAX_WEBGL_VERSION = 1; // applications that use WebGL 1/GLES 2 can initialize a WebGL 2/GLES3 context, // but still keep using WebGL1/GLES 2 functionality that no longer is supported // in WebGL2/GLES3. Currently this emulates GL_EXT_shader_texture_lod extension -// in GLSLES 1.00 shaders, support for unsized internal texture formats, and the +// in GLSL ES 1.00 shaders, support for unsized internal texture formats, and the // GL_HALF_FLOAT_OES != GL_HALF_FLOAT mixup. // [link] var WEBGL2_BACKWARDS_COMPATIBILITY_EMULATION = false; @@ -640,9 +640,9 @@ var POLYFILL_OLD_MATH_FUNCTIONS = false; var LEGACY_VM_SUPPORT = false; // Specify which runtime environments the JS output will be capable of running -// in. For maximum portability this can configured to support all environments -// or it can be limited to reduce overall code size. The supported environments -// are: +// in. For maximum portability this can be configured to support all +// environments or it can be limited to reduce overall code size. The supported +// environments are: // // - 'web' - the normal web environment. // - 'webview' - just like web, but in a webview like Cordova; considered to be @@ -691,7 +691,7 @@ var ENVIRONMENT = ['web', 'webview', 'worker', 'node']; var LZ4 = false; // Emscripten (JavaScript-based) exception handling options. -// The three relatated settings (:ref:`DISABLE_EXCEPTION_CATCHING`, +// The three related settings (:ref:`DISABLE_EXCEPTION_CATCHING`, // :ref:`EXCEPTION_CATCHING_ALLOWED`, and :ref:`DISABLE_EXCEPTION_THROWING`) // only pertain to JavaScript-based exception handling and do not control the // native Wasm exception handling option (``-fwasm-exceptions``) @@ -801,12 +801,12 @@ var WASM_LEGACY_EXCEPTIONS = true; // [link] var NODEJS_CATCH_EXIT = false; -// Catch unhandled rejections in node. This only effect versions of node older +// Catch unhandled rejections in node. This only affects versions of node older // than 15. Without this, old version node will print a warning, but exit // with a zero return code. With this setting enabled, we handle any unhandled -// rejection and throw an exception, which will cause the process exit +// rejection and throw an exception, which will cause the process to exit // immediately with a non-0 return code. -// This not needed in Node 15+ so this setting will default to false if +// This is not needed in Node 15+ so this setting will default to false if // MIN_NODE_VERSION is 150000 or above. // [link] var NODEJS_CATCH_REJECTION = true; @@ -932,7 +932,7 @@ var ASYNCIFY_EXPORTS = []; // Use VM support for the JavaScript Promise Integration proposal. This allows // async operations to happen without the overhead of modifying the wasm. This -// is experimental atm while spec discussion is ongoing, see +// is experimental at the moment while spec discussion is ongoing, see // https://github.com/WebAssembly/js-promise-integration/ TODO: document which // of the following flags are still relevant in this mode (e.g. IGNORE_INDIRECT // etc. are not needed) @@ -978,8 +978,8 @@ var EXPORTED_RUNTIME_METHODS = []; // preRun: [() => console.log('pre run')] // }; // -// Then MODULE_JS_API must contain 'print' and 'preRun'; if it does not then -// we may not emit code to read and use that value. In other words, this +// Then INCOMING_MODULE_JS_API must contain 'print' and 'preRun'; if it does not +// then we may not emit code to read and use that value. In other words, this // option lets you set, statically at compile time, the list of which Module // JS values you will be providing at runtime, so the compiler can better // optimize. @@ -1006,7 +1006,7 @@ var INCOMING_MODULE_JS_API = [ 'stdin', 'stdout', 'thisProgram', 'wasm', 'wasmBinary', 'websocket' ]; -// If set to nonzero, the provided virtual filesystem if treated +// If set to nonzero, the provided virtual filesystem is treated // case-insensitive, like Windows and macOS do. If set to 0, the VFS is // case-sensitive, like on Linux. // [link] @@ -1225,7 +1225,7 @@ var STRICT_JS = false; // (and don't want to mess with the existing buildsystem), and functions might // be implemented later on, say in --pre-js, so you may want to build with -s // WARN_ON_UNDEFINED_SYMBOLS=0 to disable the warnings if they annoy you. See -// also ERROR_ON_UNDEFINED_SYMBOLS. Any undefined symbols that are listed in- +// also ERROR_ON_UNDEFINED_SYMBOLS. Any undefined symbols that are listed in // EXPORTED_FUNCTIONS will also be reported. // [link] var WARN_ON_UNDEFINED_SYMBOLS = true; @@ -1449,7 +1449,7 @@ var STANDALONE_WASM = false; // [link] var BINARYEN_IGNORE_IMPLICIT_TRAPS = false; -// A comma-separated list of extra passes to run in the binaryen optimizer, +// A comma-separated list of extra passes to run in the binaryen optimizer. // Setting this does not override/replace the default passes. It is appended at // the end of the list of passes. // [link] @@ -1918,7 +1918,7 @@ var AUTO_NATIVE_LIBRARIES = true; // Specifies the oldest major version of Firefox to target. I.e. all Firefox // versions >= MIN_FIREFOX_VERSION // are desired to work. Pass -sMIN_FIREFOX_VERSION=majorVersion to drop support -// for Firefox versions older than < majorVersion. +// for Firefox versions older than majorVersion. // Firefox 79 was released on 2020-07-28. // MAX_INT (0x7FFFFFFF, or -1) specifies that target is not supported. // Minimum supported value is 68 which was released on 2019-07-09 (see @@ -1955,7 +1955,7 @@ var MIN_SAFARI_VERSION = 150000; var MIN_CHROME_VERSION = 85; // Specifies minimum node version to target for the generated code. This is -// distinct from the minimum version required run the emscripten compiler. +// distinct from the minimum version required to run the emscripten compiler. // Version is encoded in MMmmVV, e.g. 181401 denotes Node 18.14.01. // Minimum supported value is 122209, which was released 2022-01-11 (see // feature_matrix.py). This version aligns with the Ubuntu TLS 22.04 (Jammy). @@ -2032,11 +2032,11 @@ var DISABLE_DEPRECATED_FIND_EVENT_TARGET_BEHAVIOR = true; // Certain browser DOM API operations, such as requesting fullscreen mode // transition or pointer lock require that the request originates from within -// an user initiated event, such as mouse click or keyboard press. Refactoring +// a user initiated event, such as mouse click or keyboard press. Refactoring // an application to follow this kind of program structure can be difficult, so // HTML5_SUPPORT_DEFERRING_USER_SENSITIVE_REQUESTS allows transparent emulation // of this by deferring such requests until a suitable event callback is -// generated. Set this to 0 to disable support for deferring to on save code +// generated. Set this to 0 to disable support for deferring to save code // size if your application does not need support for deferred calls. // [link] var HTML5_SUPPORT_DEFERRING_USER_SENSITIVE_REQUESTS = true; @@ -2067,9 +2067,9 @@ var ASAN_SHADOW_SIZE = -1; // [link] var SOURCE_MAP_PREFIXES = []; -// Default to c++ mode even when run as ``emcc`` rather then ``emc++``. -// When this is disabled ``em++`` is required linking C++ programs. Disabling -// this will match the behaviour of gcc/g++ and clang/clang++. +// Default to c++ mode even when run as ``emcc`` rather than ``emc++``. +// When this is disabled ``em++`` is required when linking C++ programs. +// Disabling this will match the behaviour of gcc/g++ and clang/clang++. // [link] var DEFAULT_TO_CXX = true; @@ -2101,7 +2101,7 @@ var SEPARATE_DWARF_URL = ''; // - Lowering sign-extension operation when targeting older browsers. var ERROR_ON_WASM_CHANGES_AFTER_LINK = false; -// Abort on unhandled excptions that occur when calling exported WebAssembly +// Abort on unhandled exceptions that occur when calling exported WebAssembly // functions. This makes the program behave more like a native program where the // OS would terminate the process and no further code can be executed when an // unhandled exception (e.g. out-of-bounds memory access) happens. @@ -2114,7 +2114,7 @@ var ERROR_ON_WASM_CHANGES_AFTER_LINK = false; // want Emscripten to handle unhandled exceptions nicely at the cost of a few // bytes extra. // Exceptions that occur within the ``main`` function are already handled via an -// alternative mechanimsm. +// alternative mechanism. // [link] var ABORT_ON_WASM_EXCEPTIONS = false; @@ -2142,13 +2142,13 @@ var PURE_WASI = false; // [link] var IMPORTED_MEMORY = false; -// Generate code to loading split wasm modules. +// Generate code to load split wasm modules. // This option will automatically generate two wasm files as output, one // with the ``.orig`` suffix and one without. The default file (without -// the suffix) when run will generate instrumentation data can later be +// the suffix) when run will generate instrumentation data that can later be // fed into wasm-split (the binaryen tool). -// As well as this the generated JS code will contains helper functions -// to loading split modules. +// As well as this the generated JS code will contain helper functions +// to load split modules. // [link] // [experimental] var SPLIT_MODULE = false; @@ -2256,6 +2256,6 @@ var CROSS_ORIGIN = false; // This setting changes the behaviour of the ``-shared`` flag. The default // setting of ``true`` means the ``-shared`` flag actually produces a normal // object file (i.e. ``ld -r``). Setting this to false will cause ``-shared`` -// to behave like :ref:`SIDE_MODULE` and produce and dynamically linked +// to behave like :ref:`SIDE_MODULE` and produce a dynamically linked // library. var FAKE_DYLIBS = true; diff --git a/src/settings_internal.js b/src/settings_internal.js index 9f1f8ca63b5a5..e656c83fd455f 100644 --- a/src/settings_internal.js +++ b/src/settings_internal.js @@ -115,7 +115,7 @@ var DEBUG_LEVEL = 0; // This will contain the shrink level (1 or 2 for -Os or -Oz, or just 0). var SHRINK_LEVEL = 0; -// Whether or not to emit the name section in the final wasm binaryen. +// Whether or not to emit the name section in the final wasm binary. var EMIT_NAME_SECTION = false; // Whether we are emitting a symbol map. @@ -191,7 +191,7 @@ var MEMORYPROFILER = false; // Set automatically to : // - 1 when using `-gsource-map` -// - 2 when using `gsource-map=inline` (embed sources content in souce map) +// - 2 when using `gsource-map=inline` (embed sources content in source map) var GENERATE_SOURCE_MAP = 0; var GENERATE_DWARF = false; @@ -227,7 +227,7 @@ var CLOSURE_ARGS = []; // set of JavaScript features. This triggers transpilation using babel. var TRANSPILE = false; -// A copy of the default the default INCOMING_MODULE_JS_API. (Soon to +// A copy of the default INCOMING_MODULE_JS_API. (Soon to // include additional items). var ALL_INCOMING_MODULE_JS_API = []; @@ -256,7 +256,7 @@ var WARN_DEPRECATED = true; // WebGL 2 provides new garbage-free entry points to call to WebGL. Use // those always when possible. -// We currently set this to false for certain browser when large memory sizes +// We currently set this to false for certain browsers when large memory sizes // (2gb+ or 4gb+) are used var WEBGL_USE_GARBAGE_FREE_APIS = false; diff --git a/src/shell.js b/src/shell.js index d96d1c47599cf..58b5b7108ffc7 100644 --- a/src/shell.js +++ b/src/shell.js @@ -32,7 +32,7 @@ var Module = moduleArg; #elif USE_CLOSURE_COMPILER /** @type{Object} */ var Module; -// if (!Module)` is crucial for Closure Compiler here as it will otherwise replace every `Module` occurrence with a string +// if (!Module) is crucial for Closure Compiler here as it will otherwise replace every `Module` occurrence with a string if (!Module) /** @suppress{checkTypes}*/Module = {"__EMSCRIPTEN_PRIVATE_MODULE_EXPORT_NAME_SUBSTITUTION__":1}; #elif ENVIRONMENT_MAY_BE_AUDIO_WORKLET var Module = globalThis.Module || (typeof {{{ EXPORT_NAME }}} != 'undefined' ? {{{ EXPORT_NAME }}} : {}); diff --git a/src/shell_minimal.js b/src/shell_minimal.js index 3e87242b615ed..f4957cafbc38c 100644 --- a/src/shell_minimal.js +++ b/src/shell_minimal.js @@ -11,7 +11,7 @@ var Module = moduleArg; #elif USE_CLOSURE_COMPILER /** @type{Object} */ var Module; -// if (!Module)` is crucial for Closure Compiler here as it will +// if (!Module) is crucial for Closure Compiler here as it will // otherwise replace every `Module` occurrence with the object below if (!Module) /** @suppress{checkTypes}*/Module = #if AUDIO_WORKLET diff --git a/src/threadprofiler.js b/src/threadprofiler.js index e4684aef5e69f..2b635e4468b5e 100644 --- a/src/threadprofiler.js +++ b/src/threadprofiler.js @@ -48,7 +48,7 @@ var emscriptenThreadProfiler = { if (threadName) { threadName = `"${threadName}" (${ptrToString(threadPtr)})`; } else { - threadName = `(${ptrToString(threadPtr)}})`; + threadName = `(${ptrToString(threadPtr)})`; } console.log(`Thread ${threadName} now: ${PThread.threadStatusAsString(threadPtr)}. `); diff --git a/src/wasm_worker.js b/src/wasm_worker.js index 251e4e0da2453..e18a28b95c8ac 100644 --- a/src/wasm_worker.js +++ b/src/wasm_worker.js @@ -1,7 +1,7 @@ var wwParams; /** - * Called once the intiial message has been recieved from the creating thread. + * Called once the initial message has been received from the creating thread. * The `props` object is property bag sent via postMessage to create the worker. * * This function is called both in normal wasm workers and in audio worklets. @@ -28,7 +28,7 @@ function startWasmWorker(props) { #endif // Drop now unneeded references to from the Module object in this Worker, // these are not needed anymore. - props.wasm = props.memMemory = 0; + props.wasm = props.wasmMemory = 0; } #if AUDIO_WORKLET diff --git a/system/include/emscripten/bind.h b/system/include/emscripten/bind.h index ad5d836a886fb..f8a12af789023 100644 --- a/system/include/emscripten/bind.h +++ b/system/include/emscripten/bind.h @@ -274,7 +274,7 @@ void _embind_register_bindings(struct InitFunc* f); // to avoid static constructor ordering issues. struct InitFunc { InitFunc(void (*init_func)()) : init_func(init_func) { - // This the function immediately upon constructions, and also register + // This calls the function immediately upon construction, and also registers // it so that it can be called again on each worker that starts. init_func(); _embind_register_bindings(this); @@ -1703,8 +1703,8 @@ class class_ { auto ster = &SP::template set; typename WithPolicies::template ArgTypeList returnType; - // XXX: This currently applies all the polices (including return value polices) to the - // setter function argument to allow pointers. Using return value polices doesn't really + // XXX: This currently applies all the policies (including return value policies) to the + // setter function argument to allow pointers. Using return value policies doesn't really // make sense on an argument, but we don't have separate argument policies yet. typename WithPolicies::template ArgTypeList argType; diff --git a/system/include/emscripten/console.h b/system/include/emscripten/console.h index ec46b19f773f9..9cffba3af2b59 100644 --- a/system/include/emscripten/console.h +++ b/system/include/emscripten/console.h @@ -11,7 +11,7 @@ extern "C" { #endif -// Write directly JavaScript console. This can be useful for debugging since it +// Write directly to the JavaScript console. This can be useful for debugging since it // bypasses the stdio and filesystem sub-systems. void emscripten_console_log(const char *utf8String __attribute__((nonnull))); void emscripten_console_warn(const char *utf8String __attribute__((nonnull))); @@ -19,7 +19,7 @@ void emscripten_console_error(const char *utf8String __attribute__((nonnull))); void emscripten_console_trace(const char *utf8String __attribute__((nonnull))); // Write to the out(), err() and dbg() JS functions directly. -// These are defined an defined in shell.js and have different behavior compared +// These are defined in shell.js and have different behavior compared // to console.log/err. Under node, they write to stdout and stderr which is a // more direct way to write output especially from worker threads. The default // behavior of these functions can be overridden by print and printErr, if diff --git a/system/include/emscripten/em_asm.h b/system/include/emscripten/em_asm.h index 8e8779b96dae0..c682c783a964a 100644 --- a/system/include/emscripten/em_asm.h +++ b/system/include/emscripten/em_asm.h @@ -42,7 +42,7 @@ void emscripten_asm_const_async_on_main_thread( } #endif // __cplusplus -// EM_ASM does not work strict C mode. +// EM_ASM does not work in strict C mode. #if !defined(__cplusplus) && defined(__STRICT_ANSI__) #define EM_ASM_ERROR _Pragma("GCC error(\"EM_ASM does not work in -std=c* modes, use -std=gnu* modes instead\")") @@ -145,7 +145,7 @@ void emscripten_asm_const_async_on_main_thread( // incorrectly). So we can use a template class instead to build a temporary // buffer of characters. -// As emscripten is require to build successfully with -std=c++03, we cannot +// As emscripten is required to build successfully with -std=c++03, we cannot // use std::tuple or std::integral_constant. Using C++11 features is only a // warning in modern Clang, which are ignored in system headers. template struct __em_asm_sig {}; diff --git a/system/include/emscripten/em_js.h b/system/include/emscripten/em_js.h index 3d51e29e37514..bb3527cb55d5a 100644 --- a/system/include/emscripten/em_js.h +++ b/system/include/emscripten/em_js.h @@ -75,7 +75,7 @@ // Normally macros like `true` and `false` are not expanded inside -// of `EM_JS` or `EM_ASM` blocks. However, in the case then an +// of `EM_JS` or `EM_ASM` blocks. However, in the case when an // additional macro later is added these will be expanded and we want // to make sure the resulting expansion doesn't break the expectations // of JS code diff --git a/system/include/emscripten/em_macros.h b/system/include/emscripten/em_macros.h index 109a9df23943f..70b8a1d7a37d3 100644 --- a/system/include/emscripten/em_macros.h +++ b/system/include/emscripten/em_macros.h @@ -25,7 +25,7 @@ /* * EM_JS_DEPS: Use this macro to declare indirect dependencies on JS symbols. - * The first argument is just unique name for the set of dependencies. The + * The first argument is just a unique name for the set of dependencies. The * second argument is a C string that lists JS library symbols in the same way * they would be specified in the DEFAULT_LIBRARY_FUNCS_TO_INCLUDE command line * setting. diff --git a/system/include/emscripten/emscripten.h b/system/include/emscripten/emscripten.h index b176da1e081a2..f364c1420fd8d 100644 --- a/system/include/emscripten/emscripten.h +++ b/system/include/emscripten/emscripten.h @@ -173,7 +173,7 @@ typedef void (*em_dlopen_callback)(void* user_data, void* handle); void emscripten_dlopen(const char *filename, int flags, void* user_data, em_dlopen_callback onsuccess, em_arg_callback_func onerror); // Promisified version of emscripten_dlopen -// The returned promise will resolve once the dso has been loaded. Its up to +// The returned promise will resolve once the dso has been loaded. It's up to // the caller to call emscripten_promise_destroy on this promise. em_promise_t emscripten_dlopen_promise(const char *filename, int flags); diff --git a/system/include/emscripten/heap.h b/system/include/emscripten/heap.h index 26041d6be2be2..2456fb09bd486 100644 --- a/system/include/emscripten/heap.h +++ b/system/include/emscripten/heap.h @@ -42,7 +42,7 @@ size_t emscripten_get_heap_size(void); size_t emscripten_get_heap_max(void); // Direct access to the system allocator. Use these to access that underlying -// allocator when intercepting/wrapping the allocator API. Works with with both +// allocator when intercepting/wrapping the allocator API. Works with both // dlmalloc and emmalloc. void *emscripten_builtin_memalign(size_t alignment, size_t size); void *emscripten_builtin_malloc(size_t size); diff --git a/system/include/emscripten/html5_webgl.h b/system/include/emscripten/html5_webgl.h index 4cfbe7ff6cea6..d7934850f75f8 100644 --- a/system/include/emscripten/html5_webgl.h +++ b/system/include/emscripten/html5_webgl.h @@ -164,7 +164,7 @@ int emscripten_webgl_get_vertex_attrib_v(int index, GLenum param, void *dst __at double emscripten_webgl_get_uniform_d(GLint program, int location); // Calls GLctx.getUniform(): -// Gets an array set to an uniform in a program in the given location. +// Gets an array set to a uniform in a program in the given location. // Call this function only for array uniform types. (vec2, ivec2 and so on) // Use dstType to specify whether to read in ints or floats. // The function writes at most dstLength array elements to array dst. diff --git a/system/include/emscripten/proxying.h b/system/include/emscripten/proxying.h index 5a082000e6d32..1734821c3d306 100644 --- a/system/include/emscripten/proxying.h +++ b/system/include/emscripten/proxying.h @@ -79,7 +79,7 @@ int emscripten_proxy_sync_with_ctx(em_proxying_queue* q, // Enqueue `func` on the given queue and thread. Once (and if) it finishes // executing, it will asynchronously proxy `callback` back to the current thread // on the same queue, or if the target thread dies before the work can be -// completed, `cancel` will be proxied back instead. All three function will +// completed, `cancel` will be proxied back instead. All three functions will // receive the same argument, `arg`. Returns 1 if `func` was successfully // enqueued and the target thread notified or 0 otherwise. int emscripten_proxy_callback(em_proxying_queue* q, @@ -93,7 +93,7 @@ int emscripten_proxy_callback(em_proxying_queue* q, // task by calling `emscripten_proxy_finish` on the given `em_proxying_ctx`, it // will asynchronously proxy `callback` back to the current thread on the same // queue, or if the target thread dies before the work can be completed, -// `cancel` will be proxied back instead. All three function will receive the +// `cancel` will be proxied back instead. All three functions will receive the // same argument, `arg`. Returns 1 if `func` was successfully enqueued and the // target thread notified or 0 otherwise. int emscripten_proxy_callback_with_ctx(em_proxying_queue* q, diff --git a/system/include/emscripten/val.h b/system/include/emscripten/val.h index d7fd17b1844fc..c4e8deaddb419 100644 --- a/system/include/emscripten/val.h +++ b/system/include/emscripten/val.h @@ -291,7 +291,7 @@ class EMBIND_VISIBILITY_DEFAULT val { val view{ typed_memory_view(std::distance(begin, end), std::to_address(begin)) }; return val(internal::_emval_new_array_from_memory_view(view.as_handle())); } - // For numeric arrays, following codes are unreachable and the compiler + // For numeric arrays, the following code is unreachable and the compiler // will do 'dead code elimination'. // Others fallback old way. #endif @@ -795,13 +795,13 @@ struct BindingType::value && !std::is_const::value>::type> { typedef EM_VAL WireType; - // Marshall to JS with move semantics when we can invalidate the temporary val + // Marshal to JS with move semantics when we can invalidate the temporary val // object. static WireType toWireType(val&& v, rvp::default_tag) { return v.release_ownership(); } - // Marshal to JS with copy semantics when we cannot transfer the val objects + // Marshal to JS with copy semantics when we cannot transfer the val object's // reference count. static WireType toWireType(const val& v, rvp::default_tag) { EM_VAL handle = v.as_handle(); diff --git a/system/include/emscripten/wasm_worker.h b/system/include/emscripten/wasm_worker.h index c983e705615eb..edde682f85d4b 100644 --- a/system/include/emscripten/wasm_worker.h +++ b/system/include/emscripten/wasm_worker.h @@ -189,7 +189,7 @@ void emscripten_lock_busyspin_waitinf_acquire(emscripten_lock_t *lock __attribut // NOTE 2: This function will always acquire the lock asynchronously. That is, // the lock will only be attempted to acquire after current control flow // yields back to the browser, so that the Wasm call stack is empty. -// This is to guarantee an uniform control flow. If you use this API in +// This is to guarantee a uniform control flow. If you use this API in // a Worker, you cannot utilise an infinite loop programming model. void emscripten_lock_async_acquire(emscripten_lock_t *lock __attribute__((nonnull)), emscripten_async_wait_volatile_callback_t asyncWaitFinished __attribute__((nonnull)), diff --git a/system/include/wasi/api.h b/system/include/wasi/api.h index f3bb425f6c41a..17542122556b3 100644 --- a/system/include/wasi/api.h +++ b/system/include/wasi/api.h @@ -1272,7 +1272,7 @@ _Static_assert(offsetof(__wasi_subscription_clock_t, precision) == 16, "witx cal _Static_assert(offsetof(__wasi_subscription_clock_t, flags) == 24, "witx calculated offset"); /** - * The contents of a $subscription when type is type is + * The contents of a $subscription when type is * `eventtype::fd_read` or `eventtype::fd_write`. */ typedef struct __wasi_subscription_fd_readwrite_t { @@ -2408,7 +2408,7 @@ __wasi_errno_t __wasi_path_open( */ __wasi_rights_t fs_rights_base, - __wasi_rights_t fs_rights_inherting, + __wasi_rights_t fs_rights_inheriting, __wasi_fdflags_t fdflags, diff --git a/system/include/webgl/webgl2_ext.h b/system/include/webgl/webgl2_ext.h index 9f24cb39ac439..d4208d7efb4e2 100644 --- a/system/include/webgl/webgl2_ext.h +++ b/system/include/webgl/webgl2_ext.h @@ -67,7 +67,7 @@ WEBGL_APICALL void GL_APIENTRY glMultiDrawElementsInstancedBaseVertexBaseInstanc const GLvoid* const* offsets __attribute__((nonnull)), const GLsizei* instanceCounts __attribute__((nonnull)), const GLint* baseVertices __attribute__((nonnull)), - const GLuint* baseinstances __attribute__((nonnull)), + const GLuint* baseInstances __attribute__((nonnull)), GLsizei drawCount); #endif /* EMSCRIPTEN_GL_WEBGL_multi_draw_instanced_base_vertex_base_instance */ \ No newline at end of file diff --git a/system/lib/README.md b/system/lib/README.md index 9075e73c2ba6b..c33a65e48a145 100644 --- a/system/lib/README.md +++ b/system/lib/README.md @@ -1,4 +1,4 @@ -Source code for C/C++ system libaries +Source code for C/C++ system libraries ===================================== This directory contains the source code for libc, libc++ and other C/C++ system diff --git a/system/lib/compiler-rt/__c_longjmp.S b/system/lib/compiler-rt/__c_longjmp.S index 6ee12aa011c11..1db71eb590567 100644 --- a/system/lib/compiler-rt/__c_longjmp.S +++ b/system/lib/compiler-rt/__c_longjmp.S @@ -4,7 +4,7 @@ * University of Illinois/NCSA Open Source License. Both these licenses can be * found in the LICENSE file. * - * Define the `__c_longjmp` Wasm EH tag which is used to implment setjmp/longjmp + * Define the `__c_longjmp` Wasm EH tag which is used to implement setjmp/longjmp * in LLVM. */ diff --git a/system/lib/compiler-rt/emscripten_setjmp.c b/system/lib/compiler-rt/emscripten_setjmp.c index 984feeb66cca0..f8544c2dd9d36 100644 --- a/system/lib/compiler-rt/emscripten_setjmp.c +++ b/system/lib/compiler-rt/emscripten_setjmp.c @@ -54,7 +54,7 @@ uint32_t __wasm_setjmp_test(void* env, void* func_invocation_id) { #define C_LONGJMP 1 // Wasm EH allows us to throw and catch multiple values, but that requires -// multivalue support in the toolchain, whch is not reliable at the time. +// multivalue support in the toolchain, which is not reliable at the time. // TODO Consider switching to throwing two values at the same time later. void __wasm_longjmp(void* env, int val) { struct jmp_buf_impl* jb = env; diff --git a/system/lib/compiler-rt/lib/lsan/lsan_common_emscripten.cpp b/system/lib/compiler-rt/lib/lsan/lsan_common_emscripten.cpp index 46bfedb9b519b..8dae57970d363 100644 --- a/system/lib/compiler-rt/lib/lsan/lsan_common_emscripten.cpp +++ b/system/lib/compiler-rt/lib/lsan/lsan_common_emscripten.cpp @@ -139,7 +139,7 @@ static void ProcessThreadsCallback(ThreadContextBase *tctx, void *arg) { LOG_THREADS("Stack at %p-%p.\n", (void*)stack_begin, (void*)stack_end); // We can't get the SP for other threads to narrow down the range, but we - // we can for the current thread. + // can for the current thread. if (tctx->os_id == GetTid()) { uptr sp = (uptr) __builtin_frame_address(0); if (sp < stack_begin || sp >= stack_end) { diff --git a/system/lib/compiler-rt/lib/sanitizer_common/sanitizer_emscripten.cpp b/system/lib/compiler-rt/lib/sanitizer_common/sanitizer_emscripten.cpp index 29f77b86eb554..9481f6a6fe77e 100644 --- a/system/lib/compiler-rt/lib/sanitizer_common/sanitizer_emscripten.cpp +++ b/system/lib/compiler-rt/lib/sanitizer_common/sanitizer_emscripten.cpp @@ -48,7 +48,7 @@ void ListOfModules::init() { // Emscripten represents program counters as offsets into WebAssembly // modules. For JavaScript code, the "program counter" is the line number // of the JavaScript code with the high bit set. - // Therefore, PC values 0x80000000 and beyond represents JavaScript code. + // Therefore, PC values 0x80000000 and beyond represent JavaScript code. // As a result, 0x00000000 to 0x7FFFFFFF represents PC values for WASM code. // We consider WASM code as main_module. main_module.addAddressRange(0, 0x7FFFFFFF, /*executable*/ true, diff --git a/system/lib/compiler-rt/readme.txt b/system/lib/compiler-rt/readme.txt index 3b2ae2c04f48f..b8d907f7d8998 100644 --- a/system/lib/compiler-rt/readme.txt +++ b/system/lib/compiler-rt/readme.txt @@ -1,9 +1,9 @@ -llvm's compiler-rt +LLVM's compiler-rt ------------------ These files are from the llvm-project based on release 20.1.8. -We maintain a local fork of llvm-project that contains any emscripten +We maintain a local fork of llvm-project that contains any Emscripten specific patches: https://github.com/emscripten-core/llvm-project diff --git a/system/lib/compiler-rt/stack_limits.S b/system/lib/compiler-rt/stack_limits.S index a1c69ff6e2d20..cc12e513a5d95 100644 --- a/system/lib/compiler-rt/stack_limits.S +++ b/system/lib/compiler-rt/stack_limits.S @@ -18,7 +18,7 @@ .section .globals,"",@ -# TODO(sbc): It would be nice if these we initialized directly +# TODO(sbc): It would be nice if these were initialized directly # using PTR.const rather than using the `emscripten_stack_init` .globaltype __stack_end, PTR __stack_end: @@ -43,7 +43,7 @@ emscripten_stack_init: # emscripten_stack_get_base, or emscripten_stack_get_free are called .functype emscripten_stack_init () -> () - # What llvm calls __stack_high is the high address from where is grows + # What llvm calls __stack_high is the high address from where it grows # downwards. We call this the stack base here in emscripten. #ifdef __PIC__ global.get __stack_high@GOT diff --git a/system/lib/dlmalloc.c b/system/lib/dlmalloc.c index 7dc91503f1bec..eb2f17547c541 100644 --- a/system/lib/dlmalloc.c +++ b/system/lib/dlmalloc.c @@ -802,7 +802,7 @@ defined(__i386__) || defined(__x86_64__))) || \ statistics. It should work on any system that has a /usr/include/malloc.h defining struct mallinfo. The main declaration needed is the mallinfo struct that is returned (by-copy) - by mallinfo(). The malloinfo struct contains a bunch of fields that + by mallinfo(). The mallinfo struct contains a bunch of fields that are not even meaningful in this version of malloc. These fields are are instead filled by mallinfo() with other numbers that might be of interest. @@ -1228,7 +1228,7 @@ size_t bulk_free(void**, size_t n_elements) __attribute__((weak, alias("dlbulk_f Each element must be freed when it is no longer needed. This can be done all at once using bulk_free. - independent_comallac differs from independent_calloc in that each + independent_comalloc differs from independent_calloc in that each element may have a different size, and also that it does not automatically clear elements. @@ -1759,7 +1759,7 @@ static FORCEINLINE void* win32direct_mmap(size_t size) { return (ptr != 0)? ptr: MFAIL; } -/* This function supports releasing coalesed segments */ +/* This function supports releasing coalesced segments */ static FORCEINLINE int win32munmap(void* ptr, size_t size) { MEMORY_BASIC_INFORMATION minfo; char* cptr = (char*)ptr; @@ -1847,7 +1847,7 @@ static FORCEINLINE int win32munmap(void* ptr, size_t size) { #define CALL_MREMAP(addr, osz, nsz, mv) MFAIL #endif /* HAVE_MMAP && HAVE_MREMAP */ -/* mstate bit set if continguous morecore disabled or failed */ +/* mstate bit set if contiguous morecore disabled or failed */ #define USE_NONCONTIGUOUS_BIT (4U) /* segment bit set in create_mspace_with_base */ @@ -1860,7 +1860,7 @@ static FORCEINLINE int win32munmap(void* ptr, size_t size) { When locks are defined, there is one global lock, plus one per-mspace lock. - The global lock_ensures that mparams.magic and other unique + The global lock ensures that mparams.magic and other unique mparams values are initialized only once. It also protects sequences of calls to MORECORE. In many cases sys_alloc requires two calls, that should not be interleaved with calls by other diff --git a/system/lib/emmalloc.c b/system/lib/emmalloc.c index 81a2499daab59..3319244fcfb8e 100644 --- a/system/lib/emmalloc.c +++ b/system/lib/emmalloc.c @@ -21,7 +21,7 @@ * amount is 8 bytes, and a multiple of 4 bytes. * - Acquired memory blocks are subdivided into disjoint regions that lie * next to each other. - * - A region is either in used or free. + * - A region is either in use or free. * Used regions may be adjacent, and a used and unused region * may be adjacent, but not two unused ones - they would be * merged. @@ -94,7 +94,7 @@ static_assert(alignof(max_align_t) == 8, "max_align_t must be correct"); // That is, at the bottom and top end of each memory region, the size of that region is stored. That allows traversing the // memory regions backwards and forwards. Because each allocation must be at least a multiple of 4 bytes, the lowest two bits of -// each size field is unused. Free regions are distinguished by used regions by having the FREE_REGION_FLAG bit present +// each size field is unused. Free regions are distinguished from used regions by having the FREE_REGION_FLAG bit present // in the size field. I.e. for free regions, the size field is odd, and for used regions, the size field reads even. #define FREE_REGION_FLAG 0x1u @@ -579,7 +579,7 @@ static void *attempt_allocate(Region *freeRegion, size_t alignment, size_t size) assert(freeRegion); // Look at the next potential free region to allocate into. // First, we should check if the free region has enough of payload bytes contained - // in it to accommodate the new allocation. This check needs to take account the + // in it to accommodate the new allocation. This check needs to take into account the // requested allocation alignment, so the payload memory area needs to be rounded // upwards to the desired alignment. uint8_t *payloadStartPtr = region_payload_start_ptr(freeRegion); @@ -643,7 +643,7 @@ static void *attempt_allocate(Region *freeRegion, size_t alignment, size_t size) } static size_t validate_alloc_alignment(size_t alignment) { - // Cannot perform allocations that are less our minimal alignment, because + // Cannot perform allocations that are less than our minimal alignment, because // the Region control structures need to be aligned themselves. return MAX(alignment, MALLOC_ALIGNMENT); } @@ -962,7 +962,7 @@ static int attempt_region_resize(Region *region, size_t size) { return 1; } } else { - // Next region is an used region - we cannot change its starting address. However if we are shrinking the + // Next region is a used region - we cannot change its starting address. However if we are shrinking the // size of this region, we can create a new free region between this and the next used region. if (size + sizeof(Region) <= region->size) { size_t freeRegionSize = region->size - size; @@ -1303,7 +1303,7 @@ static int trim_dynamic_heap_reservation(size_t pad) { MAIN_THREAD_ASYNC_EM_ASM(out('emmalloc_trim(): Shrinking ' + Number($0) + ' bytes off the free heap end region. New free heap end region size: ' + Number($1) + ' bytes.'), shrinkAmount, newRegionSize); #endif // If we can't fit a free Region in the shrunk space, we should delete the - // the last free region altogether. + // last free region altogether. if (newRegionSize >= sizeof(Region)) { create_free_region(lastActualRegion, newRegionSize); link_to_free_list(lastActualRegion); diff --git a/system/lib/gl/webgl2.c b/system/lib/gl/webgl2.c index 13fc851179a74..2d9e2d29511ee 100644 --- a/system/lib/gl/webgl2.c +++ b/system/lib/gl/webgl2.c @@ -130,7 +130,7 @@ VOID_SYNC_GL_FUNCTION_5(EM_FUNC_SIG_VIIIII, void, glGetInternalformativ, GLenum, // Extensions that are aliases for the proxying functions defined above. // Normally these aliases get defined in library_webgl.js but when building with // __EMSCRIPTEN_OFFSCREEN_FRAMEBUFFER__ we want to intercept them in native -// code and redirect them to thier proxying couterparts. +// code and redirect them to their proxying counterparts. GL_APICALL void GL_APIENTRY glVertexAttribDivisorNV(GLuint index, GLuint divisor) { glVertexAttribDivisor(index, divisor); } GL_APICALL void GL_APIENTRY glVertexAttribDivisorEXT(GLuint index, GLuint divisor) { glVertexAttribDivisor(index, divisor); } GL_APICALL void GL_APIENTRY glVertexAttribDivisorARB(GLuint index, GLuint divisor) { glVertexAttribDivisor(index, divisor); } diff --git a/system/lib/gl/webgl_internal_funcs.h b/system/lib/gl/webgl_internal_funcs.h index eececa9988f72..0033c5a1ecaff 100644 --- a/system/lib/gl/webgl_internal_funcs.h +++ b/system/lib/gl/webgl_internal_funcs.h @@ -1,6 +1,6 @@ // Functions declared here are just the ones that we don't declare in our webgl // headers. These are used by emscripten_legacy_gl_emulation_GetProcAddress -// but not delcared in the public webgl headers. +// but not declared in the public webgl headers. #include diff --git a/system/lib/html5/offscreencanvas.c b/system/lib/html5/offscreencanvas.c index 536f29e704437..e147a8a1db1b8 100644 --- a/system/lib/html5/offscreencanvas.c +++ b/system/lib/html5/offscreencanvas.c @@ -2,14 +2,14 @@ #include "emscripten_internal.h" -typedef struct set_cavas_size_t { +typedef struct set_canvas_size_t { const char* target; int width; int height; -} set_cavas_size_t; +} set_canvas_size_t; static void do_set_size(void* arg) { - set_cavas_size_t* args = (set_cavas_size_t*)arg; + set_canvas_size_t* args = (set_canvas_size_t*)arg; emscripten_set_canvas_element_size(args->target, args->width, args->height); free((char *) args->target); free(arg); @@ -20,7 +20,7 @@ void _emscripten_set_offscreencanvas_size_on_thread(pthread_t t, const char* target, int width, int height) { - set_cavas_size_t* arg = malloc(sizeof(set_cavas_size_t)); + set_canvas_size_t* arg = malloc(sizeof(set_canvas_size_t)); arg->target = target; // taking ownership: will be freed in do_set_size arg->width = width; arg->height = height; diff --git a/system/lib/libc/README.md b/system/lib/libc/README.md index 0094e8a96dfe7..4ca0bcd1d3818 100644 --- a/system/lib/libc/README.md +++ b/system/lib/libc/README.md @@ -15,5 +15,5 @@ Some changes have been made to the version that was taken from upstream, includi * Handling trailing % in `strftime` and `wcsftime` format strings. Copy log.c and log2.c from earlier version of musl which result in smaller -binary size since they do not rely data tables in log_data.c and log2_data.c. +binary size since they do not rely on data tables in log_data.c and log2_data.c. See https://github.com/emscripten-core/emscripten/issues/15483. diff --git a/system/lib/libc/compat/aligned_alloc.c b/system/lib/libc/compat/aligned_alloc.c index 0941e5ddf0024..172008d5d928f 100644 --- a/system/lib/libc/compat/aligned_alloc.c +++ b/system/lib/libc/compat/aligned_alloc.c @@ -1,7 +1,7 @@ #include // Musl has an aligned_alloc routine, but that builds on top of standard malloc(). We are using dlmalloc, so -// can route to its implementation instead. +// we can route to its implementation instead. void * weak aligned_alloc(size_t alignment, size_t size) { void *ptr; diff --git a/system/lib/libc/dynlink.c b/system/lib/libc/dynlink.c index 71d9e14b98455..cfb71746b1b35 100644 --- a/system/lib/libc/dynlink.c +++ b/system/lib/libc/dynlink.c @@ -55,7 +55,7 @@ struct dlevent { struct dlevent *next, *prev; // Symbol index resulting from dlsym call. -1 means this is a dso event. int sym_index; - // dso handler resulting fomr dleopn call. Only valid when sym_index is -1. + // dso handler resulting from dlopen call. Only valid when sym_index is -1. struct dso* dso; #ifdef DYLINK_DEBUG int id; @@ -164,7 +164,7 @@ static void load_library_done(struct dso* p) { dlsync(); #endif // TODO: figure out some way to tell when its safe to free p->file_data. Its - // not safe to do here because some threads could have been alseep then when + // not safe to do here because some threads could have been asleep then when // the "dlsync" occurred and those threads will synchronize when they wake, // which could be an arbitrarily long time in the future. } @@ -305,7 +305,7 @@ bool _emscripten_dlsync_self() { // If any on the libraries fails to load here then we give up. // TODO(sbc): Ideally this would never happen and we could/should // abort, but on the main thread (where we don't have sync xhr) its - // often not possible to syncronously load side module. + // often not possible to synchronously load side module. emscripten_errf("_dlopen_js failed: %s", dlerror()); return false; } @@ -361,7 +361,7 @@ static void thread_sync_done(void* arg) { free(info); } -// Proxying queue specically for handling code loading (dlopen) events. +// Proxying queue specially for handling code loading (dlopen) events. // Initialized by the main thread on the first call to // `_emscripten_proxy_dlsync` below, and processed by background threads // that call `_emscripten_process_dlopen_queue` during futex_wait (i.e. whenever @@ -380,7 +380,7 @@ void _emscripten_process_dlopen_queue() { // Asynchronously runs _emscripten_dlsync_self on the target then and // resolves (or rejects) the given promise once it is complete. -// This function should only ever be called my the main runtime thread which +// This function should only ever be called by the main runtime thread which // manages the worker pool. int _emscripten_proxy_dlsync_async(pthread_t target_thread, em_promise_t promise) { assert(emscripten_is_main_runtime_thread()); @@ -509,7 +509,7 @@ static int path_find(const char *name, const char *s, char *buf, size_t buf_size default: dbg("dlopen: path_find failed: %s", strerror(errno)); /* Any negative value but -1 will inhibit - * futher path search. */ + * further path search. */ return -2; } } @@ -670,7 +670,7 @@ void* __dlsym(void* restrict p, const char* restrict s, void* restrict ra) { if (p != RTLD_DEFAULT && p != RTLD_NEXT && __dl_invalid_handle(p)) { return 0; } - // The first "dso" is always the default one which is equivelent to + // The first "dso" is always the default one which is equivalent to // RTLD_DEFAULT. This is what is returned from `dlopen(NULL, ...)`. if (p == head->dso) { p = RTLD_DEFAULT; diff --git a/system/lib/libc/emscripten_internal.h b/system/lib/libc/emscripten_internal.h index f4c0751acda98..1560b9e5aac50 100644 --- a/system/lib/libc/emscripten_internal.h +++ b/system/lib/libc/emscripten_internal.h @@ -61,7 +61,7 @@ bool _emscripten_get_now_is_monotonic(void); void _emscripten_get_progname(char*, int); -// Not defined in musl, but defined in library.js. Included here to for +// Not defined in musl, but defined in library.js. Included here for // the benefit of gen_sig_info.py char* strptime_l(const char* __restrict __s, const char* __restrict __fmt, diff --git a/system/lib/libc/emscripten_syscall_stubs.c b/system/lib/libc/emscripten_syscall_stubs.c index ca7e5be6eea10..23e2135a4b650 100644 --- a/system/lib/libc/emscripten_syscall_stubs.c +++ b/system/lib/libc/emscripten_syscall_stubs.c @@ -4,7 +4,7 @@ * University of Illinois/NCSA Open Source License. Both these licenses can be * found in the LICENSE file. * - * Unimplemented/dummy syscall implementations. These fall into 3 catagories. + * Unimplemented/dummy syscall implementations. These fall into 3 categories. * * 1. Fake it, use dummy/placeholder values and return success. * 2. Fake it, as above but warn at runtime if called. diff --git a/system/lib/libc/emscripten_time.c b/system/lib/libc/emscripten_time.c index 501b83e0b9434..618f7e0984de1 100644 --- a/system/lib/libc/emscripten_time.c +++ b/system/lib/libc/emscripten_time.c @@ -30,7 +30,7 @@ weak int __gettimeofday(struct timeval *restrict tv, void *restrict tz) { double now_ms = emscripten_date_now(); long long now_s = now_ms / 1000; tv->tv_sec = now_s; // seconds - tv->tv_usec = (now_ms - (now_s * 1000)) * 1000; // nicroseconds + tv->tv_usec = (now_ms - (now_s * 1000)) * 1000; // microseconds return 0; } diff --git a/system/lib/libc/lookup_name.c b/system/lib/libc/lookup_name.c index 43bead2013505..904391b5974b9 100644 --- a/system/lib/libc/lookup_name.c +++ b/system/lib/libc/lookup_name.c @@ -8,7 +8,7 @@ int __lookup_name(struct address buf[static MAXADDRS], char canon[static 256], const char *name, int family, int flags) { /* We currently only support the callsite in gethostbyname2_r which - * passes AI_CANONNAME. Remove this assertion when if we ever expand + * passes AI_CANONNAME. Remove this assertion if we ever expand * this support. */ assert(flags == AI_CANONNAME); @@ -16,7 +16,7 @@ int __lookup_name(struct address buf[static MAXADDRS], char canon[static 256], c return EAI_SYSTEM; } - /* This hunk is a duplicated from musl/src/network/lookup_name.c */ + /* This hunk is duplicated from musl/src/network/lookup_name.c */ *canon = 0; if (name) { /* reject empty name and check len so it fits into temp bufs */ diff --git a/system/lib/libc/musl/arch/emscripten/syscall_arch.h b/system/lib/libc/musl/arch/emscripten/syscall_arch.h index ff2fb2c559fa2..33fc42a99be3b 100644 --- a/system/lib/libc/musl/arch/emscripten/syscall_arch.h +++ b/system/lib/libc/musl/arch/emscripten/syscall_arch.h @@ -90,7 +90,7 @@ int __syscall_symlinkat(intptr_t target, int newdirfd, intptr_t linkpath); int __syscall_readlinkat(int dirfd, intptr_t path, intptr_t buf, size_t bufsize); int __syscall_fchmodat2(int dirfd, intptr_t path, int mode, int flags); int __syscall_faccessat(int dirfd, intptr_t path, int amode, int flags); -int __syscall_pselect6(int nfds, intptr_t readfds, intptr_t writefds, intptr_t exceptfds, intptr_t timeout, intptr_t sigmaks); +int __syscall_pselect6(int nfds, intptr_t readfds, intptr_t writefds, intptr_t exceptfds, intptr_t timeout, intptr_t sigmask); int __syscall_utimensat(int dirfd, intptr_t path, intptr_t times, int flags); int __syscall_fallocate(int fd, int mode, off_t offset, off_t len); int __syscall_dup3(int fd, int suggestfd, int flags); @@ -102,7 +102,7 @@ int __syscall_socket(int domain, int type, int protocol, int dummy1, int dummy2, int __syscall_socketpair(int domain, int type, int protocol, intptr_t fds, int dummy, int dummy2); int __syscall_bind(int sockfd, intptr_t addr, size_t alen, int dummy, int dummy2, int dummy3); int __syscall_connect(int sockfd, intptr_t addr, size_t len, int dummy, int dummy2, int dummy3); -int __syscall_listen(int sockfd, int backlock, int dummy1, int dummy2, int dummy3, int dummy4); +int __syscall_listen(int sockfd, int backlog, int dummy1, int dummy2, int dummy3, int dummy4); int __syscall_accept4(int sockfd, intptr_t addr, intptr_t addrlen, int flags, int dummy1, int dummy2); int __syscall_getsockopt(int sockfd, int level, int optname, intptr_t optval, intptr_t optlen, int dummy); int __syscall_setsockopt(int sockfd, int level, int optname, intptr_t optval, size_t optlen, int dummy); diff --git a/system/lib/libc/sbrk.c b/system/lib/libc/sbrk.c index c370f9ec2f3d6..5f7695a4c6f1c 100644 --- a/system/lib/libc/sbrk.c +++ b/system/lib/libc/sbrk.c @@ -121,7 +121,7 @@ void *sbrk(intptr_t increment_) { int brk(void* ptr) { #ifdef __EMSCRIPTEN_SHARED_MEMORY__ // FIXME - printf("brk() is not theadsafe yet, https://github.com/emscripten-core/emscripten/issues/10006"); + printf("brk() is not threadsafe yet, https://github.com/emscripten-core/emscripten/issues/10006"); abort(); #else uintptr_t last = (uintptr_t)sbrk(0); diff --git a/system/lib/libcxx/readme.txt b/system/lib/libcxx/readme.txt index 32d1053537738..3115c33a48e43 100755 --- a/system/lib/libcxx/readme.txt +++ b/system/lib/libcxx/readme.txt @@ -1,9 +1,9 @@ -llvm's libcxx +LLVM's libcxx ------------- These files are from the llvm-project based on release 20.1.8. -We maintain a local fork of llvm-project that contains any emscripten +We maintain a local fork of llvm-project that contains any Emscripten specific patches: https://github.com/emscripten-core/llvm-project diff --git a/system/lib/libcxxabi/readme.txt b/system/lib/libcxxabi/readme.txt index ebc19a8979ece..9ded680bb31c0 100644 --- a/system/lib/libcxxabi/readme.txt +++ b/system/lib/libcxxabi/readme.txt @@ -1,9 +1,9 @@ -llvm's libcxxabi +LLVM's libcxxabi ---------------- These files are from the llvm-project based on release 20.1.8. -We maintain a local fork of llvm-project that contains any emscripten +We maintain a local fork of llvm-project that contains any Emscripten specific patches: https://github.com/emscripten-core/llvm-project diff --git a/system/lib/libcxxabi/src/cxa_exception.h b/system/lib/libcxxabi/src/cxa_exception.h index 527fc57086bac..37af57bf368db 100644 --- a/system/lib/libcxxabi/src/cxa_exception.h +++ b/system/lib/libcxxabi/src/cxa_exception.h @@ -35,7 +35,7 @@ struct _LIBCXXABI_HIDDEN __cxa_exception { void *padding; }; -static_assert(sizeof(__cxa_exception) % alignof(max_align_t) == 0, "__cxa_exception must have a size that is multipl of max alignment"); +static_assert(sizeof(__cxa_exception) % alignof(max_align_t) == 0, "__cxa_exception must have a size that is multiple of max alignment"); #else diff --git a/system/lib/libcxxabi/src/cxa_exception_emscripten.cpp b/system/lib/libcxxabi/src/cxa_exception_emscripten.cpp index 20a3ba56816c0..b251112ae9d2c 100644 --- a/system/lib/libcxxabi/src/cxa_exception_emscripten.cpp +++ b/system/lib/libcxxabi/src/cxa_exception_emscripten.cpp @@ -5,9 +5,9 @@ // // Notable changes: // __cxa_allocate_exception doesn't add get_cxa_exception_offset -// __cxa_decrement_exception_refcount dosn't call the destructor if rethrown -// Both of these changes are mirrored from the historical JS implemenation of -// thse functions. +// __cxa_decrement_exception_refcount doesn't call the destructor if rethrown +// Both of these changes are mirrored from the historical JS implementation of +// these functions. // //===----------------------------------------------------------------------===// diff --git a/system/lib/libunwind/readme.txt b/system/lib/libunwind/readme.txt index 48abd678aa6a5..9fe2331add639 100644 --- a/system/lib/libunwind/readme.txt +++ b/system/lib/libunwind/readme.txt @@ -1,9 +1,9 @@ -llvm's libunwind +LLVM's libunwind ---------------- These files are from the llvm-project based on release 20.1.8. -We maintain a local fork of llvm-project that contains any emscripten +We maintain a local fork of llvm-project that contains any Emscripten specific patches: https://github.com/emscripten-core/llvm-project diff --git a/system/lib/libunwind/src/Unwind-wasm.c b/system/lib/libunwind/src/Unwind-wasm.c index b18b32c5d1784..51c363736feaa 100644 --- a/system/lib/libunwind/src/Unwind-wasm.c +++ b/system/lib/libunwind/src/Unwind-wasm.c @@ -37,9 +37,9 @@ struct _Unwind_LandingPadContext { // function thread_local struct _Unwind_LandingPadContext __wasm_lpad_context; -/// Calls to this function is in landing pads in compiler-generated user code. +/// Calls to this function are in landing pads in compiler-generated user code. /// In other EH schemes, stack unwinding is done by libunwind library, which -/// calls the personality function for each each frame it lands. On the other +/// calls the personality function for each frame it lands. On the other /// hand, WebAssembly stack unwinding process is performed by a VM, and the /// personality function cannot be called from there. So the compiler inserts /// a call to this function in landing pads in the user code, which in turn @@ -92,7 +92,7 @@ _LIBUNWIND_EXPORT void _Unwind_SetGR(struct _Unwind_Context *context, int index, /// Called by personality handler to get instruction pointer. _LIBUNWIND_EXPORT uintptr_t _Unwind_GetIP(struct _Unwind_Context *context) { - // The result will be used as an 1-based index after decrementing 1, so we + // The result will be used as a 1-based index after decrementing 1, so we // increment 2 here uintptr_t result = ((struct _Unwind_LandingPadContext *)context)->lpad_index + 2; diff --git a/system/lib/llvm-libc/src/__support/threads/linux/thread.cpp b/system/lib/llvm-libc/src/__support/threads/linux/thread.cpp index baad26aed6851..f7f564cb8e785 100644 --- a/system/lib/llvm-libc/src/__support/threads/linux/thread.cpp +++ b/system/lib/llvm-libc/src/__support/threads/linux/thread.cpp @@ -295,7 +295,7 @@ int Thread::run(ThreadStyle style, ThreadRunner runner, void *arg, void *stack, // The clone syscall takes arguments in an architecture specific order. // Also, we want the result of the syscall to be in a register as the child // thread gets a completely different stack after it is created. The stack - // variables from this function will not be availalbe to the child thread. + // variables from this function will not be available to the child thread. #if defined(LIBC_TARGET_ARCH_IS_X86_64) long register clone_result asm(CLONE_RESULT_REGISTER); clone_result = LIBC_NAMESPACE::syscall_impl( diff --git a/system/lib/mimalloc/src/prim/emscripten/prim.c b/system/lib/mimalloc/src/prim/emscripten/prim.c index 069cdb3b57ef8..b202fe8f9f7de 100644 --- a/system/lib/mimalloc/src/prim/emscripten/prim.c +++ b/system/lib/mimalloc/src/prim/emscripten/prim.c @@ -23,7 +23,7 @@ terms of the MIT license. A copy of the license can be found in the file // so we end up either never freeing memory to the system, or we can get stuck // with holes. // -// Atm wasm generally does *not* free memory back the system: once grown, we do +// Atm wasm generally does *not* free memory back to the system: once grown, we do // not shrink back down (https://github.com/WebAssembly/design/issues/1397). // However, that is expected to improve // (https://github.com/WebAssembly/memory-control/blob/main/proposals/memory-control/Overview.md) diff --git a/system/lib/pthread/emscripten_tls_init.c b/system/lib/pthread/emscripten_tls_init.c index d7d4cefcc6704..7d1d90c15d848 100644 --- a/system/lib/pthread/emscripten_tls_init.c +++ b/system/lib/pthread/emscripten_tls_init.c @@ -26,14 +26,14 @@ extern void __wasm_init_tls(void *memory); extern int __dso_handle; -// Create a thread-local wasm global which signal that the current thread is non +// Create a thread-local wasm global which signals that the current thread is not // to use the primary/static TLS region. Once this gets set it forces that all // future calls to emscripten_tls_init to dynamically allocate TLS. // This is needed because emscripten re-uses module instances owned by the // worker for new pthreads. This in turn means that stale values of __tls_base // from a previous pthreads need to be ignored. -// If this global is true then TLS needs to be dyanically allocated, if its -// flase we are free to use the existing/global __tls_base. +// If this global is true then TLS needs to be dynamically allocated, if it's +// false we are free to use the existing/global __tls_base. __asm__(".globaltype g_needs_dynamic_alloc, i32\n" "g_needs_dynamic_alloc:\n"); diff --git a/system/lib/pthread/proxying.c b/system/lib/pthread/proxying.c index 9dec45b434e02..33c24e4967630 100644 --- a/system/lib/pthread/proxying.c +++ b/system/lib/pthread/proxying.c @@ -644,7 +644,7 @@ double _emscripten_run_js_on_main_thread(int func_index, return f.result; } - // Make a heap-heap allocated copy of the proxied_js_func_t + // Make a heap allocated copy of the proxied_js_func_t proxied_js_func_t* arg = malloc(sizeof(proxied_js_func_t)); *arg = f; arg->owned = true; diff --git a/system/lib/pthread/pthread_create.c b/system/lib/pthread/pthread_create.c index 383820b3ce677..f467131bbac2a 100644 --- a/system/lib/pthread/pthread_create.c +++ b/system/lib/pthread/pthread_create.c @@ -115,7 +115,7 @@ int __pthread_create(pthread_t* restrict res, void* (*entry)(void*), void* restrict arg) { // Note on LSAN: lsan intercepts/wraps calls to pthread_create so any - // allocation we we do here should be considered leaks. + // allocation we do here should be considered leaks. // See: lsan_interceptors.cpp. if (!res) { return EINVAL; @@ -283,7 +283,7 @@ int __pthread_create(pthread_t* restrict res, } /* - * Called from JS main thread to free data accociated a thread + * Called from JS main thread to free data associated with a thread * that is no longer running. */ void _emscripten_thread_free_data(pthread_t t) { @@ -295,7 +295,7 @@ void _emscripten_thread_free_data(pthread_t t) { } #endif - // Free all the enture thread block (called map_base because + // Free all the entire thread block (called map_base because // musl normally allocates this using mmap). This region // includes the pthread structure itself. unsigned char* block = t->map_base; diff --git a/system/lib/pthread/thread_mailbox.c b/system/lib/pthread/thread_mailbox.c index 9086b9609871c..701218e3a137b 100644 --- a/system/lib/pthread/thread_mailbox.c +++ b/system/lib/pthread/thread_mailbox.c @@ -75,7 +75,7 @@ void _emscripten_check_mailbox() { // Before we attempt to execute a request from another thread make sure we // are in sync with all the loaded code. // For example, in PROXY_TO_PTHREAD the atexit functions are called via - // a proxied call, and without this call to syncronize we would crash if + // a proxied call, and without this call to synchronize we would crash if // any atexit functions were registered from a side module. assert(pthread_self()); em_task_queue* mailbox = pthread_self()->mailbox; diff --git a/system/lib/pthread/threading_internal.h b/system/lib/pthread/threading_internal.h index eae455944d578..4ce55567241cb 100644 --- a/system/lib/pthread/threading_internal.h +++ b/system/lib/pthread/threading_internal.h @@ -37,10 +37,10 @@ typedef struct thread_profiler_block { // This function takes care of running the event queue and other housekeeping // tasks. // -// If that caller already know the current time it can pass it vai the now +// If the caller already knows the current time it can pass it via the now // argument. This can save _emscripten_check_timers from needing to call out to // JS to get the current time. Passing 0 means that caller doesn't know the -// the current time. +// current time. void _emscripten_yield(double now); void _emscripten_init_main_thread_js(void* tb); @@ -62,7 +62,7 @@ void _emscripten_thread_set_strongref(pthread_t thread); // Checks certain structural invariants. This allows us to detect when // already-freed threads are used in some APIs. Technically this is undefined // behaviour, but we have a couple of places where we add these checks so that -// we can pass more of the posixtest suite that vanilla musl. +// we can pass more of the posixtest suite than vanilla musl. int _emscripten_thread_is_valid(pthread_t thread); void _emscripten_thread_exit_joinable(pthread_t thread); diff --git a/system/lib/push_llvm_changes.py b/system/lib/push_llvm_changes.py index b0ed77ead0e0c..800555e0bda85 100755 --- a/system/lib/push_llvm_changes.py +++ b/system/lib/push_llvm_changes.py @@ -6,7 +6,7 @@ # Copy local llvm library changes into the upstream llvm tree. # This is the logical inverse of update_compiler_rt.py, update_libcxx.py -# and update_libcxxabi.py which copy changes form the upstream llvm +# and update_libcxxabi.py which copy changes from the upstream llvm # into emscripten. import glob diff --git a/system/lib/push_musl_changes.py b/system/lib/push_musl_changes.py index fcf66a6263e94..8784e1a57e2ca 100755 --- a/system/lib/push_musl_changes.py +++ b/system/lib/push_musl_changes.py @@ -6,7 +6,7 @@ # Copy local emscripten changes into the upstream musl tree. # This is the logical inverse of update_musl.py which copies changes -# form the upstream musl tree into emscripten. +# from the upstream musl tree into emscripten. import glob import os diff --git a/system/lib/standalone/__main_void.c b/system/lib/standalone/__main_void.c index ae854df05860e..21dc5a2781da1 100644 --- a/system/lib/standalone/__main_void.c +++ b/system/lib/standalone/__main_void.c @@ -20,7 +20,7 @@ int __main_argc_argv(int argc, char *argv[]); // be included, and `_start` will call the application's `__main_void` directly. // // If the application's `main` does use argc/argv, then _start will call this -// function which which loads argv values and sends them to to the +// function which loads argv values and sends them to the // application's `main` which gets mangled to `__main_argc_argv` by llvm. __attribute__((weak)) int __main_void(void) { diff --git a/system/lib/standalone/standalone.c b/system/lib/standalone/standalone.c index 51d76cb652ec8..1095fb4ddb7e0 100644 --- a/system/lib/standalone/standalone.c +++ b/system/lib/standalone/standalone.c @@ -257,7 +257,7 @@ int _wasmfs_stdin_get_char(void) { } // In the non-standalone build we define this helper function in JS to avoid -// signture mismatch issues. +// signature mismatch issues. // See: https://github.com/emscripten-core/posixtestsuite/issues/6 void __call_sighandler(sighandler_t handler, int sig) { handler(sig); diff --git a/system/lib/update_llvm_libc.py b/system/lib/update_llvm_libc.py index 1e2181281ab42..5cd4d2e96350d 100644 --- a/system/lib/update_llvm_libc.py +++ b/system/lib/update_llvm_libc.py @@ -92,12 +92,12 @@ def main(): upstream_dir = os.path.join(libc_upstream_dir, dirname) local_dir = os.path.join(libc_local_dir, dirname) copy_tree(upstream_dir, local_dir) - + # Certain llvm-libc files that are incompatible in Emscripten - for excludsion_pattern in libc_exclusion_patterns: - files_to_exclude = glob.glob(os.path.join(libc_local_dir, excludsion_pattern)) + for exclusion_pattern in libc_exclusion_patterns: + files_to_exclude = glob.glob(os.path.join(libc_local_dir, exclusion_pattern)) for file in files_to_exclude: - os.remove(file) + os.remove(file) if __name__ == '__main__': main() \ No newline at end of file diff --git a/system/lib/update_musl.py b/system/lib/update_musl.py index e2b826c2f94f2..a13debc2dfb76 100755 --- a/system/lib/update_musl.py +++ b/system/lib/update_musl.py @@ -13,8 +13,8 @@ To update musl first make sure all changes from the emscripten repo are present in the `emscripten` branch of the above repo. Then run `git merge v` to pull in the latest musl changes from -a given musl version. Once any merge conflict are resolved those -change can then be copied back into emscripten using this script. +a given musl version. Once any merge conflicts are resolved those +changes can then be copied back into emscripten using this script. """ import os diff --git a/system/lib/wasm_worker/library_wasm_worker.c b/system/lib/wasm_worker/library_wasm_worker.c index 0cd0180c94b3f..152ac7656ac24 100644 --- a/system/lib/wasm_worker/library_wasm_worker.c +++ b/system/lib/wasm_worker/library_wasm_worker.c @@ -53,7 +53,7 @@ emscripten_wasm_worker_t emscripten_create_wasm_worker(void *stackPlusTLSAddress // The TLS region lives at the start of the stack region (the lowest address // of the stack). Since the TLS data alignment may be larger than stack // alignment, we may need to round up the lowest stack address to meet this - // requirment. + // requirement. if (__builtin_wasm_tls_align() > STACK_ALIGN) { uintptr_t tlsBase = (uintptr_t)stackPlusTLSAddress; tlsBase = ROUND_UP(tlsBase, __builtin_wasm_tls_align()); diff --git a/system/lib/wasmfs/js_impl_backend.h b/system/lib/wasmfs/js_impl_backend.h index d79fc5abef7d5..38d4b59c61bdc 100644 --- a/system/lib/wasmfs/js_impl_backend.h +++ b/system/lib/wasmfs/js_impl_backend.h @@ -40,7 +40,7 @@ // For a simple example, see js_file_backend.cpp and library_wasmfs_js_file.js // -// Index type that is used on the JS side to refer to backands and file +// Index type that is used on the JS side to refer to backends and file // handles. Currently these are both passed as raw pointers rather than // integer handles which is why we use uintptr_t here. // TODO: Use a narrower type here and avoid passing raw pointers. diff --git a/system/lib/wasmfs/syscalls.cpp b/system/lib/wasmfs/syscalls.cpp index 6e336f4c4fed2..9e5ea3ca6ef42 100644 --- a/system/lib/wasmfs/syscalls.cpp +++ b/system/lib/wasmfs/syscalls.cpp @@ -1716,7 +1716,7 @@ int __syscall_socket( } int __syscall_listen( - int sockfd, int backlock, int dummy1, int dummy2, int dummy3, int dummy4) { + int sockfd, int backlog, int dummy1, int dummy2, int dummy3, int dummy4) { return -ENOSYS; } diff --git a/system/lib/wasmfs/thread_utils.h b/system/lib/wasmfs/thread_utils.h index ef9886d24abe5..e05e2361e9721 100644 --- a/system/lib/wasmfs/thread_utils.h +++ b/system/lib/wasmfs/thread_utils.h @@ -70,7 +70,7 @@ class ProxyWorker { // Make sure the thread has actually started before returning. This allows // subsequent code to assume the thread has already been spawned and not // worry about potential deadlocks where it holds a lock while proxying an - // operation and meanwhile the main thread is blocked trying to acqure the + // operation and meanwhile the main thread is blocked trying to acquire the // same lock so is never able to spawn the worker thread. // // Unfortunately, this solution would cause the main thread to deadlock on diff --git a/system/lib/wasmfs/wasmfs.cpp b/system/lib/wasmfs/wasmfs.cpp index 7d0a714f5a0e6..7a771a8ff4bd0 100644 --- a/system/lib/wasmfs/wasmfs.cpp +++ b/system/lib/wasmfs/wasmfs.cpp @@ -16,7 +16,7 @@ namespace wasmfs { #ifdef WASMFS_CASE_INSENSITIVE -backend_t createIgnoreCaseBackend(std::function createBacken); +backend_t createIgnoreCaseBackend(std::function createBackend); #endif // The below lines are included to make the compiler believe that the global diff --git a/test/benchmark/benchmark_sse.h b/test/benchmark/benchmark_sse.h index d893fdd85af85..494ae190b7702 100644 --- a/test/benchmark/benchmark_sse.h +++ b/test/benchmark/benchmark_sse.h @@ -26,7 +26,7 @@ #define aligned_alloc(align, size) _aligned_malloc((size), (align)) #endif -// Scalar horizonal max across four lanes. +// Scalar horizontal max across four lanes. float hmax(__m128 m) { float f[4]; _mm_storeu_ps(f, m); diff --git a/test/browser/test_glfw.c b/test/browser/test_glfw.c index df1feae5aaf2f..7f31d5649e0ea 100644 --- a/test/browser/test_glfw.c +++ b/test/browser/test_glfw.c @@ -213,7 +213,7 @@ char* GetKeyName(int key){ case GLFW_KEY_TAB: return "tab"; case GLFW_KEY_ENTER: return "enter"; case GLFW_KEY_BACKSPACE: return "backspace"; - case GLFW_KEY_INSERT: return "insertr"; + case GLFW_KEY_INSERT: return "insert"; case GLFW_KEY_DEL: return "del"; case GLFW_KEY_PAGEUP: return "page up"; case GLFW_KEY_PAGEDOWN: return "page down"; diff --git a/test/browser/test_glfw3.c b/test/browser/test_glfw3.c index 0aaf4c329c214..95748fceccd3d 100644 --- a/test/browser/test_glfw3.c +++ b/test/browser/test_glfw3.c @@ -201,7 +201,7 @@ int main() { glfwSetCursorEnterCallback(window, wcurecb); glfwSetScrollCallback(window, wscrocb); - // XXX: stub, events come immediatly + // XXX: stub, events come immediately // glfwPollEvents(); // glfwWaitEvents(); @@ -252,8 +252,8 @@ int main() { } { - assert(glfwExtensionSupported("nonexistant") == 0); - assert(glfwGetProcAddress("nonexistant") == NULL); + assert(glfwExtensionSupported("nonexistent") == 0); + assert(glfwGetProcAddress("nonexistent") == NULL); } #endif diff --git a/test/browser/test_sdl2_canvas_palette_2.c b/test/browser/test_sdl2_canvas_palette_2.c index 9e78757cb4453..2d1fa67164e5f 100644 --- a/test/browser/test_sdl2_canvas_palette_2.c +++ b/test/browser/test_sdl2_canvas_palette_2.c @@ -15,7 +15,7 @@ static SDL_Surface *screen; static SDL_Color pal[COLOR_COUNT +1]; -void pallete(int red, int green, int blue) { +void palette(int red, int green, int blue) { //initialize sdl palette //with gradient colors pal[0].r = 0; @@ -43,7 +43,7 @@ int main(int argc, char** argv) { screen = SDL_CreateRGBSurface(0, 600, 450, 8, 0, 0, 0, 0); - //test empty pallete + //test empty palette SDL_LockSurface(screen); SDL_UnlockSurface(screen); @@ -60,20 +60,20 @@ int main(int argc, char** argv) { } SDL_UnlockSurface(screen); - //Set pallete + //Set palette if (argc > 1) { printf("%s\n", argv[1]); if (strcmp(argv[1], "-r") == 0) { printf("set [red]\n"); - pallete(255, 0, 0); + palette(255, 0, 0); } if (strcmp(argv[1], "-g") == 0) { printf("set [green]\n"); - pallete(0, 255, 0); + palette(0, 255, 0); } if (strcmp(argv[1], "-b") == 0) { printf("set [blue]\n"); - pallete(0, 0, 255); + palette(0, 0, 255); } } diff --git a/test/browser/test_sdl2_gl_read.c b/test/browser/test_sdl2_gl_read.c index d719e8b11064a..8b5ee652938ae 100644 --- a/test/browser/test_sdl2_gl_read.c +++ b/test/browser/test_sdl2_gl_read.c @@ -5,7 +5,7 @@ * found in the LICENSE file. */ -// Built from glbook/hello triange and sdl_ogl, see details there +// Built from glbook/hello triangle and sdl_ogl, see details there #include "SDL2/SDL.h" #include "SDL2/SDL_opengles2.h" diff --git a/test/browser/test_sdl_canvas_palette_2.c b/test/browser/test_sdl_canvas_palette_2.c index 22d1a7fdd1a54..29fab9f85fc6b 100644 --- a/test/browser/test_sdl_canvas_palette_2.c +++ b/test/browser/test_sdl_canvas_palette_2.c @@ -15,7 +15,7 @@ static SDL_Surface *screen; static SDL_Color pal[COLOR_COUNT +1]; -void pallete(int red, int green, int blue) { +void palette(int red, int green, int blue) { //initialize sdl palette //with gradient colors pal[0].r = 0; @@ -37,7 +37,7 @@ int main(int argc, char** argv) { SDL_Init(SDL_INIT_VIDEO); screen = SDL_SetVideoMode(600, 450, 8, SDL_HWSURFACE | SDL_HWPALETTE); - //test empty pallete + //test empty palette SDL_LockSurface(screen); SDL_UnlockSurface(screen); @@ -54,20 +54,20 @@ int main(int argc, char** argv) { } SDL_UnlockSurface(screen); - //Set pallete + //Set palette if (argc > 1) { printf("%s\n", argv[1]); if (strcmp(argv[1], "-r") == 0) { printf("set [red]\n"); - pallete(255, 0, 0); + palette(255, 0, 0); } if (strcmp(argv[1], "-g") == 0) { printf("set [green]\n"); - pallete(0, 255, 0); + palette(0, 255, 0); } if (strcmp(argv[1], "-b") == 0) { printf("set [blue]\n"); - pallete(0, 0, 255); + palette(0, 0, 255); } } diff --git a/test/browser/test_sdl_gl_mapbuffers.c b/test/browser/test_sdl_gl_mapbuffers.c index 5b5473f4b292c..a92efb834e68a 100644 --- a/test/browser/test_sdl_gl_mapbuffers.c +++ b/test/browser/test_sdl_gl_mapbuffers.c @@ -5,7 +5,7 @@ * found in the LICENSE file. */ -// Built from glbook/hello triange and sdl_ogl, see details there +// Built from glbook/hello triangle and sdl_ogl, see details there #include "SDL/SDL.h" #include "SDL/SDL_image.h" diff --git a/test/browser/test_sdl_gl_read.c b/test/browser/test_sdl_gl_read.c index 4aff57b4e771c..a61d0755880ec 100644 --- a/test/browser/test_sdl_gl_read.c +++ b/test/browser/test_sdl_gl_read.c @@ -5,7 +5,7 @@ * found in the LICENSE file. */ -// Built from glbook/hello triange and sdl_ogl, see details there +// Built from glbook/hello triangle and sdl_ogl, see details there #include "SDL/SDL.h" #include "SDL/SDL_image.h" diff --git a/test/browser/test_sdl_set_clip_rect.c b/test/browser/test_sdl_set_clip_rect.c index 59eae7535b3da..36bd2c5fd8ae3 100644 --- a/test/browser/test_sdl_set_clip_rect.c +++ b/test/browser/test_sdl_set_clip_rect.c @@ -90,8 +90,8 @@ int main() { SDL_UpdateRect(dst, 0, 0, width, height); printf("There should be yellow background\n"); - printf("One the left side there should be red rect with green rect inside\n"); - printf("One the right side there should be blue rect with pink rect inside\n"); + printf("On the left side there should be red rect with green rect inside\n"); + printf("On the right side there should be blue rect with pink rect inside\n"); SDL_Quit(); diff --git a/test/browser/test_sdl_togglefullscreen.c b/test/browser/test_sdl_togglefullscreen.c index 935fabe64ed78..34fb6b80e2b0a 100644 --- a/test/browser/test_sdl_togglefullscreen.c +++ b/test/browser/test_sdl_togglefullscreen.c @@ -121,7 +121,7 @@ int main() { * Click and mouseup don't work. */ if (emscripten_set_mouseup_callback("#canvas", NULL, 1, mouseup) != EMSCRIPTEN_RESULT_SUCCESS) { - printf("Couldn't to set mouse callback. Test failed.\n"); + printf("Couldn't set mouse callback. Test failed.\n"); return 1; } diff --git a/test/browser/webgl_draw_triangle_with_uniform_color.c b/test/browser/webgl_draw_triangle_with_uniform_color.c index da8af3abe10ab..95b17f9a91822 100644 --- a/test/browser/webgl_draw_triangle_with_uniform_color.c +++ b/test/browser/webgl_draw_triangle_with_uniform_color.c @@ -137,7 +137,7 @@ int main() { float color2[4] = { 0.0f, 1.f, 0.0f, 1.0f }; glUniform4fv(glGetUniformLocation(program, "color2"), 1, color2); - // Test that passing zero for the size paramater does not cause error + // Test that passing zero for the size parameter does not cause error // https://github.com/emscripten-core/emscripten/issues/21567 // (These are zero-sized, so shouldn't overwrite anything.) { diff --git a/test/browser/webgl_with_closure.c b/test/browser/webgl_with_closure.c index 2d9e79ae9b060..09a501ff32b86 100644 --- a/test/browser/webgl_with_closure.c +++ b/test/browser/webgl_with_closure.c @@ -47,7 +47,7 @@ break; case GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE: printf("**** The value of GL_RENDERBUFFER_SAMPLES is not the same for all attached renderbuffers; " - "if the value of GL_TEXTURE_SAMPLES is the not same for all attached textures; or, if " + "if the value of GL_TEXTURE_SAMPLES is not the same for all attached textures; or, if " "the attached images are a mix of renderbuffers and textures, the value of " "GL_RENDERBUFFER_SAMPLES does not match the value of GL_TEXTURE_SAMPLES." "Or the value of GL_TEXTURE_FIXED_SAMPLE_LOCATIONS is not the same for all attached " diff --git a/test/browser_common.py b/test/browser_common.py index d4ab2d5da760f..bda971b505e48 100644 --- a/test/browser_common.py +++ b/test/browser_common.py @@ -872,7 +872,7 @@ def compile_btest(self, filename, cflags, reporting=Reporting.FULL): # contains the implementation of REPORT_RESULT (we can't just include that implementation in # the header as there may be multiple files being compiled here). if reporting != Reporting.NONE: - # For basic reporting we inject JS helper funtions to report result back to server. + # For basic reporting we inject JS helper functions to report result back to server. self.add_browser_reporting() cflags += ['--pre-js', 'browser_reporting.js'] if reporting == Reporting.FULL: diff --git a/test/clang_native.py b/test/clang_native.py index e4dcc61025db8..a835166bb65f9 100644 --- a/test/clang_native.py +++ b/test/clang_native.py @@ -124,11 +124,11 @@ def highest_version_subdir(path): vc_root = os.path.join(visual_studio_path, 'VC') vc_code_root = highest_version_subdir(os.path.join(vc_root, 'Tools', 'MSVC')) if not vc_code_root: - raise Exception ('Unable to find Visual Studio INCLUDE root directory. Run in Visual Studio command prompt to avoid the need to autoguess this location.') + raise Exception('Unable to find Visual Studio INCLUDE root directory. Run in Visual Studio command prompt to avoid the need to autoguess this location.') windows_sdk_dir = highest_version_subdir(os.path.join(prog_files_x86, 'Windows Kits')) if not windows_sdk_dir: - raise Exception ('Unable to find Windows SDK root directory. Run in Visual Studio command prompt to avoid the need to autoguess this location.') + raise Exception('Unable to find Windows SDK root directory. Run in Visual Studio command prompt to avoid the need to autoguess this location.') env.setdefault('VSINSTALLDIR', visual_studio_path) env.setdefault('VCINSTALLDIR', os.path.join(visual_studio_path, 'VC')) diff --git a/test/cmake/find_stuff/CMakeLists.txt b/test/cmake/find_stuff/CMakeLists.txt index 70593485725e5..c2fb9f8b383e0 100644 --- a/test/cmake/find_stuff/CMakeLists.txt +++ b/test/cmake/find_stuff/CMakeLists.txt @@ -29,7 +29,7 @@ if (NOT HAS_STRING) endif() message(STATUS "find_file string: ${HAS_STRING}") -# Test that we can libraries that exist in the sysroot +# Test that we can find libraries that exist in the sysroot find_library(HAS_ZLIB NAMES libz.a) if (NOT HAS_ZLIB) message(FATAL_ERROR "libz.a not found via find_library") diff --git a/test/cocos2d_hello.cpp b/test/cocos2d_hello.cpp index efd5d6e7f03fe..00d1a2a097aed 100644 --- a/test/cocos2d_hello.cpp +++ b/test/cocos2d_hello.cpp @@ -20,17 +20,17 @@ or one resource to match different design resolutions. [Situation 1] Using one design resolution to match different resources. - Please look into Appdelegate::applicationDidFinishLaunching. + Please look into AppDelegate::applicationDidFinishLaunching. We check current device frame size to decide which resource need to be selected. So if you want to test this situation which said in title '[Situation 1]', you should change ios simulator to different device(e.g. iphone, iphone-retina3.5, iphone-retina4.0, ipad, ipad-retina), - or change the window size in "proj.XXX/main.cpp" by "CCEGLView::setFrameSize" if you are using win32 or linux plaform + or change the window size in "proj.XXX/main.cpp" by "CCEGLView::setFrameSize" if you are using win32 or linux platform and modify "proj.mac/AppController.mm" by changing the window rectangle. [Situation 2] Using one resource to match different design resolutions. The coordinates in your codes is based on your current design resolution rather than resource size. Therefore, your design resolution could be very large and your resource size could be small. - To test this, just define the marco 'TARGET_DESIGN_RESOLUTION_SIZE' to 'DESIGN_RESOLUTION_2048X1536' + To test this, just define the macro 'TARGET_DESIGN_RESOLUTION_SIZE' to 'DESIGN_RESOLUTION_2048X1536' and open iphone simulator or create a window of 480x320 size. [Note] Normally, developer just need to define one design resolution(e.g. 960x640) with one or more resources. diff --git a/test/common.py b/test/common.py index 10e19997fc5d8..bca859cca12bc 100644 --- a/test/common.py +++ b/test/common.py @@ -253,7 +253,7 @@ def force_delete_dir(dirname): except PermissionError as e: # This issue currently occurs on Windows when running browser tests e.g. # on Firefox browser. Killing Firefox browser is not 100% watertight, and - # occassionally a Firefox browser process can be left behind, holding on + # occasionally a Firefox browser process can be left behind, holding on # to a file handle, preventing the deletion from succeeding. # We expect this issue to only occur on Windows. if not WINDOWS: @@ -619,7 +619,7 @@ def setUp(self): self.set_setting('NO_DEFAULT_TO_CXX') self.ldflags = [] # Increase the stack trace limit to maximise usefulness of test failure reports. - # Also, include backtrace for all uncuaght exceptions (not just Error). + # Also, include backtrace for all uncaught exceptions (not just Error). self.node_args = ['--stack-trace-limit=50', '--trace-uncaught'] self.spidermonkey_args = ['-w'] @@ -883,7 +883,7 @@ def measure_wasm_code_lines(self, wasm): return len(non_data_lines) def clean_js_output(self, output): - """Cleaup the JS output prior to running verification steps on it. + """Cleanup the JS output prior to running verification steps on it. Due to minification, when we get a crash report from JS it can sometimes contains the entire program in the output (since the entire program is @@ -1160,7 +1160,7 @@ def run_process(self, cmd, check=True, **kwargs): # core emscripten code (shared.py) here. # Handle buffering for subprocesses. The python unittest buffering mechanism - # will only buffer output from the current process (by overwriding sys.stdout + # will only buffer output from the current process (by overriding sys.stdout # and sys.stderr), not from sub-processes. stdout_buffering = 'stdout' not in kwargs and isinstance(sys.stdout, io.StringIO) stderr_buffering = 'stderr' not in kwargs and isinstance(sys.stderr, io.StringIO) @@ -1216,7 +1216,7 @@ def assert_fail(self, cmd, expected, **kwargs): self.assertContained(expected, err) return err - # excercise dynamic linker. + # exercise dynamic linker. # # test that linking to shared library B, which is linked to A, loads A as well. # main is also linked to C, which is also linked to A. A is loaded/initialized only once. @@ -1226,7 +1226,7 @@ def assert_fail(self, cmd, expected, **kwargs): # C # # this test is used by both test_core and test_browser. - # when run under browser it excercises how dynamic linker handles concurrency + # when run under browser it exercises how dynamic linker handles concurrency # - because B and C are loaded in parallel. def _test_dylink_dso_needed(self, do_run): create_file('liba.cpp', r''' @@ -1479,7 +1479,7 @@ def get_zlib_library(self, cmake, cflags=None): self.cflags += cflags # inflate.c does -1L << 16 self.cflags.append('-Wno-shift-negative-value') - # adler32.c uses K&R sytyle function declarations + # adler32.c uses K&R style function declarations self.cflags.append('-Wno-deprecated-non-prototype') # Work around configure-script error. TODO: remove when # https://github.com/emscripten-core/emscripten/issues/16908 is fixed diff --git a/test/core/FS_exports.cpp b/test/core/FS_exports.cpp index e3a6f774e9360..3fa175dc26855 100644 --- a/test/core/FS_exports.cpp +++ b/test/core/FS_exports.cpp @@ -8,7 +8,7 @@ int main() { #ifdef USE_FILES - if (fopen("nonexistend", "r")) { + if (fopen("nonexistent", "r")) { puts("that was bad"); return 1; } diff --git a/test/core/pthread/test_pthread_dlopen.c b/test/core/pthread/test_pthread_dlopen.c index 78ca23454c8c4..564ac717042ba 100644 --- a/test/core/pthread/test_pthread_dlopen.c +++ b/test/core/pthread/test_pthread_dlopen.c @@ -24,7 +24,7 @@ static void* thread_main(void* arg) { started = true; while (!ready) { - printf("yeilding ..\n"); + printf("yielding ..\n"); sched_yield(); usleep(1000*100); } diff --git a/test/core/test_em_asm_2.cpp b/test/core/test_em_asm_2.cpp index 7e4dcf261dfb7..73e9b59315eaa 100644 --- a/test/core/test_em_asm_2.cpp +++ b/test/core/test_em_asm_2.cpp @@ -29,7 +29,7 @@ int main() { EM_ASM("out('3. this is \"double\" \"quotes\"')"); EM_ASM({"out('4. this is \"double\" \"quotes\"')"}); EM_ASM({out('5. this is \"double\" \"quotes\"')}); - EM_ASM({out('6. this is "double" "quotes" without esacping')}); + EM_ASM({out('6. this is "double" "quotes" without escaping')}); EM_ASM("{out('7. this is \"double\" \"quotes\"')}"); printf("\nEM_ASM: Pass a string\n"); diff --git a/test/core/test_em_asm_2.out b/test/core/test_em_asm_2.out index 3e9fe05e39e40..5809d180aa06f 100644 --- a/test/core/test_em_asm_2.out +++ b/test/core/test_em_asm_2.out @@ -18,7 +18,7 @@ EM_ASM: Double quotes inside a string 3. this is "double" "quotes" 4. this is "double" "quotes" 5. this is "double" "quotes" -6. this is "double" "quotes" without esacping +6. this is "double" "quotes" without escaping 7. this is "double" "quotes" EM_ASM: Pass a string diff --git a/test/core/test_emscripten_async_call.c b/test/core/test_emscripten_async_call.c index cda272a05dec6..c3709c22a1687 100644 --- a/test/core/test_emscripten_async_call.c +++ b/test/core/test_emscripten_async_call.c @@ -20,7 +20,7 @@ void callback(void *arg) { int main() { atexit(myatexit); - // The runtime should stay alive long enough for the callbackl + // The runtime should stay alive long enough for the callback // to run. emscripten_async_call(callback, (void*)42, 500); printf("returning from main\n"); diff --git a/test/core/test_exceptions_convert.cpp b/test/core/test_exceptions_convert.cpp index 563057dad0c51..59cb2f9f61712 100644 --- a/test/core/test_exceptions_convert.cpp +++ b/test/core/test_exceptions_convert.cpp @@ -30,7 +30,7 @@ namespace if (raw == "Zero") { value = TestEnum::Zero; return in; } if (raw == "One") { value = TestEnum::One; return in; } - // The boost input operator uses it's own facet for input which can + // The boost input operator uses its own facet for input which can // throw, so we simulate something failing by just throwing an exception // directly. throw std::exception(); diff --git a/test/core/test_exceptions_rethrow.cpp b/test/core/test_exceptions_rethrow.cpp index 0a7ec750216dd..401b742d5e90a 100644 --- a/test/core/test_exceptions_rethrow.cpp +++ b/test/core/test_exceptions_rethrow.cpp @@ -30,7 +30,7 @@ namespace if (raw == "Zero") { value = TestEnum::Zero; return in; } if (raw == "One") { value = TestEnum::One; return in; } - // The boost input operator uses it's own facet for input which can + // The boost input operator uses its own facet for input which can // throw, so we simulate something failing by just throwing an exception // directly. std::ios_base::failure failz(""); diff --git a/test/core/test_externref.c b/test/core/test_externref.c index d087b88b8d0e2..17a63698f5c78 100644 --- a/test/core/test_externref.c +++ b/test/core/test_externref.c @@ -7,9 +7,9 @@ int main() { printf("in main\n"); log_externref(); get_externref(); - printf("extenref stored\n"); + printf("externref stored\n"); log_externref(); - printf("extenref logged\n"); + printf("externref logged\n"); return 0; } diff --git a/test/core/test_externref.out b/test/core/test_externref.out index 4bd491b8adf16..8adb2e2395540 100644 --- a/test/core/test_externref.out +++ b/test/core/test_externref.out @@ -1,5 +1,5 @@ in main log_externref_js: null -extenref stored +externref stored log_externref_js: {"foo":1} -extenref logged +externref logged diff --git a/test/core/test_gl_get_proc_address.c b/test/core/test_gl_get_proc_address.c index d67fae7751ad0..c08c26e5f19b5 100644 --- a/test/core/test_gl_get_proc_address.c +++ b/test/core/test_gl_get_proc_address.c @@ -1,7 +1,7 @@ #include // This test just verifies the libgl can be linked with MAIN_MODULE=1. -// All we do here is reference a symbol libgl to cause it be added to the link +// All we do here is reference a symbol libgl to cause it to be added to the link // line. int main(int argc, char* argv[]) { diff --git a/test/core/test_promise_await.c b/test/core/test_promise_await.c index 86bda9b5acdc5..24a9eaf83e048 100644 --- a/test/core/test_promise_await.c +++ b/test/core/test_promise_await.c @@ -5,7 +5,7 @@ #include #include -void fulfill_from_timout(void* arg) { +void fulfill_from_timeout(void* arg) { emscripten_promise_resolve((em_promise_t)arg, EM_PROMISE_FULFILL, (void*)43); } @@ -25,7 +25,7 @@ void test_already_fulfilled() { void test_not_yet_fulfilled() { em_promise_t p = emscripten_promise_create(); - emscripten_async_call(fulfill_from_timout, p, 0); + emscripten_async_call(fulfill_from_timeout, p, 0); printf("waiting on promise: %p\n", p); em_settled_result_t res = emscripten_promise_await(p); diff --git a/test/core/test_signals.c b/test/core/test_signals.c index 873a963dad305..12506bae9c0b3 100644 --- a/test/core/test_signals.c +++ b/test/core/test_signals.c @@ -59,7 +59,7 @@ void test_raise_sigusr1() { } } -void test_sigpenging() { +void test_sigpending() { printf("test_sigpending\n"); recieved1 = false; @@ -85,7 +85,7 @@ void test_sigpenging() { printf("is not pending\n"); } - // Unlock the signal and then check that is recieved. + // Unlock the signal and then check that is received. assert(!recieved1); unblock_all(); @@ -157,7 +157,7 @@ int main() { test_sigaction(); test_bad_signal(); test_raise_sigusr1(); - test_sigpenging(); + test_sigpending(); test_sigwaitinfo(); test_sigemptyset(); return 0; diff --git a/test/core/test_sscanf_other_whitespace.c b/test/core/test_sscanf_other_whitespace.c index 0b8d061635a7e..17b18e58ade0d 100644 --- a/test/core/test_sscanf_other_whitespace.c +++ b/test/core/test_sscanf_other_whitespace.c @@ -16,7 +16,7 @@ int main() { "\t\t5\t\t7\t\t", "\n11\n13\n", /* LF - line feed */ "\n\n17\n\n19\n\n", "\v23\v29\v", /* VT - vertical tab */ "\v\v31\v\v37\v\v", "\f41\f43\f", /* FF - form feed */ - "\f\f47\f\f53\f\f", "\r59\r61\r", /* CR - carrage return */ + "\f\f47\f\f53\f\f", "\r59\r61\r", /* CR - carriage return */ "\r\r67\r\r71\r\r"}; for (int i = 0; i < 10; ++i) { diff --git a/test/core/test_stack_get_free.c b/test/core/test_stack_get_free.c index 9445ef9371b09..e18aaae0cc8b2 100644 --- a/test/core/test_stack_get_free.c +++ b/test/core/test_stack_get_free.c @@ -38,8 +38,8 @@ int main() { uintptr_t free = emscripten_stack_get_free(); assert(prevFree - free == increment); prevFree = free; - // Print something from the allocationed region to prevent whole program - // optimizations from elminiating the alloca completely. + // Print something from the allocated region to prevent whole program + // optimizations from eliminating the alloca completely. printf("Val: %d\n", p[10]); printf("Stack used: %zu\n", origFree - emscripten_stack_get_free()); TestStackValidity(); diff --git a/test/core/test_varargs.c b/test/core/test_varargs.c index 87f9c0974b131..a83774c67a701 100644 --- a/test/core/test_varargs.c +++ b/test/core/test_varargs.c @@ -43,7 +43,7 @@ void varargs_listoffsets_list_evaluate(int count, va_list ap, int vaIteration) { printf("\n"); } -void varags_listoffsets_list_copy(int count, va_list ap, int iteration) { +void varargs_listoffsets_list_copy(int count, va_list ap, int iteration) { va_list ap_copy; va_copy(ap_copy, ap); varargs_listoffsets_list_evaluate(count, ap_copy, iteration); @@ -55,10 +55,10 @@ void varargs_listoffsets_args(int type, int count, ...) { va_start(ap, count); // evaluate a copied list - varags_listoffsets_list_copy(count, ap, 1); - varags_listoffsets_list_copy(count, ap, 2); - varags_listoffsets_list_copy(count, ap, 3); - varags_listoffsets_list_copy(count, ap, 4); + varargs_listoffsets_list_copy(count, ap, 1); + varargs_listoffsets_list_copy(count, ap, 2); + varargs_listoffsets_list_copy(count, ap, 3); + varargs_listoffsets_list_copy(count, ap, 4); } void varargs_listoffsets_main() { diff --git a/test/core/test_wrap_malloc.c b/test/core/test_wrap_malloc.c index be58ffa2ae917..bf80e598ceadf 100644 --- a/test/core/test_wrap_malloc.c +++ b/test/core/test_wrap_malloc.c @@ -43,7 +43,7 @@ int main() { void *ptr = malloc(1024 * 1024); // Make sure we do something with the pointer do ensure the optimizer // doesn't completely remove the allocation. - emscripten_console_logf("alloacted: %p", ptr); + emscripten_console_logf("allocated: %p", ptr); free(ptr); } diff --git a/test/cube_explosion.c b/test/cube_explosion.c index c097959f98a4b..02002497fe118 100644 --- a/test/cube_explosion.c +++ b/test/cube_explosion.c @@ -153,7 +153,7 @@ int main(int argc, char *argv[]) { // get active uniform data for 10 uniforms. XXX they include our additions from shader rewriting! XXX - // gen texture, we already has one + // gen texture, we already have one GLuint arrayBuffer; glGenBuffers(1, &arrayBuffer); diff --git a/test/decorators.py b/test/decorators.py index ae1184f52a9df..11984fc12fb51 100644 --- a/test/decorators.py +++ b/test/decorators.py @@ -76,7 +76,7 @@ def flaky(note=''): def decorated(func): @wraps(func) def modified(self, *args, **kwargs): - # Browser tests have there own method of retrying tests. + # Browser tests have their own method of retrying tests. if self.is_browser_test(): self.flaky = True return func(self, *args, **kwargs) diff --git a/test/embind/test_val.cpp b/test/embind/test_val.cpp index 44178adbcaf7b..14424b95a8948 100644 --- a/test/embind/test_val.cpp +++ b/test/embind/test_val.cpp @@ -578,7 +578,7 @@ int main() { test("bool in(const val& v)"); EM_ASM( - // can't declare like this because i get: + // can't declare like this because I get: // error: use of undeclared identifier 'c' // possibly a bug with EM_ASM //a = {b: 'bb',c: 'cc'}; @@ -636,7 +636,7 @@ int main() { // these tests should probably go elsewhere as it is not a member of val test("template std::vector vecFromJSArray(const val& v)"); EM_ASM( - // can't declare like this because i get: + // can't declare like this because I get: // error: expected ')' // possibly a bug with EM_ASM //a = [1, '2']; diff --git a/test/emscripten_set_timeout_loop.c b/test/emscripten_set_timeout_loop.c index 1ddf79c21ecdc..50cf1f28ce183 100644 --- a/test/emscripten_set_timeout_loop.c +++ b/test/emscripten_set_timeout_loop.c @@ -4,7 +4,7 @@ #include #include -double previousSetTimeouTime = 0; +double previousSetTimeoutTime = 0; int funcExecuted = 0; void testDone(void *userData) { @@ -14,8 +14,8 @@ void testDone(void *userData) { } bool tick(double time, void *userData) { - assert(time >= previousSetTimeouTime); - previousSetTimeouTime = time; + assert(time >= previousSetTimeoutTime); + previousSetTimeoutTime = time; assert((long)userData == 1); ++funcExecuted; if (funcExecuted == 10) diff --git a/test/fetch/test_fetch_progress.c b/test/fetch/test_fetch_progress.c index 666739cdb0f8a..3c24e9c5eb5eb 100644 --- a/test/fetch/test_fetch_progress.c +++ b/test/fetch/test_fetch_progress.c @@ -40,7 +40,7 @@ int main() { attr.onerror = downloadFailed; emscripten_fetch(&attr, "myfile.dat"); - // Program won't actaully exit until fetch is complete (i.e. when + // Program won't actually exit until fetch is complete (i.e. when // emscripten_fetch_close is called above). return 0; } diff --git a/test/freetype/main_2.c b/test/freetype/main_2.c index 567d63501f465..dbe1fca959fc6 100644 --- a/test/freetype/main_2.c +++ b/test/freetype/main_2.c @@ -116,7 +116,7 @@ main( int argc, /* use 50pt at 100dpi */ error = FT_Set_Char_Size( face, 0, 32 * 64, 0, 0 ); /* set character size */ - if (error) printf("Set_Cshar_Size Error! %d\n", error); + if (error) printf("Set_Char_Size Error! %d\n", error); slot = face->glyph; diff --git a/test/freetype/main_3.c b/test/freetype/main_3.c index 27cfe93c41656..7b6bab8d636f7 100644 --- a/test/freetype/main_3.c +++ b/test/freetype/main_3.c @@ -44,7 +44,7 @@ draw_bitmap( FT_Bitmap* bitmap, unsigned char* src = bitmap->buffer; unsigned char* dest = pixelData; - // Note: FT_RENDER_MONO_MODE render characater's one pixel by a single bit, + // Note: FT_RENDER_MONO_MODE render character's one pixel by a single bit, // translate the single bit to a single char for displaying image. for(int _y = 0; _y < bitmap->rows; ++_y) { diff --git a/test/fs/test_fs_bad_lookup.c b/test/fs/test_fs_bad_lookup.c index 690798bfc138a..00f04b03ab9fc 100644 --- a/test/fs/test_fs_bad_lookup.c +++ b/test/fs/test_fs_bad_lookup.c @@ -51,7 +51,7 @@ int main() { return 1; } if (exists("file1/dir")) { - printf("Path should not exists: file1/dir\n"); + printf("Path should not exist: file1/dir\n"); return 1; } @@ -61,7 +61,7 @@ int main() { return 1; } if (exists("file2/dir")) { - printf("Path should not exists: file2/dir\n"); + printf("Path should not exist: file2/dir\n"); return 1; } @@ -71,7 +71,7 @@ int main() { return 1; } if (exists("file3/dir")) { - printf("Path should not exists: file3/dir\n"); + printf("Path should not exist: file3/dir\n"); return 1; } diff --git a/test/fs/test_fs_js_api.c b/test/fs/test_fs_js_api.c index 91344ff9d45e3..fba9b141caf5d 100644 --- a/test/fs/test_fs_js_api.c +++ b/test/fs/test_fs_js_api.c @@ -214,7 +214,7 @@ void test_fs_rmdir() { } catch (err) { ex = err; } - assert(ex.name === "ErrnoError" && ex.errno === 44 /* ENOEN */); + assert(ex.name === "ErrnoError" && ex.errno === 44 /* ENOENT */); ); } diff --git a/test/fs/test_fs_symlink_resolution.c b/test/fs/test_fs_symlink_resolution.c index 9ef6756652234..bbd8635940bb8 100644 --- a/test/fs/test_fs_symlink_resolution.c +++ b/test/fs/test_fs_symlink_resolution.c @@ -1,7 +1,5 @@ #include #include -#include -#include #include #include #include diff --git a/test/fs/test_lz4fs.c b/test/fs/test_lz4fs.c index d0a6474f1c574..1545d31a35481 100644 --- a/test/fs/test_lz4fs.c +++ b/test/fs/test_lz4fs.c @@ -118,7 +118,7 @@ void EMSCRIPTEN_KEEPALIVE finish() { fclose(f2); fclose(f3); - // attemping to read a lz4 node as a link should be invalid + // attempting to read a lz4 node as a link should be invalid buffer[0] = '\0'; assert(readlink("file1.txt", buffer, sizeof(buffer)) == -1); assert(buffer[0] == '\0'); diff --git a/test/fs/test_workerfs.c b/test/fs/test_workerfs.c index 994b04e3f6266..534aa870b9487 100644 --- a/test/fs/test_workerfs.c +++ b/test/fs/test_workerfs.c @@ -89,7 +89,7 @@ void test_readdir() { } void test_readlink() { - // attemping to read a worker node as a link should result in EINVAL + // attempting to read a worker node as a link should result in EINVAL char buf[100]; buf[0] = '\0'; assert(readlink("/work/blob.txt", buf, sizeof(buf)) == -1); diff --git a/test/jsrun.py b/test/jsrun.py index f18afc7285a03..318813aab0064 100644 --- a/test/jsrun.py +++ b/test/jsrun.py @@ -29,7 +29,7 @@ def make_command(filename, engine, args=None): # it can also use d8 (the v8 engine shell) or jsc (JavaScript Core aka # Safari). Both d8 and jsc require a '--' to delimit arguments to be passed # to the executed script from d8/jsc options. Node does not require a - # delimeter--arguments after the filename are passed to the script. + # delimiter--arguments after the filename are passed to the script. # # Check only the last part of the engine path to ensure we don't accidentally # label a path to nodejs containing a 'd8' as spidermonkey instead. diff --git a/test/module/test_stdin.c b/test/module/test_stdin.c index d70860716959f..6997e41fc553b 100644 --- a/test/module/test_stdin.c +++ b/test/module/test_stdin.c @@ -50,7 +50,7 @@ void main_loop() { int main(int argc, char const *argv[]) { fcntl(STDIN_FILENO, F_SETFL, O_NONBLOCK); - // SM shell doesn't implement an event loop and therefor doesn't support + // SM shell doesn't implement an event loop and therefore doesn't support // emscripten_set_main_loop. However, its stdin reads are sync so it // should exit out after calling main_loop once. main_loop(); diff --git a/test/openal/test_openal_capture.c b/test/openal/test_openal_capture.c index 38c467f1ef2f9..e4f39cc0ea76c 100644 --- a/test/openal/test_openal_capture.c +++ b/test/openal/test_openal_capture.c @@ -164,7 +164,7 @@ void iter() { if (app.captured < target) return; else if (app.captured > target) { - fprintf(stderr, "Captured frames exeedes expectations!\n"); + fprintf(stderr, "Captured frames exceeds expectations!\n"); end_test(EXIT_FAILURE); } @@ -288,7 +288,7 @@ void ignite() { #endif } - //allocate memory to store captured audio + // allocate memory to store captured audio app.recorded_size = bytesForDuration(app.duration); app.recorded = malloc(app.recorded_size); if (!app.recorded) { diff --git a/test/openal/test_openal_capture_sanity.c b/test/openal/test_openal_capture_sanity.c index 1258e6fe3f403..e6aef5c89af8a 100644 --- a/test/openal/test_openal_capture_sanity.c +++ b/test/openal/test_openal_capture_sanity.c @@ -10,7 +10,7 @@ // checks some basic conformance to expectations w.r.t the spec. // // Wishlist: -// - Any operation a closed device should fail; +// - Any operation on a closed device should fail; // - Trying to open multiple devices with the same name at the same time // and different settings should be fine; diff --git a/test/other/embind_tsgen_main.ts b/test/other/embind_tsgen_main.ts index 782868b4a9320..acdc2ab47e05f 100644 --- a/test/other/embind_tsgen_main.ts +++ b/test/other/embind_tsgen_main.ts @@ -1,5 +1,5 @@ -// Example TS program that consumes the emscripten-generated module to to -// illustrate how the type definitions are used and test they are workings as +// Example TS program that consumes the emscripten-generated module to +// illustrate how the type definitions are used and test they are working as // expected. // The imported file will either be an ES module or a CommonJS module depending diff --git a/test/other/test_dlopen_promise.c b/test/other/test_dlopen_promise.c index ae368e0f068e6..acd0910b01077 100644 --- a/test/other/test_dlopen_promise.c +++ b/test/other/test_dlopen_promise.c @@ -6,7 +6,7 @@ #include #include -em_promise_result_t on_fullfilled(void **result, void* data, void *handle) { +em_promise_result_t on_fulfilled(void **result, void* data, void *handle) { printf("onsuccess\n"); int* foo = (int*)dlsym(handle, "foo"); assert(foo); @@ -22,7 +22,7 @@ em_promise_result_t on_rejected(void **result, void* data, void *value) { int main() { em_promise_t inner = emscripten_dlopen_promise("libside.so", RTLD_NOW); - em_promise_t outer = emscripten_promise_then(inner, on_fullfilled, on_rejected, NULL); + em_promise_t outer = emscripten_promise_then(inner, on_fulfilled, on_rejected, NULL); emscripten_promise_destroy(outer); emscripten_promise_destroy(inner); printf("returning from main\n"); diff --git a/test/other/test_em_asm_i64.cpp b/test/other/test_em_asm_i64.cpp index ce0124e6cb3df..de8e81aff79a3 100644 --- a/test/other/test_em_asm_i64.cpp +++ b/test/other/test_em_asm_i64.cpp @@ -11,7 +11,7 @@ int main() { console.log("js = " + $0); }, num); - // EM_ASM doesn't currently have any supprot for unsigned values so UINT64_MAX + // EM_ASM doesn't currently have any support for unsigned values so UINT64_MAX // will show up on the JS side -1. uint64_t unsigned_num = UINT64_MAX; printf("native = %llu\n", unsigned_num); diff --git a/test/other/test_em_js_main_module_address.c b/test/other/test_em_js_main_module_address.c index ca3f20e8c501a..93b14bcd4bc31 100644 --- a/test/other/test_em_js_main_module_address.c +++ b/test/other/test_em_js_main_module_address.c @@ -10,7 +10,7 @@ void (*f)(void) = &foo; int main() { printf("main\n"); - // Calling en EM_JS function by its address, without also importing + // Calling an EM_JS function by its address, without also importing // as a normal function, doesn't yet work with dynamic linking and this // call will fail with `Missing signature argument to addFunction`. f(); diff --git a/test/other/test_gmtime_noleak.c b/test/other/test_gmtime_noleak.c index 92ae99e48f0f3..404953c05896a 100644 --- a/test/other/test_gmtime_noleak.c +++ b/test/other/test_gmtime_noleak.c @@ -5,7 +5,7 @@ int main() { // Verify that it doesn't leak memory on first use (if we call it via - // via gmtime thn this can hide the leak because the result is stored + // via gmtime then this can hide the leak because the result is stored // in static data). time_t xmas2002 = 1040786563ll; diff --git a/test/other/test_lto_atexit.c b/test/other/test_lto_atexit.c index 12651078bbf81..fa3f8d7418cda 100644 --- a/test/other/test_lto_atexit.c +++ b/test/other/test_lto_atexit.c @@ -4,7 +4,7 @@ // // Because this lowering happens during compilation this symbol cannot itself be // compiled as LTO (since generated new references to LTO symbols at LTO time -// results int link failure). We had a bug where this symbol was itself LTO +// results in link failure). We had a bug where this symbol was itself LTO // which can cause link failures. // // See: https://github.com/emscripten-core/emscripten/issues/16836 diff --git a/test/other/test_mmap_and_munmap.c b/test/other/test_mmap_and_munmap.c index 2ecba69a5a728..755c3878a9478 100644 --- a/test/other/test_mmap_and_munmap.c +++ b/test/other/test_mmap_and_munmap.c @@ -147,7 +147,7 @@ int test_mmap_anon() { void *m = (char *)mmap(NULL, file_len(), PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); ASSERT(m != MAP_FAILED, "Failed to mmap pages"); - ASSERT(munmap(m, file_len()) == 0, "Failed to unmmap allocated pages"); + ASSERT(munmap(m, file_len()) == 0, "Failed to unmap allocated pages"); TEST_PASS(); } @@ -170,7 +170,7 @@ int test_mmap_fixed() { char *m3 = (char *)mmap(m, file_len(), PROT_READ, MAP_FIXED, fileno(f_ro), invalid_offset); ASSERT(m3 == MAP_FAILED && errno == EINVAL, "Expected EINVAL for invalid offset"); - ASSERT(munmap(m, file_len()) == 0, "Failed to unmmap allocated pages"); + ASSERT(munmap(m, file_len()) == 0, "Failed to unmap allocated pages"); TEST_PASS(); } diff --git a/test/other/test_mmap_and_munmap_anonymous.cpp b/test/other/test_mmap_and_munmap_anonymous.cpp index 722a116a4b06f..5d9fa02ca500d 100644 --- a/test/other/test_mmap_and_munmap_anonymous.cpp +++ b/test/other/test_mmap_and_munmap_anonymous.cpp @@ -61,7 +61,7 @@ int test_mmap_anon() { void *m = (char *)mmap(NULL, file_len(), PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); ASSERT(m != MAP_FAILED, "Failed to mmap pages"); - ASSERT(munmap(m, file_len()) == 0, "Failed to unmmap allocated pages"); + ASSERT(munmap(m, file_len()) == 0, "Failed to unmap allocated pages"); TEST_PASS(); } diff --git a/test/other/test_mmap_empty.c b/test/other/test_mmap_empty.c index 81a71ae2181ff..3e3c6b6c847c4 100644 --- a/test/other/test_mmap_empty.c +++ b/test/other/test_mmap_empty.c @@ -51,7 +51,7 @@ int main() { // mapping a non-zero number of pages should succeed, even for empty files. // On native systems this results in pages beyond the length of the file - // being inaccessable, but we don't have any real memory protection on + // being inaccessible, but we don't have any real memory protection on // emscripten so we cannot test that. mapped = (char*) mmap(NULL, 2*PAGE_SIZE, PROT_READ, MAP_PRIVATE, fd, 0); assert(mapped != MAP_FAILED); diff --git a/test/other/test_parseTools.js b/test/other/test_parseTools.js index 65dd7f5dabb83..8a62309e648b7 100644 --- a/test/other/test_parseTools.js +++ b/test/other/test_parseTools.js @@ -12,7 +12,7 @@ addToLibrary({ return 0; }, - // receiveI64ParamAsDoulbe is a legacy function that is no longer + // receiveI64ParamAsDouble is a legacy function that is no longer // used within emscripten, but we continue to test it in case // there are external users. test_receiveI64ParamAsDouble: function({{{ defineI64Param('arg1') }}}, @@ -39,7 +39,7 @@ addToLibrary({ // When interpreted as an unsigned value that bytes stored at in the linear // memory represent a number outside of the i53 range so we get some // rounding here. - // readI53FromU64 doesn't currently have any kind of range checkes, even in + // readI53FromU64 doesn't currently have any kind of range checks, even in // debug mode. val = {{{ makeGetValue('ptr', '0', 'u53') }}}; out('u53: ' + val.toString(16)) diff --git a/test/other/test_proxy_to_pthread_stack.c b/test/other/test_proxy_to_pthread_stack.c index ae8547ab205e6..f2fa5d0f36f55 100644 --- a/test/other/test_proxy_to_pthread_stack.c +++ b/test/other/test_proxy_to_pthread_stack.c @@ -17,7 +17,7 @@ int main(void) { printf("stack size %zd\n", stacksize); // This test is run with STACK_SIZE=128k so we always expect that to be - // the ammount of stack we have in main() + // the amount of stack we have in main() assert(stacksize == 128*1024); // This test is run with DEFAULT_PTHREAD_STACK_SIZE=64k. This would fail if diff --git a/test/other/test_pthread_self_join_detach.c b/test/other/test_pthread_self_join_detach.c index 7d4293b76dfde..4a3dbac1b8bb9 100644 --- a/test/other/test_pthread_self_join_detach.c +++ b/test/other/test_pthread_self_join_detach.c @@ -22,7 +22,7 @@ int main() { /* * Attempts to join the current thread will either generate - * EDEADLK or EINVAL depending on whether has already been + * EDEADLK or EINVAL depending on whether it has already been * detached */ int ret = pthread_join(self, NULL); @@ -35,7 +35,7 @@ int main() { /* * Attempts to detach the main thread will either succeed - * or cause EINVAL if its already been detached. + * or cause EINVAL if it's already been detached. */ ret = pthread_detach(self); printf("pthread_detach(self) -> %s\n", strerror(ret)); diff --git a/test/other/test_pthread_set_main_loop.c b/test/other/test_pthread_set_main_loop.c index c19c20c84756e..576367e948c8c 100644 --- a/test/other/test_pthread_set_main_loop.c +++ b/test/other/test_pthread_set_main_loop.c @@ -27,7 +27,7 @@ void* loopthread(void* arg) { void mainloop() { if (loopthread_done) { - printf("joinng..\n"); + printf("joining..\n"); pthread_join(thread, NULL); printf("join done\n"); emscripten_cancel_main_loop(); diff --git a/test/other/test_pthread_set_main_loop.out b/test/other/test_pthread_set_main_loop.out index 604dfb09ef171..dead1f0adaf7c 100644 --- a/test/other/test_pthread_set_main_loop.out +++ b/test/other/test_pthread_set_main_loop.out @@ -11,5 +11,5 @@ loop thread: 9 loop thread: 10 loop thread: 11 loop thread done -joinng.. +joining.. join done diff --git a/test/other/test_pthread_stub.c b/test/other/test_pthread_stub.c index d9cc9902c4c95..0def71e12cca5 100644 --- a/test/other/test_pthread_stub.c +++ b/test/other/test_pthread_stub.c @@ -57,7 +57,7 @@ void test_pthreads() { pthread_t thread; CHECK_FAIL(pthread_create(&thread, NULL, start_pthread, NULL)); - // Thread cleanup push/pop should still work for the main thrad + // Thread cleanup push/pop should still work for the main thread pthread_cleanup_push(cleanup, (void*)42); pthread_cleanup_pop(1); } diff --git a/test/other/test_syscall_stubs.c b/test/other/test_syscall_stubs.c index 0a55a3302fb6e..eacee66aebbf5 100644 --- a/test/other/test_syscall_stubs.c +++ b/test/other/test_syscall_stubs.c @@ -3,7 +3,7 @@ int main() { // The current implementation uses the stub symbol __syscall_wait4. - // This test exists simply to ensure that it compile and link. + // This test exists simply to ensure that it compiles and links. waitpid(0, NULL, 0); wait3(NULL, 0, NULL); wait4(0, NULL, 0, NULL); diff --git a/test/other/test_syslog.c b/test/other/test_syslog.c index 4ae05e611f385..b8130209c68bb 100644 --- a/test/other/test_syslog.c +++ b/test/other/test_syslog.c @@ -4,7 +4,7 @@ int main() { // The current implementation of syslog that we use comes // from musl and doesn't do anything useful under emscripten. - // This test exists simply to ensure that it compile and link. + // This test exists simply to ensure that it compiles and links. syslog(LOG_CRIT, "%s", "log1"); openlog(NULL, LOG_CONS, LOG_USER); syslog(LOG_CRIT, "%s", "log2"); diff --git a/test/parallel_testsuite.py b/test/parallel_testsuite.py index 1b82a0a23d70c..86967c97abe22 100644 --- a/test/parallel_testsuite.py +++ b/test/parallel_testsuite.py @@ -260,17 +260,17 @@ def integrate_result(self, overall_results): """This method get called on the main thread once the buffered result is received. It adds the buffered result to the overall result.""" - # Turns a pair back into something that looks enoough - # link a pair. The exc_info tripple has the exception - # type as its first element. This is needed in particilar in the + # Turns a pair back into something that looks enough + # link a pair. The exc_info triple has the exception + # type as its first element. This is needed in particular in the # XMLTestRunner. def restore_exc_info(pair): test, exn_string = pair assert self.last_err_type, exn_string return (test, (self.last_err_type, exn_string, None)) - # Our fame exc_info tripple keep the pre-serialized string in the - # second element of the triple so we overide _exc_info_to_string + # Our fake exc_info triple keep the pre-serialized string in the + # second element of the triple so we override _exc_info_to_string # _exc_info_to_string to simply return it. overall_results._exc_info_to_string = lambda x, _y: x[1] diff --git a/test/pthread/test_pthread_busy_wait_atexit.cpp b/test/pthread/test_pthread_busy_wait_atexit.cpp index 00ca44b81cfec..4efc55bc67f82 100644 --- a/test/pthread/test_pthread_busy_wait_atexit.cpp +++ b/test/pthread/test_pthread_busy_wait_atexit.cpp @@ -21,7 +21,7 @@ void* thread_main(void*) { } // Similar to test_pthread_busy_wait.cpp but with lower level pthreads -// API and explcit use of atexit before setting done to true. +// API and explicit use of atexit before setting done to true. // We also don't make any calls during the busy loop which means that // proxied calls are *not* processed. int main() { diff --git a/test/pthread/test_pthread_cancel_async.c b/test/pthread/test_pthread_cancel_async.c index 93c8315a15c0c..8b0a43416cd83 100644 --- a/test/pthread/test_pthread_cancel_async.c +++ b/test/pthread/test_pthread_cancel_async.c @@ -25,7 +25,7 @@ static void cleanup_handler(void *arg) } static void *thread_start(void *arg) { - // Setup thread for async cancelation only + // Setup thread for async cancellation only pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL); pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL); @@ -38,7 +38,7 @@ static void *thread_start(void *arg) { // This mutex is locked by the main thread so this call should never return. // pthread_mutex_lock is not a cancellation point so deferred cancellation - // won't work here, async cancelation should. + // won't work here, async cancellation should. pthread_mutex_lock(&mutex); assert(false && "pthread_mutex_lock returned!"); diff --git a/test/pthread/test_pthread_cancel_cond_wait.c b/test/pthread/test_pthread_cancel_cond_wait.c index 19628ec45d765..c72d5c3019180 100644 --- a/test/pthread/test_pthread_cancel_cond_wait.c +++ b/test/pthread/test_pthread_cancel_cond_wait.c @@ -72,7 +72,7 @@ int main() { th_cancelled = true; pthread_mutex_unlock(&mutex); - emscripten_outf("Main thread waitnig for side-thread"); + emscripten_outf("Main thread waiting for side-thread"); pthread_barrier_wait(&barrier); pthread_barrier_destroy(&barrier); diff --git a/test/pthread/test_pthread_tls_dylink.c b/test/pthread/test_pthread_tls_dylink.c index a7734c66138de..54b22b7799a9d 100644 --- a/test/pthread/test_pthread_tls_dylink.c +++ b/test/pthread/test_pthread_tls_dylink.c @@ -5,7 +5,7 @@ int foo = 3; // This should generate a relocation in data section static int* _Atomic foo_addr = &foo; -// This should generate a reloction in the TLS data section +// This should generate a relocation in the TLS data section static _Thread_local int *tls_foo_addr = &foo; void run_test() { @@ -14,7 +14,7 @@ void run_test() { printf("&tls_foo_addr: %p\n", &tls_foo_addr); // The values stored foo_addr and tls_foo_addr should both be // the address of foo - printf("foo_add=%p tls_foo_addr=%p [delta=%ld]\n", foo_addr, tls_foo_addr, foo_addr - tls_foo_addr); + printf("foo_addr=%p tls_foo_addr=%p [delta=%ld]\n", foo_addr, tls_foo_addr, foo_addr - tls_foo_addr); assert(foo_addr == &foo); assert(tls_foo_addr == &foo); } diff --git a/test/runner.py b/test/runner.py index 9b1703594a844..e82b335eaa7ab 100755 --- a/test/runner.py +++ b/test/runner.py @@ -119,7 +119,7 @@ def check_js_engines(): if not all(jsrun.check_engine(e) for e in config.JS_ENGINES): - errlog('Not all the JS engines in JS_ENGINES appears to work.') + errlog('Not all the JS engines in JS_ENGINES appear to work.') sys.exit(1) if common.EMTEST_ALL_ENGINES: @@ -441,7 +441,7 @@ def run_tests(options, suites): testRunner = SingleLineTestRunner(failfast=options.failfast) else: if not options.ansi: - print('using verbose test runner (ANSI not avilable)') + print('using verbose test runner (ANSI not available)') else: print('using verbose test runner (verbose output requested)') testRunner = ColorTextRunner(failfast=options.failfast) diff --git a/test/sockets/test_enet_client.c b/test/sockets/test_enet_client.c index 46d03067ce22d..5291f7d940319 100644 --- a/test/sockets/test_enet_client.c +++ b/test/sockets/test_enet_client.c @@ -48,7 +48,7 @@ void main_loop() { enet_packet_destroy (event.packet); break; case ENET_EVENT_TYPE_DISCONNECT: - printf ("%s disconected.\n", (char*)event.peer -> data); + printf ("%s disconnected.\n", (char*)event.peer -> data); /* Reset the peer's client information. */ event.peer -> data = NULL; enet_host_destroy(host); @@ -71,7 +71,7 @@ int main (int argc, char ** argv) host = enet_host_create (NULL /* create a client host */, 1 /* only allow 1 outgoing connection */, - 2 /* allow up 2 channels to be used, 0 and 1 */, + 2 /* allow up to 2 channels to be used, 0 and 1 */, 57600 / 8 /* 56K modem with 56 Kbps downstream bandwidth */, 14400 / 8 /* 56K modem with 14 Kbps upstream bandwidth */); if (host == NULL) diff --git a/test/sockets/test_enet_server.c b/test/sockets/test_enet_server.c index b15b727d5ffb4..2b542288e2e6f 100644 --- a/test/sockets/test_enet_server.c +++ b/test/sockets/test_enet_server.c @@ -22,7 +22,7 @@ void send_msg(ENetPeer *peer) { ENetPacket * packet = enet_packet_create ("packet", strlen ("packet") + 1, ENET_PACKET_FLAG_RELIABLE); - /* Extend the packet so and append the string "foo", so it now */ + /* Extend the packet and append the string "foo", so it now */ /* contains "packetfoo\0" */ enet_packet_resize (packet, strlen ("packetfoo") + 1); strcpy ((char*)& packet -> data [strlen ("packet")], "foo"); @@ -73,7 +73,7 @@ printf("enet host, got event of type %d\n", event.type); enet_packet_destroy (event.packet); break; case ENET_EVENT_TYPE_DISCONNECT: - printf ("%s disconected.\n", (char*)event.peer -> data); + printf ("%s disconnected.\n", (char*)event.peer -> data); /* Reset the peer's client information. */ event.peer -> data = NULL; enet_host_destroy(host); diff --git a/test/sockets/test_sockets_partial_client.c b/test/sockets/test_sockets_partial_client.c index 4b3c675722b36..3f9cec07e7ac0 100644 --- a/test/sockets/test_sockets_partial_client.c +++ b/test/sockets/test_sockets_partial_client.c @@ -57,7 +57,7 @@ void iter() { return; //try again } - perror("unexcepted end of data"); + perror("unexpected end of data"); finish(EXIT_FAILURE); } @@ -72,7 +72,7 @@ void iter() { printf("got %d,%d\n", res, packetLength); if (res != packetLength) { - fprintf(stderr, "lost packet data, expected: %d readed: %d", packetLength, res); + fprintf(stderr, "lost packet data, expected: %d read: %d", packetLength, res); finish(EXIT_FAILURE); } diff --git a/test/sqlite/speedtest1.c b/test/sqlite/speedtest1.c index c179f34523cba..c7b2f510f1ac7 100644 --- a/test/sqlite/speedtest1.c +++ b/test/sqlite/speedtest1.c @@ -18,7 +18,7 @@ static const char zHelp[] = " --exclusive Enable locking_mode=EXCLUSIVE\n" " --explain Like --sqlonly but with added EXPLAIN keywords\n" " --heap SZ MIN Memory allocator uses SZ bytes & min allocation MIN\n" - " --incrvacuum Enable incremenatal vacuum mode\n" + " --incrvacuum Enable incremental vacuum mode\n" " --journalmode M Set the journal_mode to MODE\n" " --key KEY Set the encryption key to KEY\n" " --lookaside N SZ Configure lookaside for N slots of SZ bytes each\n" @@ -169,7 +169,7 @@ unsigned int speedtest1_random(void){ } /* Map the value in within the range of 1...limit into another -** number in a way that is chatic and invertable. +** number in a way that is chaotic and invertible. */ unsigned swizzle(unsigned in, unsigned limit){ unsigned out = 0; @@ -189,7 +189,7 @@ unsigned roundup_allones(unsigned limit){ return m; } -/* The speedtest1_numbername procedure below converts its argment (an integer) +/* The speedtest1_numbername procedure below converts its argument (an integer) ** into a string which is the English-language name for that number. ** The returned string should be freed with sqlite3_free(). ** @@ -1150,7 +1150,7 @@ int main(int argc, char **argv){ int nPCache = 0, szPCache = 0;/* --pcache configuration */ int nScratch = 0, szScratch=0;/* --scratch configuration */ int showStats = 0; /* True for --stats */ - const char *zTSet = "main"; /* Which --testset torun */ + const char *zTSet = "main"; /* Which --testset to run */ int doTrace = 0; /* True for --trace */ const char *zEncoding = 0; /* --utf16be or --utf16le */ const char *zDbName = 0; /* Name of the test database */ diff --git a/test/stdio/test_rename.c b/test/stdio/test_rename.c index 08bd30b9e2d5a..0d0c5800573cc 100644 --- a/test/stdio/test_rename.c +++ b/test/stdio/test_rename.c @@ -161,7 +161,7 @@ void test() { #endif assert(!err); - // Test that non-existant parent during rename generates the correct error + // Test that non-existent parent during rename generates the correct error // code. err = rename("dir/hicsuntdracones/empty", "dir/hicsuntdracones/renamed"); assert(err == -1); diff --git a/test/test_browser.py b/test/test_browser.py index 89247368832c5..3b8b21600a591 100644 --- a/test/test_browser.py +++ b/test/test_browser.py @@ -540,7 +540,7 @@ def test_output_file_escaping(self): self.run_browser(page_file, '/report_result?exit:0') # Clear all IndexedDB databases. This gives us a fresh state for tests that - # chech caching. + # check caching. def clear_indexed_db(self): self.add_browser_reporting() create_file('clear_indexed_db.html', ''' @@ -1235,7 +1235,7 @@ def test_webgl_context_attributes(self): self.btest_exit('test_webgl_context_attributes_sdl2.c', cflags=['--js-library', 'check_webgl_attributes_support.js', '-DAA_ACTIVATED', '-DDEPTH_ACTIVATED', '-DSTENCIL_ACTIVATED', '-DALPHA_ACTIVATED', '-lGL', '-sUSE_SDL=2', '-lGLEW']) self.btest_exit('test_webgl_context_attributes_glfw.c', cflags=['--js-library', 'check_webgl_attributes_support.js', '-DAA_ACTIVATED', '-DDEPTH_ACTIVATED', '-DSTENCIL_ACTIVATED', '-DALPHA_ACTIVATED', '-lGL', '-lglfw', '-lGLEW']) - # perform tests with attributes desactivated + # perform tests with attributes deactivated self.btest_exit('test_webgl_context_attributes_glut.c', cflags=['--js-library', 'check_webgl_attributes_support.js', '-lGL', '-lglut', '-lGLEW']) self.btest_exit('test_webgl_context_attributes_sdl.c', cflags=['--js-library', 'check_webgl_attributes_support.js', '-lGL', '-lSDL', '-lGLEW']) self.btest_exit('test_webgl_context_attributes_glfw.c', cflags=['--js-library', 'check_webgl_attributes_support.js', '-lGL', '-lglfw', '-lGLEW']) @@ -2035,7 +2035,7 @@ def test_cubegeom_normal_dap(self): # draw is given a direct pointer to clientsi self.reftest('third_party/cubegeom/cubegeom_normal_dap.c', 'third_party/cubegeom/cubegeom_normal.png', cflags=['-sLEGACY_GL_EMULATION', '-lGL', '-lSDL']) @requires_graphics_hardware - def test_cubegeom_normal_dap_far(self): # indices do nto start from 0 + def test_cubegeom_normal_dap_far(self): # indices do not start from 0 self.reftest('third_party/cubegeom/cubegeom_normal_dap_far.c', 'third_party/cubegeom/cubegeom_normal.png', cflags=['-sLEGACY_GL_EMULATION', '-lGL', '-lSDL']) @requires_graphics_hardware @@ -3322,7 +3322,7 @@ def test_minimal_runtime_export_name(self): # use EXPORT_NAME 'export_name': (['-sEXPORT_NAME="HelloWorld"'], ''' if (typeof Module !== "undefined") throw "what?!"; // do not pollute the global scope, we are modularized! - HelloWorld.noInitialRun = true; // errorneous module capture will load this and cause timeout + HelloWorld.noInitialRun = true; // erroneous module capture will load this and cause timeout let promise = HelloWorld(); if (!promise instanceof Promise) throw new Error('Return value should be a promise'); '''), @@ -3492,7 +3492,7 @@ def test_dlopen_async(self): def test_dlopen_blocking(self): self.emcc('other/test_dlopen_blocking_side.c', ['-o', 'libside.so', '-sSIDE_MODULE', '-pthread', '-Wno-experimental']) # Attempt to use dlopen the side module (without preloading) should fail on the main thread - # since the syncronous `readBinary` function does not exist. + # since the synchronous `readBinary` function does not exist. self.btest_exit('other/test_dlopen_blocking.c', assert_returncode=1, cflags=['-sMAIN_MODULE=2', '-sAUTOLOAD_DYLIBS=0', 'libside.so']) # But with PROXY_TO_PTHEAD it does work, since we can do blocking and sync XHR in a worker. self.btest_exit('other/test_dlopen_blocking.c', cflags=['-sMAIN_MODULE=2', '-sPROXY_TO_PTHREAD', '-pthread', '-Wno-experimental', '-sAUTOLOAD_DYLIBS=0', 'libside.so']) @@ -3593,7 +3593,7 @@ def test_dylink_pthread_many(self): # Test asynchronously loading two side modules during startup # They should always load in the same order # Verify that function pointers in the browser's main thread - # reffer to the same function as in a pthread worker. + # refer to the same function as in a pthread worker. # The main thread function table is populated asynchronously # in the browser's main thread. However, it should still be @@ -4053,8 +4053,8 @@ def test_pthread_asan_use_after_free(self): @no_safari('TODO: Hangs') # Fails in Safari 17.6 (17618.3.11.11.7, 17618), Safari 26.0.1 (21622.1.22.11.15) @also_with_wasmfs def test_pthread_asan_use_after_free_2(self): - # similiar to test_pthread_asan_use_after_free, but using a pool instead - # of proxy-to-pthread, and al, '-Wno-experimental'so the allocation happens on the pthread + # similar to test_pthread_asan_use_after_free, but using a pool instead + # of proxy-to-pthread, and also the allocation happens on the pthread # (which tests that it can use the offset converter to get the stack # trace there) self.btest('pthread/test_pthread_asan_use_after_free_2.cpp', expected='1', cflags=['-fsanitize=address', '-pthread', '-sPTHREAD_POOL_SIZE=1', '--pre-js', test_file('pthread/test_pthread_asan_use_after_free_2.js')]) @@ -5269,7 +5269,7 @@ def test_emmalloc_3gb(self, args): # Test that it is possible to malloc() a huge 3GB memory block in 4GB mode using dlmalloc. @no_firefox('no 4GB support yet') - @no_2gb('not enough space tp run in this mode') + @no_2gb('not enough space to run in this mode') def test_dlmalloc_3gb(self): if self.is_4gb(): self.set_setting('MAXIMUM_MEMORY', '8GB') @@ -5385,7 +5385,7 @@ def test_browser_run_with_slash_in_query_and_hash(self): }) def test_manual_pthread_proxy_hammer(self, args): # the specific symptom of the hang that was fixed is that the test hangs - # at some point, using 0% CPU. often that occured in 0-200 iterations, but + # at some point, using 0% CPU. often that occurred in 0-200 iterations, but # you may want to adjust "ITERATIONS". self.btest_exit('pthread/test_pthread_proxy_hammer.cpp', cflags=['-pthread', '-O2', '-sPROXY_TO_PTHREAD', @@ -5592,7 +5592,7 @@ def test_cross_origin(self, args, port): create_file('subdir/foo.txt', 'hello') self.compile_btest('hello_world.c', ['-o', 'subdir/hello.js', '-sRUNTIME_DEBUG', '-sCROSS_ORIGIN', '-sPROXY_TO_PTHREAD', '-pthread', '-sEXIT_RUNTIME'] + args) - class MyReqestHandler(SimpleHTTPRequestHandler): + class MyRequestHandler(SimpleHTTPRequestHandler): def __init__(self, *args, **kwargs): super().__init__(*args, directory='subdir', **kwargs) @@ -5616,7 +5616,7 @@ def end_headers(self): else: create_file('test.html', f'') - server = HttpServerThread(ThreadingHTTPServer(('localhost', port), MyReqestHandler)) + server = HttpServerThread(ThreadingHTTPServer(('localhost', port), MyRequestHandler)) server.start() try: self.run_browser('test.html', '/report_result?exit:0') diff --git a/test/test_c_preprocessor.c b/test/test_c_preprocessor.c index e09b4fc7733f0..55dea067822ce 100644 --- a/test/test_c_preprocessor.c +++ b/test/test_c_preprocessor.c @@ -146,7 +146,7 @@ EM_JS(void, test_c_preprocessor, (void), { test('#define FOO 42\n#define BAR FOO\nBAR\n', '42\n'); // Test chained expanding a preprocessor symbol test('#define MACRO(x) x\nMACRO(42)\n', '42\n'); // Test one-parameter preprocessor macro test('#define MACRO(x,y) x\nMACRO(42, 53)\n', '42\n'); // Test a two-parameter preprocessor macro - test('#define MACRO( \t x , y ) \t x \t\nMACRO(42, 53)\n', '42\n'); // Test a macro with odd whitescape in it + test('#define MACRO( \t x , y ) \t x \t\nMACRO(42, 53)\n', '42\n'); // Test a macro with odd whitespace in it test('#define MACRO(x,y,z) x+y<=z\nMACRO(42,15,30)\n', '42+15<=30\n'); // Test three-arg macro diff --git a/test/test_codesize.py b/test/test_codesize.py index 4316e17cc537d..2611cd83bbc79 100644 --- a/test/test_codesize.py +++ b/test/test_codesize.py @@ -252,7 +252,7 @@ def run_codesize_test(self, filename, cflags, check_funcs=True, check_full_js=Fa relevant = relevant.split(',') sent = [x.split(':')[0].strip() for x in relevant] sent = [x for x in sent if x] - # Deminify the sent list, if minification occured + # Deminify the sent list, if minification occurred if os.path.exists('minify.map'): sent = deminify_syms(sent, 'minify.map') os.remove('minify.map') @@ -269,7 +269,7 @@ def run_codesize_test(self, filename, cflags, check_funcs=True, check_full_js=Fa outputs.append('a.out.nodebug.wasm') imports, exports, funcs = self.parse_wasm('a.out.wasm') - # Deminify the imports/export lists, if minification occured + # Deminify the imports/export lists, if minification occurred if os.path.exists('minify.map'): exports = deminify_syms(exports, 'minify.map') imports = [i.split('.', 1)[1] for i in imports] @@ -359,7 +359,7 @@ def test_codesize_cxx(self, args): # finally, check what happens when we export nothing. wasm should be almost empty 'export_nothing': (['-Os', '-sEXPORTED_FUNCTIONS=[]'],), # we don't metadce with linkable code! other modules may want stuff - # TODO(sbc): Investivate why the number of exports is order of magnitude + # TODO(sbc): Investigate why the number of exports is order of magnitude # larger for wasm backend. # This test seems to produce different results under gzip on macOS and Windows machines # so skip the gzip size reporting here. diff --git a/test/test_core.py b/test/test_core.py index 29e5fc1d54dc0..8d225d54a50d9 100644 --- a/test/test_core.py +++ b/test/test_core.py @@ -151,7 +151,7 @@ def asan(func): @no_safe_heap('asan does not work with SAFE_HEAP') @no_wasm2js('TODO: ASAN in wasm2js') @no_wasm64('TODO: ASAN in memory64') - @no_2gb('asan doesnt support GLOBAL_BASE') + @no_2gb("asan doesn't support GLOBAL_BASE") @no_esm_integration('sanitizers do not support WASM_ESM_INTEGRATION') def decorated(self, *args, **kwargs): return func(self, *args, **kwargs) @@ -193,7 +193,7 @@ def decorated(self, relocatable, *args, **kwargs): self.check_dylink() if relocatable: # Since `-sMAIN_MODULE` no longer implies `-sRELOCATABLE` but we want - # to keep that cominbation working we run all the `@needs_dylink` tests + # to keep that combination working we run all the `@needs_dylink` tests # both with and without the explicit `-sRELOCATABLE` self.set_setting('RELOCATABLE') self.cflags.append('-Wno-deprecated') @@ -757,7 +757,7 @@ def test_align64(self): def test_unsigned(self): src = ''' #include - const signed char cvals[2] = { -1, -2 }; // compiler can store this is a string, so -1 becomes \\FF, and needs re-signing + const signed char cvals[2] = { -1, -2 }; // compiler can store this as a string, so -1 becomes \\FF, and needs re-signing int main() { { @@ -1725,7 +1725,7 @@ def clear_all_relevant_settings(self): clear_all_relevant_settings(self) # Marked as impure since the WASI reactor modules (modules without main) - # are not yet suppored by the wasm engines we test against. + # are not yet supported by the wasm engines we test against. @also_with_standalone_wasm(impure=True) @no_2gb('https://github.com/WebAssembly/binaryen/issues/5893') def test_ctors_no_main(self): @@ -2210,9 +2210,9 @@ def test_memorygrowth_linear_step(self): self.cflags += ['-sALLOW_MEMORY_GROWTH', '-sSTACK_SIZE=1Mb', '-sINITIAL_MEMORY=32Mb', '-sMAXIMUM_MEMORY=64Mb', '-sMEMORY_GROWTH_LINEAR_STEP=1Mb'] self.do_core_test('test_memorygrowth_linear_step.c') - @no_ubsan('UBSan seems to effect the precise memory usage') - @no_4gb('depends on specifc memory layout') - @no_2gb('depends on specifc memory layout') + @no_ubsan('UBSan seems to affect the precise memory usage') + @no_4gb('depends on specific memory layout') + @no_2gb('depends on specific memory layout') def test_memorygrowth_geometric_step(self): if self.has_changed_setting('ALLOW_MEMORY_GROWTH'): self.skipTest('test needs to modify memory growth') @@ -2738,7 +2738,7 @@ def test_pthread_tls(self): self.skipTest('MINIMAL_RUNTIME + threads + asan does not work') self.do_runf('pthread/test_pthread_tls.c') - @no_modularize_instance('uses global Module objecgt') + @no_modularize_instance('uses global Module object') def test_pthread_run_script(self): if not self.is_optimizing() and ('-flto' in self.cflags or '-flto=thin' in self.cflags): self.skipTest('https://github.com/emscripten-core/emscripten/issues/25015') @@ -3119,7 +3119,7 @@ def test_dlfcn_data_and_fptr(self): void lib_fptr() { printf("Second calling lib_fptr from main.\n"); parent_func(); - // call it also through a pointer, to check indexizing + // call it also through a pointer, to check indexing void (*p_f)(); p_f = parent_func; p_f(); @@ -3937,7 +3937,7 @@ def test_dlfcn_rtld_local(self): @needs_dylink @no_modularize_instance('uses file packager') def test_dlfcn_preload(self): - # Create chain of dependencies and load the first libary with preload plugin. + # Create chain of dependencies and load the first library with preload plugin. # main -> libb.so -> liba.so create_file('liba.c', r''' #include @@ -4037,7 +4037,7 @@ def dylink_testf(self, main, side=None, expected=None, force_c=False, main_cflag shutil.move(so_file, so_file + '.orig') - # Verify that building with -sSIDE_MODULE is essentailly the same as building with `-shared -fPIC -sFAKE_DYLIBS=0`. + # Verify that building with -sSIDE_MODULE is essentially the same as building with `-shared -fPIC -sFAKE_DYLIBS=0`. flags = ['-shared', '-fPIC', '-sFAKE_DYLIBS=0'] if isinstance(side, list): # side is just a library @@ -4145,7 +4145,7 @@ def test_dylink_function_pointer_equality(self): int main() { void* puts_side = get_address(); printf("main module address %p.\n", &puts); - printf("side module address address %p.\n", puts_side); + printf("side module address %p.\n", puts_side); if (&puts == puts_side) printf("success\n"); else @@ -4626,8 +4626,8 @@ def test_dylink_jslib(self): extern int main2(); double sidey() { int temp = main2(); - printf("main2 sed: %d\n", temp); - printf("main2 sed: %u, %c\n", temp, temp/2); + printf("main2 said: %d\n", temp); + printf("main2 said: %u, %c\n", temp, temp/2); return test_lib_func(temp); } ''', expected='other says 45.2', main_cflags=['--js-library', 'lib.js'], force_c=True) @@ -5750,7 +5750,7 @@ def test_utf32(self): @no_sanitize('requires libc to be built with -fshort-char') def test_utf32_short_wchar(self): if '-flto' in self.cflags or '-flto=thin' in self.cflags: - self.skipTest('-fshort-wchar is not compatible with LTO (libraries would need rebuilting)') + self.skipTest('-fshort-wchar is not compatible with LTO (libraries would need rebuilding)') self.do_runf('utf32.cpp', 'OK (short).\n', cflags=['-fshort-wchar']) @with_both_text_decoder @@ -5936,7 +5936,7 @@ def test_fs_mmap(self): @no_wasmfs('wasmfs will (?) need a non-JS mechanism to ignore permissions during startup') @also_with_minimal_runtime def test_fs_no_main(self): - # library_fs.js uses hooks to enable ignoring of permisions up until ATMAINs are run. This + # library_fs.js uses hooks to enable ignoring of permissions up until ATMAINs are run. This # test verified that they work correctly, even in programs without a main function. create_file('pre.js', ''' Module.preRun = () => { @@ -5976,7 +5976,7 @@ def test_fs_errorstack(self): ); return 0; } - ''', 'at Object.readFile', assert_returncode=NON_ZERO) # engines has different error stack format + ''', 'at Object.readFile', assert_returncode=NON_ZERO) # engines have different error stack format @also_with_noderawfs def test_fs_llseek(self): @@ -6021,7 +6021,7 @@ def test_fs_rename_on_existing(self): self.do_runf('fs/test_fs_rename_on_existing.c', 'success') @also_with_nodefs_both - @no_windows('stat ino values dont match on windows') + @no_windows("stat ino values don't match on windows") @crossplatform @no_wasmfs('Assertion failed: "a_ino == sta.st" in test_fs_readdir_ino_matches_stat_ino.c, line 58. https://github.com/emscripten-core/emscripten/issues/25035') def test_fs_readdir_ino_matches_stat_ino(self): @@ -6061,9 +6061,9 @@ def test_sigaction_default(self, signal, exit_code, assert_identical): def test_unistd_access(self): if self.get_setting('WASMFS'): self.set_setting('FORCE_FILESYSTEM') - # On windows we have slighly different output because we the same + # On windows we have slightly different output because we use the same # level of permissions are not available. For example, on windows - # its not possible have a file that is not readable, but writable. + # it's not possible to have a file that is not readable, but writable. # We also report all files as executable since there is no x bit # recorded there. # See https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/chmod-wchmod?view=msvc-170#remarks @@ -6353,7 +6353,7 @@ def test_unicode_js_library(self): # The follow program should fail, assuming the above LC_CTYPE + PYTHONUTF8 # are having the desired effect. # This means that files open()'d by emscripten without an explicit encoding will - # cause this test to file, hopefully catching any places where we forget to do this. + # cause this test to fail, hopefully catching any places where we forget to do this. # On Windows when Unicode support is enabled, this test code does not fail. if not (WINDOWS and self.run_process(['chcp'], stdout=PIPE, shell=True).stdout.strip() == 'Active code page: 65001'): @@ -6581,7 +6581,7 @@ def test_relocatable_void_function(self): 'unsigned_char': (['-funsigned-char'],), }) def test_wasm_intrinsics_simd(self, args): - # These flags need to go first so that they comebore any existing `-Wno-..` flags + # These flags need to go first so that they come before any existing `-Wno-..` flags self.cflags.insert(0, '-Wpedantic') self.cflags.insert(0, '-Wall') self.do_runf('test_wasm_intrinsics_simd.c', 'Success!', cflags=args) @@ -7912,7 +7912,7 @@ def test_source_map(self): src_index = data['sources'].index('src.cpp') if hasattr(data, 'sourcesContent'): # the sourcesContent attribute is optional, but if it is present it - # needs to containt valid source text. + # needs to contain valid source text. self.assertTextDataIdentical(src, data['sourcesContent'][src_index]) mappings = json.loads(self.run_js( path_from_root('test/sourcemap2json.js'), @@ -8731,16 +8731,16 @@ def test_no_declare_asm_module_exports(self): self.maybe_closure() self.do_runf('declare_asm_module_exports.c', 'jsFunction: 1') js = read_file('declare_asm_module_exports.js') - occurances = js.count('cFunction') + occurrences = js.count('cFunction') if self.is_optimizing() and '-g' not in self.cflags: # In optimized builds only the single reference cFunction that exists in the EM_ASM should exist if self.is_wasm(): - self.assertEqual(occurances, 1) + self.assertEqual(occurrences, 1) else: # With js the asm module itself also contains a reference for the cFunction name - self.assertEqual(occurances, 2) + self.assertEqual(occurrences, 2) else: - print(occurances) + print(occurrences) # Tests that -sMINIMAL_RUNTIME works well in different build modes @no_wasmfs('https://github.com/emscripten-core/emscripten/issues/16816') @@ -9675,7 +9675,7 @@ def test_pipe_select(self, args): @also_without_bigint def test_jslib_i64_params(self): # Tests the defineI64Param and receiveI64ParamAsI53 helpers that are - # used to recieve i64 argument in syscalls. + # used to receive i64 argument in syscalls. self.cflags += ['--js-library=' + test_file('core/test_jslib_i64_params.js')] self.do_core_test('test_jslib_i64_params.c') diff --git a/test/test_emscripten_async_wget2.cpp b/test/test_emscripten_async_wget2.cpp index 8720c6a185e79..f94e42be9e060 100644 --- a/test/test_emscripten_async_wget2.cpp +++ b/test/test_emscripten_async_wget2.cpp @@ -19,8 +19,8 @@ class http { REQUEST_POST , }; - enum AssyncMode { - ASSYNC_THREAD + enum AsyncMode { + ASYNC_THREAD }; // Callback @@ -39,15 +39,15 @@ class http { req->onProgress(progress); } - // Constructeur + // Constructor http(const char* hostname, int requestType, const char* targetFilename = "") : _hostname(hostname), _targetFileName(targetFilename), _request((RequestType)requestType), - _status(ST_PENDING), _assync(ASSYNC_THREAD), _uid(uid++) {} + _status(ST_PENDING), _async(ASYNC_THREAD), _uid(uid++) {} /** * Effectue la requete */ - void runRequest(const char* page, int assync); + void runRequest(const char* page, int async); /** * Abort the request @@ -143,8 +143,8 @@ class http { // progress value int _progressValue = -1; - // mode assyncrone courant - AssyncMode _assync; + // current async mode + AsyncMode _async; // request handle unsigned _handle; @@ -223,10 +223,10 @@ std::string http::cross_domain = ""; /** * Effectue la requete */ -void http::runRequest(const char* page, int assync) { +void http::runRequest(const char* page, int async) { _page = page; _status = ST_PENDING; - _assync = (AssyncMode)assync; + _async = (AsyncMode)async; _progressValue = 0; std::string url = cross_domain; @@ -362,7 +362,7 @@ int main() { /* Http* http4 = new Http("http://www.---.com",Http::REQUEST_POST); http4->addValue("app","123"); - http4->runRequest("/test.php",Http::ASSYNC_THREAD); + http4->runRequest("/test.php",Http::ASYNC_THREAD); num_request ++; emscripten_async_call(wait_http,http4,500); */ diff --git a/test/test_emscripten_async_wget2_data.cpp b/test/test_emscripten_async_wget2_data.cpp index eb92ca6dd5abc..d6881f926c523 100644 --- a/test/test_emscripten_async_wget2_data.cpp +++ b/test/test_emscripten_async_wget2_data.cpp @@ -49,7 +49,7 @@ void onerror(unsigned handle, void* arg, int status, const char* status_text) { error_count++; request->status = FAIL; } else if (status_text != nullptr && request->expected_http_status_text == nullptr) { - printf("Error: Request [%s] gave status text [%s] but no response was expted\n", + printf("Error: Request [%s] gave status text [%s] but no response was expected\n", request->target, status_text); error_count++; request->status = FAIL; diff --git a/test/test_emscripten_log.cpp b/test/test_emscripten_log.cpp index c21d730b4b6d4..9dd8ce8b8f468 100644 --- a/test/test_emscripten_log.cpp +++ b/test/test_emscripten_log.cpp @@ -35,7 +35,7 @@ void __attribute__((noinline)) kitten() { emscripten_log(EM_LOG_NO_PATHS | EM_LOG_CONSOLE | EM_LOG_INFO, "Info message to console."); emscripten_log(EM_LOG_NO_PATHS | EM_LOG_CONSOLE | EM_LOG_DEBUG, "Debug message to console."); - // Log to with full callstack information (both original C source and JS callstacks): + // Log with full callstack information (both original C source and JS callstacks): emscripten_log(EM_LOG_C_STACK | EM_LOG_JS_STACK, "A message with as full call stack information as possible:"); // Log with just mangled JS callstacks: diff --git a/test/test_gles2_conformance.c b/test/test_gles2_conformance.c index a6053970050dc..b67e424e7d545 100644 --- a/test/test_gles2_conformance.c +++ b/test/test_gles2_conformance.c @@ -26,7 +26,7 @@ int main(int argc, char *argv[]) { return 1; } - // Test that code containing functions related to GLES2 binary shader API will successfully compile ad run + // Test that code containing functions related to GLES2 binary shader API will successfully compile and run // (will be nonfunctional no-ops since WebGL doesn't have binary shaders) GLuint vs = glCreateShader(GL_VERTEX_SHADER); glShaderBinary(1, &vs, 0, 0, 0); diff --git a/test/test_jslib_override_system_symbol.js b/test/test_jslib_override_system_symbol.js index 3ede691a3cf19..c5fd8db0e417c 100644 --- a/test/test_jslib_override_system_symbol.js +++ b/test/test_jslib_override_system_symbol.js @@ -7,7 +7,7 @@ addToLibrary({ glTexImage3D__deps: ['orig_glTexImage3D'], glTexImage3D: function(target, level, internalFormat, width, height, depth, border, format, type, pixels) { _glTexImage3D.createdType = type; - // Check that the original fuction exists + // Check that the original function exists assert(_orig_glTexImage3D); // Also try invoking glTexImage3D to verify that it is actually the // underlying function from library_webgl2.js diff --git a/test/test_other.py b/test/test_other.py index bf92565d970c9..e9a431e39e390 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -368,7 +368,7 @@ def test_log_subcommands(self): self.assertExists('a.out.js') def test_skip_subcommands(self): - # The -### flag is like `-v` but it doesn't actaully execute the sub-commands + # The -### flag is like `-v` but it doesn't actually execute the sub-commands proc = self.run_process([EMCC, '-###', '-O3', test_file('hello_world.c')], stdout=PIPE, stderr=PIPE) self.assertContained(CLANG_CC, proc.stderr) self.assertContained(WASM_LD, proc.stderr) @@ -706,7 +706,7 @@ def test_combining_object_files(self): # Combining object files into another object should also work, using the `-r` flag err = self.run_process([EMCC, '-r', 'twopart_main.o', 'twopart_side.o', '-o', 'combined.o'], stderr=PIPE).stderr self.assertNotContained('warning:', err) - # Warn about legecy support for outputing object file without `-r`, `-c` or `-shared` + # Warn about legacy support for outputting object file without `-r`, `-c` or `-shared` err = self.run_process([EMCC, 'twopart_main.o', 'twopart_side.o', '-o', 'combined2.o'], stderr=PIPE).stderr self.assertContained('warning: object file output extension (.o) used for non-object output', err) @@ -983,7 +983,7 @@ def test_cmake_compile_features(self, args): self.assertTextDataIdentical(native_features, emscripten_features) # Test that the user's explicitly specified generator is always honored - # Internally we override the generator on windows, unles the user specifies one + # Internally we override the generator on windows, unless the user specifies one # Test require Ninja to be installed @requires_ninja def test_cmake_explicit_generator(self): @@ -3384,7 +3384,7 @@ def test_embind_allow_raw_pointer(self): @parameterized({ # With no arguments we are testing the default C++ version provided by clang. '': [], - # Ensure embind compiles under C++17 which is the miniumum supported version. + # Ensure embind compiles under C++17 which is the minimum supported version. 'cxx17': ['-std=c++17', '-Wno-#warnings'], 'o1': ['-O1'], 'o2': ['-O2'], @@ -3545,7 +3545,7 @@ def test_embind_tsgen_end_to_end(self, opts, tsc_opts): self.emcc(test_file('other/embind_tsgen.cpp'), ['-o', 'embind_tsgen.js', '-lembind', '--emit-tsd', 'embind_tsgen.d.ts'] + opts) - # Test that the output compiles with a TS file that uses the defintions. + # Test that the output compiles with a TS file that uses the definitions. shutil.copyfile(test_file('other/embind_tsgen_main.ts'), 'main.ts') if '-sEXPORT_ES6' in opts: # A package file with type=module is needed to enabled ES modules in TSC and @@ -3708,7 +3708,7 @@ def test_emit_tsd(self): '-Wno-experimental', '-o', 'test_emit_tsd.js'] + self.get_cflags()) self.assertFileContents(test_file('other/test_emit_tsd.d.ts'), read_file('test_emit_tsd.d.ts')) - # Test that the output compiles with a TS file that uses the defintions. + # Test that the output compiles with a TS file that uses the definitions. cmd = shared.get_npm_cmd('tsc') + [test_file('other/test_tsd.ts'), '--noEmit'] shared.check_call(cmd) @@ -3720,7 +3720,7 @@ def test_emit_tsd_sync_compilation(self): '-o', 'test_emit_tsd_sync.js'] + self.get_cflags()) self.assertFileContents(test_file('other/test_emit_tsd_sync.d.ts'), read_file('test_emit_tsd_sync.d.ts')) - # Test that the output compiles with a TS file that uses the defintions. + # Test that the output compiles with a TS file that uses the definitions. cmd = shared.get_npm_cmd('tsc') + [test_file('other/test_tsd_sync.ts'), '--noEmit'] shared.check_call(cmd) @@ -3731,7 +3731,7 @@ def test_emit_tsd_wasm_only(self): def test_emconfig(self): output = self.run_process([emconfig, 'LLVM_ROOT'], stdout=PIPE).stdout.strip() self.assertEqual(output, config.LLVM_ROOT) - # EMSCRIPTEN_ROOT is kind of special since it should always report the locaton of em-config + # EMSCRIPTEN_ROOT is kind of special since it should always report the location of em-config # itself (its not configurable via the config file but driven by the location for arg0) output = self.run_process([emconfig, 'EMSCRIPTEN_ROOT'], stdout=PIPE).stdout.strip() self.assertEqual(output, os.path.dirname(emconfig)) @@ -5542,7 +5542,7 @@ def test_fs_dev_random(self): # forced libs is ok, they were there anyhow 'normal': [{'EMCC_FORCE_STDLIBS': 'libc,libc++abi,libc++'}, False], # partial list, but ok since we grab them as needed - 'parial': [{'EMCC_FORCE_STDLIBS': 'libc++'}, False], + 'partial': [{'EMCC_FORCE_STDLIBS': 'libc++'}, False], # fail! not enough stdlibs 'partial_only': [{'EMCC_FORCE_STDLIBS': 'libc++,libc,libc++abi', 'EMCC_ONLY_FORCED_STDLIBS': '1'}, True], # force all the needed stdlibs, so this works even though we ignore the input file @@ -5953,7 +5953,7 @@ def test_no_filesystem_code_size(self, opts, absolute): def do(name, source, moar_opts): self.clear() - # pad the name to a common length so that doesn't effect the size of the + # pad the name to a common length so that doesn't affect the size of the # output padded_name = name + '_' * (20 - len(name)) self.run_process([EMCC, test_file(source), '-o', padded_name + '.js'] + self.get_cflags() + opts + moar_opts) @@ -7245,7 +7245,7 @@ def test_no_warn_exported_jslibfunc(self): self.run_process([EMCC, test_file('hello_world.c'), '-sEXPORTED_FUNCTIONS=_main,_alGetError']) - # Same again but with `_alGet` wich does not exist. This is a regression + # Same again but with `_alGet` which does not exist. This is a regression # test for a bug we had where any prefix of a valid function was accepted. self.assert_fail([EMCC, test_file('hello_world.c'), '-sDEFAULT_LIBRARY_FUNCS_TO_INCLUDE=alGetError', @@ -7485,7 +7485,7 @@ def test_lib_include_flags(self): self.run_process([EMCC] + '-l m -l c -I'.split() + [test_file('include_test'), test_file('lib_include_flags.c')]) def test_dash_s_link_flag(self): - # -s is also a valid link flag. We try to distingish between this case and when + # -s is also a valid link flag. We try to distinguish between this case and when # its used to set a settings based on looking at the argument that follows. # Test the case when -s is the last flag @@ -7516,7 +7516,7 @@ def test_dash_s_response_file_list_with_comments(self): create_file('response_file.txt', '_main\n#_nope_ish_nope\n_malloc\n') self.run_process([EMCC, test_file('hello_world.c'), '-sEXPORTED_FUNCTIONS=@response_file.txt']) - def test_dash_s_response_file_misssing(self): + def test_dash_s_response_file_missing(self): expected = 'error: foo: file not found parsing argument: EXPORTED_FUNCTIONS=@foo' self.assert_fail([EMCC, test_file('hello_world.c'), '-sEXPORTED_FUNCTIONS=@foo'], expected) @@ -7671,7 +7671,7 @@ def test(p1, p2, p3, last, expected): assert first == second and second == third print('with bad ctor') first = test(1000, 2000, 3000, 0xf, 0x58f) # noqa: E221, 2 will succeed - second = test(3000, 1000, 2000, 0xf, 0x8f5) # 1 will succedd + second = test(3000, 1000, 2000, 0xf, 0x8f5) # 1 will succeed third = test(2000, 3000, 1000, 0xf, 0xf58) # noqa: E221, 0 will succeed print(first, second, third) self.assertLess(first, second) @@ -8348,7 +8348,7 @@ def test_wasm_target_and_STANDALONE_WASM(self): self.assertContained('hello, world!', self.run_js('out.wasm', engine=engine)) def test_side_module_naming(self): - # SIDE_MODULE should work with any arbirary filename + # SIDE_MODULE should work with any arbitrary filename for opts, target in [([], 'a.out.wasm'), (['-o', 'lib.wasm'], 'lib.wasm'), (['-o', 'lib.so'], 'lib.so'), @@ -8927,7 +8927,7 @@ def test_emar_M(self): self.assertContained('file2', result) def test_emar_duplicate_inputs(self): - # Verify the we can supply the same intput muliple times without + # Verify that we can supply the same input multiple times without # confusing emar.py: # See https://github.com/emscripten-core/emscripten/issues/9733 create_file('file1', ' ') @@ -8945,8 +8945,8 @@ def test_emar_response_file(self): building.emar('cr', 'libfoo.a', ['@tmp.rsp']) def test_response_file_bom(self): - # Modern CMake version create response fils in UTF-8 but with BOM - # at the begining. Test that we can handle this. + # Modern CMake version create response files in UTF-8 but with BOM + # at the beginning. Test that we can handle this. # https://docs.python.org/3/library/codecs.html#encodings-and-unicode create_file('test.rsp', b'\xef\xbb\xbf--version', binary=True) self.run_process([EMCC, '@test.rsp']) @@ -9054,7 +9054,7 @@ def test_closure_full_js_library(self, args): '-sINCLUDE_FULL_LIBRARY', '-sOFFSCREEN_FRAMEBUFFER', # Enable as many features as possible in order to maximise - # tha amount of library code we inculde here. + # the amount of library code we include here. '-sMAIN_MODULE', '-sFETCH', '-sFETCH_SUPPORT_INDEXEDDB', @@ -9150,7 +9150,7 @@ def test_closure_type_annotations(self): # ambiguity and maximize optimization opportunities in user code. # # Currently we check for a fixed set of known attribute names which - # have been reported as unannoted in the past: + # have been reported as unannotated in the past: attributes = ['put', 'getContext', 'contains', 'stopPropagation', 'pause'] methods = '' for attribute in attributes: @@ -11314,7 +11314,7 @@ def test_on_reject_promise(self): self.assertContained('UnhandledPromiseRejection', err) def test_em_asm_duplicate_strings(self): - # We had a regression where tow different EM_ASM strings from two diffferent + # We had a regression where two different EM_ASM strings from two different # object files were de-duplicated in wasm-emscripten-finalize. This used to # work when we used zero-based index for store the JS strings, but once we # switched to absolute addresses the string needs to exist twice in the JS @@ -11482,7 +11482,7 @@ def test_linker_flags_pass_through_u(self): # Verify that the library is normally ignored and that the link succeeds self.run_process(cmd + ['libtest.a']) - # Adding `-u baz` makes no diffeence + # Adding `-u baz` makes no difference self.run_process(cmd + ['-ubaz', 'libtest.a']) # But adding `-ufoo` should fail because it loads foo, which depends on bar @@ -11529,7 +11529,7 @@ def test_backwards_deps_in_archive(self): def test_warning_flags(self): self.run_process([EMCC, '-c', '-o', 'hello.o', test_file('hello_world.c')]) - # -g4 will generte a deprecated warning + # -g4 will generate a deprecated warning cmd = [EMCC, 'hello.o', '-o', 'a.js', '-g4'] # warning that is enabled by default @@ -11552,7 +11552,7 @@ def test_warning_flags(self): stderr = self.run_process(cmd + ['-Werror', '-Wno-error=deprecated'], stderr=PIPE).stderr self.assertContained('emcc: warning: please replace -g4 with -gsource-map [-Wdeprecated]', stderr) - # check that `-Werror=foo` also enales foo + # check that `-Werror=foo` also enables foo expected = 'error: use of legacy setting: TOTAL_MEMORY (setting renamed to INITIAL_MEMORY) [-Wlegacy-settings] [-Werror]' self.assert_fail(cmd + ['-Werror=legacy-settings', '-sTOTAL_MEMORY'], expected) @@ -11577,7 +11577,7 @@ def test_emranlib(self): def test_pthread_stub(self): # Verify that programs containing pthread code can still work even - # without enabling threads. This is possible becase we link in + # without enabling threads. This is possible because we link in # libpthread_stub.a self.do_other_test('test_pthread_stub.c') @@ -11771,7 +11771,7 @@ def test_signature_mismatch(self): self.expect_fail([EMCC, '-Wl,--fatal-warnings', 'a.c', 'b.c']) # STRICT mode implies fatal warnings self.expect_fail([EMCC, '-sSTRICT', 'a.c', 'b.c']) - # Unless `--no-fatal-warnings` is explictly passed + # Unless `--no-fatal-warnings` is explicitly passed stderr = self.run_process([EMCC, '-sSTRICT', '-Wl,--no-fatal-warnings', 'a.c', 'b.c'], stderr=PIPE).stderr self.assertContained('function signature mismatch: foo', stderr) @@ -11811,7 +11811,7 @@ def test_nostdlib(self): self.assertContained(err, self.expect_fail([EMCC, test_file('unistd/close.c'), '-nostdlib'])) self.assertContained(err, self.expect_fail([EMCC, test_file('unistd/close.c'), '-nodefaultlibs'])) - # Build again but with explit system libraries + # Build again but with explicit system libraries libs = ['-lc', '-lcompiler_rt'] self.run_process([EMCC, test_file('unistd/close.c'), '-nostdlib'] + libs) self.run_process([EMCC, test_file('unistd/close.c'), '-nodefaultlibs'] + libs) @@ -12391,7 +12391,7 @@ def test_gen_struct_info_env(self): self.run_process([PYTHON, path_from_root('tools/gen_struct_info.py'), '-o', 'out.json']) def test_dylink_limited_exports(self): - # Building with MAIN_MODULE=2 should *not* automatically export all sybmols. + # Building with MAIN_MODULE=2 should *not* automatically export all symbols. self.run_process([EMCC, test_file('hello_world.c'), '-sMAIN_MODULE=2', '-o', 'out.wasm']) # Building with MAIN_MODULE=1 should include and export all of the standard library diff --git a/test/test_stress.py b/test/test_stress.py index ae4731efbf413..e1f4a90de2a96 100644 --- a/test/test_stress.py +++ b/test/test_stress.py @@ -8,7 +8,7 @@ stress tests each saturate the CPU cores. TODO: Find a way to replace these tests with an `@also_with_stress_test` decorator. -Hopfully we can replace the current parallelism with `taskset -u 0` to force the test +Hopefully we can replace the current parallelism with `taskset -u 0` to force the test only run on a single core (would limit the tests to linux-only). """ @@ -76,7 +76,7 @@ def test_run(): @node_pthreads @is_slow_test def test_stress_proxy_to_pthread_hello_world(self): - self.skipTest('Occassionally hangs. https://github.com/emscripten-core/emscripten/issues/20067') + self.skipTest('Occasionally hangs. https://github.com/emscripten-core/emscripten/issues/20067') self.set_setting('ABORT_ON_WASM_EXCEPTIONS') self.set_setting('PROXY_TO_PTHREAD') self.set_setting('EXIT_RUNTIME') diff --git a/test/unistd/access.c b/test/unistd/access.c index c9de2ae7f930e..491a106dea83d 100644 --- a/test/unistd/access.c +++ b/test/unistd/access.c @@ -32,7 +32,7 @@ void test_rename() { printf("F_OK('%s'): %d\n", "filetorename", access("filetorename", F_OK)); printf("F_OK('%s'): %d\n", "renamedfile", access("renamedfile", F_OK)); - // Same againt with faccessat + // Same again with faccessat printf("F_OK('%s'): %d\n", "filetorename", faccessat(AT_FDCWD, "filetorename", F_OK, 0)); printf("F_OK('%s'): %d\n", "renamedfile", faccessat(AT_FDCWD, "renamedfile", F_OK, 0)); } @@ -43,7 +43,7 @@ void test_fchmod() { struct stat fileStats; stat("fchmodtest", &fileStats); int mode = fileStats.st_mode & 0o777; - // Allow S_IXUGO in addtion to S_IWUGO because on windows + // Allow S_IXUGO in addition to S_IWUGO because on windows // we always report the execute bit. assert(mode == (S_IRUGO | S_IWUGO) || mode == (S_IRUGO | S_IWUGO | S_IXUGO)); diff --git a/test/unistd/pipe.c b/test/unistd/pipe.c index 7039c92c887c2..8448a9e497ddf 100644 --- a/test/unistd/pipe.c +++ b/test/unistd/pipe.c @@ -43,7 +43,7 @@ void test_read(int fd0, unsigned char *ch, int size) { // test_select and test_poll perform the exact same actions/assertions but // with two different system calls. They should always give the same -// retult. +// result. void test_select(int *fd, bool data_available) { fd_set rfds; diff --git a/test/unistd/unlink.c b/test/unistd/unlink.c index 09a22f07ff3da..1660764aea28e 100644 --- a/test/unistd/unlink.c +++ b/test/unistd/unlink.c @@ -73,7 +73,7 @@ void test() { err = unlink("dir-readonly"); assert(err == -1); - // emscripten uses 'musl' what is an implementation of the standard library for Linux-based systems + // emscripten uses 'musl' which is an implementation of the standard library for Linux-based systems #if defined(__linux__) || defined(__EMSCRIPTEN__) // Here errno is supposed to be EISDIR, but it is EPERM for NODERAWFS on macOS. // See issue #6121. diff --git a/test/utime/test_futimens.c b/test/utime/test_futimens.c index 0488561144fee..538694e413583 100644 --- a/test/utime/test_futimens.c +++ b/test/utime/test_futimens.c @@ -79,7 +79,7 @@ void test() { times[1].tv_sec = s.st_mtim.tv_sec; times[1].tv_nsec = s.st_mtim.tv_nsec; - // set the timestampe to the current value + // set the timestamp to the current value err = futimens(fd, times); assert(!err); check_times(fd, times, 0); diff --git a/test/wasm_worker/shared_memory_preprocessor_flags.c b/test/wasm_worker/shared_memory_preprocessor_flags.c index 5a268f484de1d..b884b0faf6404 100644 --- a/test/wasm_worker/shared_memory_preprocessor_flags.c +++ b/test/wasm_worker/shared_memory_preprocessor_flags.c @@ -5,7 +5,7 @@ #endif #ifdef __EMSCRIPTEN_WASM_WORKERS__ -#error __EMSCRIPTEN_WASM_WORKERS__ should not defined when building with -sSHARED_MEMORY=1! +#error __EMSCRIPTEN_WASM_WORKERS__ should not be defined when building with -sSHARED_MEMORY=1! #endif #ifdef __EMSCRIPTEN_PTHREADS__ diff --git a/test/wasm_worker/thread_stack.c b/test/wasm_worker/thread_stack.c index 8269555d61828..df7192e5d3786 100644 --- a/test/wasm_worker/thread_stack.c +++ b/test/wasm_worker/thread_stack.c @@ -21,8 +21,8 @@ void test_stack(int i) { THREAD_STACK_SIZE); assert(emscripten_stack_get_base() == (uintptr_t)thread_stack[i] + THREAD_STACK_SIZE); emscripten_outf("__builtin_wasm_tls_size: %lu", __builtin_wasm_tls_size()); - // The stack region in wasm workers also incldues TLS, so we need to take - // this into account when calulating our expected stack end. + // The stack region in wasm workers also includes TLS, so we need to take + // this into account when calculating our expected stack end. size_t expected_stack_end = (uintptr_t)thread_stack[i] + ALIGN(__builtin_wasm_tls_size(), 16); assert(emscripten_stack_get_end() == expected_stack_end); diff --git a/test/webaudio/audioworklet_emscripten_locks.c b/test/webaudio/audioworklet_emscripten_locks.c index 20471eced5f63..5834b6ad8ae2b 100644 --- a/test/webaudio/audioworklet_emscripten_locks.c +++ b/test/webaudio/audioworklet_emscripten_locks.c @@ -28,9 +28,9 @@ typedef enum { // Release in process after above TEST_RELEASE, // Released in process above, spin in main - TEST_WAIT_INFINTE_1, + TEST_WAIT_INFINITE_1, // Release in process to stop spinning in main - TEST_WAIT_INFINTE_2, + TEST_WAIT_INFINITE_2, // Call emscripten_get_now() in process TEST_GET_NOW, // Test finished @@ -93,12 +93,12 @@ bool ProcessAudio(int numInputs, const AudioSampleFrame *inputs, int numOutputs, result = emscripten_lock_try_acquire(&testLock); emscripten_outf("TEST_RELEASE: %d (expect: 1)", result); assert(result); - whichTest = TEST_WAIT_INFINTE_1; + whichTest = TEST_WAIT_INFINITE_1; break; - case TEST_WAIT_INFINTE_1: + case TEST_WAIT_INFINITE_1: // Still locked when we enter here but move on in the main thread break; - case TEST_WAIT_INFINTE_2: + case TEST_WAIT_INFINITE_2: emscripten_lock_release(&testLock); whichTest = TEST_GET_NOW; break; @@ -138,11 +138,11 @@ bool MainLoop(double time, void* data) { didUnlock = true; } break; - case TEST_WAIT_INFINTE_1: + case TEST_WAIT_INFINITE_1: // Spin here until released in process (but don't change test until we know this case ran) - whichTest = TEST_WAIT_INFINTE_2; + whichTest = TEST_WAIT_INFINITE_2; emscripten_lock_busyspin_waitinf_acquire(&testLock); - emscripten_out("TEST_WAIT_INFINTE (from main)"); + emscripten_out("TEST_WAIT_INFINITE (from main)"); break; case TEST_DONE: // Finished, exit from the main thread diff --git a/test/webaudio/audioworklet_post_function.c b/test/webaudio/audioworklet_post_function.c index 9b38fabccb324..bd4c433268ca4 100644 --- a/test/webaudio/audioworklet_post_function.c +++ b/test/webaudio/audioworklet_post_function.c @@ -20,7 +20,7 @@ void do_exit() { } // [v, vi, vii, viii, vd, vdd, vddd, viiiiiidddddd] * [audio_worklet, main] -// 8 * 2 callbacks invoked, each callbacks check the correctivity of arguments +// 8 * 2 callbacks invoked, each callbacks check the correctness of arguments void v_received_on_audio_worklet() { assert(emscripten_current_thread_is_audio_worklet()); emscripten_out("v_on_audio_worklet"); diff --git a/test/webgpu_required_limits.c b/test/webgpu_required_limits.c index a3c68d3e9f004..21fa416dbcb40 100644 --- a/test/webgpu_required_limits.c +++ b/test/webgpu_required_limits.c @@ -52,7 +52,7 @@ static void on_device_request_ended(WGPURequestDeviceStatus status, WGPULimits device_supported_limits = {0}; wgpuDeviceGetLimits(device, &device_supported_limits); - // verify that the obtained device fullfils required limits + // verify that the obtained device fulfills required limits assertLimitsCompatible(adapter_supported_limits, device_supported_limits); diff --git a/test/worker_api_2_main.cpp b/test/worker_api_2_main.cpp index ed1af19b3a696..517db01ccfe2c 100644 --- a/test/worker_api_2_main.cpp +++ b/test/worker_api_2_main.cpp @@ -37,7 +37,7 @@ void c3(char *data, int size, void *arg) { // tests calls different in different c3_8++; assert(calls == 1); } - if (c3_7 && c3_8) { // note: racey, responses from 2 workers here + if (c3_7 && c3_8) { // note: racy, responses from 2 workers here emscripten_destroy_worker(w1); REPORT_RESULT(11); emscripten_force_exit(0); diff --git a/tools/acorn-optimizer.mjs b/tools/acorn-optimizer.mjs index 11a9d2c401ce1..5fd4c6c098637 100755 --- a/tools/acorn-optimizer.mjs +++ b/tools/acorn-optimizer.mjs @@ -308,7 +308,7 @@ function JSDCE(ast, aggressive) { continue; } if (data.def && !data.use && !data.param) { - // this is eliminateable! + // this is eliminatable! names.add(name); } } @@ -387,7 +387,7 @@ function JSDCE(ast, aggressive) { for (const [name, data] of Object.entries(scope)) { if (data.def && !data.use) { assert(!data.param); // can't be - // this is eliminateable! + // this is eliminatable! names.add(name); } } diff --git a/tools/building.py b/tools/building.py index 9168bd4f19983..dcdc03fc458ef 100644 --- a/tools/building.py +++ b/tools/building.py @@ -224,7 +224,7 @@ def lld_flags_for_executable(external_symbols): if not settings.WASM_BIGINT: # When we don't have WASM_BIGINT available, JS signature legalization # in binaryen will mutate the signatures of the imports/exports of our - # shared libraries. Because of this we need to disabled signature + # shared libraries. Because of this we need to disable signature # checking of shared library functions in this case. cmd.append('--no-shlib-sigcheck') @@ -1026,7 +1026,7 @@ def strip(infile, outfile, debug=False, sections=None): # extract the DWARF info from the main file, and leave the wasm with -# debug into as a file on the side +# debug info as a file on the side def emit_debug_on_side(wasm_file, wasm_file_with_dwarf): embedded_path = settings.SEPARATE_DWARF_URL if not embedded_path: @@ -1095,7 +1095,7 @@ def read_name_section(wasm_file): module.seek(section.offset) if module.read_string() == 'name': name_map = {} - # The name section is made up sub-section. + # The name section is made up of sub-sections. # We are looking for the function names sub-section while module.tell() < section.offset + section.size: name_type = module.read_uleb() @@ -1125,7 +1125,7 @@ def write_symbol_map(wasm_file, symbols_file): def is_ar(filename): - """Return True if a the given filename is an ar archive, False otherwise. + """Return True if the given filename is an ar archive, False otherwise. """ try: header = open(filename, 'rb').read(8) diff --git a/tools/cmdline.py b/tools/cmdline.py index 995fda9f42853..8ce4faf2a7a12 100644 --- a/tools/cmdline.py +++ b/tools/cmdline.py @@ -521,7 +521,7 @@ def consume_arg_file(): override=True) elif arg == '-mno-sign-ext': feature_matrix.disable_feature(feature_matrix.Feature.SIGN_EXT) - elif arg == '-mnontrappting-fptoint': + elif arg == '-mnontrapping-fptoint': feature_matrix.enable_feature(feature_matrix.Feature.NON_TRAPPING_FPTOINT, '-mnontrapping-fptoint', override=True) diff --git a/tools/colored_logger.py b/tools/colored_logger.py index f8cf4773c011c..29627eb93bc06 100644 --- a/tools/colored_logger.py +++ b/tools/colored_logger.py @@ -5,7 +5,7 @@ """Enables colored logger just by importing this module -Also, provides utiliy functions to use ANSI colors in the terminal. +Also, provides utility functions to use ANSI colors in the terminal. """ import ctypes diff --git a/tools/compile.py b/tools/compile.py index 1575b8c81a394..81bedffa25ca7 100644 --- a/tools/compile.py +++ b/tools/compile.py @@ -15,7 +15,7 @@ required compiler flags. get_cflags(): In addition to compiler flags this function also returns pre-processor -flags. For example, include paths and macro defintions. +flags. For example, include paths and macro definitions. """ import os diff --git a/tools/config.py b/tools/config.py index 96ec8fd46c72a..fb3b19d1dfacb 100644 --- a/tools/config.py +++ b/tools/config.py @@ -15,7 +15,7 @@ # The following class can be overridden by the config file and/or # environment variables. Specifically any variable whose name -# is in ALL_UPPER_CASE is condifered a valid config file key. +# is in ALL_UPPER_CASE is considered a valid config file key. # See parse_config_file below. EMSCRIPTEN_ROOT = __rootpath__ NODE_JS = None diff --git a/tools/diagnostics.py b/tools/diagnostics.py index cfbf517aa6a00..db4f1ed70a948 100644 --- a/tools/diagnostics.py +++ b/tools/diagnostics.py @@ -3,7 +3,7 @@ # University of Illinois/NCSA Open Source License. Both these licenses can be # found in the LICENSE file. -"""Simple color-enabled diagnositics reporting functions. +"""Simple color-enabled diagnostics reporting functions. """ import logging diff --git a/tools/empath-split.py b/tools/empath-split.py index 66d5d7b340b03..838311d47210f 100755 --- a/tools/empath-split.py +++ b/tools/empath-split.py @@ -14,7 +14,7 @@ separately supplied with --sourcemap. If we have two files a.c and b.c, to generate a source map and the name section, if you compile and link within a single command, you can do something like -$ emcc -g2 -gsrouce-map a.c b.c -o result.js +$ emcc -g2 -gsource-map a.c b.c -o result.js If you want to compile and link in separate commands, you can do $ emcc -gsource-map a.c -o a.o $ emcc -gsource-map b.c -o b.o @@ -48,8 +48,8 @@ 'sources' field contains paths relative to a build directory, so source files may be recorded as '../src/subdir/test.c', for example. In this case, if you want to split the directory src/subdir, you should list it as ../src/subdir. You -can manually open the source map file and check 'sources' field, but we also an -option to help that. You can do like +can manually open the source map file and check 'sources' field, but we also +have an option to help that. You can do like $ empath-split --print-sources test.wasm or $ empath-split --print-sources --source-map test.wasm.map diff --git a/tools/emscripten.py b/tools/emscripten.py index f440909e3bacd..015b87f65b23e 100644 --- a/tools/emscripten.py +++ b/tools/emscripten.py @@ -181,7 +181,7 @@ def inject_code_hooks(name): def generate_js_compiler_input_hash(symbols_only=False): # We define a cache hit as when all the settings and all the `--js-library` # contents are identical. - # Ignore certain settings that can are no relevant to library deps. Here we + # Ignore certain settings that are not relevant to library deps. Here we # skip PRE_JS_FILES/POST_JS_FILES which don't affect the library symbol list # and can contain full paths to temporary files. skip_settings = {'PRE_JS_FILES', 'POST_JS_FILES'} @@ -343,7 +343,7 @@ def compile_javascript_cached(): # Avoiding using the cache when generating struct info since # this step is performed while the cache is locked. # Sadly we have to skip the caching whenever we have user JS libraries. This is because - # these libraries can import arbirary other JS files (either vis node's `import` or via #include) + # these libraries can import arbitrary other JS files (either vis node's `import` or via #include) if DEBUG or settings.BOOTSTRAPPING_STRUCT_INFO or config.FROZEN_CACHE or settings.JS_LIBRARIES: return compile_javascript() @@ -395,7 +395,7 @@ def emscript(in_wasm, out_wasm, outfile_js, js_syms, finalize=True, base_metadat em_js_funcs = create_em_js(metadata) if settings.SIDE_MODULE: - # When building side modules, valid the EM_ASM and EM_JS string by running + # When building side modules, validate the EM_ASM and EM_JS string by running # them through node. Without this step, syntax errors are not surfaced # until runtime. # We use subprocess directly here rather than shared.check_call since @@ -959,7 +959,7 @@ def install_debug_wrapper(sym): if sym.startswith(('__asan_', 'emscripten_stack_', '_emscripten_stack_')): return False # `__trap` can occur before the runtime is initialized since it is used in abort. - # `emscripten_get_sbrk_ptr` can be called prior to runtime initialzaion by + # `emscripten_get_sbrk_ptr` can be called prior to runtime initialization by # the dynamic linking code. return sym not in ['__trap', 'emscripten_get_sbrk_ptr'] @@ -1068,7 +1068,7 @@ def create_receiving(function_exports, other_exports, library_symbols, aliases): else: assignment = f"Module['{mangled}']" elif not js_manipulation.isidentifier(mangled): - # Symbol is not a valid JS identify and also not exported. In this case we + # Symbol is not a valid JS identifier and also not exported. In this case we # have nothing to do here. continue @@ -1258,7 +1258,7 @@ def create_pointer_conversion_wrappers(metadata): # dynCall_ functions are generated by binaryen. They all take a # function pointer as their first argument. # The second part of this check can be removed once the table64 - # llvm changs lands. + # llvm changes land. if symbol.startswith('dynCall_') and functype.params[0] == webassembly.Type.I64: sig = symbol.split('_')[-1] sig = ['p' if t == 'p' else '_' for t in sig] diff --git a/tools/emsymbolizer.py b/tools/emsymbolizer.py index a4046ce7c5a81..8de97f75bffca 100755 --- a/tools/emsymbolizer.py +++ b/tools/emsymbolizer.py @@ -194,7 +194,7 @@ def find_offset(self, offset, lower_bound=None): if lo == 0: return None # If lower bound is given, return the offset only if the offset is equal to - # or greather than the lower bound + # or greater than the lower bound if lower_bound: if self.offsets[lo - 1] >= lower_bound: return self.offsets[lo - 1] diff --git a/tools/file_packager.py b/tools/file_packager.py index 7fe31e70f22b2..f9d896d278d2b 100755 --- a/tools/file_packager.py +++ b/tools/file_packager.py @@ -219,7 +219,7 @@ def escape(c): } if c in escape_chars: return escape_chars[c] - # Enscode all other chars are three octal digits(!) + # Encode all other chars as three octal digits(!) return '\\%s%s%s' % (oct(c >> 6), oct(c >> 3), oct(c >> 0)) return ''.join(escape(c) for c in string.encode('utf-8')) diff --git a/tools/filelock.py b/tools/filelock.py index 3c41dbcf45568..10ade558b9e3b 100644 --- a/tools/filelock.py +++ b/tools/filelock.py @@ -223,7 +223,7 @@ def is_locked(self): """ return self._lock_file_fd is not None - def acquire(self, timeout=None, poll_intervall=0.05): + def acquire(self, timeout=None, poll_interval=0.05): """ Acquires the file lock or fails with a :exc:`Timeout` error. @@ -246,8 +246,8 @@ def acquire(self, timeout=None, poll_intervall=0.05): block until the lock could be acquired. If ``timeout`` is None, the default :attr:`~timeout` is used. - :arg float poll_intervall: - We check once in *poll_intervall* seconds if we can acquire the + :arg float poll_interval: + We check once in *poll_interval* seconds if we can acquire the file lock. :raises Timeout: @@ -286,9 +286,9 @@ def acquire(self, timeout=None, poll_intervall=0.05): else: logger().debug( 'Lock %s not acquired on %s, waiting %s seconds ...', - lock_id, lock_filename, poll_intervall + lock_id, lock_filename, poll_interval ) - time.sleep(poll_intervall) + time.sleep(poll_interval) except: # Something did go wrong, so decrement the counter. with self._thread_lock: diff --git a/tools/link.py b/tools/link.py index 67de2fbf49c08..0af32259c3214 100644 --- a/tools/link.py +++ b/tools/link.py @@ -251,8 +251,8 @@ def is_supported(f): # lld allows various flags to have either a single -foo or double --foo if f.startswith((flag, '-' + flag)): diagnostics.warning('linkflags', 'ignoring unsupported linker flag: `%s`', f) - # Skip the next argument if this linker flag takes and argument and that - # argument was not specified as a separately (i.e. it was specified as + # Skip the next argument if this linker flag takes an argument and that + # argument was not specified separately (i.e. it was specified as # single arg containing an `=` char.) skip_next = takes_arg and '=' not in f return False, skip_next @@ -781,7 +781,7 @@ def setup_sanitizers(options): def get_dylibs(options, linker_args): - """Find all the Wasm dynanamic libraries specified on the command line, + """Find all the Wasm dynamic libraries specified on the command line, either via `-lfoo` or via `libfoo.so` directly.""" dylibs = [] @@ -949,7 +949,7 @@ def phase_linker_setup(options, linker_args): # noqa: C901, PLR0912, PLR0915 settings.OUTPUT_FORMAT = options.oformat.name if settings.SUPPORT_BIG_ENDIAN and settings.WASM2JS: - exit_with_error('WASMJ2S is currently not compatible with SUPPORT_BIG_ENDIAN') + exit_with_error('WASM2JS is currently not compatible with SUPPORT_BIG_ENDIAN') if settings.WASM_ESM_INTEGRATION: default_setting('MODULARIZE', 'instance') @@ -975,7 +975,7 @@ def phase_linker_setup(options, linker_args): # noqa: C901, PLR0912, PLR0915 def limit_incoming_module_api(): if options.oformat == OFormat.HTML and options.shell_path == DEFAULT_SHELL_HTML: - # Out default shell.html file has minimal set of INCOMING_MODULE_JS_API elements that it expects + # Our default shell.html file has minimal set of INCOMING_MODULE_JS_API elements that it expects default_setting('INCOMING_MODULE_JS_API', 'canvas,monitorRunDependencies,onAbort,onExit,print,setStatus'.split(',')) else: default_setting('INCOMING_MODULE_JS_API', []) @@ -1876,7 +1876,7 @@ def get_full_import_name(name): settings.MINIFY_WHITESPACE = settings.OPT_LEVEL >= 2 and settings.DEBUG_LEVEL == 0 and not options.no_minify # Closure might be run if we run it ourselves, or if whitespace is not being - # minifed. In the latter case we keep both whitespace and comments, and the + # minified. In the latter case we keep both whitespace and comments, and the # purpose of the comments might be closure compiler, so also perform all # adjustments necessary to ensure that works (which amounts to a few more # comments; adding some more of them is not an issue in such a build which @@ -2003,7 +2003,7 @@ def run_embind_gen(options, wasm_target, js_syms, extra_settings): # generation output. # Don't invoke the program's `main` function. settings.INVOKE_RUN = False - # Ignore -sMODULARIZE which could otherwise effect how we run the module + # Ignore -sMODULARIZE which could otherwise affect how we run the module # to generate the bindings. settings.MODULARIZE = False # Disable ESM integration to avoid enabling the experimental feature in node. @@ -2271,7 +2271,7 @@ def phase_binaryen(target, options, wasm_target): # whether we need to emit -g in the intermediate binaryen invocations (but not # necessarily at the very end). this is necessary if we depend on debug info # during compilation, even if we do not emit it at the end. - # we track the number of causes for needing intermdiate debug info so + # we track the number of causes for needing intermediate debug info so # that we can stop emitting it when possible - in particular, that is # important so that we stop emitting it before the end, and it is not in the # final binary (if it shouldn't be) @@ -2464,7 +2464,7 @@ def modularize(): save_intermediate('modularized') # FIXME(https://github.com/emscripten-core/emscripten/issues/24558): Running acorn at this - # late phase seems to cause OOM (some kind of inifite loop perhaps) in node. + # late phase seems to cause OOM (some kind of infinite loop perhaps) in node. # Instead we minify src/modularize.js in isolation above. #if settings.MINIFY_WHITESPACE: # final_js = building.acorn_optimizer(final_js, ['--minify-whitespace']) @@ -2922,7 +2922,7 @@ def get_secondary_target(target, ext): # Depending on the output format emscripten creates zero or more secondary # output files (e.g. the .wasm file when creating JS output, or the # .js and the .wasm file when creating html output. - # Thus function names the secondary output files, while ensuring they + # This function names the secondary output files, while ensuring they # never collide with the primary one. base = unsuffixed(target) if get_file_suffix(target) == ext: @@ -3134,7 +3134,7 @@ def run(options, linker_args): system_libs = phase_calculate_system_libraries(options) # Only add system libraries that have not already been specified. - # This avoids issues where the user explictly includes, for example, `-lGL`. + # This avoids issues where the user explicitly includes, for example, `-lGL`. # This is not normally a problem except in the case of -sMAIN_MODULE=1 where # the duplicate library would result in duplicate symbols. for s in system_libs: diff --git a/tools/maint/check_struct_info.py b/tools/maint/check_struct_info.py index b7e0cfc1be2eb..30fe281a6bd69 100755 --- a/tools/maint/check_struct_info.py +++ b/tools/maint/check_struct_info.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 -"""Find entries in struct_info.json that are not needd by +"""Find entries in struct_info.json that are not needed by any JS library code and can be removed.""" import json @@ -19,7 +19,7 @@ def check_structs(info): for struct, values in info['structs'].items(): key = 'C_STRUCTS\\.' + struct + '\\.' - # grep --quiet ruturns 0 when there is a match + # grep --quiet returns 0 when there is a match if subprocess.run(['git', 'grep', '--quiet', key], check=False).returncode != 0: print(key) else: @@ -34,7 +34,7 @@ def check_structs(info): def check_defines(info): for define in info['defines']: key = r'cDefs\.' + define + r'\>' - # grep --quiet ruturns 0 when there is a match + # grep --quiet returns 0 when there is a match if subprocess.run(['git', 'grep', '--quiet', key], check=False).returncode != 0: print(define) diff --git a/tools/maint/create_entry_points.py b/tools/maint/create_entry_points.py index 92d57bb47fc8a..6307549ba463d 100755 --- a/tools/maint/create_entry_points.py +++ b/tools/maint/create_entry_points.py @@ -4,12 +4,12 @@ # University of Illinois/NCSA Open Source License. Both these licenses can be # found in the LICENSE file. -"""Tool for creating/maintains the python launcher scripts for all the emscripten +"""Tool for creating/maintaining the python launcher scripts for all the emscripten python tools. -This tools makes copies or `run_python.sh/.bat` and `run_python_compiler.sh/.bat` +This tool makes copies or `run_python.sh/.bat` and `run_python_compiler.sh/.bat` script for each entry point. On UNIX we previously used symbolic links for -simplicity but this breaks MINGW users on windows who want use the shell script +simplicity but this breaks MINGW users on windows who want to use the shell script launcher but don't have symlink support. """ diff --git a/tools/maint/find_unused_settings.py b/tools/maint/find_unused_settings.py index 91972ca9861fd..fed2ba8d55edb 100755 --- a/tools/maint/find_unused_settings.py +++ b/tools/maint/find_unused_settings.py @@ -11,7 +11,7 @@ sys.path.insert(0, root_dir) -# This avoiding including `LEGACY_SETTINGS` +# This avoids including `LEGACY_SETTINGS` os.environ['EMCC_STRICT'] = '1' from tools.settings import settings diff --git a/tools/maint/post-checkout b/tools/maint/post-checkout index e4ae941c2b87a..c4838f1ac1940 100755 --- a/tools/maint/post-checkout +++ b/tools/maint/post-checkout @@ -1,6 +1,6 @@ #!/bin/sh # -# Git post-checkout script that takes care of running emscirpten's +# Git post-checkout script that takes care of running emscripten's # bootstrap script when changing branches. # # The bootstrap script itself is smart enough to basically do nothing unless diff --git a/tools/maint/simde_update.py b/tools/maint/simde_update.py index 426a3695ac7c5..716f842960a3c 100755 --- a/tools/maint/simde_update.py +++ b/tools/maint/simde_update.py @@ -57,7 +57,7 @@ def main(): return 1 SIMDE_FILE_HEADER_RE = r'^(/\* :: )(Begin |End )[^ ]+/(simde/simde/[^ ]+ :: \*/$)' - # Replace file headers, which contains tmp directory names and changes every time we + # Replace file headers, which contain tmp directory names and changes every time we # update simde, causing a larger diff than necessary. neon_h_buf = re.sub(SIMDE_FILE_HEADER_RE, r'\1\2\3', neon_h_buf, count=0, flags=re.MULTILINE) diff --git a/tools/maint/update_settings_docs.py b/tools/maint/update_settings_docs.py index b17f8d2e90bb1..8140e6fd8ba6f 100755 --- a/tools/maint/update_settings_docs.py +++ b/tools/maint/update_settings_docs.py @@ -67,8 +67,8 @@ =================== The following settings have been proposed for removal from emscripten. These settings -still function but may be removed in a future version. If your project is using of -the these settings please open a bug (or reply to one of the existing bugs). +still function but may be removed in a future version. If your project is using one of +these settings please open a bug (or reply to one of the existing bugs). ''' @@ -80,7 +80,7 @@ =============== The following settings no longer have any effect but are still accepted by emscripten -for backwards compatbility with older versions: +for backwards compatibility with older versions: ''' diff --git a/tools/ports/sdl3.py b/tools/ports/sdl3.py index 78b127160cac7..033eb94ec5b81 100644 --- a/tools/ports/sdl3.py +++ b/tools/ports/sdl3.py @@ -78,7 +78,7 @@ def create(final): 'video/*.c', 'video/yuv2rgb/*.c', 'tray/*.c', - # Platform speecifc sources + # Platform specific sources 'storage/generic/*.c', 'tray/unix/*.c', 'time/unix/*.c', diff --git a/tools/response_file.py b/tools/response_file.py index 66da2921fa6ea..7b01ad7b8cd71 100644 --- a/tools/response_file.py +++ b/tools/response_file.py @@ -80,7 +80,7 @@ def expand_response_file(arg): response_filename = None # Is the argument is not a response file, or if the file does not exist - # just return orginal argument. + # just return original argument. if not response_filename or not os.path.exists(response_filename): return [arg] diff --git a/tools/shared.py b/tools/shared.py index a3f5590892299..3f0585848d172 100644 --- a/tools/shared.py +++ b/tools/shared.py @@ -197,7 +197,7 @@ def exec_process(cmd): def run_js_tool(filename, jsargs=[], node_args=[], **kw): # noqa: B006 """Execute a javascript tool. - This is used by emcc to run parts of the build process that are written + This is used by emcc to run parts of the build process that are implemented in javascript. """ command = config.NODE_JS + node_args + [filename] + jsargs diff --git a/tools/system_libs.py b/tools/system_libs.py index f6d8183d0a216..3cdf76d9af161 100644 --- a/tools/system_libs.py +++ b/tools/system_libs.py @@ -62,7 +62,7 @@ def get_base_cflags(build_dir, force_object_files=False, preprocess=True): if settings.LTO and not force_object_files: flags += ['-flto=' + settings.LTO] if settings.RELOCATABLE or settings.MAIN_MODULE: - # Explictly include `-sRELOCATABLE` when building system libraries. + # Explicitly include `-sRELOCATABLE` when building system libraries. # `-fPIC` alone is not enough to configure trigger the building and # caching of `pic` libraries (see `get_lib_dir` in `cache.py`) # FIXME(sbc): `-fPIC` should really be enough here. @@ -88,7 +88,7 @@ def clean_env(): # building system libraries and ports should be hermetic in that it is not # affected by things like EMCC_CFLAGS which the user may have set. # At least one port also uses autoconf (harfbuzz) so we also need to clear - # CFLAGS/LDFLAGS which we don't want to effect the inner call to configure. + # CFLAGS/LDFLAGS which we don't want to affect the inner call to configure. safe_env = os.environ.copy() for opt in ['CFLAGS', 'CXXFLAGS', 'LDFLAGS', 'EMCC_CFLAGS', @@ -694,14 +694,14 @@ def get_usable_variations(cls): This returns a dictionary of simple names to Library objects. """ - if not hasattr(cls, 'useable_variations'): - cls.useable_variations = {} + if not hasattr(cls, 'usable_variations'): + cls.usable_variations = {} for subclass in cls.get_inheritance_tree(): if subclass.name: library = subclass.get_default_variation() if library.can_build() and library.can_use(): - cls.useable_variations[subclass.name] = library - return cls.useable_variations + cls.usable_variations[subclass.name] = library + return cls.usable_variations class MTLibrary(Library): diff --git a/tools/wasm-sourcemap.py b/tools/wasm-sourcemap.py index 487f0c1f48e64..2e52e136c5b63 100755 --- a/tools/wasm-sourcemap.py +++ b/tools/wasm-sourcemap.py @@ -41,7 +41,7 @@ def parse_args(args): parser.add_argument('-l', '--load-prefix', nargs='*', help='replace source debug filename prefix for reading sources from file system (see also --sources)', default=[]) parser.add_argument('-w', nargs='?', help='set output wasm file') parser.add_argument('-x', '--strip', action='store_true', help='removes debug and linking sections') - parser.add_argument('-u', '--source-map-url', nargs='?', help='specifies sourceMappingURL section contest') + parser.add_argument('-u', '--source-map-url', nargs='?', help='specifies sourceMappingURL section content') parser.add_argument('--dwarfdump', help="path to llvm-dwarfdump executable") parser.add_argument('--dwarfdump-output', nargs='?', help=argparse.SUPPRESS) parser.add_argument('--basepath', help='base path for source files, which will be relative to this') diff --git a/tools/webidl_binder.py b/tools/webidl_binder.py index c575f173d7683..02e78224ae249 100644 --- a/tools/webidl_binder.py +++ b/tools/webidl_binder.py @@ -225,7 +225,7 @@ def build_constructor(name): len = alignMemory(len, 8); // keep things aligned to 8 byte boundaries var ret; if (ensureCache.pos + len >= ensureCache.size) { - // we failed to allocate in the buffer, ensureCache time around :( + // we failed to allocate in the buffer, next time around :( assert(len > 0); // null terminator, at least ensureCache.needed += len; ret = Module['_webidl_malloc'](len); diff --git a/tools/websocket_to_posix_proxy/src/websocket_to_posix_proxy.c b/tools/websocket_to_posix_proxy/src/websocket_to_posix_proxy.c index 776bcdad9b66d..337aa062fa400 100644 --- a/tools/websocket_to_posix_proxy/src/websocket_to_posix_proxy.c +++ b/tools/websocket_to_posix_proxy/src/websocket_to_posix_proxy.c @@ -338,7 +338,7 @@ static int Translate_Socket_Domain(int domain) { // case MUSL_AF_KCM: return AF_KCM; case MUSL_AF_MAX: return AF_MAX; default: - fprintf(stderr, "Uncrecognized Socket Domain %d!\n", domain); + fprintf(stderr, "Unrecognized Socket Domain %d!\n", domain); return domain; } } @@ -372,7 +372,7 @@ static int Translate_Socket_Type(int type) { // case MUSL_SOCK_DCCP: return SOCK_DCCP; // case MUSL_SOCK_PACKET: return SOCK_PACKET; default: - fprintf(stderr, "Uncrecognized socket type %d!\n", type); + fprintf(stderr, "Unrecognized socket type %d!\n", type); return type; } } @@ -519,7 +519,7 @@ static int Translate_Socket_Level(int level) { // case MUSL_SOL_NFC: return SOL_NFC; // case MUSL_SOL_KCM: return SOL_KCM; default: - fprintf(stderr, "Uncrecognized socket level %d!\n", level); + fprintf(stderr, "Unrecognized socket level %d!\n", level); return level; } } From ef1be90b2a8a1907ee25e47828973e1dcbbdc1af Mon Sep 17 00:00:00 2001 From: Heejin Ahn Date: Sat, 27 Dec 2025 00:10:40 +0000 Subject: [PATCH 2/7] Fix emcc.txt --- docs/emcc.txt | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/emcc.txt b/docs/emcc.txt index 87be29ca9b79d..919849122bd7f 100644 --- a/docs/emcc.txt +++ b/docs/emcc.txt @@ -221,7 +221,7 @@ Options that are modified or new in *emcc* are listed below: [link] Make the output suitable for profiling. This means including function names in the wasm and JS output, and preserving whitespace in the JS output. It does not affect optimizations (to ensure that - performance profiles reflect production builds). Currenly this is + performance profiles reflect production builds). Currently this is the same as "-g2". "--profiling-funcs" @@ -255,10 +255,11 @@ Options that are modified or new in *emcc* are listed below: "[name].wasm.js.symbols" (with ASM.js symbols) "--emit-minification-map " - [link] In cases where emscripten performs import/export minificiton - this option can be used to output a file that maps minified names - back to their original names. The format of this file is single - line per import/export of the form ":". + [link] In cases where emscripten performs import/export + minification this option can be used to output a file that maps + minified names back to their original names. The format of this + file is single line per import/export of the form + ":". "-flto" [compile+link] Enables link-time optimizations (LTO). From 9576e42f51b5878410794149687dba8e84f38a7c Mon Sep 17 00:00:00 2001 From: Heejin Ahn Date: Sat, 27 Dec 2025 00:57:50 +0000 Subject: [PATCH 3/7] Automatic rebaseline of codesize expectations. NFC This is an automatic change generated by tools/maint/rebaseline_tests.py. The following (6) test expectation files were updated by running the tests with `--rebaseline`: ``` test/codesize/audio_worklet_wasm.expected.js updated test/codesize/hello_wasm_worker_wasm.expected.js updated test/codesize/test_codesize_file_preload.expected.js updated test/codesize/test_codesize_minimal_O0.expected.js updated codesize/test_minimal_runtime_code_size_audio_worklet.json: 6157 => 6157 [+0 bytes / +0.00%] codesize/test_unoptimized_code_size.json: 180994 => 180979 [-15 bytes / -0.01%] Average change: -0.00% (-0.01% - +0.00%) ``` --- test/codesize/audio_worklet_wasm.expected.js | 26 +++++++++---------- .../hello_wasm_worker_wasm.expected.js | 14 +++++----- .../test_codesize_file_preload.expected.js | 10 +++---- .../test_codesize_minimal_O0.expected.js | 4 +-- ...nimal_runtime_code_size_audio_worklet.json | 4 +-- test/codesize/test_unoptimized_code_size.json | 16 ++++++------ 6 files changed, 37 insertions(+), 37 deletions(-) diff --git a/test/codesize/audio_worklet_wasm.expected.js b/test/codesize/audio_worklet_wasm.expected.js index f18e8adf6f120..c68efe128e45e 100644 --- a/test/codesize/audio_worklet_wasm.expected.js +++ b/test/codesize/audio_worklet_wasm.expected.js @@ -2,12 +2,12 @@ var m = globalThis.Module || "undefined" != typeof Module ? Module : {}, p = !!g function v(a) { u = a; - w = a.L; + w = a.H; x(); m ||= {}; m.wasm = a.G; y(); - a.G = a.M = 0; + a.G = a.H = 0; } t && !p && (onmessage = a => { @@ -26,9 +26,9 @@ if (p) { this.u = d.u; this.s = 4 * this.u; this.B = Array(Math.min((u.F - 16) / this.s | 0, 64)); - this.K(); + this.L(); } - K() { + L() { for (var d = C(), g = D(this.B.length * this.s) >> 2, e = this.B.length - 1; 0 <= e; e--) this.B[e] = E.subarray(g, g += this.u); F(d); } @@ -81,9 +81,9 @@ if (p) { port.onmessage = async b => { await z; b = b.data; - b._boot ? v(b) : b._wpn ? (registerProcessor(b._wpn, a(b.H)), port.postMessage({ + b._boot ? v(b) : b._wpn ? (registerProcessor(b._wpn, a(b.I)), port.postMessage({ _wsc: b.v, - C: [ b.I, 1, b.A ] + C: [ b.J, 1, b.A ] })) : b._wsc && A.get(b._wsc)(...b.C); }; } @@ -134,7 +134,7 @@ var K = [], L = a => { a = { latencyHint: c, sampleRate: G[a + 4 >> 2] || void 0, - N: 0 > b ? "hardware" : b || "default" + M: 0 > b ? "hardware" : b || "default" }; } else a = void 0; a = new AudioContext(a); @@ -178,8 +178,8 @@ var K = [], L = a => { }), c += 16; O[a].audioWorklet.port.postMessage({ _wpn: d, - H: e, - I: a, + I: e, + J: a, v: b, A: h }); @@ -204,10 +204,10 @@ var K = [], L = a => { }); e.port.postMessage({ _boot: 1, - O: ba++, + N: ba++, G: m.wasm, - L: w, - J: c, + H: w, + K: c, F: b }); e.port.onmessage = ca; @@ -246,7 +246,7 @@ function y() { C = a.n; Y = a.o; A = a.k; - t ? (Y(u.J, u.F), p || (removeEventListener("message", M), K = K.forEach(L), addEventListener("message", L))) : a.i(); + t ? (Y(u.K, u.F), p || (removeEventListener("message", M), K = K.forEach(L), addEventListener("message", L))) : a.i(); t || X(); })); } diff --git a/test/codesize/hello_wasm_worker_wasm.expected.js b/test/codesize/hello_wasm_worker_wasm.expected.js index af0817a7749eb..377c6a7eb46e4 100644 --- a/test/codesize/hello_wasm_worker_wasm.expected.js +++ b/test/codesize/hello_wasm_worker_wasm.expected.js @@ -3,12 +3,12 @@ var c = Module, d = "em-ww" == globalThis.name, e, f, y, z, l, A, t; d && (onmessage = a => { onmessage = null; e = a = a.data; - f = a.o; + f = a.l; g(); c ||= {}; c.wasm = a.j; h(); - a.j = a.s = 0; + a.j = a.l = 0; }); function g() {} @@ -30,11 +30,11 @@ var k = [], n = a => { name: "em-ww" }); m.postMessage({ - u: r, + s: r, j: t, - o: f, - l: a, - m: b + l: f, + m: a, + o: b }); m.onmessage = n; return r++; @@ -67,7 +67,7 @@ function h() { y = b.g; z = b.i; l = b.h; - d ? (z(e.l, e.m), removeEventListener("message", p), k = k.forEach(n), addEventListener("message", n)) : b.f(); + d ? (z(e.m, e.o), removeEventListener("message", p), k = k.forEach(n), addEventListener("message", n)) : b.f(); d || y(); })); } diff --git a/test/codesize/test_codesize_file_preload.expected.js b/test/codesize/test_codesize_file_preload.expected.js index 7476eb95dd24f..6f271cf72afc0 100644 --- a/test/codesize/test_codesize_file_preload.expected.js +++ b/test/codesize/test_codesize_file_preload.expected.js @@ -294,7 +294,7 @@ var wasmBinary; var ABORT = false; // set by exit() and abort(). Passed to 'onExit' handler. -// NOTE: This is also used as the process return code code in shell environments +// NOTE: This is also used as the process return code in shell environments // but only when noExitRuntime is false. var EXITSTATUS; @@ -398,7 +398,7 @@ function getBinarySync(file) { if (readBinary) { return readBinary(file); } - // Throwing a plain string here, even though it not normally adviables since + // Throwing a plain string here, even though it not normally advisable since // this gets turning into an `abort` in instantiateArrayBuffer. throw "both async and sync fetching of the wasm failed"; } @@ -976,7 +976,7 @@ var MEMFS = { }, createNode(parent, name, mode, dev) { if (FS.isBlkdev(mode) || FS.isFIFO(mode)) { - // no supported + // not supported throw new FS.ErrnoError(63); } MEMFS.ops_table ||= { @@ -1337,7 +1337,7 @@ var FS_handledByPreloadPlugin = async (byteArray, fullname) => { return plugin["handle"](byteArray, fullname); } } - // In no plugin handled this file then return the original/unmodified + // If no plugin handled this file then return the original/unmodified // byteArray. return byteArray; }; @@ -2300,7 +2300,7 @@ var FS = { } else { // node doesn't exist, try to create it // Ignore the permission bits here to ensure we can `open` this new - // file below. We use chmod below the apply the permissions once the + // file below. We use chmod below to apply the permissions once the // file is open. node = FS.mknod(path, mode | 511, 0); created = true; diff --git a/test/codesize/test_codesize_minimal_O0.expected.js b/test/codesize/test_codesize_minimal_O0.expected.js index aa479e063864f..7f5e25905054a 100644 --- a/test/codesize/test_codesize_minimal_O0.expected.js +++ b/test/codesize/test_codesize_minimal_O0.expected.js @@ -256,7 +256,7 @@ if (!globalThis.WebAssembly) { var ABORT = false; // set by exit() and abort(). Passed to 'onExit' handler. -// NOTE: This is also used as the process return code code in shell environments +// NOTE: This is also used as the process return code in shell environments // but only when noExitRuntime is false. var EXITSTATUS; @@ -599,7 +599,7 @@ function getBinarySync(file) { if (readBinary) { return readBinary(file); } - // Throwing a plain string here, even though it not normally adviables since + // Throwing a plain string here, even though it not normally advisable since // this gets turning into an `abort` in instantiateArrayBuffer. throw 'both async and sync fetching of the wasm failed'; } diff --git a/test/codesize/test_minimal_runtime_code_size_audio_worklet.json b/test/codesize/test_minimal_runtime_code_size_audio_worklet.json index 50ff7beecdafb..21fe3d952deea 100644 --- a/test/codesize/test_minimal_runtime_code_size_audio_worklet.json +++ b/test/codesize/test_minimal_runtime_code_size_audio_worklet.json @@ -2,9 +2,9 @@ "a.html": 519, "a.html.gz": 357, "a.js": 4309, - "a.js.gz": 2219, + "a.js.gz": 2217, "a.wasm": 1329, "a.wasm.gz": 895, "total": 6157, - "total_gz": 3471 + "total_gz": 3469 } diff --git a/test/codesize/test_unoptimized_code_size.json b/test/codesize/test_unoptimized_code_size.json index 0fe2ad9460cda..b1c6db56dd000 100644 --- a/test/codesize/test_unoptimized_code_size.json +++ b/test/codesize/test_unoptimized_code_size.json @@ -1,16 +1,16 @@ { - "hello_world.js": 56962, - "hello_world.js.gz": 17714, + "hello_world.js": 56957, + "hello_world.js.gz": 17711, "hello_world.wasm": 15138, "hello_world.wasm.gz": 7455, - "no_asserts.js": 26632, - "no_asserts.js.gz": 8884, + "no_asserts.js": 26627, + "no_asserts.js.gz": 8882, "no_asserts.wasm": 12187, "no_asserts.wasm.gz": 5984, - "strict.js": 54937, - "strict.js.gz": 17047, + "strict.js": 54932, + "strict.js.gz": 17044, "strict.wasm": 15138, "strict.wasm.gz": 7450, - "total": 180994, - "total_gz": 64534 + "total": 180979, + "total_gz": 64526 } From 86c17ee8771379ea6c7480a8f986ec9f142c17f7 Mon Sep 17 00:00:00 2001 From: Heejin Ahn Date: Sat, 27 Dec 2025 01:01:43 +0000 Subject: [PATCH 4/7] ASSYNC_THREAD -> ASYNC_THREAD --- test/test_emscripten_async_wget2.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/test_emscripten_async_wget2.cpp b/test/test_emscripten_async_wget2.cpp index f94e42be9e060..080441d90fa18 100644 --- a/test/test_emscripten_async_wget2.cpp +++ b/test/test_emscripten_async_wget2.cpp @@ -343,14 +343,14 @@ int main() { time_elapsed = emscripten_get_now(); http* http1 = new http("https://github.com", http::REQUEST_GET, "emscripten_main.zip"); - http1->runRequest("/emscripten-core/emscripten/archive/main.zip", http::ASSYNC_THREAD); + http1->runRequest("/emscripten-core/emscripten/archive/main.zip", http::ASYNC_THREAD); http* http2 = new http("https://github.com",http::REQUEST_GET, "wolfviking_master.zip"); - http2->runRequest("/wolfviking0/image.js/archive/master.zip", http::ASSYNC_THREAD); + http2->runRequest("/wolfviking0/image.js/archive/master.zip", http::ASYNC_THREAD); http2->abortRequest(); http* http3 = new http("https://raw.github.com", http::REQUEST_GET); - http3->runRequest("/emscripten-core/emscripten/main/LICENSE", http::ASSYNC_THREAD); + http3->runRequest("/emscripten-core/emscripten/main/LICENSE", http::ASYNC_THREAD); num_request++; emscripten_async_call(wait_http, http1, 500); From e28c17d674a1461754deee84b8f4c29dfc0a2cca Mon Sep 17 00:00:00 2001 From: Heejin Ahn Date: Wed, 31 Dec 2025 06:38:46 +0000 Subject: [PATCH 5/7] Address comments --- src/lib/libglut.js | 2 +- src/lib/libsdl.js | 2 +- system/lib/README.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/libglut.js b/src/lib/libglut.js index 4b4c740226bad..1590c7ee25095 100644 --- a/src/lib/libglut.js +++ b/src/lib/libglut.js @@ -42,7 +42,7 @@ var LibraryGLUT = { onMousemove: (event) => { /* Send motion event only if the motion changed, prevents - * spamming our app with unnecessary callback call. It does happen in + * spamming our app with unnecessary callbacks. It does happen in * Chrome on Windows. */ var lastX = Browser.mouseX; diff --git a/src/lib/libsdl.js b/src/lib/libsdl.js index 7eed913a814bf..fae111096cdef 100644 --- a/src/lib/libsdl.js +++ b/src/lib/libsdl.js @@ -1461,7 +1461,7 @@ var LibrarySDL = { var size = driverName.length; if (max_size <= size) { - size = max_size - 1; //-1 because of null-terminator + size = max_size - 1; // -1 because of null-terminator } while (index < size) { diff --git a/system/lib/README.md b/system/lib/README.md index c33a65e48a145..aaf37978718c7 100644 --- a/system/lib/README.md +++ b/system/lib/README.md @@ -1,5 +1,5 @@ Source code for C/C++ system libraries -===================================== +====================================== This directory contains the source code for libc, libc++ and other C/C++ system libraries. Where possible these are clones of upstream projects (e.g. musl). From 8da9bb5e102aec8f868dee7dc1a1100d36b73ef8 Mon Sep 17 00:00:00 2001 From: Heejin Ahn Date: Wed, 31 Dec 2025 06:49:32 +0000 Subject: [PATCH 6/7] Revert changes in third-party code --- system/lib/dlmalloc.c | 2 +- test/sqlite/speedtest1.c | 2 +- tools/filelock.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/system/lib/dlmalloc.c b/system/lib/dlmalloc.c index eb2f17547c541..46e14122efa4e 100644 --- a/system/lib/dlmalloc.c +++ b/system/lib/dlmalloc.c @@ -802,7 +802,7 @@ defined(__i386__) || defined(__x86_64__))) || \ statistics. It should work on any system that has a /usr/include/malloc.h defining struct mallinfo. The main declaration needed is the mallinfo struct that is returned (by-copy) - by mallinfo(). The mallinfo struct contains a bunch of fields that + by mallinfo(). The malloinfo struct contains a bunch of fields that are not even meaningful in this version of malloc. These fields are are instead filled by mallinfo() with other numbers that might be of interest. diff --git a/test/sqlite/speedtest1.c b/test/sqlite/speedtest1.c index c7b2f510f1ac7..ecd63fad0e1b9 100644 --- a/test/sqlite/speedtest1.c +++ b/test/sqlite/speedtest1.c @@ -18,7 +18,7 @@ static const char zHelp[] = " --exclusive Enable locking_mode=EXCLUSIVE\n" " --explain Like --sqlonly but with added EXPLAIN keywords\n" " --heap SZ MIN Memory allocator uses SZ bytes & min allocation MIN\n" - " --incrvacuum Enable incremental vacuum mode\n" + " --incrvacuum Enable incremenatal vacuum mode\n" " --journalmode M Set the journal_mode to MODE\n" " --key KEY Set the encryption key to KEY\n" " --lookaside N SZ Configure lookaside for N slots of SZ bytes each\n" diff --git a/tools/filelock.py b/tools/filelock.py index 10ade558b9e3b..c33802181f76b 100644 --- a/tools/filelock.py +++ b/tools/filelock.py @@ -223,7 +223,7 @@ def is_locked(self): """ return self._lock_file_fd is not None - def acquire(self, timeout=None, poll_interval=0.05): + def acquire(self, timeout=None, poll_intervall=0.05): """ Acquires the file lock or fails with a :exc:`Timeout` error. From 34e23df3f087d2cb4c491e50519e333f8f014538 Mon Sep 17 00:00:00 2001 From: Heejin Ahn Date: Wed, 31 Dec 2025 06:53:22 +0000 Subject: [PATCH 7/7] More poll_intervall reverts --- tools/filelock.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/filelock.py b/tools/filelock.py index c33802181f76b..3c41dbcf45568 100644 --- a/tools/filelock.py +++ b/tools/filelock.py @@ -246,8 +246,8 @@ def acquire(self, timeout=None, poll_intervall=0.05): block until the lock could be acquired. If ``timeout`` is None, the default :attr:`~timeout` is used. - :arg float poll_interval: - We check once in *poll_interval* seconds if we can acquire the + :arg float poll_intervall: + We check once in *poll_intervall* seconds if we can acquire the file lock. :raises Timeout: @@ -286,9 +286,9 @@ def acquire(self, timeout=None, poll_intervall=0.05): else: logger().debug( 'Lock %s not acquired on %s, waiting %s seconds ...', - lock_id, lock_filename, poll_interval + lock_id, lock_filename, poll_intervall ) - time.sleep(poll_interval) + time.sleep(poll_intervall) except: # Something did go wrong, so decrement the counter. with self._thread_lock: