Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
104 changes: 52 additions & 52 deletions ChangeLog.md

Large diffs are not rendered by default.

11 changes: 6 additions & 5 deletions docs/emcc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ Options that are modified or new in *emcc* are listed below:
[link] Make the output suitable for profiling. This means including
function names in the wasm and JS output, and preserving whitespace
in the JS output. It does not affect optimizations (to ensure that
performance profiles reflect production builds). Currenly this is
performance profiles reflect production builds). Currently this is
the same as "-g2".

"--profiling-funcs"
Expand Down Expand Up @@ -255,10 +255,11 @@ Options that are modified or new in *emcc* are listed below:
"[name].wasm.js.symbols" (with ASM.js symbols)

"--emit-minification-map <file>"
[link] In cases where emscripten performs import/export minificiton
this option can be used to output a file that maps minified names
back to their original names. The format of this file is single
line per import/export of the form "<minname>:<origname>".
[link] In cases where emscripten performs import/export
minification this option can be used to output a file that maps
minified names back to their original names. The format of this
file is single line per import/export of the form
"<minname>:<origname>".

"-flto"
[compile+link] Enables link-time optimizations (LTO).
Expand Down
4 changes: 2 additions & 2 deletions embuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ def main():
parser.add_argument('--lto', action='store_const', const='full', help='build bitcode object for LTO')
parser.add_argument('--lto=thin', dest='lto', action='store_const', const='thin', help='build bitcode object for ThinLTO')
parser.add_argument('--pic', action='store_true',
help='build relocatable objects for suitable for dynamic linking')
help='build relocatable objects suitable for dynamic linking')
parser.add_argument('-f', '--force', action='store_true',
help='force rebuild of target (by removing it first)')
parser.add_argument('-v', '--verbose', action='store_true',
Expand Down Expand Up @@ -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')

Expand Down
12 changes: 6 additions & 6 deletions emcc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion emconfigure.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def run():
args = sys.argv[1:]

if 'cmake' in args:
print('error: use `emcmake` rather then `emconfigure` for cmake projects', file=sys.stderr)
print('error: use `emcmake` rather than `emconfigure` for cmake projects', file=sys.stderr)
return 1

env = building.get_building_env()
Expand Down
18 changes: 9 additions & 9 deletions emrun.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -832,12 +832,12 @@ def find_gpu_model(model):
VideoCardString = winreg.QueryValueEx(hVideoReg, '\\Device\\Video' + str(i))[0]
# Get Rid of Registry/Machine from the string
VideoCardStringSplit = VideoCardString.split('\\')
ClearnVideoCardString = "\\".join(VideoCardStringSplit[3:])
CleanVideoCardString = "\\".join(VideoCardStringSplit[3:])
# Go up one level for detailed
# VideoCardStringRoot = "\\".join(VideoCardStringSplit[3:len(VideoCardStringSplit)-1])

# Get the graphics card information
hVideoCardReg = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, ClearnVideoCardString)
hVideoCardReg = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, CleanVideoCardString)
try:
VideoCardDescription = winreg.QueryValueEx(hVideoCardReg, 'Device Description')[0]
except WindowsError:
Expand Down Expand Up @@ -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,
Expand All @@ -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 = {}
Expand Down Expand Up @@ -1558,7 +1558,7 @@ def parse_args(args):

parser.add_argument('--json', action='store_true',
help='If specified, --system-info and --browser-info are '
'outputted in JSON format.')
'output in JSON format.')

parser.add_argument('--safe-firefox-profile', action='store_true',
help='If true, the browser is launched into a new clean '
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion emsize.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def parse_args(argv):

def print_sizes(js_file):
if not os.path.isfile(js_file):
return error('Input JS file %s not foune' % js_file)
return error('Input JS file %s not found' % js_file)
if not js_file.endswith('.js'):
return error('Input file %s does not have a JS extension' % js_file)

Expand Down
2 changes: 1 addition & 1 deletion site/source/docs/api_reference/Filesystem-API.rst
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ The device node acts as an interface between the device and the file system. Any
Setting up standard I/O devices
===============================

Emscripten standard I/O works by going though the virtual ``/dev/stdin``, ``/dev/stdout`` and ``/dev/stderr`` devices. You can set them up using your own I/O functions by calling :js:func:`FS.init`.
Emscripten standard I/O works by going through the virtual ``/dev/stdin``, ``/dev/stdout`` and ``/dev/stderr`` devices. You can set them up using your own I/O functions by calling :js:func:`FS.init`.

By default:

Expand Down
2 changes: 1 addition & 1 deletion site/source/docs/api_reference/console.h.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,6 @@ Functions
Prints the string using the `dbg()` JS function, which by will write to the
console (or stdout). Just like the `dbg()` JS function this symbol is
only available in debug builds (i.e. when linking with `-sASSERTIONS` or
equivelently `-O0`).
equivalently `-O0`).

