aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJukka Jylänki <jujjyl@gmail.com>2013-08-30 14:42:18 +0300
committerAlon Zakai <alonzakai@gmail.com>2013-09-10 14:39:31 -0700
commit998bfbaf23a3ac894b7f57e237af529b08a5a2c3 (patch)
tree216627f1a8d30c24af2e7d799bdf7aefcd626720
parent61b6d3c337b1c35692d2c1fc3b5d30cafeec3950 (diff)
Rename utf32<->jsstring marshalling functions to UTF32ToString and stringToUTF32 following azakai's suggestion on naming convention.
-rw-r--r--src/preamble.js8
-rw-r--r--tests/utf32.cpp4
2 files changed, 6 insertions, 6 deletions
diff --git a/src/preamble.js b/src/preamble.js
index 465e47a3..cbd50ade 100644
--- a/src/preamble.js
+++ b/src/preamble.js
@@ -571,7 +571,7 @@ Module['Pointer_stringify'] = Pointer_stringify;
// Given a pointer 'ptr' to a null-terminated UTF32LE-encoded string in the emscripten HEAP, returns
// a copy of that string as a Javascript String object.
-function utf32_to_jsstring(ptr) {
+function UTF32ToString(ptr) {
var i = 0;
var str = '';
@@ -583,18 +583,18 @@ function utf32_to_jsstring(ptr) {
str += String.fromCharCode(utf32);
}
}
-Module['utf32_to_jsstring'] = utf32_to_jsstring;
+Module['UTF32ToString'] = UTF32ToString;
// Copies the given Javascript String object 'str' to the emscripten HEAP at address 'outPtr',
// null-terminated and encoded in UTF32LE form. The copy will require (str.length+1)*4 bytes of space in the HEAP.
-function jsstring_to_utf32(str, outPtr) {
+function stringToUTF32(str, outPtr) {
for(var i = 0; i < str.length; ++i) {
var utf32 = str.charCodeAt(i);
{{{ makeSetValue('outPtr', 'i*4', 'utf32', 'i32') }}}
}
{{{ makeSetValue('outPtr', 'str.length*4', 0, 'i32') }}}
}
-Module['jsstring_to_utf32'] = jsstring_to_utf32;
+Module['stringToUTF32'] = stringToUTF32;
// Memory management
diff --git a/tests/utf32.cpp b/tests/utf32.cpp
index a3e660ee..810704d3 100644
--- a/tests/utf32.cpp
+++ b/tests/utf32.cpp
@@ -10,9 +10,9 @@ int main() {
const int len = (wstr.length()+1)*4;
char *memory = new char[len];
- asm("var str = Module.utf32_to_jsstring(%0);"
+ asm("var str = Module.UTF32ToString(%0);"
"Module.print(str);"
- "Module.jsstring_to_utf32(str, %1);"
+ "Module.stringToUTF32(str, %1);"
:
: "r"(wstr.c_str()), "r"(memory));