From aa742c3f0cf50d3bb7e269170afd944e9a144864 Mon Sep 17 00:00:00 2001 From: TheShadowEevee Date: Wed, 20 Apr 2022 20:59:56 -0500 Subject: [PATCH] Remove wrong `long` formatting in (s)printf calls --- source/detect_settings.c | 36 ++++++++++++++++++------------------ source/id.c | 10 +++++----- source/wiibasics.c | 40 ++++++++++++++++++++-------------------- 3 files changed, 43 insertions(+), 43 deletions(-) diff --git a/source/detect_settings.c b/source/detect_settings.c index 76f7cf0..c6d9f06 100644 --- a/source/detect_settings.c +++ b/source/detect_settings.c @@ -54,12 +54,12 @@ u16 get_installed_title_version(u64 title) // printf("Error! ES_GetStoredTMDSize: %d\n", ret); - sprintf(filepath, "/title/%08lx/%08lx/content/title.tmd", TITLE_UPPER(title), TITLE_LOWER(title)); + sprintf(filepath, "/title/%08x/%08x/content/title.tmd", TITLE_UPPER(title), TITLE_LOWER(title)); ret = ISFS_Open(filepath, ISFS_OPEN_READ); if (ret <= 0) { - printf("Error! ISFS_Open (ret = %ld)\n", ret); + printf("Error! ISFS_Open (ret = %d)\n", ret); return 0; } @@ -68,21 +68,21 @@ u16 get_installed_title_version(u64 title) ret = ISFS_Seek(fd, 0x1dc, 0); if (ret < 0) { - printf("Error! ISFS_Seek (ret = %ld)\n", ret); + printf("Error! ISFS_Seek (ret = %d)\n", ret); return 0; } ret = ISFS_Read(fd, tmd_buf, 2); if (ret < 0) { - printf("Error! ISFS_Read (ret = %ld)\n", ret); + printf("Error! ISFS_Read (ret = %d)\n", ret); return 0; } ret = ISFS_Close(fd); if (ret < 0) { - printf("Error! ISFS_Close (ret = %ld)\n", ret); + printf("Error! ISFS_Close (ret = %d)\n", ret); return 0; } @@ -97,7 +97,7 @@ u16 get_installed_title_version(u64 title) ret = ES_GetStoredTMD(title, s_tmd, tmd_size); if (ret < 0) { - printf("Error! ES_GetStoredTMD: %ld\n", ret); + printf("Error! ES_GetStoredTMD: %d\n", ret); return -1; } tmd *t = SIGNATURE_PAYLOAD(s_tmd); @@ -127,12 +127,12 @@ u64 get_title_ios(u64 title) // printf("Error! ES_GetStoredTMDSize: %d\n", ret); - sprintf(filepath, "/title/%08lx/%08lx/content/title.tmd", TITLE_UPPER(title), TITLE_LOWER(title)); + sprintf(filepath, "/title/%08x/%08x/content/title.tmd", TITLE_UPPER(title), TITLE_LOWER(title)); ret = ISFS_Open(filepath, ISFS_OPEN_READ); if (ret <= 0) { - printf("Error! ISFS_Open (ret = %ld)\n", ret); + printf("Error! ISFS_Open (ret = %d)\n", ret); return 0; } @@ -141,21 +141,21 @@ u64 get_title_ios(u64 title) ret = ISFS_Seek(fd, 0x184, 0); if (ret < 0) { - printf("Error! ISFS_Seek (ret = %ld)\n", ret); + printf("Error! ISFS_Seek (ret = %d)\n", ret); return 0; } ret = ISFS_Read(fd, tmd_buf, 8); if (ret < 0) { - printf("Error! ISFS_Read (ret = %ld)\n", ret); + printf("Error! ISFS_Read (ret = %d)\n", ret); return 0; } ret = ISFS_Close(fd); if (ret < 0) { - printf("Error! ISFS_Close (ret = %ld)\n", ret); + printf("Error! ISFS_Close (ret = %d)\n", ret); return 0; } @@ -170,7 +170,7 @@ u64 get_title_ios(u64 title) ret = ES_GetStoredTMD(title, s_tmd, tmd_size); if (ret < 0) { - printf("Error! ES_GetStoredTMD: %ld\n", ret); + printf("Error! ES_GetStoredTMD: %d\n", ret); return -1; } tmd *t = SIGNATURE_PAYLOAD(s_tmd); @@ -220,7 +220,7 @@ char get_sysmenu_region(void) ret = ES_GetNumTicketViews(tid, &views); if (ret < 0) { - printf(" Error! ES_GetNumTickets (ret = %ld)\n", ret); + printf(" Error! ES_GetNumTickets (ret = %d)\n", ret); wait_anyKey(); return ret; } @@ -233,7 +233,7 @@ char get_sysmenu_region(void) } else if (views > 16) { - printf(" Too many ticket views! (views = %ld)\n", views); + printf(" Too many ticket views! (views = %d)\n", views); wait_anyKey(); return 0; } @@ -241,7 +241,7 @@ char get_sysmenu_region(void) ret = ES_GetTicketViews(tid, viewdata, 1); if (ret < 0) { - printf("Error! ES_OpenTitleContent (ret = %ld)\n", ret); + printf("Error! ES_OpenTitleContent (ret = %d)\n", ret); wait_anyKey(); return 0; } @@ -249,7 +249,7 @@ char get_sysmenu_region(void) ret = ES_OpenTitleContent(tid, viewdata, 1); if (ret < 0) { - printf("Error! ES_OpenTitleContent (ret = %ld)\n", ret); + printf("Error! ES_OpenTitleContent (ret = %d)\n", ret); wait_anyKey(); return 0; } @@ -262,7 +262,7 @@ char get_sysmenu_region(void) ret = ES_ReadContent(cfd, fbuffer, 0x500); if (ret < 0) { - printf("Error! ES_ReadContent (ret = %ld)\n", ret); + printf("Error! ES_ReadContent (ret = %d)\n", ret); wait_anyKey(); return 0; } @@ -282,7 +282,7 @@ char get_sysmenu_region(void) ret = ES_CloseContent(cfd); if (ret < 0) { - printf("Error! ES_CloseContent (ret = %ld)\n", ret); + printf("Error! ES_CloseContent (ret = %d)\n", ret); wait_anyKey(); return 0; } diff --git a/source/id.c b/source/id.c index ce05f14..ad71c66 100644 --- a/source/id.c +++ b/source/id.c @@ -171,19 +171,19 @@ s32 Identify(const u8 *certs, u32 certs_size, const u8 *idtmd, u32 idtmd_size, c switch (ret) { case ES_EINVAL: - printf("Error! ES_Identify (ret = %ld;) Data invalid!\n", ret); + printf("Error! ES_Identify (ret = %d;) Data invalid!\n", ret); break; case ES_EALIGN: - printf("Error! ES_Identify (ret = %ld;) Data not aligned!\n", ret); + printf("Error! ES_Identify (ret = %d;) Data not aligned!\n", ret); break; case ES_ENOTINIT: - printf("Error! ES_Identify (ret = %ld;) ES not initialized!\n", ret); + printf("Error! ES_Identify (ret = %d;) ES not initialized!\n", ret); break; case ES_ENOMEM: - printf("Error! ES_Identify (ret = %ld;) No memory!\n", ret); + printf("Error! ES_Identify (ret = %d;) No memory!\n", ret); break; default: - printf("Error! ES_Identify (ret = %ld)\n", ret); + printf("Error! ES_Identify (ret = %d)\n", ret); break; } #ifdef DEBUG_IDENT diff --git a/source/wiibasics.c b/source/wiibasics.c index e1caad4..21cacd9 100644 --- a/source/wiibasics.c +++ b/source/wiibasics.c @@ -306,11 +306,11 @@ void hex_print_array16(const u8 *array, u32 size) char line[17]; line[16] = 0; if (size > page_size) - printf("Page 1 of %lu", (size / page_size) + 1); + printf("Page 1 of %u", (size / page_size) + 1); while (offset < size) { if (!(offset % 16)) - printf("\n0x%08lX: ", offset); + printf("\n0x%08X: ", offset); printf("%02X", array[offset]); @@ -362,7 +362,7 @@ s32 ISFS_ReadFileToArray(const char *filepath, u8 *filearray, u32 max_size, u32 ret = ISFS_Open(filepath, ISFS_OPEN_READ); if (ret <= 0) { - printf("Error! ISFS_Open (ret = %ld)\n", ret); + printf("Error! ISFS_Open (ret = %d)\n", ret); return -1; } @@ -371,7 +371,7 @@ s32 ISFS_ReadFileToArray(const char *filepath, u8 *filearray, u32 max_size, u32 ret = ISFS_GetFileStats(fd, &filestats); if (ret < 0) { - printf("Error! ISFS_GetFileStats (ret = %ld)\n", ret); + printf("Error! ISFS_GetFileStats (ret = %d)\n", ret); return -1; } @@ -379,7 +379,7 @@ s32 ISFS_ReadFileToArray(const char *filepath, u8 *filearray, u32 max_size, u32 if (*file_size > max_size) { - printf("File is too large! Size: %lu Max: %lu", *file_size, max_size); + printf("File is too large! Size: %u Max: %u", *file_size, max_size); return -1; } @@ -387,19 +387,19 @@ s32 ISFS_ReadFileToArray(const char *filepath, u8 *filearray, u32 max_size, u32 *file_size = ret; if (ret < 0) { - printf("Error! ISFS_Read (ret = %ld)\n", ret); + printf("Error! ISFS_Read (ret = %d)\n", ret); return -1; } else if (ret != filestats.file_length) { - printf("Error! ISFS_Read Only read: %ld\n", ret); + printf("Error! ISFS_Read Only read: %d\n", ret); return -1; } ret = ISFS_Close(fd); if (ret < 0) { - printf("Error! ISFS_Close (ret = %ld)\n", ret); + printf("Error! ISFS_Close (ret = %d)\n", ret); return -1; } return 0; @@ -425,7 +425,7 @@ s32 ISFS_WriteFileFromArray(const char *filepath, const u8 *filearray, u32 array ret = ISFS_SetAttr(filepath, ownerID, groupID, attr, 3, 3, 3); if (ret < 0) { - printf("Error! ISFS_SetAttr (ret = %ld)\n", ret); + printf("Error! ISFS_SetAttr (ret = %d)\n", ret); out = -1; goto cleanup; } @@ -439,7 +439,7 @@ s32 ISFS_WriteFileFromArray(const char *filepath, const u8 *filearray, u32 array ret = ISFS_CreateFile(filepath, attr, 3, 3, 3); if (ret < 0) { - printf("Error! ISFS_CreateFile (ret = %ld)\n", ret); + printf("Error! ISFS_CreateFile (ret = %d)\n", ret); out = -1; goto cleanup; } @@ -448,7 +448,7 @@ s32 ISFS_WriteFileFromArray(const char *filepath, const u8 *filearray, u32 array } else if (ret <= 0) { - printf("Error! ISFS_Open WRITE (ret = %ld)\n", ret); + printf("Error! ISFS_Open WRITE (ret = %d)\n", ret); out = -1; goto cleanup; } @@ -458,7 +458,7 @@ s32 ISFS_WriteFileFromArray(const char *filepath, const u8 *filearray, u32 array ret = ISFS_Seek(fd, 0, 0); if (ret < 0) { - printf("Error! ISFS_Seek (ret = %ld)\n", ret); + printf("Error! ISFS_Seek (ret = %d)\n", ret); out = -1; goto cleanup; } @@ -466,21 +466,21 @@ s32 ISFS_WriteFileFromArray(const char *filepath, const u8 *filearray, u32 array ret = ISFS_Write(fd, filearray, array_size); if (ret < 0) { - printf("Error! ISFS_Write (ret = %ld)\n", ret); + printf("Error! ISFS_Write (ret = %d)\n", ret); out = -1; goto cleanup; } if (ret != array_size) { - printf("Filesize is wrong! Wrote:%lu Expect:%lu", filestats.file_length, array_size); + printf("Filesize is wrong! Wrote:%u Expect:%u", filestats.file_length, array_size); out = -1; } ret = ISFS_Close(fd); if (ret < 0) { - printf("Error! ISFS_Close (ret = %ld)\n", ret); + printf("Error! ISFS_Close (ret = %d)\n", ret); return -1; } fd = 0; @@ -513,7 +513,7 @@ s32 ISFS_WriteFileFromArray(const char *filepath, const u8 *filearray, u32 array ret = ISFS_GetAttr(filepath, &realownid, &realgroupid, &realattr, &realownperm, &realgroupperm, &realotherperm); if (ret < 0) { - printf("Error! ISFS_GetAttr (ret = %ld)\n", ret); + printf("Error! ISFS_GetAttr (ret = %d)\n", ret); out = -1; } @@ -522,7 +522,7 @@ s32 ISFS_WriteFileFromArray(const char *filepath, const u8 *filearray, u32 array ret = ES_GetTitleID(¤tTid); if (ret) { - printf("Fail GetTitleID %ld", ret); + printf("Fail GetTitleID %d", ret); if (wait_key(WPAD_BUTTON_A | WPAD_BUTTON_B) & WPAD_BUTTON_B) goto cleanup; } @@ -539,7 +539,7 @@ s32 ISFS_WriteFileFromArray(const char *filepath, const u8 *filearray, u32 array ret = ISFS_SetAttr(filepath, ownerID, groupID, attr, own_perm, group_perm, other_perm); if (ret < 0) { - printf("Error! ISFS_SetAttr (ret = %ld)\n", ret); + printf("Error! ISFS_SetAttr (ret = %d)\n", ret); out = -1; goto cleanup; } @@ -549,7 +549,7 @@ s32 ISFS_WriteFileFromArray(const char *filepath, const u8 *filearray, u32 array ret = ES_SetUID(currentTid); if (ret) { - printf("Fail SetUID %ld", ret); + printf("Fail SetUID %d", ret); if (wait_key(WPAD_BUTTON_A | WPAD_BUTTON_B) & WPAD_BUTTON_B) goto cleanup; } @@ -561,7 +561,7 @@ cleanup: ret = ISFS_Close(fd); if (ret < 0) { - printf("Error! ISFS_Close (ret = %ld)\n", ret); + printf("Error! ISFS_Close (ret = %d)\n", ret); return -1; } }