diff --git a/embuilder.py b/embuilder.py index 005fd5b6f2418..0d9c9e891f289 100755 --- a/embuilder.py +++ b/embuilder.py @@ -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 4ed379a26dee8..891eb6f222110 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) @@ -510,13 +510,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 @@ -547,7 +547,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/emrun.py b/emrun.py index bcc46ae881124..64edfac483146 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): @@ -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 = {} @@ -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/site/source/conf.py b/site/source/conf.py index a4d3d3dd2fe67..52e33674bc67a 100644 --- a/site/source/conf.py +++ b/site/source/conf.py @@ -71,7 +71,7 @@ ] -#Build "Todo" notes into the source +# Build "Todo" notes into the source #todo_include_todos = 'True' # Add any paths that contain templates here, relative to this directory. diff --git a/src/Fetch.js b/src/Fetch.js index 050942b8e73cf..52619b454e936 100644 --- a/src/Fetch.js +++ b/src/Fetch.js @@ -840,7 +840,7 @@ function fetchGetResponseHeaders(id, dst, dstSizeBytes) { return stringToUTF8(responseHeaders, dst, dstSizeBytes) + 1; } -//Delete the xhr JS object, allowing it to be garbage collected. +// Delete the xhr JS object, allowing it to be garbage collected. function fetchFree(id) { #if FETCH_DEBUG dbg(`fetch: fetchFree id:${id}`); diff --git a/src/audio_worklet.js b/src/audio_worklet.js index 26dfa5d3ad823..6923213f7f9c0 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 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 1cee8b93bf179..093a593df1be1 100644 --- a/src/lib/libatomic.js +++ b/src/lib/libatomic.js @@ -87,7 +87,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/libcore.js b/src/lib/libcore.js index d774ed139d044..1342026a6ce33 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 { @@ -756,7 +756,7 @@ addToLibrary({ // IPv4-compatible IPv6 address if 16-bit value (bytes 11 and 12) == 0x0000 (6th word) if (parts[5] === 0) { str = "::"; - //special case IPv6 addresses + // special case IPv6 addresses if (v4part === "0.0.0.0") v4part = ""; // any/unspecified address if (v4part === "0.0.0.1") v4part = "1";// loopback address str += v4part; @@ -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..2650072ca8b20 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') }}}); @@ -507,7 +507,7 @@ var LibraryDylink = { // we should see the dylink custom section right after the magic number and wasm version failIf(binary[8] !== 0, 'need the dylink section to be first') offset = 9; - var section_size = getLEB(); //section size + var section_size = getLEB(); // section size end = offset + section_size; var name = getString(); failIf(name !== 'dylink.0'); @@ -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..41fd69cd4a5a8 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]; 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..b03a69b321541 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 @@ -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..5137d3c8ac13e 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 callbacks. It does happen in * Chrome on Windows. */ var lastX = Browser.mouseX; 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..2040584348a14 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. diff --git a/src/lib/libpthread.js b/src/lib/libpthread.js index aa3a59f69eb29..4ecbb2d63754e 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 @@ -1100,7 +1100,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 @@ -1140,7 +1140,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); @@ -1161,7 +1161,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) => { @@ -1210,11 +1210,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..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 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..651fb52e3847c 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 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/libwget.js b/src/lib/libwget.js index a137779c6e689..aabab8e223393 100644 --- a/src/lib/libwget.js +++ b/src/lib/libwget.js @@ -144,7 +144,7 @@ var LibraryWget = { }; if (_request == "POST") { - //Send the proper header information along with the request + // Send the proper header information along with the request http.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); http.send(_param); } else { @@ -212,7 +212,7 @@ var LibraryWget = { }; if (_request == "POST") { - //Send the proper header information along with the request + // Send the proper header information along with the request http.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); http.send(_param); } else { 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_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/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/wasm_worker.js b/src/wasm_worker.js index 251e4e0da2453..b34d1856ed8eb 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. 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..1f882aafa9b5d 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 { 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/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/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/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/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/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/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_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/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/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_glfw3.c b/test/browser/test_glfw3.c index 0aaf4c329c214..0f82a3fb27f88 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(); diff --git a/test/browser/test_sdl2_canvas_palette.c b/test/browser/test_sdl2_canvas_palette.c index c96732cd4cffc..e44fc397843f9 100644 --- a/test/browser/test_sdl2_canvas_palette.c +++ b/test/browser/test_sdl2_canvas_palette.c @@ -19,9 +19,9 @@ int main() { SDL_Surface *screen = SDL_CreateRGBSurface(0, 600, 400, 8, 0, 0, 0, 0); - //initialize sdl palette - //with red green and blue - //colors + // initialize sdl palette + // with red green and blue + // colors SDL_Color pal[4]; pal[0].r = 255; pal[0].g = 0; diff --git a/test/browser/test_sdl2_canvas_palette_2.c b/test/browser/test_sdl2_canvas_palette_2.c index 9e78757cb4453..14ba158f0a768 100644 --- a/test/browser/test_sdl2_canvas_palette_2.c +++ b/test/browser/test_sdl2_canvas_palette_2.c @@ -16,8 +16,8 @@ static SDL_Surface *screen; static SDL_Color pal[COLOR_COUNT +1]; void pallete(int red, int green, int blue) { - //initialize sdl palette - //with gradient colors + // initialize sdl palette + // with gradient colors pal[0].r = 0; pal[0].g = 0; pal[0].b = 0; @@ -43,11 +43,11 @@ 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); - //Draw gradient + // Draw gradient SDL_LockSurface(screen); int size = screen->h * screen->pitch; char *color = screen->pixels; @@ -60,7 +60,7 @@ 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) { @@ -77,7 +77,7 @@ int main(int argc, char** argv) { } } - //refreshing + // refreshing SDL_LockSurface(screen); SDL_UnlockSurface(screen); 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.c b/test/browser/test_sdl_canvas_palette.c index 12a77b2516af8..e4f307ff7da20 100644 --- a/test/browser/test_sdl_canvas_palette.c +++ b/test/browser/test_sdl_canvas_palette.c @@ -13,9 +13,9 @@ int main() { SDL_Init(SDL_INIT_VIDEO); SDL_Surface *screen = SDL_SetVideoMode(600, 400, 8, SDL_HWSURFACE | SDL_HWPALETTE); - //initialize sdl palette - //with red green and blue - //colors + // initialize sdl palette + // with red green and blue + // colors SDL_Color pal[3]; pal[0].r = 255; pal[0].g = 0; @@ -46,8 +46,8 @@ int main() { SDL_FillRect(screen, &rect, 2); } - //changing green color - //to yellow + // changing green color + // to yellow pal[1].r = 255; SDL_SetColors(screen, &pal[1], 1, 1); diff --git a/test/browser/test_sdl_canvas_palette_2.c b/test/browser/test_sdl_canvas_palette_2.c index 22d1a7fdd1a54..d7df447c7bfc0 100644 --- a/test/browser/test_sdl_canvas_palette_2.c +++ b/test/browser/test_sdl_canvas_palette_2.c @@ -16,8 +16,8 @@ static SDL_Surface *screen; static SDL_Color pal[COLOR_COUNT +1]; void pallete(int red, int green, int blue) { - //initialize sdl palette - //with gradient colors + // initialize sdl palette + // with gradient colors pal[0].r = 0; pal[0].g = 0; pal[0].b = 0; @@ -37,24 +37,24 @@ 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); - //Draw gradient + // Draw gradient SDL_LockSurface(screen); int size = screen->h * screen->pitch; char *color = screen->pixels; int divider = size / COLOR_COUNT; int i = 0; while (i < size) { - *color = 1 + (i / divider); //red + *color = 1 + (i / divider); // red color++; i++; } SDL_UnlockSurface(screen); - //Set pallete + // Set palette if (argc > 1) { printf("%s\n", argv[1]); if (strcmp(argv[1], "-r") == 0) { @@ -71,7 +71,7 @@ int main(int argc, char** argv) { } } - //refreshing + // refreshing SDL_LockSurface(screen); SDL_UnlockSurface(screen); 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/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_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/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/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_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 } 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/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_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_signals.c b/test/core/test_signals.c index 873a963dad305..b7086d0cd73ca 100644 --- a/test/core/test_signals.c +++ b/test/core/test_signals.c @@ -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(); 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/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/embind.test.js b/test/embind/embind.test.js index 67ca8966a9587..f328ab4258b46 100644 --- a/test/embind/embind.test.js +++ b/test/embind/embind.test.js @@ -397,17 +397,17 @@ module({ var expected = ''; if(stdStringIsUTF8) { - //ASCII + // ASCII expected = 'aei'; - //Latin-1 Supplement + // Latin-1 Supplement expected += '\u00E1\u00E9\u00ED'; - //Greek + // Greek expected += '\u03B1\u03B5\u03B9'; - //Cyrillic + // Cyrillic expected += '\u0416\u041B\u0424'; - //CJK + // CJK expected += '\u5F9E\u7345\u5B50'; - //Euro sign + // Euro sign expected += '\u20AC'; } else { for (var i = 0; i < 128; ++i) { 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/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/float_tex.c b/test/float_tex.c index 2fbdadc1589fd..03a2680a97e8f 100644 --- a/test/float_tex.c +++ b/test/float_tex.c @@ -48,20 +48,20 @@ static const char fragment_shader[] = "if ( dst > 0.5) discard;\n" "}"; -typedef struct NodeInfo { //structure that we want to transmit to our shaders +typedef struct NodeInfo { // structure that we want to transmit to our shaders float x; float y; float s; float c; } NodeInfo; -GLuint nodeTexture; //texture id used to bind -GLuint nodeSamplerLocation; //shader sampler address -GLuint indicesAttributeLocation; //shader attribute address -GLuint indicesVBO; //Vertex Buffer Object Id; +GLuint nodeTexture; // texture id used to bind +GLuint nodeSamplerLocation; // shader sampler address +GLuint indicesAttributeLocation; // shader attribute address +GLuint indicesVBO; // Vertex Buffer Object Id; #define NUM_NODES 512 -NodeInfo data[NUM_NODES]; //our data that will be transmitted using float texture. -double alpha = 0; //use to make a simple funny effect; +NodeInfo data[NUM_NODES]; // our data that will be transmitted using float texture. +double alpha = 0; // use to make a simple funny effect; // static void updateFloatTexture() { int count = 0; @@ -94,7 +94,7 @@ static void glut_draw_callback(void) { glClearColor(1., 1., 1., 0.); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glActiveTexture(GL_TEXTURE0); - updateFloatTexture(); //we change the texture each time to create the effect (it is just for the test) + updateFloatTexture(); // we change the texture each time to create the effect (it is just for the test) glBindTexture(GL_TEXTURE_2D, nodeTexture); glUniform1i(nodeSamplerLocation, 0); glEnableVertexAttribArray(0); @@ -142,7 +142,7 @@ static void gl_init(void) { elements[count] = count; ++count; } - /*Create one texture to store all the needed information */ + /* Create one texture to store all the needed information */ glGenTextures(1, &nodeTexture); /* Store the vertices in a vertex buffer object (VBO) */ glGenBuffers(1, &indicesVBO); @@ -152,7 +152,7 @@ static void gl_init(void) { nodeSamplerLocation = glGetUniformLocation(program, "nodeInfo"); glBindAttribLocation(program, 0, "indices"); #ifndef __EMSCRIPTEN__ // GLES2 & WebGL do not have these, only pre 3.0 desktop GL and compatibility mode GL3.0+ GL do. - //Enable glPoint size in shader, always enable in Open Gl ES 2. + // Enable glPoint size in shader, always enable in Open Gl ES 2. glEnable(GL_VERTEX_PROGRAM_POINT_SIZE); glEnable(GL_POINT_SPRITE); #endif 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_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_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/gl_subdata.c b/test/gl_subdata.c index 6c376bd563259..f69c4eb330287 100644 --- a/test/gl_subdata.c +++ b/test/gl_subdata.c @@ -49,20 +49,20 @@ static const char fragment_shader[] = "if ( dst > 0.5) discard;\n" "}"; -typedef struct NodeInfo { //structure that we want to transmit to our shaders +typedef struct NodeInfo { // structure that we want to transmit to our shaders float x; float y; float s; float c; } NodeInfo; -GLuint nodeTexture; //texture id used to bind -GLuint nodeSamplerLocation; //shader sampler address -GLuint indicesAttributeLocation; //shader attribute address -GLuint indicesVBO; //Vertex Buffer Object Id; +GLuint nodeTexture; // texture id used to bind +GLuint nodeSamplerLocation; // shader sampler address +GLuint indicesAttributeLocation; // shader attribute address +GLuint indicesVBO; // Vertex Buffer Object Id; #define NUM_NODES 512 -NodeInfo data[NUM_NODES]; //our data that will be transmitted using float texture. -double alpha = 0; //use to make a simple funny effect; +NodeInfo data[NUM_NODES]; // our data that will be transmitted using float texture. +double alpha = 0; // use to make a simple funny effect; static void updateFloatTexture() { int count = 0; @@ -95,7 +95,7 @@ static void glut_draw_callback(void) { glClearColor(1., 1., 1., 0.); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glActiveTexture(GL_TEXTURE0); - updateFloatTexture(); //we change the texture each time to create the effect (it is just for the test) + updateFloatTexture(); // we change the texture each time to create the effect (it is just for the test) glBindTexture(GL_TEXTURE_2D, nodeTexture); glUniform1i(nodeSamplerLocation, 0); glEnableVertexAttribArray(0); @@ -148,7 +148,7 @@ static void gl_init(void) { nodeSamplerLocation = glGetUniformLocation(program, "nodeInfo"); glBindAttribLocation(program, 0, "indices"); #ifndef __EMSCRIPTEN__ // GLES2 & WebGL do not have these, only pre 3.0 desktop GL and compatibility mode GL3.0+ GL do. - //Enable glPoint size in shader, always enable in Open Gl ES 2. + // Enable glPoint size in shader, always enable in Open Gl ES 2. glEnable(GL_VERTEX_PROGRAM_POINT_SIZE); glEnable(GL_POINT_SPRITE); #endif 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..5c5dd5b81b130 100644 --- a/test/openal/test_openal_capture.c +++ b/test/openal/test_openal_capture.c @@ -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_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_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_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/other/test_time.c b/test/other/test_time.c index 6e97a03321b68..e4f74300bcbbd 100644 --- a/test/other/test_time.c +++ b/test/other/test_time.c @@ -208,7 +208,7 @@ void test_yday() { localtime_r(&test, &this_tm); if (this_tm.tm_year != prev_tm.tm_year) { - assert(this_tm.tm_yday == 0 && prev_tm.tm_yday == 364); //flipped over to 2003, 2002 was non-leap + assert(this_tm.tm_yday == 0 && prev_tm.tm_yday == 364); // flipped over to 2003, 2002 was non-leap } else if (this_tm.tm_mday != prev_tm.tm_mday) { assert(this_tm.tm_yday == prev_tm.tm_yday + 1); } 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_tls_dylink.c b/test/pthread/test_pthread_tls_dylink.c index a7734c66138de..0f04549192334 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() { diff --git a/test/pthread/test_std_thread_detach.cpp b/test/pthread/test_std_thread_detach.cpp index 8bc484017a874..71f864c4addd4 100644 --- a/test/pthread/test_std_thread_detach.cpp +++ b/test/pthread/test_std_thread_detach.cpp @@ -10,17 +10,17 @@ #include extern "C" { -//Create a thread that does some work +// Create a thread that does some work void EMSCRIPTEN_KEEPALIVE spawn_a_thread() { std::thread( [] { double d=0; - for (int i=0; i<10; i++) //simulate work + for (int i=0; i<10; i++) // simulate work d += (i%2 ? sqrt((int)(rand())) : (-1)*sqrt((int)(rand()))); } ).detach(); } -//Check that the number of workers is less than the number of spawned threads. +// Check that the number of workers is less than the number of spawned threads. void EMSCRIPTEN_KEEPALIVE count_threads(int num_threads_spawned, int num_threads_spawned_extra) { num_threads_spawned += num_threads_spawned_extra; int num_workers = EM_ASM_INT({ @@ -37,22 +37,22 @@ void EMSCRIPTEN_KEEPALIVE count_threads(int num_threads_spawned, int num_threads } } -//Spawn a detached thread every 0.1s. After 0.3s Check that the number of workers are less than the number of spawned threads +// Spawn a detached thread every 0.1s. After 0.3s Check that the number of workers are less than the number of spawned threads int main(int argc, char** argv) { EM_ASM( let thread_check = 0; - const max_thread_check = 5; //fail the test if the number of threads doesn't go down after checking this many times + const max_thread_check = 5; // fail the test if the number of threads doesn't go down after checking this many times const threads_to_spawn = 3; let threads_to_spawn_extra = 0; - //Spawn some detached threads + // Spawn some detached threads for (let i=0; i { _spawn_a_thread(); }, i*100); } - //Check if a worker is free every threads_to_spawn*100 ms, or until max_thread_check is exceeded + // Check if a worker is free every threads_to_spawn*100 ms, or until max_thread_check is exceeded const SpawnMoreThreads = setInterval(() => { - if (PThread.unusedWorkers.length > 0) { //Spawn a thread if a worker is available + if (PThread.unusedWorkers.length > 0) { // Spawn a thread if a worker is available _spawn_a_thread(); threads_to_spawn_extra++; } diff --git a/test/s3tc.c b/test/s3tc.c index ca575ffc2c42f..b793fd3a7e462 100644 --- a/test/s3tc.c +++ b/test/s3tc.c @@ -90,7 +90,7 @@ int main(int argc, char *argv[]) #define DDS_SIZE 262272 FILE *dds = fopen("screenshot.dds", "rb"); - char *ddsdata = (char*)malloc(512*512*4);//DDS_SIZE); + char *ddsdata = (char*)malloc(512*512*4); // DDS_SIZE assert(fread(ddsdata, 1, DDS_SIZE, dds) == DDS_SIZE); fclose(dds); diff --git a/test/sockets/test_enet_client.c b/test/sockets/test_enet_client.c index 46d03067ce22d..bb3152b2599a3 100644 --- a/test/sockets/test_enet_client.c +++ b/test/sockets/test_enet_client.c @@ -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..f69b9a012da1b 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"); diff --git a/test/sockets/test_sockets_partial_client.c b/test/sockets/test_sockets_partial_client.c index 4b3c675722b36..60373aa8cbd89 100644 --- a/test/sockets/test_sockets_partial_client.c +++ b/test/sockets/test_sockets_partial_client.c @@ -54,7 +54,7 @@ void iter() { res = recv(sockfd, buffer, 1, 0); if (res == -1) { if (errno == EAGAIN || errno == EWOULDBLOCK) { - return; //try again + return; // try again } perror("unexcepted end of data"); 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..ec46d9d938115 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')]) @@ -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', 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..b0fea35636ba2 100644 --- a/test/test_core.py +++ b/test/test_core.py @@ -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): @@ -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 @@ -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): @@ -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'), @@ -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_egl.c b/test/test_egl.c index c62cd8e8f3bf2..e060a53359641 100644 --- a/test/test_egl.c +++ b/test/test_egl.c @@ -52,7 +52,7 @@ int main(int argc, char *argv[]) { EGLContext context = eglCreateContext(display, config, NULL, contextAttribsOld); assert(eglGetError() != EGL_SUCCESS); - //Test for invalid attribs + // Test for invalid attribs EGLint contextInvalidAttribs[] = { EGL_CONTEXT_CLIENT_VERSION, 2, @@ -62,7 +62,7 @@ int main(int argc, char *argv[]) { context = eglCreateContext(display, config, NULL, contextInvalidAttribs); assert(eglGetError() != EGL_SUCCESS); assert(context == 0); - //Test for missing terminator + // Test for missing terminator EGLint contextAttribsMissingTerm[] = { EGL_CONTEXT_CLIENT_VERSION, 2, @@ -70,7 +70,7 @@ int main(int argc, char *argv[]) { context = eglCreateContext(display, config, NULL, contextAttribsMissingTerm); assert(eglGetError() != EGL_SUCCESS); assert(context == 0); - //Test for null terminator + // Test for null terminator EGLint contextAttribsNullTerm[] = { EGL_CONTEXT_CLIENT_VERSION, 2, @@ -79,7 +79,7 @@ int main(int argc, char *argv[]) { context = eglCreateContext(display, config, NULL, contextAttribsNullTerm); assert(eglGetError() != EGL_SUCCESS); assert(context == 0); - //Test for invalid and null terminator + // Test for invalid and null terminator EGLint contextAttribsNullTermInvalid[] = { 0, diff --git a/test/test_emscripten_async_wget2.cpp b/test/test_emscripten_async_wget2.cpp index 8720c6a185e79..6b8b9ae4c0206 100644 --- a/test/test_emscripten_async_wget2.cpp +++ b/test/test_emscripten_async_wget2.cpp @@ -39,7 +39,7 @@ 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++) {} @@ -143,7 +143,7 @@ class http { // progress value int _progressValue = -1; - // mode assyncrone courant + // current async mode AssyncMode _assync; // request handle @@ -151,7 +151,7 @@ class http { }; -//this is safe and convenient but not exactly efficient +// this is safe and convenient but not exactly efficient inline std::string format(const char* fmt, ...){ int size = 512; char* buffer = 0; @@ -159,7 +159,7 @@ inline std::string format(const char* fmt, ...){ va_list vl; va_start(vl,fmt); int nsize = vsnprintf(buffer, size, fmt, vl); - if (size <= nsize) {//fail delete buffer and try again + if (size <= nsize) {// fail delete buffer and try again delete buffer; buffer = 0; buffer = new char[nsize+1];//+1 for /0 nsize = vsnprintf(buffer, size, fmt, vl); 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 62508d5133310..f4bd9ef19a388 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)) @@ -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 @@ -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..f246e7c15d44b 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). """ diff --git a/test/test_webgl_resize_offscreencanvas_from_main_thread.c b/test/test_webgl_resize_offscreencanvas_from_main_thread.c index dd9adc9b8b90f..f1d1912869fed 100644 --- a/test/test_webgl_resize_offscreencanvas_from_main_thread.c +++ b/test/test_webgl_resize_offscreencanvas_from_main_thread.c @@ -68,7 +68,7 @@ void resize_canvas(void* arg) { emscripten_set_canvas_element_size("#canvas", 699, 299); } -//should be able to do this regardless of offscreen canvas support +// should be able to do this regardless of offscreen canvas support void get_canvas_size() { int w, h; emscripten_get_canvas_element_size("#canvas", &w, &h); 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/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_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/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/link.py b/tools/link.py index 67de2fbf49c08..9e43b1605c3e2 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 = [] @@ -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/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..58b692366a305 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', 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);