Skip to content

Commit 0021eac

Browse files
committed
PR feedback
1 parent ae0c3b4 commit 0021eac

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# dependencies
2-
SQLITE_VERSION = version-3.47.0
2+
SQLITE_VERSION = 3.47.0
33
MC_SQLITE_VERSION = 1.9.0
4-
SQLITE_TARBALL_URL = https://www.sqlite.org/src/tarball/sqlite.tar.gz?r=${SQLITE_VERSION}
5-
MC_SQLITE_URL = https://github.com/utelle/SQLite3MultipleCiphers/releases/download/v${MC_SQLITE_VERSION}/sqlite3mc-${MC_SQLITE_VERSION}-sqlite-3.47.0-amalgamation.zip
4+
SQLITE_TARBALL_URL = https://www.sqlite.org/src/tarball/sqlite.tar.gz?r=version-${SQLITE_VERSION}
5+
MC_SQLITE_URL = https://github.com/utelle/SQLite3MultipleCiphers/releases/download/v${MC_SQLITE_VERSION}/sqlite3mc-${MC_SQLITE_VERSION}-sqlite-${SQLITE_VERSION}-amalgamation.zip
66
EXTENSION_FUNCTIONS = extension-functions.c
77
EXTENSION_FUNCTIONS_URL = https://www.sqlite.org/contrib/download/extension-functions.c?get=25
88
EXTENSION_FUNCTIONS_SHA3 = ee39ddf5eaa21e1d0ebcbceeab42822dd0c4f82d8039ce173fd4814807faabfa

src/FacadeVFS.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ import * as VFS from './VFS.js';
33

44
const AsyncFunction = Object.getPrototypeOf(async function(){}).constructor;
55

6+
// Unix epoch in milliseconds as a BigInt.
7+
const UNIX_EPOCH = 24405875n * 8640000n;
8+
69
// Convenience base class for a JavaScript VFS.
710
// The raw xOpen, xRead, etc. function signatures receive only C primitives
811
// which aren't easy to work with. This class provides corresponding calls
@@ -243,11 +246,10 @@ export class FacadeVFS extends VFS.Base {
243246
// Exact copy of SQLite's calculation:
244247
// static const sqlite3_int64 unixEpoch = 24405875*(sqlite3_int64)8640000;
245248
// *piNow = unixEpoch + 1000*(sqlite3_int64)sNow.tv_sec + sNow.tv_usec/1000;
246-
const unixEpoch = 24405875n * 8640000n;
247249
const seconds = BigInt(Math.floor(Date.now() / 1000));
248250
const microseconds = BigInt(Date.now() % 1000) * 1000n;
249251

250-
const value = unixEpoch + (1000n * seconds) + (microseconds / 1000n);
252+
const value = UNIX_EPOCH + (1000n * seconds) + (microseconds / 1000n);
251253

252254
// Write the time value to the pointer location
253255
timeView.setBigInt64(0, value, true);

0 commit comments

Comments
 (0)