Skip to content

Commit c8ad779

Browse files
committed
Use strict mode by default
1 parent 6d504c1 commit c8ad779

File tree

6 files changed

+10
-6
lines changed

6 files changed

+10
-6
lines changed

boot/uefi/memory.hexa

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ fun uefiGetMemoryMap(efiMemoryMap UefiMemoryMap, systemTable EFI_SYSTEM_TABLE) {
112112
return EFI_STATUS.EFI_SUCCESS
113113
}
114114

115-
fun uefiSetFrameBufferMode(fb FrameBuffer, systemTable EFI_SYSTEM_TABLE) {
115+
fun uefiSetFrameBufferMode(fb FrameBuffer, systemTable EFI_SYSTEM_TABLE) EFI_STATUS {
116116
var gopGuid EFI_GUID = new EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID()
117117
var igop ArrayByValue<UInt64, 1> = [] // TODO must error: should'nt be empty
118118
// TODO ^ also `<..., 1> = [1,2,3, too much]` error
@@ -139,6 +139,8 @@ fun uefiSetFrameBufferMode(fb FrameBuffer, systemTable EFI_SYSTEM_TABLE) {
139139

140140
// TODO https://forum.osdev.org/viewtopic.php?f=1&t=37201
141141
gop.setMode(gop, gop.mode.mode)
142+
143+
return EFI_STATUS.EFI_SUCCESS
142144
}
143145

144146
/// `destination` can be zero for allocation at any address chosen by UEFI

boot/uefi/visuals.hexa

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ fun drawChar(c UInt8, x Float, y Int16, framebuffer FrameBuffer) {
8383
let atx UInt32 = xx + xi
8484
let aty UInt32 = y + yi
8585

86+
// TODO well, re-parsing BMP for every pixel is not fast
8687
let font = getBitmapPixel(binFontBitmap, textChar.x + xi, textChar.y + yi, fontWidth, fontHeight)
8788

8889
drawPixel(framebuffer, atx, aty, font)

build.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ IF %ERRORLEVEL% NEQ 0 (
2323
:: we can compare dates for cashes and rebuild only required projects
2424

2525
::debug
26-
..\Teapot\node-v18.1.0-win-x64\node build.js init-or-clean asm efi dll engine ramdisk iso
26+
..\Teapot\node-v18.1.0-win-x64\node build.js init-or-clean cxx asm efi dll engine ramdisk iso
2727
::
2828
IF %ERRORLEVEL% NEQ 0 (
2929
goto somethingbad

build/main.hexa

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ fun runTasks() {
320320
[
321321
clang + ' ',
322322
'-target ' + target + ' -fno-stack-protector',
323-
'-x c -std=gnu17',
323+
useCpp ? '-x c++ -std=c++2a -fno-rtti -fno-exceptions': '-x c -std=gnu17',
324324
'-fshort-wchar -mno-red-zone -w',
325325
'-fomit-frame-pointer',
326326
'-fno-stack-check',
@@ -413,7 +413,6 @@ fun runTasks() {
413413
'-DHEXA_NO_PLATFORM_INCLUDES',
414414
'-msse -msse2 -msse3 -mpopcnt -mcx16 -msahf -mprfchw',
415415
'-mno-ssse3 -mno-sse4a -mno-sse4.1 -mno-sse4.2 -mno-sse4', // Unsupported by some targeted CPUs
416-
// TODO useCpp, fix C build
417416
definedBehavior,
418417
useCpp ? '-x c++ -std=c++2a': '-x c -std=gnu17',
419418
'-fomit-frame-pointer',

devices/cpu/cpuid.hexa

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,8 @@ fun getCPUID() CPUID {
496496
}
497497
}
498498

499-
return result
499+
// return result // TODO Hexa: keep this, remove return below, and make it checked by typer to always return
500500
}
501+
502+
return result
501503
}

dlls/tofita32/tofita32.header.hexa

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ declare fun tofitaFastSystemCall(rcx TofitaSyscalls,
4747
declare fun tofitaDebugLogREAL(message ConstArrayPointer<ClangWideChar>, extra SizeOfPointer = 0, more SizeOfPointer = 0) Void
4848

4949
@customHeader('
50-
#define tofitaDebugLog_(m, e, mo) tofitaDebugLogREAL_(m, (size_t)(e), (size_t)(mo))
50+
#define tofitaDebugLog_(m, e, mo) tofitaDebugLogREAL_((wchar_t *)m, (size_t)(e), (size_t)(mo))
5151
')
5252
declare fun tofitaDebugLog(message ConstArrayPointer<ClangWideChar>, extra UInt64 = 0, more UInt64 = 0) Void
5353

0 commit comments

Comments
 (0)