[refactor] Organize STRING
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user