:param utf8String: A string encoded as UTF-8.
2 changes: 1 addition & 1 deletion site/source/docs/api_reference/emscripten.h.rst
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,7 @@ Functions
:param int flags: See dlopen flags.
:param void* user_data: User data passed to onsuccess, and onerror callbacks.
:param em_dlopen_callback onsuccess: Called if the library was loaded successfully.
:param em_arg_callback_func onerror: Called if there as an error loading the library.
:param em_arg_callback_func onerror: Called if there is an error loading the library.


Asynchronous IndexedDB API
Expand Down
24 changes: 12 additions & 12 deletions site/source/docs/api_reference/html5.h.rst
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ Struct

A system and implementation dependent numeric code identifying the unmodified value of the pressed key; this is usually the same as ``keyCode``.

.. warning:: This attribute is deprecated, you should use the field ``key`` instead, if available. Note thought that while this field is deprecated, the cross-browser support for ``which`` may be better than for the other fields, so experimentation is recommended. Read issue https://github.com/emscripten-core/emscripten/issues/2817 for more information.
.. warning:: This attribute is deprecated, you should use the field ``key`` instead, if available. Note though that while this field is deprecated, the cross-browser support for ``which`` may be better than for the other fields, so experimentation is recommended. Read issue https://github.com/emscripten-core/emscripten/issues/2817 for more information.


Callback functions
Expand Down Expand Up @@ -458,7 +458,7 @@ Struct
.. c:member:: int canvasX
int canvasY

These fields give the mouse coordinates mapped to the Emscripten canvas client area (Emscripten-specific extension; coordinates are rounded down the nearest integer).
These fields give the mouse coordinates mapped to the Emscripten canvas client area (Emscripten-specific extension; coordinates are rounded down to the nearest integer).


.. c:member:: int padding
Expand Down Expand Up @@ -515,7 +515,7 @@ Functions

Returns the most recently received mouse event state.

Note that for this function call to succeed, :c:func:`emscripten_set_xxx_callback <emscripten_set_click_callback>` must have first been called with one of the mouse event types and a non-zero callback function pointer to enable the Mouse state capture.
Note that for this function call to succeed, :c:func:`emscripten_set_xxx_callback <emscripten_set_click_callback>` must have first been called with one of the mouse event types and a non-zero callback function pointer to enable the mouse state capture.

:param EmscriptenMouseEvent* mouseState: The most recently received mouse event state.
:returns: :c:data:`EMSCRIPTEN_RESULT_SUCCESS`, or one of the other result values.
Expand Down Expand Up @@ -561,7 +561,7 @@ Struct
double deltaY
double deltaZ

Movement of the wheel on each of the axis. Note that these values may be fractional, so you should avoid simply casting them to integer, or it might result
Movement of the wheel on each of the axes. Note that these values may be fractional, so you should avoid simply casting them to integer, or it might result
in scroll values of 0. The positive Y scroll direction is when scrolling the page downwards (page CSS pixel +Y direction), which corresponds to scrolling
the mouse wheel downwards (away from the screen) on Windows, Linux, and also on macOS when the 'natural scroll' option is disabled.

Expand Down Expand Up @@ -794,7 +794,7 @@ Struct

The `orientation <https://developer.mozilla.org/en-US/Apps/Build/gather_and_modify_data/responding_to_device_orientation_changes#Device_Orientation_API>`_ of the device in terms of the transformation from a coordinate frame fixed on the Earth to a coordinate frame fixed in the device.

The image (source: `dev.opera.com <http://dev.opera.com/articles/view/w3c-device-orientation-api/>`_) and definitions below illustrate the co-ordinate frame:
The image (source: `dev.opera.com <http://dev.opera.com/articles/view/w3c-device-orientation-api/>`_) and definitions below illustrate the coordinate frame:

- :c:type:`~EmscriptenDeviceOrientationEvent.alpha`: the rotation of the device around the Z axis.
- :c:type:`~EmscriptenDeviceOrientationEvent.beta`: the rotation of the device around the X axis.
Expand Down Expand Up @@ -1767,7 +1767,7 @@ Functions
.. note::

Gamepad API uses an array of gamepad state objects to return the state of
each device. The devices are identified via the index they are present in in
each device. The devices are identified via the index they are present in
this array. Because of that, if one first connects gamepad A, then gamepad
B, and then disconnects gamepad A, the gamepad B shall not take the place of
gamepad A, so in this scenario, this function will still keep returning two
Expand Down Expand Up @@ -1803,15 +1803,15 @@ Defines
.. c:macro:: EMSCRIPTEN_EVENT_BATTERYCHARGINGCHANGE
EMSCRIPTEN_EVENT_BATTERYLEVELCHANGE

