porffor 0.37.12 → 0.37.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/compiler/2c.js +2 -2
- package/compiler/index.js +1 -1
- package/package.json +1 -1
- package/runner/index.js +1 -1
package/compiler/2c.js
CHANGED
@@ -213,7 +213,7 @@ export default ({ funcs, globals, tags, data, exceptions, pages }) => {
|
|
213
213
|
}
|
214
214
|
|
215
215
|
if (pages.size > 0) {
|
216
|
-
prepend.set('_memory', `char _memory[${pages.size * pageSize}];\n`);
|
216
|
+
prepend.set('_memory', `static char _memory[${pages.size * pageSize}];\n`);
|
217
217
|
if (Prefs['2cMemcpy']) includes.set('string.h', true);
|
218
218
|
}
|
219
219
|
|
@@ -224,7 +224,7 @@ export default ({ funcs, globals, tags, data, exceptions, pages }) => {
|
|
224
224
|
prependMain.set('_data', activeData.map(x => `memcpy(_memory + ${dataOffset(x)}, (unsigned char[]){${x.bytes.join(',')}}, ${x.bytes.length});`).join('\n '));
|
225
225
|
includes.set('string.h', true);
|
226
226
|
} else {
|
227
|
-
prependMain.set('_data', activeData.map(x => x.bytes.reduce((acc, y, i) => acc + `_memory[${dataOffset(x) + i}]=(u8)${y}
|
227
|
+
prependMain.set('_data', activeData.map(x => x.bytes.reduce((acc, y, i) => acc + (y === 0 ? '' : `_memory[${dataOffset(x) + i}]=(u8)${y};`), '')).join('\n '));
|
228
228
|
}
|
229
229
|
}
|
230
230
|
|
package/compiler/index.js
CHANGED
@@ -256,7 +256,7 @@ export default (code, flags) => {
|
|
256
256
|
if (logProgress) {
|
257
257
|
const total = performance.now();
|
258
258
|
progressClear();
|
259
|
-
console.log(`\u001b[90m[${total.toFixed(0)}ms]\u001b[0m \u001b[
|
259
|
+
console.log(`\u001b[90m[${total.toFixed(0)}ms]\u001b[0m \u001b[32mcompiled ${globalThis.file} \u001b[90m->\u001b[0m \u001b[92m${outFile}\u001b[90m (${(fs.statSync(outFile).size / 1000).toFixed(1)}KB)\u001b[0m`);
|
260
260
|
}
|
261
261
|
|
262
262
|
process.exit();
|
package/package.json
CHANGED