Skip to content

Commit b256e55

Browse files
authored
Move some unused parseTools to parseTools_legacy. NFC (#19979)
1 parent 8541184 commit b256e55

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

src/parseTools.js

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -547,17 +547,6 @@ function charCode(char) {
547547
return char.charCodeAt(0);
548548
}
549549

550-
function ensureValidFFIType(type) {
551-
return type === 'float' ? 'double' : type; // ffi does not tolerate float XXX
552-
}
553-
554-
// FFI return values must arrive as doubles, and we can force them to floats afterwards
555-
function asmFFICoercion(value, type) {
556-
value = asmCoercion(value, ensureValidFFIType(type));
557-
if (type === 'float') value = asmCoercion(value, 'float');
558-
return value;
559-
}
560-
561550
function makeDynCall(sig, funcPtr) {
562551
assert(!sig.includes('j'), 'Cannot specify 64-bit signatures ("j" in signature string) with makeDynCall!');
563552

src/parseTools_legacy.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,3 +121,14 @@ function addAtMain(code) {
121121
assert(HAS_MAIN, 'addAtMain called but program has no main function');
122122
ATMAINS.push(code);
123123
}
124+
125+
function ensureValidFFIType(type) {
126+
return type === 'float' ? 'double' : type; // ffi does not tolerate float XXX
127+
}
128+
129+
// FFI return values must arrive as doubles, and we can force them to floats afterwards
130+
function asmFFICoercion(value, type) {
131+
value = asmCoercion(value, ensureValidFFIType(type));
132+
if (type === 'float') value = asmCoercion(value, 'float');
133+
return value;
134+
}

0 commit comments

Comments
 (0)