MCPcopy Index your code
hub / github.com/sql-js/sql.js / setValue

Function setValue

js/sql-debug.js:543–556  ·  view source on GitHub ↗

@type {function(number, number, string, boolean=)}

(ptr, value, type, noSafe)

Source from the content-addressed store, hash-verified

541
542/** @type {function(number, number, string, boolean=)} */
543function setValue(ptr, value, type, noSafe) {
544 type = type || 'i8';
545 if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit
546 switch(type) {
547 case 'i1': HEAP8[((ptr)>>0)]=value; break;
548 case 'i8': HEAP8[((ptr)>>0)]=value; break;
549 case 'i16': HEAP16[((ptr)>>1)]=value; break;
550 case 'i32': HEAP32[((ptr)>>2)]=value; break;
551 case 'i64': (tempI64 = [value>>>0,(tempDouble=value,(+(Math_abs(tempDouble))) >= 1.0 ? (tempDouble > 0.0 ? ((Math_min((+(Math_floor((tempDouble)/4294967296.0))), 4294967295.0))|0)>>>0 : (~~((+(Math_ceil((tempDouble - +(((~~(tempDouble)))>>>0))/4294967296.0)))))>>>0) : 0)],HEAP32[((ptr)>>2)]=tempI64[0],HEAP32[(((ptr)+(4))>>2)]=tempI64[1]); break;
552 case 'float': HEAPF32[((ptr)>>2)]=value; break;
553 case 'double': HEAPF64[((ptr)>>3)]=value; break;
554 default: abort('invalid type for setValue: ' + type);
555 }
556}
557
558
559/** @type {function(number, string, boolean=)} */

Callers 2

allocateFunction · 0.70
sql-debug.jsFile · 0.70

Calls 1

abortFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…