From 60296c0b7d22b73c5ad944c6a3647af75fd01780 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sat, 1 Jul 2017 04:37:32 +0200 Subject: [PATCH] Improve logs some more --- input/drivers/dinput.c | 14 +++++++------- input/drivers_joypad/dinput_joypad.c | 6 +++--- input/drivers_joypad/xinput_joypad.c | 16 ++++++++-------- playlist.c | 2 +- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/input/drivers/dinput.c b/input/drivers/dinput.c index c6773b7eab..4f78febd2f 100644 --- a/input/drivers/dinput.c +++ b/input/drivers/dinput.c @@ -125,7 +125,7 @@ bool dinput_init_context(void) return true; error: - RARCH_ERR("[DINPUT] Failed to initialize DirectInput.\n"); + RARCH_ERR("[DINPUT]: Failed to initialize DirectInput.\n"); return false; } @@ -137,7 +137,7 @@ static void *dinput_init(const char *joypad_driver) if (!dinput_init_context()) { - RARCH_ERR("[DINPUT] Failed to start DirectInput driver.\n"); + RARCH_ERR("[DINPUT]: Failed to start DirectInput driver.\n"); return NULL; } @@ -151,24 +151,24 @@ static void *dinput_init(const char *joypad_driver) #ifdef __cplusplus if (FAILED(IDirectInput8_CreateDevice(g_dinput_ctx, GUID_SysKeyboard, &di->keyboard, NULL))) { - RARCH_ERR("[DINPUT] Failed to create keyboard device.\n"); + RARCH_ERR("[DINPUT]: Failed to create keyboard device.\n"); di->keyboard = NULL; } if (FAILED(IDirectInput8_CreateDevice(g_dinput_ctx, GUID_SysMouse, &di->mouse, NULL))) { - RARCH_ERR("[DINPUT] Failed to create mouse device.\n"); + RARCH_ERR("[DINPUT]: Failed to create mouse device.\n"); di->mouse = NULL; } #else if (FAILED(IDirectInput8_CreateDevice(g_dinput_ctx, &GUID_SysKeyboard, &di->keyboard, NULL))) { - RARCH_ERR("[DINPUT] Failed to create keyboard device.\n"); + RARCH_ERR("[DINPUT]: Failed to create keyboard device.\n"); di->keyboard = NULL; } if (FAILED(IDirectInput8_CreateDevice(g_dinput_ctx, &GUID_SysMouse, &di->mouse, NULL))) { - RARCH_ERR("[DINPUT] Failed to create mouse device.\n"); + RARCH_ERR("[DINPUT]: Failed to create mouse device.\n"); di->mouse = NULL; } #endif @@ -628,7 +628,7 @@ bool dinput_handle_message(void *dinput, UINT message, WPARAM wParam, LPARAM lPa if (!new_pointer) { - RARCH_ERR("[DINPUT] dinput_handle_message: pointer allocation in WM_POINTERDOWN failed.\n"); + RARCH_ERR("[DINPUT]: dinput_handle_message: pointer allocation in WM_POINTERDOWN failed.\n"); return false; } diff --git a/input/drivers_joypad/dinput_joypad.c b/input/drivers_joypad/dinput_joypad.c index 78e0ac3588..fb02db9a8a 100644 --- a/input/drivers_joypad/dinput_joypad.c +++ b/input/drivers_joypad/dinput_joypad.c @@ -239,7 +239,7 @@ static BOOL CALLBACK enum_joypad_cb(const DIDEVICEINSTANCE *inst, void *p) g_pads[g_joypad_cnt].vid = inst->guidProduct.Data1 % 0x10000; g_pads[g_joypad_cnt].pid = inst->guidProduct.Data1 / 0x10000; - RARCH_LOG("[DINPUT] Device #%u PID: {%04lX} VID:{%04lX}\n", g_joypad_cnt, g_pads[g_joypad_cnt].pid, g_pads[g_joypad_cnt].vid); + RARCH_LOG("[DINPUT]: Device #%u PID: {%04lX} VID:{%04lX}\n", g_joypad_cnt, g_pads[g_joypad_cnt].pid, g_pads[g_joypad_cnt].vid); #ifdef HAVE_XINPUT is_xinput_pad = g_xinput_block_pads @@ -299,10 +299,10 @@ static bool dinput_joypad_init(void *data) g_pads[i].joy_friendly_name = NULL; } - RARCH_LOG("[DINPUT] Enumerating joypads ...\n"); + RARCH_LOG("[DINPUT]: Enumerating joypads ...\n"); IDirectInput8_EnumDevices(g_dinput_ctx, DI8DEVCLASS_GAMECTRL, enum_joypad_cb, NULL, DIEDFL_ATTACHEDONLY); - RARCH_LOG("[DINPUT] Done enumerating joypads ...\n"); + RARCH_LOG("[DINPUT]: Done enumerating joypads ...\n"); return true; } diff --git a/input/drivers_joypad/xinput_joypad.c b/input/drivers_joypad/xinput_joypad.c index 3159127f10..3c77f48547 100644 --- a/input/drivers_joypad/xinput_joypad.c +++ b/input/drivers_joypad/xinput_joypad.c @@ -197,11 +197,11 @@ static bool xinput_joypad_init(void *data) if (!g_xinput_dll) { - RARCH_ERR("[XInput] Failed to load XInput, ensure DirectX and controller drivers are up to date.\n"); + RARCH_ERR("[XInput]: Failed to load XInput, ensure DirectX and controller drivers are up to date.\n"); return false; } - RARCH_LOG("[XInput] Found XInput v%s.\n", version); + RARCH_LOG("[XInput]: Found XInput v%s.\n", version); /* If we get here then an xinput DLL is correctly loaded. * First try to load ordinal 100 (XInputGetStateEx). @@ -219,17 +219,17 @@ static bool xinput_joypad_init(void *data) if (!g_XInputGetStateEx) { - RARCH_ERR("[XInput] Failed to init: DLL is invalid or corrupt.\n"); + RARCH_ERR("[XInput]: Failed to init: DLL is invalid or corrupt.\n"); dylib_close(g_xinput_dll); return false; /* DLL was loaded but did not contain the correct function. */ } - RARCH_WARN("[XInput] No guide button support.\n"); + RARCH_WARN("[XInput]: No guide button support.\n"); } g_XInputSetState = (XInputSetState_t)dylib_proc(g_xinput_dll, "XInputSetState"); if (!g_XInputSetState) { - RARCH_ERR("[XInput] Failed to init: DLL is invalid or corrupt.\n"); + RARCH_ERR("[XInput]: Failed to init: DLL is invalid or corrupt.\n"); dylib_close(g_xinput_dll); return false; /* DLL was loaded but did not contain the correct function. */ } @@ -243,7 +243,7 @@ static bool xinput_joypad_init(void *data) { g_xinput_states[i].connected = !(g_XInputGetStateEx(i, &dummy_state) == ERROR_DEVICE_NOT_CONNECTED); if (g_xinput_states[i].connected) - RARCH_LOG("[XInput] Found controller, user #%u\n", i); + RARCH_LOG("[XInput]: Found controller, user #%u\n", i); } if ((!g_xinput_states[0].connected) && @@ -254,7 +254,7 @@ static bool xinput_joypad_init(void *data) #if (1) else { - RARCH_LOG("[XInput] Pads connected: %d\n", g_xinput_states[0].connected + + RARCH_LOG("[XInput]: Pads connected: %d\n", g_xinput_states[0].connected + g_xinput_states[1].connected + g_xinput_states[2].connected + g_xinput_states[3].connected); } #endif @@ -270,7 +270,7 @@ static bool xinput_joypad_init(void *data) for (j = 0; j < MAX_USERS; j++) { - RARCH_LOG("[XInput] Attempting autoconf for, user #%u\n", j); + RARCH_LOG("[XInput]: Attempting autoconf for, user #%u\n", j); if (pad_index_to_xuser_index(j) > -1) { if (!input_autoconfigure_connect( diff --git a/playlist.c b/playlist.c index 454f5f7a6c..b8907f1a96 100644 --- a/playlist.c +++ b/playlist.c @@ -423,7 +423,7 @@ void playlist_free(playlist_t *playlist) if (!playlist) return; - if (playlist->conf_path) + if (playlist->conf_path != NULL) free(playlist->conf_path); playlist->conf_path = NULL;