From 998bfbaf23a3ac894b7f57e237af529b08a5a2c3 Mon Sep 17 00:00:00 2001 From: Jukka Jylänki Date: Fri, 30 Aug 2013 14:42:18 +0300 Subject: Rename utf32<->jsstring marshalling functions to UTF32ToString and stringToUTF32 following azakai's suggestion on naming convention. --- src/preamble.js | 8 ++++---- tests/utf32.cpp | 4 ++-- 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)); -- cgit v1.2.3-18-g5258