[WiiU] Various warning/format string fixes

All things from unsigned comparisons to missing initializers; we got it
here.
This commit is contained in:
Ash 2017-11-04 17:58:04 +11:00
parent b49268a9e9
commit 0d38612f4a
No known key found for this signature in database
GPG Key ID: F8C85A8C836C0A7E
6 changed files with 33 additions and 26 deletions

View File

@ -193,11 +193,11 @@ static bool ax_audio_start(void* data, bool is_shutdown)
static ssize_t ax_audio_write(void* data, const void* buf, size_t size) static ssize_t ax_audio_write(void* data, const void* buf, size_t size)
{ {
int i; uint32_t i;
size_t countAvail = 0; size_t countAvail = 0;
ax_audio_t* ax = (ax_audio_t*)data; ax_audio_t* ax = (ax_audio_t*)data;
const uint16_t* src = buf; const uint16_t* src = buf;
int count = size >> 2; size_t count = size >> 2;
if(!size || (size & 0x3)) if(!size || (size & 0x3))
return 0; return 0;
@ -330,8 +330,8 @@ audio_driver_t audio_ax =
ax_audio_free, ax_audio_free,
ax_audio_use_float, ax_audio_use_float,
"AX", "AX",
NULL, NULL, /* device_list_new */
NULL, NULL, /* device_list_free */
/* ax_audio_write_avail, */ NULL, /* write_avail */
/* ax_audio_buffer_size */ NULL, /* buffer_size */
}; };

View File

