1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-14 20:05:02 +00:00

T() macro 6 (#2090)

* T() in z_skelanime.c

* T() in z_eff_blure.c

* T() in z_play.c

* T() in z_jpeg.c

* T() in z_horse.c

* T() in z_eff_spark.c

* T() in z_malloc.c

* T() in z_effect_soft_sprite.c

* add todo on translating "確保" (litterally ~"secure", but may be better as "allocate"-ish)

* review

* format
This commit is contained in:
Dragorn421 2024-08-27 17:10:07 +02:00 committed by GitHub
parent fd14ddcbf1
commit 6b58a15fc0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 106 additions and 102 deletions

View file

@ -12,13 +12,11 @@ s32 gZeldaArenaLogSeverity = LOG_SEVERITY_ERROR;
void ZeldaArena_CheckPointer(void* ptr, u32 size, const char* name, const char* action) {
if (ptr == NULL) {
if (gZeldaArenaLogSeverity >= LOG_SEVERITY_ERROR) {
// "%s: %u bytes %s failed\n"
PRINTF("%s: %u バイトの%sに失敗しました\n", name, size, action);
PRINTF(T("%s: %u バイトの%sに失敗しました\n", "%s: %u bytes %s failed\n"), name, size, action);
__osDisplayArena(&sZeldaArena);
}
} else if (gZeldaArenaLogSeverity >= LOG_SEVERITY_VERBOSE) {
// "%s: %u bytes %s succeeded\n"
PRINTF("%s: %u バイトの%sに成功しました\n", name, size, action);
PRINTF(T("%s: %u バイトの%sに成功しました\n", "%s: %u bytes %s succeeded\n"), name, size, action);
}
}
@ -30,7 +28,8 @@ void ZeldaArena_CheckPointer(void* ptr, u32 size, const char* name, const char*
void* ZeldaArena_Malloc(u32 size) {
void* ptr = __osMalloc(&sZeldaArena, size);
ZELDA_ARENA_CHECK_POINTER(ptr, size, "zelda_malloc", "確保"); // "Secure"
// TODO re-evaluate "secure" as a translation (in this file and others using "確保")
ZELDA_ARENA_CHECK_POINTER(ptr, size, "zelda_malloc", T("確保", "Secure"));
return ptr;
}
@ -38,7 +37,7 @@ void* ZeldaArena_Malloc(u32 size) {
void* ZeldaArena_MallocDebug(u32 size, const char* file, int line) {
void* ptr = __osMallocDebug(&sZeldaArena, size, file, line);
ZELDA_ARENA_CHECK_POINTER(ptr, size, "zelda_malloc_DEBUG", "確保"); // "Secure"
ZELDA_ARENA_CHECK_POINTER(ptr, size, "zelda_malloc_DEBUG", T("確保", "Secure"));
return ptr;
}
#endif
@ -46,7 +45,7 @@ void* ZeldaArena_MallocDebug(u32 size, const char* file, int line) {
void* ZeldaArena_MallocR(u32 size) {
void* ptr = __osMallocR(&sZeldaArena, size);
ZELDA_ARENA_CHECK_POINTER(ptr, size, "zelda_malloc_r", "確保"); // "Secure"
ZELDA_ARENA_CHECK_POINTER(ptr, size, "zelda_malloc_r", T("確保", "Secure"));
return ptr;
}
@ -54,21 +53,21 @@ void* ZeldaArena_MallocR(u32 size) {
void* ZeldaArena_MallocRDebug(u32 size, const char* file, int line) {
void* ptr = __osMallocRDebug(&sZeldaArena, size, file, line);
ZELDA_ARENA_CHECK_POINTER(ptr, size, "zelda_malloc_r_DEBUG", "確保"); // "Secure"
ZELDA_ARENA_CHECK_POINTER(ptr, size, "zelda_malloc_r_DEBUG", T("確保", "Secure"));
return ptr;
}
#endif
void* ZeldaArena_Realloc(void* ptr, u32 newSize) {
ptr = __osRealloc(&sZeldaArena, ptr, newSize);
ZELDA_ARENA_CHECK_POINTER(ptr, newSize, "zelda_realloc", "再確保"); // "Re-securing"
ZELDA_ARENA_CHECK_POINTER(ptr, newSize, "zelda_realloc", T("再確保", "Re-securing"));
return ptr;
}
#if OOT_DEBUG
void* ZeldaArena_ReallocDebug(void* ptr, u32 newSize, const char* file, int line) {
ptr = __osReallocDebug(&sZeldaArena, ptr, newSize, file, line);
ZELDA_ARENA_CHECK_POINTER(ptr, newSize, "zelda_realloc_DEBUG", "再確保"); // "Re-securing"
ZELDA_ARENA_CHECK_POINTER(ptr, newSize, "zelda_realloc_DEBUG", T("再確保", "Re-securing"));
return ptr;
}
#endif
@ -92,13 +91,13 @@ void* ZeldaArena_Calloc(u32 num, u32 size) {
bzero(ret, n);
}
ZELDA_ARENA_CHECK_POINTER(ret, n, "zelda_calloc", "確保"); // "Secure"
ZELDA_ARENA_CHECK_POINTER(ret, n, "zelda_calloc", T("確保", "Secure"));
return ret;
}
#if OOT_DEBUG
void ZeldaArena_Display(void) {
PRINTF("ゼルダヒープ表示\n"); // "Zelda heap display"
PRINTF(T("ゼルダヒープ表示\n", "Zelda heap display\n"));
__osDisplayArena(&sZeldaArena);
}
#endif