clean up and standardize types across the codebase, unify atomic operations, improve UTF-8 handling throughout the system, remove obsolete input and named queue interfaces, redesign process preparation and creation, tighten IPC and service boundaries, improve error handling and reliability, minor documentation cleanup, fix doom surfaces, fix panic in ini parsing.
This commit is contained in:
1 parent
899225f551
commit
c0ad63c27f
226 files changed
+6562
-4147
No files matched your search
@@ -4,6 +4,7 @@
|
||||
// include <windows.h> here; Win32 compatibility belongs in the Win32 personality
|
||||
// layer, not in native apps.
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
@@ -45,7 +46,7 @@ static void print_u64(uint64_t v) {
|
||||
}
|
||||
}
|
||||
|
||||
static void fail_status(const char* what, uint32_t status) {
|
||||
static void fail_status(const char* what, KSTATUS status) {
|
||||
print("video: ");
|
||||
print(what);
|
||||
print(" failed status=");
|
||||
@@ -65,7 +66,7 @@ static SYS_STRING_VIEW command_line_view(void) {
|
||||
return peb->CommandLine;
|
||||
}
|
||||
|
||||
static int sv_is_space(char c) {
|
||||
static bool sv_is_space(char c) {
|
||||
return c == ' ' || c == '\t';
|
||||
}
|
||||
|
||||
@@ -116,21 +117,21 @@ static SYS_STRING_VIEW command_line_first_argument(SYS_STRING_VIEW cmdline) {
|
||||
return SysSvFromParts(rest.Data + begin, end - begin);
|
||||
}
|
||||
|
||||
static int sv_equals_cstr(SYS_STRING_VIEW s, const char* cstr) {
|
||||
static bool sv_equals_cstr(SYS_STRING_VIEW s, const char* cstr) {
|
||||
size_t len = 0;
|
||||
if (!s.Data || !cstr)
|
||||
return 0;
|
||||
return false;
|
||||
|
||||
while (cstr[len])
|
||||
len++;
|
||||
|
||||
if (s.Length != len)
|
||||
return 0;
|
||||
return false;
|
||||
|
||||
return memcmp(s.Data, cstr, len) == 0;
|
||||
}
|
||||
|
||||
static int video_argument_is_help(SYS_STRING_VIEW arg) {
|
||||
static bool video_argument_is_help(SYS_STRING_VIEW arg) {
|
||||
return sv_equals_cstr(arg, "-h") ||
|
||||
sv_equals_cstr(arg, "--help") ||
|
||||
sv_equals_cstr(arg, "/?");
|
||||
@@ -158,7 +159,7 @@ static const char* path_to_cstr(SYS_STRING_VIEW path, char* out, size_t outSize)
|
||||
return out;
|
||||
}
|
||||
|
||||
static uint32_t open_file_view(SYS_STRING_VIEW path, uint32_t* handleOut) {
|
||||
static KSTATUS open_file_view(SYS_STRING_VIEW path, uint32_t* handleOut) {
|
||||
return NtlOpenFile(path, SYS_FILE_ACCESS_READ | SYS_FILE_ACCESS_QUERY,
|
||||
SYS_FILE_OPEN_EXISTING, SYS_FILE_FLAG_NONE, handleOut);
|
||||
}
|
||||
@@ -179,7 +180,7 @@ int main(void) {
|
||||
}
|
||||
|
||||
uint32_t file = 0;
|
||||
uint32_t status = open_file_view(pathView, &file);
|
||||
KSTATUS status = open_file_view(pathView, &file);
|
||||
if (status != NTLSTATUS_SUCCESS) {
|
||||
char pathBuf[260];
|
||||
print("video: failed to open input file: ");
|
||||
|
||||
Reference in new issue
Block a user