misc changes, preparing for 8086 module.

This commit is contained in:
ed
2026-09-04 21:02:31 -04:00
parent aa9c4d48f6
commit bfd02f4472
6 changed files with 160 additions and 145 deletions
+2 -2
View File
@@ -67,8 +67,8 @@ Standard: c23
#define T_ typeof //
#define T_same(a,b) _Generic((a), typeof((b)): 1, default: 0)
#define R_ restrict
#define V_ volatile
#define R_ restrict
#define V_ volatile
// R_ (restrict) establishes an "Eigen" or "Proprius" mapping.
// Unlike volatile (V_), which assumes the memory can be changed by anything,
+1 -1
View File
@@ -16,7 +16,7 @@ FI_ void u64_to_hex(U8 val, char* buf, S4 chars) {
for(S1 i = chars - 1; i >= 0; --i) { buf[i] = hex_chars[val & 0xF]; val >>= 4; }
}
internal UnicodeDecode
I_ UnicodeDecode
utf8_decode(U1* str, U1 max) {
UnicodeDecode result = {1, Max_U4};
U1 byte = str[0];
+1 -1
View File
@@ -50,7 +50,7 @@ os_layer File file_open(FArena* scratch, AccessFlags flags, Str8 path);
os_layer FileProperties properties_from_file(File file);
os_layer U8 file_read(File file, R1_U8 rng, U1* out_data);
internal Slice_U1
I_ Slice_U1
data_from_file_range(FArena* arena, File file, R1_U8 range) {
U8 pre_pos = farena_save(arena[0]);
U8 len = span_r1u8(range);
+2 -1
View File
@@ -2,6 +2,7 @@
# pragma once
# include "dsl.h"
# include "memory.h"
# include "files.h"
#endif
WinAPI void ms_exit_process(U4 uExitCode) asm("ExitProcess"); // Kernel 32
@@ -245,7 +246,7 @@ w32_date_time_from_system_time(DateTime* out, MS_SYSTEMTIME* in) {
I_ void
w32_dense_time_from_file_time(DenseTime* out, MS_FILETIME* in) {
MS_SYSTEMTIME systime = {0}; ms_filetime_to_systemtime(in, &systime); DateTime date_time = {0};
w32_date_time_from_system_time(&date_time, &systime); *out = dense_time_from_date_time(date_time);
w32_date_time_from_system_time(&date_time, &systime); out[0] = dense_time_from_date_time(date_time);
}
I_ FilePropertyFlags