Emscripten `batterymanager <http://www.w3.org/TR/battery-status/#batterymanager-interface>`_ events.
Emscripten `BatteryManager <http://www.w3.org/TR/battery-status/#batterymanager-interface>`_ events.


Struct
------

.. c:type:: EmscriptenBatteryEvent

The event structure passed in the `batterymanager <http://www.w3.org/TR/battery-status/#batterymanager-interface>`_ events: ``chargingchange`` and ``levelchange``.
The event structure passed in the `BatteryManager <http://www.w3.org/TR/battery-status/#batterymanager-interface>`_ events: ``chargingchange`` and ``levelchange``.


.. c:member:: double chargingTime
Expand All @@ -1836,14 +1836,14 @@ Callback functions

.. c:type:: em_battery_callback_func

Function pointer for the :c:func:`batterymanager event callback functions <emscripten_set_batterychargingchange_callback>`, defined as:
Function pointer for the :c:func:`BatteryManager event callback functions <emscripten_set_batterychargingchange_callback>`, defined as:

.. code-block:: cpp

typedef bool (*em_battery_callback_func)(int eventType, const EmscriptenBatteryEvent *batteryEvent, void *userData);

:param int eventType: The type of ``batterymanager`` event (:c:data:`EMSCRIPTEN_EVENT_BATTERYCHARGINGCHANGE`).
:param batteryEvent: Information about the ``batterymanager`` event that occurred.
:param int eventType: The type of ``BatteryManager`` event (:c:data:`EMSCRIPTEN_EVENT_BATTERYCHARGINGCHANGE`).
:param batteryEvent: Information about the ``BatteryManager`` event that occurred.
:type batteryEvent: const EmscriptenBatteryEvent*
:param void* userData: The ``userData`` originally passed to the registration function.
:returns: |callback-handler-return-value-doc|
Expand All @@ -1857,7 +1857,7 @@ Functions
.. c:function:: EMSCRIPTEN_RESULT emscripten_set_batterychargingchange_callback(void *userData, em_battery_callback_func callback)
EMSCRIPTEN_RESULT emscripten_set_batterylevelchange_callback(void *userData, em_battery_callback_func callback)

Registers a callback function for receiving the `batterymanager <http://www.w3.org/TR/battery-status/#batterymanager-interface>`_ events: ``chargingchange`` and ``levelchange``.
Registers a callback function for receiving the `BatteryManager <http://www.w3.org/TR/battery-status/#batterymanager-interface>`_ events: ``chargingchange`` and ``levelchange``.

:param void* userData: |userData-parameter-doc|
:param em_battery_callback_func callback: |callback-function-parameter-doc|
Expand Down
2 changes: 1 addition & 1 deletion site/source/docs/api_reference/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ high level it consists of:
Low level glue bindings for interfacing with HTML5 APIs from native code.

- :ref:`console-h`:
Functions to writing to the console and stdout/stderr.
Functions for writing to the console and stdout/stderr.

- :ref:`preamble-js`:
APIs for working with compiled code from JavaScript.
Expand Down
6 changes: 3 additions & 3 deletions site/source/docs/api_reference/preamble.js.rst
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ Calling compiled C functions from JavaScript

Returns a native JavaScript wrapper for a C function.

This is similar to :js:func:`ccall`, but returns a JavaScript function that can be reused as many time as needed. The C function can be defined in a C file, or be a C-compatible C++ function defined using ``extern "C"`` (to prevent name mangling).
This is similar to :js:func:`ccall`, but returns a JavaScript function that can be reused as many times as needed. The C function can be defined in a C file, or be a C-compatible C++ function defined using ``extern "C"`` (to prevent name mangling).


.. code-block:: javascript
Expand Down Expand Up @@ -239,7 +239,7 @@ Conversion functions — strings, pointers and arrays

.. js:function:: intArrayFromString(stringy, dontAddNull[, length])

This converts a JavaScript string into a C-line array of numbers, 0-terminated.
This converts a JavaScript string into a C-like array of numbers, 0-terminated.

:param stringy: The string to be converted.
:type stringy: String
Expand All @@ -251,7 +251,7 @@ Conversion functions — strings, pointers and arrays

.. js:function:: intArrayToString(array)

This creates a JavaScript string from a zero-terminated C-line array of numbers.
This creates a JavaScript string from a zero-terminated C-like array of numbers.

:param array: The array to convert.
:returns: A ``String``, containing the content of ``array``.
Expand Down
Loading