@ -308,6 +308,7 @@ frontend_ctx_driver_t frontend_ctx_wiiu =
NULL, /* attach_console */ NULL, /* attach_console */
NULL, /* detach_console */ NULL, /* detach_console */
"wiiu", "wiiu",
NULL, /* get_video_driver */
}; };
static int wiiu_log_socket = -1; static int wiiu_log_socket = -1;
@ -379,6 +380,7 @@ void net_print_exp(const char *str)
send(wiiu_log_socket, str, strlen(str), 0); send(wiiu_log_socket, str, strlen(str), 0);
} }
#if defined(PC_DEVELOPMENT_IP_ADDRESS) && defined(PC_DEVELOPMENT_TCP_PORT)
static devoptab_t dotab_stdout = static devoptab_t dotab_stdout =
{ {
"stdout_net", // device name "stdout_net", // device name
@ -389,6 +391,7 @@ static devoptab_t dotab_stdout =
NULL, NULL,
/* ... */ /* ... */
}; };
#endif
void SaveCallback() void SaveCallback()
{ {
@ -642,7 +645,7 @@ void _start(int argc, char **argv)
__init(); __init();
fsdev_init(); fsdev_init();
int ret = main(argc, argv); main(argc, argv);
fsdev_exit(); fsdev_exit();
// __fini(); // __fini();

View File

@ -51,7 +51,7 @@ static const wiiu_render_mode_t wiiu_render_mode_map[] =
{1920, 1080, GX2_TV_RENDER_MODE_WIDE_1080P} /* GX2_TV_SCAN_MODE_1080P */ {1920, 1080, GX2_TV_RENDER_MODE_WIDE_1080P} /* GX2_TV_SCAN_MODE_1080P */
}; };
static int wiiu_set_position(position_t* position, GX2ColorBuffer* draw_buffer, float x0, float y0, float x1, float y1) static void wiiu_set_position(position_t* position, GX2ColorBuffer* draw_buffer, float x0, float y0, float x1, float y1)
{ {
position[0].x = (2.0f * x0 / draw_buffer->surface.width) - 1.0f; position[0].x = (2.0f * x0 / draw_buffer->surface.width) - 1.0f;
position[0].y = (2.0f * y0 / draw_buffer->surface.height) - 1.0f; position[0].y = (2.0f * y0 / draw_buffer->surface.height) - 1.0f;
@ -194,7 +194,6 @@ static void wiiu_gfx_set_aspect_ratio(void* data, unsigned aspect_ratio_idx)
static void* wiiu_gfx_init(const video_info_t* video, static void* wiiu_gfx_init(const video_info_t* video,
const input_driver_t** input, void** input_data) const input_driver_t** input, void** input_data)
{ {
int i;
float refresh_rate = 60.0f / 1.001f; float refresh_rate = 60.0f / 1.001f;
u32 size = 0; u32 size = 0;
u32 tmp = 0; u32 tmp = 0;
@ -387,9 +386,9 @@ static void* wiiu_gfx_init(const video_info_t* video,
wiiu->vertex_cache.size = 0x1000; wiiu->vertex_cache.size = 0x1000;
wiiu->vertex_cache.current = 0; wiiu->vertex_cache.current = 0;
wiiu->vertex_cache.positions = MEM2_alloc(wiiu->vertex_cache.size wiiu->vertex_cache.positions = MEM2_alloc(wiiu->vertex_cache.size
* sizeof(position_t), GX2_VERTEX_BUFFER_ALIGNMENT); * sizeof(position_t), GX2_VERTEX_BUFFER_ALIGNMENT);
wiiu->vertex_cache.tex_coords = MEM2_alloc(wiiu->vertex_cache.size wiiu->vertex_cache.tex_coords = MEM2_alloc(wiiu->vertex_cache.size
* sizeof(tex_coord_t), GX2_VERTEX_BUFFER_ALIGNMENT); * sizeof(tex_coord_t), GX2_VERTEX_BUFFER_ALIGNMENT);
/* Initialize samplers */ /* Initialize samplers */
@ -498,7 +497,7 @@ static bool wiiu_gfx_frame(void* data, const void* frame,
static u32 lastTick , currentTick; static u32 lastTick , currentTick;
u32 diff; u32 diff;
#endif #endif
int i; uint32_t i;
wiiu_video_t* wiiu = (wiiu_video_t*) data; wiiu_video_t* wiiu = (wiiu_video_t*) data;
(void)msg; (void)msg;
@ -572,7 +571,7 @@ static bool wiiu_gfx_frame(void* data, const void* frame,
for (i = 0; i < height; i++) for (i = 0; i < height; i++)
{ {
int j; uint32_t j;
for(j = 0; j < width; j++) for(j = 0; j < width; j++)
dst[j] = src[j]; dst[j] = src[j];
dst += wiiu->texture.surface.pitch; dst += wiiu->texture.surface.pitch;
@ -725,7 +724,7 @@ static bool wiiu_gfx_read_viewport(void* data, uint8_t* buffer, bool is_idle)
static uintptr_t wiiu_gfx_load_texture(void* video_data, void* data, static uintptr_t wiiu_gfx_load_texture(void* video_data, void* data,
bool threaded, enum texture_filter_type filter_type) bool threaded, enum texture_filter_type filter_type)
{ {
int i; uint32_t i;
wiiu_video_t* wiiu = (wiiu_video_t*) video_data; wiiu_video_t* wiiu = (wiiu_video_t*) video_data;
struct texture_image *image = (struct texture_image*)data; struct texture_image *image = (struct texture_image*)data;
@ -785,7 +784,7 @@ static void wiiu_gfx_apply_state_changes(void* data)
static void wiiu_gfx_set_texture_frame(void* data, const void* frame, bool rgb32, static void wiiu_gfx_set_texture_frame(void* data, const void* frame, bool rgb32,
unsigned width, unsigned height, float alpha) unsigned width, unsigned height, float alpha)
{ {
int i; uint32_t i;
const uint16_t *src = NULL; const uint16_t *src = NULL;
uint16_t *dst = NULL; uint16_t *dst = NULL;
wiiu_video_t* wiiu = (wiiu_video_t*) data; wiiu_video_t* wiiu = (wiiu_video_t*) data;
@ -851,13 +850,13 @@ static const video_poke_interface_t wiiu_poke_interface =
{ {
wiiu_gfx_load_texture, wiiu_gfx_load_texture,
wiiu_gfx_unload_texture, wiiu_gfx_unload_texture,
NULL, NULL, /* set_video_mode */
wiiu_gfx_set_filtering, wiiu_gfx_set_filtering,
NULL, /* get_video_output_size */ NULL, /* get_video_output_size */
NULL, /* get_video_output_prev */ NULL, /* get_video_output_prev */
NULL, /* get_video_output_next */ NULL, /* get_video_output_next */
NULL, /* get_current_framebuffer */ NULL, /* get_current_framebuffer */
NULL, NULL, /* get_proc_address */
wiiu_gfx_set_aspect_ratio, wiiu_gfx_set_aspect_ratio,
wiiu_gfx_apply_state_changes, wiiu_gfx_apply_state_changes,
#ifdef HAVE_MENU #ifdef HAVE_MENU
@ -865,9 +864,11 @@ static const video_poke_interface_t wiiu_poke_interface =
#endif #endif
wiiu_gfx_set_texture_enable, wiiu_gfx_set_texture_enable,
wiiu_gfx_set_osd_msg, wiiu_gfx_set_osd_msg,
NULL, NULL, /* show_mouse */
NULL, NULL, /* grab_mouse_toggle */
NULL NULL, /* get_current_shader */
NULL, /* get_current_software_framebuffer */
NULL, /* get_hw_render_interface */
}; };
static void wiiu_gfx_get_poke_interface(void* data, static void wiiu_gfx_get_poke_interface(void* data,
@ -898,4 +899,5 @@ video_driver_t video_wiiu =
NULL, /* overlay_interface */ NULL, /* overlay_interface */
#endif #endif
wiiu_gfx_get_poke_interface, wiiu_gfx_get_poke_interface,
NULL, /* wrap_type_to_enum */
}; };

View File

@ -40,7 +40,7 @@ typedef struct
static void* wiiu_font_init_font(void* data, const char* font_path, static void* wiiu_font_init_font(void* data, const char* font_path,
float font_size, bool is_threaded) float font_size, bool is_threaded)
{ {
int i; uint32_t i;
wiiu_font_t* font = (wiiu_font_t*)calloc(1, sizeof(*font)); wiiu_font_t* font = (wiiu_font_t*)calloc(1, sizeof(*font));
if (!font) if (!font)

View File

@ -21,6 +21,7 @@
#include <stdio.h> #include <stdio.h>
#include <malloc.h> #include <malloc.h>
#include <string.h> #include <string.h>
#include <inttypes.h>
#include <wiiu/os.h> #include <wiiu/os.h>
#include "hbl.h" #include "hbl.h"
@ -236,7 +237,7 @@ int HBL_loadToMemory(const char *filepath, u32 args_size)
if (bytesRead != fileSize) if (bytesRead != fileSize)
{ {
free(buffer); free(buffer);
printf("File loading not finished for file %s, finished %i of %i bytes\n", filepath, bytesRead, printf("File loading not finished for file %s, finished %" PRIi32 " of %" PRIi32 " bytes\n", filepath, bytesRead,
fileSize); fileSize);
printf("File read failure"); printf("File read failure");
return -1; return -1;

View File

@ -3,6 +3,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdint.h> #include <stdint.h>
#include <inttypes.h>
#ifdef WIIU #ifdef WIIU
#include <wiiu/types.h> #include <wiiu/types.h>
@ -26,11 +27,11 @@ void DisassemblePPCRange(void *start, void *end, void* printf_func, void* GetSym
//#define DEBUG_HOLD() do{printf("%s@%s:%d.\n",__FUNCTION__, __FILE__, __LINE__);fflush(stdout);wait_for_input();}while(0) //#define DEBUG_HOLD() do{printf("%s@%s:%d.\n",__FUNCTION__, __FILE__, __LINE__);fflush(stdout);wait_for_input();}while(0)
#define DEBUG_LINE() do{printf("%s:%4d %s().\n", __FILE__, __LINE__, __FUNCTION__);fflush(stdout);}while(0) #define DEBUG_LINE() do{printf("%s:%4d %s().\n", __FILE__, __LINE__, __FUNCTION__);fflush(stdout);}while(0)
#define DEBUG_STR(X) printf( "%s: %s\n", #X, (char*)(X)) #define DEBUG_STR(X) printf( "%s: %s\n", #X, (char*)(X))
#define DEBUG_VAR(X) printf( "%-20s: 0x%08X\n", #X, (uint32_t)(X)) #define DEBUG_VAR(X) printf( "%-20s: 0x%08" PRIX32 "\n", #X, (uint32_t)(X))
#define DEBUG_VAR2(X) printf( "%-20s: 0x%08X (%i)\n", #X, (uint32_t)(X), (int)(X)) #define DEBUG_VAR2(X) printf( "%-20s: 0x%08" PRIX32 " (%i)\n", #X, (uint32_t)(X), (int)(X))
#define DEBUG_INT(X) printf( "%-20s: %10i\n", #X, (int32_t)(X)) #define DEBUG_INT(X) printf( "%-20s: %10" PRIi32 "\n", #X, (int32_t)(X))
#define DEBUG_FLOAT(X) printf( "%-20s: %10.3f\n", #X, (float)(X)) #define DEBUG_FLOAT(X) printf( "%-20s: %10.3f\n", #X, (float)(X))
#define DEBUG_VAR64(X) printf( #X"\r\t\t\t\t : 0x%016llX\n", (uint64_t)(X)) #define DEBUG_VAR64(X) printf( #X"\r\t\t\t\t : 0x%016" PRIX64 "\n", (uint64_t)(X))
//#define DEBUG_ERROR(X) do{if(X)dump_result_value(X);}while(0) //#define DEBUG_ERROR(X) do{if(X)dump_result_value(X);}while(0)
#define PRINTFPOS(X,Y) "\x1b["#X";"#Y"H" #define PRINTFPOS(X,Y) "\x1b["#X";"#Y"H"
#define PRINTFPOS_STR(X,Y) "\x1b[" X ";" Y "H" #define PRINTFPOS_STR(X,Y) "\x1b[" X ";" Y "H"