[refactor] Organize STRING

This commit is contained in:
2026-06-05 18:38:45 +08:00
Unverified
parent da03b301fb
commit 9ee88ef7b9
19 changed files with 124 additions and 51 deletions
+2 -7
View File
@@ -7,7 +7,7 @@
#include <serial.h>
#include <idt.h>
#include <pic.h>
#include <common.h>
#include <string_utils.h>
// --- Layer list (sorted by z, lowest first) ---
@@ -84,12 +84,7 @@ layer_t* layer_create(const char* name, layer_type_t type, UINT32 w, UINT32 h) {
layer->visible = true;
layer->next = NULL;
const char* s = name;
char* d = layer->name;
for (SSINT32 i = 0; i < LAYER_NAME_LEN - 1 && *s; i++) {
*d++ = *s++;
}
*d = '\0';
str_copy(layer->name, name, LAYER_NAME_LEN);
UINTN buf_size = (UINTN)w * h * sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL);
layer->buffer = (EFI_GRAPHICS_OUTPUT_BLT_PIXEL*)kmalloc(buf_size);