aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFraser Adams <fraser.adams@blueyonder.co.uk>2013-11-11 18:32:23 +0000
committerFraser Adams <fraser.adams@blueyonder.co.uk>2013-11-11 18:32:23 +0000
commit14590829a02c7bc65e62df5caeb15a5803f9da5c (patch)
tree9093a5be304f046d9d961c550261747c7253dd61 /src
parent38a6435e0f7ddc04c3fbb1c05bbae20039aa5ed7 (diff)
Replaced loop in gai_strerror with writeAsciiToMemory call and made the comment around hopefully a little more descriptive
Diffstat (limited to 'src')
-rw-r--r--src/library.js9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/library.js b/src/library.js
index d28e97c6..ccf62b27 100644
--- a/src/library.js
+++ b/src/library.js
@@ -7643,7 +7643,8 @@ LibraryManager.library = {
return 0;
},
- // Can't use a literal for GAI_ERRNO_MESSAGES as the keys are negative values.
+ // Can't use a literal for $GAI_ERRNO_MESSAGES as was done for $ERRNO_MESSAGES as the keys (e.g. EAI_BADFLAGS)
+ // are actually negative numbers and you can't have expressions as keys in JavaScript literals.
$GAI_ERRNO_MESSAGES: {},
gai_strerror__deps: ['$GAI_ERRNO_MESSAGES'],
@@ -7677,11 +7678,7 @@ LibraryManager.library = {
}
}
- for (var i = 0; i < msg.length; i++) {
- {{{ makeSetValue('_gai_strerror.buffer', 'i', 'msg.charCodeAt(i)', 'i8') }}}
- }
- {{{ makeSetValue('_gai_strerror.buffer', 'i', 0, 'i8') }}}
-
+ writeAsciiToMemory(msg, _gai_strerror.buffer);
return _gai_strerror.buffer;
},