From 983cfe8b1cdfced8ae2d9a5ff3078a4615e2ab35 Mon Sep 17 00:00:00 2001 From: Petar Popovic Date: Thu, 23 Jan 2025 18:06:29 +0100 Subject: [PATCH] Remove even more newlines from log messages --- src/audio/aaudio/SDL_aaudio.c | 8 +- src/audio/alsa/SDL_alsa_audio.c | 6 +- src/joystick/hidapi/SDL_hidapijoystick.c | 2 +- src/video/kmsdrm/SDL_kmsdrmvideo.c | 2 +- src/video/wayland/SDL_waylanddatamanager.c | 4 +- src/video/wayland/SDL_waylandevents.c | 38 +++++----- src/video/windows/SDL_windowskeyboard.c | 38 +++++----- src/video/windows/SDL_windowswindow.c | 72 +++++++++--------- test/testrumble.c | 2 +- test/testvulkan.c | 86 +++++++++++----------- 10 files changed, 129 insertions(+), 129 deletions(-) diff --git a/src/audio/aaudio/SDL_aaudio.c b/src/audio/aaudio/SDL_aaudio.c index 8b1681b4e1..0339a6158b 100644 --- a/src/audio/aaudio/SDL_aaudio.c +++ b/src/audio/aaudio/SDL_aaudio.c @@ -102,7 +102,7 @@ static aaudio_data_callback_result_t AAUDIO_dataCallback(AAudioStream *stream, v size_t end = (offset + size) % hidden->mixbuf_bytes; SDL_assert(size <= hidden->mixbuf_bytes); -//LOGI("Recorded %zu frames, %zu available, %zu max (%zu written, %zu read)\n", callback_bytes / framesize, available_bytes / framesize, hidden->mixbuf_bytes / framesize, hidden->callback_bytes / framesize, hidden->processed_bytes / framesize); +//LOGI("Recorded %zu frames, %zu available, %zu max (%zu written, %zu read)", callback_bytes / framesize, available_bytes / framesize, hidden->mixbuf_bytes / framesize, hidden->callback_bytes / framesize, hidden->processed_bytes / framesize); if (offset <= end) { SDL_memcpy(&hidden->mixbuf[offset], input, size); @@ -116,7 +116,7 @@ static aaudio_data_callback_result_t AAUDIO_dataCallback(AAudioStream *stream, v hidden->callback_bytes += size; if (size < callback_bytes) { - LOGI("Audio recording overflow, dropped %zu frames\n", (callback_bytes - size) / framesize); + LOGI("Audio recording overflow, dropped %zu frames", (callback_bytes - size) / framesize); } } else { Uint8 *output = (Uint8 *)audioData; @@ -126,7 +126,7 @@ static aaudio_data_callback_result_t AAUDIO_dataCallback(AAudioStream *stream, v size_t end = (offset + size) % hidden->mixbuf_bytes; SDL_assert(size <= hidden->mixbuf_bytes); -//LOGI("Playing %zu frames, %zu available, %zu max (%zu written, %zu read)\n", callback_bytes / framesize, available_bytes / framesize, hidden->mixbuf_bytes / framesize, hidden->processed_bytes / framesize, hidden->callback_bytes / framesize); +//LOGI("Playing %zu frames, %zu available, %zu max (%zu written, %zu read)", callback_bytes / framesize, available_bytes / framesize, hidden->mixbuf_bytes / framesize, hidden->processed_bytes / framesize, hidden->callback_bytes / framesize); SDL_MemoryBarrierAcquire(); if (offset <= end) { @@ -139,7 +139,7 @@ static aaudio_data_callback_result_t AAUDIO_dataCallback(AAudioStream *stream, v hidden->callback_bytes += size; if (size < callback_bytes) { - LOGI("Audio playback underflow, missed %zu frames\n", (callback_bytes - size) / framesize); + LOGI("Audio playback underflow, missed %zu frames", (callback_bytes - size) / framesize); SDL_memset(&output[size], device->silence_value, (callback_bytes - size)); } } diff --git a/src/audio/alsa/SDL_alsa_audio.c b/src/audio/alsa/SDL_alsa_audio.c index 652a1a5cfa..633e36440a 100644 --- a/src/audio/alsa/SDL_alsa_audio.c +++ b/src/audio/alsa/SDL_alsa_audio.c @@ -923,7 +923,7 @@ static int ALSA_pcm_cfg_hw_chans_n_scan(struct ALSA_pcm_cfg_ctx *ctx, unsigned i return CHANS_N_NOT_CONFIGURED; } - LOGDEBUG("target chans_n is %u\n", target_chans_n); + LOGDEBUG("target chans_n is %u", target_chans_n); int status = ALSA_snd_pcm_hw_params_any(ctx->device->hidden->pcm, ctx->hwparams); if (status < 0) { @@ -1050,7 +1050,7 @@ static int ALSA_pcm_cfg_hw_chans_n_scan(struct ALSA_pcm_cfg_ctx *ctx, unsigned i static bool ALSA_pcm_cfg_hw(struct ALSA_pcm_cfg_ctx *ctx) { - LOGDEBUG("target chans_n, equal or above requested chans_n mode\n"); + LOGDEBUG("target chans_n, equal or above requested chans_n mode"); int status = ALSA_pcm_cfg_hw_chans_n_scan(ctx, CHANS_N_SCAN_MODE__EQUAL_OR_ABOVE_REQUESTED_CHANS_N); if (status < 0) { // something went too wrong return false; @@ -1059,7 +1059,7 @@ static bool ALSA_pcm_cfg_hw(struct ALSA_pcm_cfg_ctx *ctx) } // Here, status == CHANS_N_NOT_CONFIGURED - LOGDEBUG("target chans_n, below requested chans_n mode\n"); + LOGDEBUG("target chans_n, below requested chans_n mode"); status = ALSA_pcm_cfg_hw_chans_n_scan(ctx, CHANS_N_SCAN_MODE__BELOW_REQUESTED_CHANS_N); if (status < 0) { // something went too wrong return false; diff --git a/src/joystick/hidapi/SDL_hidapijoystick.c b/src/joystick/hidapi/SDL_hidapijoystick.c index d1f34eef6a..30bae026fd 100644 --- a/src/joystick/hidapi/SDL_hidapijoystick.c +++ b/src/joystick/hidapi/SDL_hidapijoystick.c @@ -458,7 +458,7 @@ static void HIDAPI_SetupDeviceDriver(SDL_HIDAPI_Device *device, bool *removed) S if (dev == NULL) { SDL_LogDebug(SDL_LOG_CATEGORY_INPUT, - "HIDAPI_SetupDeviceDriver() couldn't open %s: %s\n", + "HIDAPI_SetupDeviceDriver() couldn't open %s: %s", device->path, SDL_GetError()); return; } diff --git a/src/video/kmsdrm/SDL_kmsdrmvideo.c b/src/video/kmsdrm/SDL_kmsdrmvideo.c index 1d25b8d0f0..a6f3730a6a 100644 --- a/src/video/kmsdrm/SDL_kmsdrmvideo.c +++ b/src/video/kmsdrm/SDL_kmsdrmvideo.c @@ -163,7 +163,7 @@ static int get_driindex(void) close(drm_fd); } else { SDL_LogDebug(SDL_LOG_CATEGORY_VIDEO, - "Failed to open KMSDRM device %s, errno: %d\n", device, errno); + "Failed to open KMSDRM device %s, errno: %d", device, errno); } } } diff --git a/src/video/wayland/SDL_waylanddatamanager.c b/src/video/wayland/SDL_waylanddatamanager.c index 8c75e3d06d..d9b1b91e6c 100644 --- a/src/video/wayland/SDL_waylanddatamanager.c +++ b/src/video/wayland/SDL_waylanddatamanager.c @@ -382,7 +382,7 @@ void *Wayland_data_offer_receive(SDL_WaylandDataOffer *offer, close(pipefd[0]); } SDL_LogTrace(SDL_LOG_CATEGORY_INPUT, - ". In Wayland_data_offer_receive for '%s', buffer (%ld) at %p\n", + ". In Wayland_data_offer_receive for '%s', buffer (%ld) at %p", mime_type, *length, buffer); return buffer; } @@ -418,7 +418,7 @@ void *Wayland_primary_selection_offer_receive(SDL_WaylandPrimarySelectionOffer * close(pipefd[0]); } SDL_LogTrace(SDL_LOG_CATEGORY_INPUT, - ". In Wayland_primary_selection_offer_receive for '%s', buffer (%ld) at %p\n", + ". In Wayland_primary_selection_offer_receive for '%s', buffer (%ld) at %p", mime_type, *length, buffer); return buffer; } diff --git a/src/video/wayland/SDL_waylandevents.c b/src/video/wayland/SDL_waylandevents.c index c6260b863b..c63721ec3d 100644 --- a/src/video/wayland/SDL_waylandevents.c +++ b/src/video/wayland/SDL_waylandevents.c @@ -2179,7 +2179,7 @@ static void data_offer_handle_offer(void *data, struct wl_data_offer *wl_data_of SDL_WaylandDataOffer *offer = data; Wayland_data_offer_add_mime(offer, mime_type); SDL_LogTrace(SDL_LOG_CATEGORY_INPUT, - ". In wl_data_offer_listener . data_offer_handle_offer on data_offer 0x%08x for MIME '%s'\n", + ". In wl_data_offer_listener . data_offer_handle_offer on data_offer 0x%08x for MIME '%s'", (wl_data_offer ? WAYLAND_wl_proxy_get_id((struct wl_proxy *)wl_data_offer) : -1), mime_type); } @@ -2188,7 +2188,7 @@ static void data_offer_handle_source_actions(void *data, struct wl_data_offer *w uint32_t source_actions) { SDL_LogTrace(SDL_LOG_CATEGORY_INPUT, - ". In wl_data_offer_listener . data_offer_handle_source_actions on data_offer 0x%08x for Source Actions '%d'\n", + ". In wl_data_offer_listener . data_offer_handle_source_actions on data_offer 0x%08x for Source Actions '%d'", (wl_data_offer ? WAYLAND_wl_proxy_get_id((struct wl_proxy *)wl_data_offer) : -1), source_actions); } @@ -2197,7 +2197,7 @@ static void data_offer_handle_actions(void *data, struct wl_data_offer *wl_data_ uint32_t dnd_action) { SDL_LogTrace(SDL_LOG_CATEGORY_INPUT, - ". In wl_data_offer_listener . data_offer_handle_actions on data_offer 0x%08x for DND Actions '%d'\n", + ". In wl_data_offer_listener . data_offer_handle_actions on data_offer 0x%08x for DND Actions '%d'", (wl_data_offer ? WAYLAND_wl_proxy_get_id((struct wl_proxy *)wl_data_offer) : -1), dnd_action); } @@ -2214,7 +2214,7 @@ static void primary_selection_offer_handle_offer(void *data, struct zwp_primary_ SDL_WaylandPrimarySelectionOffer *offer = data; Wayland_primary_selection_offer_add_mime(offer, mime_type); SDL_LogTrace(SDL_LOG_CATEGORY_INPUT, - ". In zwp_primary_selection_offer_v1_listener . primary_selection_offer_handle_offer on primary_selection_offer 0x%08x for MIME '%s'\n", + ". In zwp_primary_selection_offer_v1_listener . primary_selection_offer_handle_offer on primary_selection_offer 0x%08x for MIME '%s'", (zwp_primary_selection_offer_v1 ? WAYLAND_wl_proxy_get_id((struct wl_proxy *)zwp_primary_selection_offer_v1) : -1), mime_type); } @@ -2234,7 +2234,7 @@ static void data_device_handle_data_offer(void *data, struct wl_data_device *wl_ wl_data_offer_set_user_data(id, data_offer); wl_data_offer_add_listener(id, &data_offer_listener, data_offer); SDL_LogTrace(SDL_LOG_CATEGORY_INPUT, - ". In wl_data_device_listener . data_device_handle_data_offer on data_offer 0x%08x\n", + ". In wl_data_device_listener . data_device_handle_data_offer on data_offer 0x%08x", (id ? WAYLAND_wl_proxy_get_id((struct wl_proxy *)id) : -1)); } } @@ -2292,25 +2292,25 @@ static void data_device_handle_enter(void *data, struct wl_data_device *wl_data_ const float dy = (float)wl_fixed_to_double(y); SDL_SendDropPosition(data_device->dnd_window, dx, dy); SDL_LogTrace(SDL_LOG_CATEGORY_INPUT, - ". In wl_data_device_listener . data_device_handle_enter on data_offer 0x%08x at %d x %d into window %d for serial %d\n", + ". In wl_data_device_listener . data_device_handle_enter on data_offer 0x%08x at %d x %d into window %d for serial %d", WAYLAND_wl_proxy_get_id((struct wl_proxy *)id), wl_fixed_to_int(x), wl_fixed_to_int(y), SDL_GetWindowID(data_device->dnd_window), serial); } else { data_device->dnd_window = NULL; SDL_LogTrace(SDL_LOG_CATEGORY_INPUT, - ". In wl_data_device_listener . data_device_handle_enter on data_offer 0x%08x at %d x %d for serial %d\n", + ". In wl_data_device_listener . data_device_handle_enter on data_offer 0x%08x at %d x %d for serial %d", WAYLAND_wl_proxy_get_id((struct wl_proxy *)id), wl_fixed_to_int(x), wl_fixed_to_int(y), serial); } } else { SDL_LogTrace(SDL_LOG_CATEGORY_INPUT, - ". In wl_data_device_listener . data_device_handle_enter on data_offer 0x%08x at %d x %d for serial %d\n", + ". In wl_data_device_listener . data_device_handle_enter on data_offer 0x%08x at %d x %d for serial %d", WAYLAND_wl_proxy_get_id((struct wl_proxy *)id), wl_fixed_to_int(x), wl_fixed_to_int(y), serial); } } else { SDL_LogTrace(SDL_LOG_CATEGORY_INPUT, - ". In wl_data_device_listener . data_device_handle_enter on data_offer 0x%08x at %d x %d for serial %d\n", + ". In wl_data_device_listener . data_device_handle_enter on data_offer 0x%08x at %d x %d for serial %d", -1, wl_fixed_to_int(x), wl_fixed_to_int(y), serial); } } @@ -2323,12 +2323,12 @@ static void data_device_handle_leave(void *data, struct wl_data_device *wl_data_ if (data_device->dnd_window) { SDL_SendDropComplete(data_device->dnd_window); SDL_LogTrace(SDL_LOG_CATEGORY_INPUT, - ". In wl_data_device_listener . data_device_handle_leave on data_offer 0x%08x from window %d for serial %d\n", + ". In wl_data_device_listener . data_device_handle_leave on data_offer 0x%08x from window %d for serial %d", WAYLAND_wl_proxy_get_id((struct wl_proxy *)data_device->drag_offer->offer), SDL_GetWindowID(data_device->dnd_window), data_device->drag_serial); } else { SDL_LogTrace(SDL_LOG_CATEGORY_INPUT, - ". In wl_data_device_listener . data_device_handle_leave on data_offer 0x%08x for serial %d\n", + ". In wl_data_device_listener . data_device_handle_leave on data_offer 0x%08x for serial %d", WAYLAND_wl_proxy_get_id((struct wl_proxy *)data_device->drag_offer->offer), data_device->drag_serial); } @@ -2336,7 +2336,7 @@ static void data_device_handle_leave(void *data, struct wl_data_device *wl_data_ data_device->drag_offer = NULL; } else { SDL_LogTrace(SDL_LOG_CATEGORY_INPUT, - ". In wl_data_device_listener . data_device_handle_leave on data_offer 0x%08x for serial %d\n", + ". In wl_data_device_listener . data_device_handle_leave on data_offer 0x%08x for serial %d", -1, -1); } data_device->has_mime_file = false; @@ -2358,13 +2358,13 @@ static void data_device_handle_motion(void *data, struct wl_data_device *wl_data */ SDL_SendDropPosition(data_device->dnd_window, dx, dy); SDL_LogTrace(SDL_LOG_CATEGORY_INPUT, - ". In wl_data_device_listener . data_device_handle_motion on data_offer 0x%08x at %d x %d in window %d serial %d\n", + ". In wl_data_device_listener . data_device_handle_motion on data_offer 0x%08x at %d x %d in window %d serial %d", WAYLAND_wl_proxy_get_id((struct wl_proxy *)data_device->drag_offer->offer), wl_fixed_to_int(x), wl_fixed_to_int(y), SDL_GetWindowID(data_device->dnd_window), data_device->drag_serial); } else { SDL_LogTrace(SDL_LOG_CATEGORY_INPUT, - ". In wl_data_device_listener . data_device_handle_motion on data_offer 0x%08x at %d x %d serial %d\n", + ". In wl_data_device_listener . data_device_handle_motion on data_offer 0x%08x at %d x %d serial %d", -1, wl_fixed_to_int(x), wl_fixed_to_int(y), -1); } } @@ -2375,7 +2375,7 @@ static void data_device_handle_drop(void *data, struct wl_data_device *wl_data_d if (data_device->drag_offer && data_device->dnd_window && (data_device->has_mime_file || data_device->has_mime_text)) { SDL_LogTrace(SDL_LOG_CATEGORY_INPUT, - ". In wl_data_device_listener . data_device_handle_drop on data_offer 0x%08x in window %d serial %d\n", + ". In wl_data_device_listener . data_device_handle_drop on data_offer 0x%08x in window %d serial %d", WAYLAND_wl_proxy_get_id((struct wl_proxy *)data_device->drag_offer->offer), SDL_GetWindowID(data_device->dnd_window), data_device->drag_serial); // TODO: SDL Support more mime types @@ -2457,7 +2457,7 @@ static void data_device_handle_drop(void *data, struct wl_data_device *wl_data_d } } else { SDL_LogTrace(SDL_LOG_CATEGORY_INPUT, - ". In wl_data_device_listener . data_device_handle_drop on data_offer 0x%08x serial %d\n", + ". In wl_data_device_listener . data_device_handle_drop on data_offer 0x%08x serial %d", -1, -1); } @@ -2511,7 +2511,7 @@ static void data_device_handle_selection(void *data, struct wl_data_device *wl_d } SDL_LogTrace(SDL_LOG_CATEGORY_INPUT, - ". In data_device_listener . data_device_handle_selection on data_offer 0x%08x\n", + ". In data_device_listener . data_device_handle_selection on data_offer 0x%08x", (id ? WAYLAND_wl_proxy_get_id((struct wl_proxy *)id) : -1)); if (data_device->selection_offer != offer) { Wayland_data_offer_destroy(data_device->selection_offer); @@ -2542,7 +2542,7 @@ static void primary_selection_device_handle_offer(void *data, struct zwp_primary zwp_primary_selection_offer_v1_add_listener(id, &primary_selection_offer_listener, primary_selection_offer); } SDL_LogTrace(SDL_LOG_CATEGORY_INPUT, - ". In zwp_primary_selection_device_v1_listener . primary_selection_device_handle_offer on primary_selection_offer 0x%08x\n", + ". In zwp_primary_selection_device_v1_listener . primary_selection_device_handle_offer on primary_selection_offer 0x%08x", (id ? WAYLAND_wl_proxy_get_id((struct wl_proxy *)id) : -1)); } @@ -2561,7 +2561,7 @@ static void primary_selection_device_handle_selection(void *data, struct zwp_pri primary_selection_device->selection_offer = offer; } SDL_LogTrace(SDL_LOG_CATEGORY_INPUT, - ". In zwp_primary_selection_device_v1_listener . primary_selection_device_handle_selection on primary_selection_offer 0x%08x\n", + ". In zwp_primary_selection_device_v1_listener . primary_selection_device_handle_selection on primary_selection_offer 0x%08x", (id ? WAYLAND_wl_proxy_get_id((struct wl_proxy *)id) : -1)); notifyFromMimes(offer ? &offer->mimes : NULL); diff --git a/src/video/windows/SDL_windowskeyboard.c b/src/video/windows/SDL_windowskeyboard.c index 5f934e021e..75e8ad4a28 100644 --- a/src/video/windows/SDL_windowskeyboard.c +++ b/src/video/windows/SDL_windowskeyboard.c @@ -741,7 +741,7 @@ static void IME_GetCompositionString(SDL_VideoData *videodata, HIMC himc, DWORD videodata->ime_cursor = LOWORD(ImmGetCompositionStringW(himc, GCS_CURSORPOS, 0, 0)); videodata->ime_selected_start = 0; videodata->ime_selected_length = 0; - SDL_DebugIMELog("Cursor = %d\n", videodata->ime_cursor); + SDL_DebugIMELog("Cursor = %d", videodata->ime_cursor); length = ImmGetCompositionStringW(himc, string, NULL, 0); if (length > 0 && videodata->ime_composition_length < length) { @@ -786,7 +786,7 @@ static void IME_GetCompositionString(SDL_VideoData *videodata, HIMC himc, DWORD } for (LONG i = 0; i < length; ++i) { - SDL_DebugIMELog("attrib[%d] = %d\n", i, attributes[i]); + SDL_DebugIMELog("attrib[%d] = %d", i, attributes[i]); } for (start = 0; start < length; ++start) { @@ -987,7 +987,7 @@ bool WIN_HandleIMEMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM *lParam, SD HIMC himc = 0; if (msg == WM_IME_SETCONTEXT) { - SDL_DebugIMELog("WM_IME_SETCONTEXT\n"); + SDL_DebugIMELog("WM_IME_SETCONTEXT"); LPARAM element_mask; if (videodata->ime_internal_composition && videodata->ime_internal_candidates) { @@ -1013,35 +1013,35 @@ bool WIN_HandleIMEMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM *lParam, SD switch (msg) { case WM_KEYDOWN: if (wParam == VK_PROCESSKEY) { - SDL_DebugIMELog("WM_KEYDOWN VK_PROCESSKEY\n"); + SDL_DebugIMELog("WM_KEYDOWN VK_PROCESSKEY"); trap = true; } else { - SDL_DebugIMELog("WM_KEYDOWN normal\n"); + SDL_DebugIMELog("WM_KEYDOWN normal"); } break; case WM_INPUTLANGCHANGE: - SDL_DebugIMELog("WM_INPUTLANGCHANGE\n"); + SDL_DebugIMELog("WM_INPUTLANGCHANGE"); IME_InputLangChanged(videodata); break; case WM_IME_STARTCOMPOSITION: - SDL_DebugIMELog("WM_IME_STARTCOMPOSITION\n"); + SDL_DebugIMELog("WM_IME_STARTCOMPOSITION"); if (videodata->ime_internal_composition) { trap = true; } break; case WM_IME_COMPOSITION: - SDL_DebugIMELog("WM_IME_COMPOSITION %x\n", lParam); + SDL_DebugIMELog("WM_IME_COMPOSITION %x", lParam); if (videodata->ime_internal_composition) { trap = true; himc = ImmGetContext(hwnd); if (*lParam & GCS_RESULTSTR) { - SDL_DebugIMELog("GCS_RESULTSTR\n"); + SDL_DebugIMELog("GCS_RESULTSTR"); IME_GetCompositionString(videodata, himc, GCS_RESULTSTR); IME_SendClearComposition(videodata); IME_SendInputEvent(videodata); } if (*lParam & GCS_COMPSTR) { - SDL_DebugIMELog("GCS_COMPSTR\n"); + SDL_DebugIMELog("GCS_COMPSTR"); videodata->ime_readingstring[0] = 0; IME_GetCompositionString(videodata, himc, GCS_COMPSTR); IME_SendEditingEvent(videodata); @@ -1050,7 +1050,7 @@ bool WIN_HandleIMEMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM *lParam, SD } break; case WM_IME_ENDCOMPOSITION: - SDL_DebugIMELog("WM_IME_ENDCOMPOSITION\n"); + SDL_DebugIMELog("WM_IME_ENDCOMPOSITION"); if (videodata->ime_internal_composition) { trap = true; videodata->ime_composition[0] = 0; @@ -1062,32 +1062,32 @@ bool WIN_HandleIMEMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM *lParam, SD } break; case WM_IME_NOTIFY: - SDL_DebugIMELog("WM_IME_NOTIFY %x\n", wParam); + SDL_DebugIMELog("WM_IME_NOTIFY %x", wParam); switch (wParam) { case IMN_SETCOMPOSITIONWINDOW: - SDL_DebugIMELog("IMN_SETCOMPOSITIONWINDOW\n"); + SDL_DebugIMELog("IMN_SETCOMPOSITIONWINDOW"); break; case IMN_SETCOMPOSITIONFONT: - SDL_DebugIMELog("IMN_SETCOMPOSITIONFONT\n"); + SDL_DebugIMELog("IMN_SETCOMPOSITIONFONT"); break; case IMN_SETCANDIDATEPOS: - SDL_DebugIMELog("IMN_SETCANDIDATEPOS\n"); + SDL_DebugIMELog("IMN_SETCANDIDATEPOS"); break; case IMN_SETCONVERSIONMODE: case IMN_SETOPENSTATUS: - SDL_DebugIMELog("%s\n", wParam == IMN_SETCONVERSIONMODE ? "IMN_SETCONVERSIONMODE" : "IMN_SETOPENSTATUS"); + SDL_DebugIMELog("%s", wParam == IMN_SETCONVERSIONMODE ? "IMN_SETCONVERSIONMODE" : "IMN_SETOPENSTATUS"); IME_UpdateInputLocale(videodata); break; case IMN_OPENCANDIDATE: case IMN_CHANGECANDIDATE: - SDL_DebugIMELog("%s\n", wParam == IMN_OPENCANDIDATE ? "IMN_OPENCANDIDATE" : "IMN_CHANGECANDIDATE"); + SDL_DebugIMELog("%s", wParam == IMN_OPENCANDIDATE ? "IMN_OPENCANDIDATE" : "IMN_CHANGECANDIDATE"); if (videodata->ime_internal_candidates) { trap = true; videodata->ime_update_candidates = true; } break; case IMN_CLOSECANDIDATE: - SDL_DebugIMELog("IMN_CLOSECANDIDATE\n"); + SDL_DebugIMELog("IMN_CLOSECANDIDATE"); if (videodata->ime_internal_candidates) { trap = true; videodata->ime_update_candidates = false; @@ -1097,7 +1097,7 @@ bool WIN_HandleIMEMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM *lParam, SD case IMN_PRIVATE: { DWORD dwId = IME_GetId(videodata, 0); - SDL_DebugIMELog("IMN_PRIVATE %u\n", dwId); + SDL_DebugIMELog("IMN_PRIVATE %u", dwId); IME_GetReadingString(videodata, hwnd); switch (dwId) { case IMEID_CHT_VER42: diff --git a/src/video/windows/SDL_windowswindow.c b/src/video/windows/SDL_windowswindow.c index 1711fc0a59..bb3f3cf690 100644 --- a/src/video/windows/SDL_windowswindow.c +++ b/src/video/windows/SDL_windowswindow.c @@ -1862,16 +1862,16 @@ static STDMETHODIMP SDLDropTarget_DragEnter(SDLDropTarget *target, POINTL pt, DWORD *pdwEffect) { SDL_LogTrace(SDL_LOG_CATEGORY_INPUT, - ". In DragEnter at %ld, %ld\n", pt.x, pt.y); + ". In DragEnter at %ld, %ld", pt.x, pt.y); *pdwEffect = DROPEFFECT_COPY; POINT pnt = { pt.x, pt.y }; if (ScreenToClient(target->hwnd, &pnt)) { SDL_LogTrace(SDL_LOG_CATEGORY_INPUT, - ". In DragEnter at %ld, %ld => window %u at %ld, %ld\n", pt.x, pt.y, target->window->id, pnt.x, pnt.y); + ". In DragEnter at %ld, %ld => window %u at %ld, %ld", pt.x, pt.y, target->window->id, pnt.x, pnt.y); SDL_SendDropPosition(target->window, pnt.x, pnt.y); } else { SDL_LogTrace(SDL_LOG_CATEGORY_INPUT, - ". In DragEnter at %ld, %ld => nil, nil\n", pt.x, pt.y); + ". In DragEnter at %ld, %ld => nil, nil", pt.x, pt.y); } return S_OK; } @@ -1881,16 +1881,16 @@ static STDMETHODIMP SDLDropTarget_DragOver(SDLDropTarget *target, POINTL pt, DWORD *pdwEffect) { SDL_LogTrace(SDL_LOG_CATEGORY_INPUT, - ". In DragOver at %ld, %ld\n", pt.x, pt.y); + ". In DragOver at %ld, %ld", pt.x, pt.y); *pdwEffect = DROPEFFECT_COPY; POINT pnt = { pt.x, pt.y }; if (ScreenToClient(target->hwnd, &pnt)) { SDL_LogTrace(SDL_LOG_CATEGORY_INPUT, - ". In DragOver at %ld, %ld => window %u at %ld, %ld\n", pt.x, pt.y, target->window->id, pnt.x, pnt.y); + ". In DragOver at %ld, %ld => window %u at %ld, %ld", pt.x, pt.y, target->window->id, pnt.x, pnt.y); SDL_SendDropPosition(target->window, pnt.x, pnt.y); } else { SDL_LogTrace(SDL_LOG_CATEGORY_INPUT, - ". In DragOver at %ld, %ld => nil, nil\n", pt.x, pt.y); + ". In DragOver at %ld, %ld => nil, nil", pt.x, pt.y); } return S_OK; } @@ -1898,7 +1898,7 @@ static STDMETHODIMP SDLDropTarget_DragOver(SDLDropTarget *target, static STDMETHODIMP SDLDropTarget_DragLeave(SDLDropTarget *target) { SDL_LogTrace(SDL_LOG_CATEGORY_INPUT, - ". In DragLeave\n"); + ". In DragLeave"); SDL_SendDropComplete(target->window); return S_OK; } @@ -1911,11 +1911,11 @@ static STDMETHODIMP SDLDropTarget_Drop(SDLDropTarget *target, POINT pnt = { pt.x, pt.y }; if (ScreenToClient(target->hwnd, &pnt)) { SDL_LogTrace(SDL_LOG_CATEGORY_INPUT, - ". In Drop at %ld, %ld => window %u at %ld, %ld\n", pt.x, pt.y, target->window->id, pnt.x, pnt.y); + ". In Drop at %ld, %ld => window %u at %ld, %ld", pt.x, pt.y, target->window->id, pnt.x, pnt.y); SDL_SendDropPosition(target->window, pnt.x, pnt.y); } else { SDL_LogTrace(SDL_LOG_CATEGORY_INPUT, - ". In Drop at %ld, %ld => nil, nil\n", pt.x, pt.y); + ". In Drop at %ld, %ld => nil, nil", pt.x, pt.y); } { @@ -1923,7 +1923,7 @@ static STDMETHODIMP SDLDropTarget_Drop(SDLDropTarget *target, HRESULT hres; hres = pDataObject->lpVtbl->EnumFormatEtc(pDataObject, DATADIR_GET, &pEnumFormatEtc); SDL_LogTrace(SDL_LOG_CATEGORY_INPUT, - ". In Drop for EnumFormatEtc, HRESULT is %08lx\n", hres); + ". In Drop for EnumFormatEtc, HRESULT is %08lx", hres); if (hres == S_OK) { FORMATETC fetc; while (pEnumFormatEtc->lpVtbl->Next(pEnumFormatEtc, 1, &fetc, NULL) == S_OK) { @@ -1931,10 +1931,10 @@ static STDMETHODIMP SDLDropTarget_Drop(SDLDropTarget *target, const char *cfnm = SDLGetClipboardFormatName(fetc.cfFormat, name, 256); if (cfnm) { SDL_LogTrace(SDL_LOG_CATEGORY_INPUT, - ". In Drop, Supported format is %08x, '%s'\n", fetc.cfFormat, cfnm); + ". In Drop, Supported format is %08x, '%s'", fetc.cfFormat, cfnm); } else { SDL_LogTrace(SDL_LOG_CATEGORY_INPUT, - ". In Drop, Supported format is %08x, Predefined\n", fetc.cfFormat); + ". In Drop, Supported format is %08x, Predefined", fetc.cfFormat); } } } @@ -1950,18 +1950,18 @@ static STDMETHODIMP SDLDropTarget_Drop(SDLDropTarget *target, const char *format_mime = "text/uri-list"; if (SUCCEEDED(pDataObject->lpVtbl->QueryGetData(pDataObject, &fetc))) { SDL_LogTrace(SDL_LOG_CATEGORY_INPUT, - ". In Drop File for QueryGetData, format %08x '%s', success\n", + ". In Drop File for QueryGetData, format %08x '%s', success", fetc.cfFormat, format_mime); STGMEDIUM med; HRESULT hres = pDataObject->lpVtbl->GetData(pDataObject, &fetc, &med); SDL_LogTrace(SDL_LOG_CATEGORY_INPUT, - ". In Drop File for GetData, format %08x '%s', HRESULT is %08lx\n", + ". In Drop File for GetData, format %08x '%s', HRESULT is %08lx", fetc.cfFormat, format_mime, hres); if (SUCCEEDED(hres)) { const size_t bsize = GlobalSize(med.hGlobal); const void *buffer = (void *)GlobalLock(med.hGlobal); SDL_LogTrace(SDL_LOG_CATEGORY_INPUT, - ". In Drop File for GlobalLock, format %08x '%s', memory (%lu) %p\n", + ". In Drop File for GlobalLock, format %08x '%s', memory (%lu) %p", fetc.cfFormat, format_mime, (unsigned long)bsize, buffer); if (buffer) { char *text = (char *)SDL_malloc(bsize + sizeof(Uint32)); @@ -1972,7 +1972,7 @@ static STDMETHODIMP SDLDropTarget_Drop(SDLDropTarget *target, while (token != NULL) { if (SDL_URIToLocal(token, token) >= 0) { SDL_LogTrace(SDL_LOG_CATEGORY_INPUT, - ". In Drop File, file (%lu of %lu) '%s'\n", + ". In Drop File, file (%lu of %lu) '%s'", (unsigned long)SDL_strlen(token), (unsigned long)bsize, token); SDL_SendDropFile(target->window, NULL, token); } @@ -1998,18 +1998,18 @@ static STDMETHODIMP SDLDropTarget_Drop(SDLDropTarget *target, const char *format_mime = "text/plain;charset=utf-8"; if (SUCCEEDED(pDataObject->lpVtbl->QueryGetData(pDataObject, &fetc))) { SDL_LogTrace(SDL_LOG_CATEGORY_INPUT, - ". In Drop Text for QueryGetData, format %08x '%s', success\n", + ". In Drop Text for QueryGetData, format %08x '%s', success", fetc.cfFormat, format_mime); STGMEDIUM med; HRESULT hres = pDataObject->lpVtbl->GetData(pDataObject, &fetc, &med); SDL_LogTrace(SDL_LOG_CATEGORY_INPUT, - ". In Drop Text for GetData, format %08x '%s', HRESULT is %08lx\n", + ". In Drop Text for GetData, format %08x '%s', HRESULT is %08lx", fetc.cfFormat, format_mime, hres); if (SUCCEEDED(hres)) { const size_t bsize = GlobalSize(med.hGlobal); const void *buffer = (void *)GlobalLock(med.hGlobal); SDL_LogTrace(SDL_LOG_CATEGORY_INPUT, - ". In Drop Text for GlobalLock, format %08x '%s', memory (%lu) %p\n", + ". In Drop Text for GlobalLock, format %08x '%s', memory (%lu) %p", fetc.cfFormat, format_mime, (unsigned long)bsize, buffer); if (buffer) { char *text = (char *)SDL_malloc(bsize + sizeof(Uint32)); @@ -2019,7 +2019,7 @@ static STDMETHODIMP SDLDropTarget_Drop(SDLDropTarget *target, char *token = SDL_strtok_r(text, "\r\n", &saveptr); while (token != NULL) { SDL_LogTrace(SDL_LOG_CATEGORY_INPUT, - ". In Drop Text, text (%lu of %lu) '%s'\n", + ". In Drop Text, text (%lu of %lu) '%s'", (unsigned long)SDL_strlen(token), (unsigned long)bsize, token); SDL_SendDropText(target->window, (char *)token); token = SDL_strtok_r(NULL, "\r\n", &saveptr); @@ -2044,25 +2044,25 @@ static STDMETHODIMP SDLDropTarget_Drop(SDLDropTarget *target, const char *format_mime = "CF_UNICODETEXT"; if (SUCCEEDED(pDataObject->lpVtbl->QueryGetData(pDataObject, &fetc))) { SDL_LogTrace(SDL_LOG_CATEGORY_INPUT, - ". In Drop Text for QueryGetData, format %08x '%s', success\n", + ". In Drop Text for QueryGetData, format %08x '%s', success", fetc.cfFormat, format_mime); STGMEDIUM med; HRESULT hres = pDataObject->lpVtbl->GetData(pDataObject, &fetc, &med); SDL_LogTrace(SDL_LOG_CATEGORY_INPUT, - ". In Drop Text for GetData, format %08x '%s', HRESULT is %08lx\n", + ". In Drop Text for GetData, format %08x '%s', HRESULT is %08lx", fetc.cfFormat, format_mime, hres); if (SUCCEEDED(hres)) { const size_t bsize = GlobalSize(med.hGlobal); const void *buffer = (void *)GlobalLock(med.hGlobal); SDL_LogTrace(SDL_LOG_CATEGORY_INPUT, - ". In Drop Text for GlobalLock, format %08x '%s', memory (%lu) %p\n", + ". In Drop Text for GlobalLock, format %08x '%s', memory (%lu) %p", fetc.cfFormat, format_mime, (unsigned long)bsize, buffer); if (buffer) { buffer = WIN_StringToUTF8((const wchar_t *)buffer); if (buffer) { const size_t lbuffer = SDL_strlen((const char *)buffer); SDL_LogTrace(SDL_LOG_CATEGORY_INPUT, - ". In Drop Text for StringToUTF8, format %08x '%s', memory (%lu) %p\n", + ". In Drop Text for StringToUTF8, format %08x '%s', memory (%lu) %p", fetc.cfFormat, format_mime, (unsigned long)lbuffer, buffer); char *text = (char *)SDL_malloc(lbuffer + sizeof(Uint32)); SDL_memcpy((Uint8 *)text, buffer, lbuffer); @@ -2071,7 +2071,7 @@ static STDMETHODIMP SDLDropTarget_Drop(SDLDropTarget *target, char *token = SDL_strtok_r(text, "\r\n", &saveptr); while (token != NULL) { SDL_LogTrace(SDL_LOG_CATEGORY_INPUT, - ". In Drop Text, text (%lu of %lu) '%s'\n", + ". In Drop Text, text (%lu of %lu) '%s'", (unsigned long)SDL_strlen(token), (unsigned long)lbuffer, token); SDL_SendDropText(target->window, (char *)token); token = SDL_strtok_r(NULL, "\r\n", &saveptr); @@ -2098,18 +2098,18 @@ static STDMETHODIMP SDLDropTarget_Drop(SDLDropTarget *target, const char *format_mime = "CF_TEXT"; if (SUCCEEDED(pDataObject->lpVtbl->QueryGetData(pDataObject, &fetc))) { SDL_LogTrace(SDL_LOG_CATEGORY_INPUT, - ". In Drop Text for QueryGetData, format %08x '%s', success\n", + ". In Drop Text for QueryGetData, format %08x '%s', success", fetc.cfFormat, format_mime); STGMEDIUM med; HRESULT hres = pDataObject->lpVtbl->GetData(pDataObject, &fetc, &med); SDL_LogTrace(SDL_LOG_CATEGORY_INPUT, - ". In Drop Text for GetData, format %08x '%s', HRESULT is %08lx\n", + ". In Drop Text for GetData, format %08x '%s', HRESULT is %08lx", fetc.cfFormat, format_mime, hres); if (SUCCEEDED(hres)) { const size_t bsize = GlobalSize(med.hGlobal); const void *buffer = (void *)GlobalLock(med.hGlobal); SDL_LogTrace(SDL_LOG_CATEGORY_INPUT, - ". In Drop Text for GlobalLock, format %08x '%s', memory (%lu) %p\n", + ". In Drop Text for GlobalLock, format %08x '%s', memory (%lu) %p", fetc.cfFormat, format_mime, (unsigned long)bsize, buffer); if (buffer) { char *text = (char *)SDL_malloc(bsize + sizeof(Uint32)); @@ -2119,7 +2119,7 @@ static STDMETHODIMP SDLDropTarget_Drop(SDLDropTarget *target, char *token = SDL_strtok_r(text, "\r\n", &saveptr); while (token != NULL) { SDL_LogTrace(SDL_LOG_CATEGORY_INPUT, - ". In Drop Text, text (%lu of %lu) '%s'\n", + ". In Drop Text, text (%lu of %lu) '%s'", (unsigned long)SDL_strlen(token), (unsigned long)bsize, token); SDL_SendDropText(target->window, (char *)token); token = SDL_strtok_r(NULL, "\r\n", &saveptr); @@ -2144,18 +2144,18 @@ static STDMETHODIMP SDLDropTarget_Drop(SDLDropTarget *target, const char *format_mime = "CF_HDROP"; if (SUCCEEDED(pDataObject->lpVtbl->QueryGetData(pDataObject, &fetc))) { SDL_LogTrace(SDL_LOG_CATEGORY_INPUT, - ". In Drop File for QueryGetData, format %08x '%s', success\n", + ". In Drop File for QueryGetData, format %08x '%s', success", fetc.cfFormat, format_mime); STGMEDIUM med; HRESULT hres = pDataObject->lpVtbl->GetData(pDataObject, &fetc, &med); SDL_LogTrace(SDL_LOG_CATEGORY_INPUT, - ". In Drop File for GetData, format %08x '%s', HRESULT is %08lx\n", + ". In Drop File for GetData, format %08x '%s', HRESULT is %08lx", fetc.cfFormat, format_mime, hres); if (SUCCEEDED(hres)) { const size_t bsize = GlobalSize(med.hGlobal); HDROP drop = (HDROP)GlobalLock(med.hGlobal); SDL_LogTrace(SDL_LOG_CATEGORY_INPUT, - ". In Drop File for GlobalLock, format %08x '%s', memory (%lu) %p\n", + ". In Drop File for GlobalLock, format %08x '%s', memory (%lu) %p", fetc.cfFormat, format_mime, (unsigned long)bsize, drop); UINT count = DragQueryFile(drop, 0xFFFFFFFF, NULL, 0); for (UINT i = 0; i < count; ++i) { @@ -2165,7 +2165,7 @@ static STDMETHODIMP SDLDropTarget_Drop(SDLDropTarget *target, if (DragQueryFile(drop, i, buffer, size)) { char *file = WIN_StringToUTF8(buffer); SDL_LogTrace(SDL_LOG_CATEGORY_INPUT, - ". In Drop File, file (%lu of %lu) '%s'\n", + ". In Drop File, file (%lu of %lu) '%s'", (unsigned long)SDL_strlen(file), (unsigned long)bsize, file); SDL_SendDropFile(target->window, NULL, file); SDL_free(file); @@ -2211,7 +2211,7 @@ void WIN_AcceptDragAndDrop(SDL_Window *window, bool accept) SDLDropTarget_AddRef(drop_target); RegisterDragDrop(data->hwnd, (LPDROPTARGET)drop_target); SDL_LogTrace(SDL_LOG_CATEGORY_INPUT, - ". In Accept Drag and Drop, window %u, enabled Full OLE IDropTarget\n", + ". In Accept Drag and Drop, window %u, enabled Full OLE IDropTarget", window->id); } } else if (!accept && data->drop_target) { @@ -2219,13 +2219,13 @@ void WIN_AcceptDragAndDrop(SDL_Window *window, bool accept) SDLDropTarget_Release(data->drop_target); data->drop_target = NULL; SDL_LogTrace(SDL_LOG_CATEGORY_INPUT, - ". In Accept Drag and Drop, window %u, disabled Full OLE IDropTarget\n", + ". In Accept Drag and Drop, window %u, disabled Full OLE IDropTarget", window->id); } } else { DragAcceptFiles(data->hwnd, accept ? TRUE : FALSE); SDL_LogTrace(SDL_LOG_CATEGORY_INPUT, - ". In Accept Drag and Drop, window %u, %s Fallback WM_DROPFILES\n", + ". In Accept Drag and Drop, window %u, %s Fallback WM_DROPFILES", window->id, (accept ? "enabled" : "disabled")); } } diff --git a/test/testrumble.c b/test/testrumble.c index b53cb18edd..df35e0bb57 100644 --- a/test/testrumble.c +++ b/test/testrumble.c @@ -74,7 +74,7 @@ int main(int argc, char **argv) SDLTest_CommonLogUsage(state, argv[0], options); SDL_Log("%s", ""); SDL_Log("If device is a two-digit number it'll use it as an index, otherwise\n" - "it'll use it as if it were part of the device's name.\n"); + "it'll use it as if it were part of the device's name."); return 1; } diff --git a/test/testvulkan.c b/test/testvulkan.c index e4437e50ab..a728b79e53 100644 --- a/test/testvulkan.c +++ b/test/testvulkan.c @@ -198,18 +198,18 @@ static void loadGlobalFunctions(void) vkGetInstanceProcAddr = (PFN_vkGetInstanceProcAddr)SDL_Vulkan_GetVkGetInstanceProcAddr(); if (!vkGetInstanceProcAddr) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, - "SDL_Vulkan_GetVkGetInstanceProcAddr(): %s\n", + "SDL_Vulkan_GetVkGetInstanceProcAddr(): %s", SDL_GetError()); quit(2); } #define VULKAN_DEVICE_FUNCTION(name) -#define VULKAN_GLOBAL_FUNCTION(name) \ - name = (PFN_##name)vkGetInstanceProcAddr(VK_NULL_HANDLE, #name); \ - if (!name) { \ - SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, \ - "vkGetInstanceProcAddr(VK_NULL_HANDLE, \"" #name "\") failed\n"); \ - quit(2); \ +#define VULKAN_GLOBAL_FUNCTION(name) \ + name = (PFN_##name)vkGetInstanceProcAddr(VK_NULL_HANDLE, #name); \ + if (!name) { \ + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, \ + "vkGetInstanceProcAddr(VK_NULL_HANDLE, \"" #name "\") failed"); \ + quit(2); \ } #define VULKAN_INSTANCE_FUNCTION(name) VULKAN_FUNCTIONS() @@ -237,7 +237,7 @@ static void createInstance(void) if (result != VK_SUCCESS) { vulkanContext->instance = VK_NULL_HANDLE; SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, - "vkCreateInstance(): %s\n", + "vkCreateInstance(): %s", getVulkanResultString(result)); quit(2); } @@ -247,12 +247,12 @@ static void loadInstanceFunctions(void) { #define VULKAN_DEVICE_FUNCTION(name) #define VULKAN_GLOBAL_FUNCTION(name) -#define VULKAN_INSTANCE_FUNCTION(name) \ - name = (PFN_##name)vkGetInstanceProcAddr(vulkanContext->instance, #name); \ - if (!name) { \ - SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, \ - "vkGetInstanceProcAddr(instance, \"" #name "\") failed\n"); \ - quit(2); \ +#define VULKAN_INSTANCE_FUNCTION(name) \ + name = (PFN_##name)vkGetInstanceProcAddr(vulkanContext->instance, #name); \ + if (!name) { \ + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, \ + "vkGetInstanceProcAddr(instance, \"" #name "\") failed"); \ + quit(2); \ } VULKAN_FUNCTIONS() #undef VULKAN_DEVICE_FUNCTION @@ -283,13 +283,13 @@ static void findPhysicalDevice(void) result = vkEnumeratePhysicalDevices(vulkanContext->instance, &physicalDeviceCount, NULL); if (result != VK_SUCCESS) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, - "vkEnumeratePhysicalDevices(): %s\n", + "vkEnumeratePhysicalDevices(): %s", getVulkanResultString(result)); quit(2); } if (physicalDeviceCount == 0) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, - "vkEnumeratePhysicalDevices(): no physical devices\n"); + "vkEnumeratePhysicalDevices(): no physical devices"); quit(2); } physicalDevices = (VkPhysicalDevice *)SDL_malloc(sizeof(VkPhysicalDevice) * physicalDeviceCount); @@ -300,7 +300,7 @@ static void findPhysicalDevice(void) if (result != VK_SUCCESS) { SDL_free(physicalDevices); SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, - "vkEnumeratePhysicalDevices(): %s\n", + "vkEnumeratePhysicalDevices(): %s", getVulkanResultString(result)); quit(2); } @@ -353,7 +353,7 @@ static void findPhysicalDevice(void) SDL_free(queueFamiliesProperties); SDL_free(deviceExtensions); SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, - "vkGetPhysicalDeviceSurfaceSupportKHR(): %s\n", + "vkGetPhysicalDeviceSurfaceSupportKHR(): %s", getVulkanResultString(result)); quit(2); } @@ -369,7 +369,7 @@ static void findPhysicalDevice(void) SDL_free(queueFamiliesProperties); SDL_free(deviceExtensions); SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, - "SDL_Vulkan_GetPresentationSupport(): %s\n", + "SDL_Vulkan_GetPresentationSupport(): %s", SDL_GetError()); quit(2); } @@ -393,7 +393,7 @@ static void findPhysicalDevice(void) SDL_free(queueFamiliesProperties); SDL_free(deviceExtensions); SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, - "vkEnumerateDeviceExtensionProperties(): %s\n", + "vkEnumerateDeviceExtensionProperties(): %s", getVulkanResultString(result)); quit(2); } @@ -416,7 +416,7 @@ static void findPhysicalDevice(void) SDL_free(queueFamiliesProperties); SDL_free(deviceExtensions); SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, - "vkEnumerateDeviceExtensionProperties(): %s\n", + "vkEnumerateDeviceExtensionProperties(): %s", getVulkanResultString(result)); quit(2); } @@ -485,12 +485,12 @@ static void createDevice(void) static void loadDeviceFunctions(void) { -#define VULKAN_DEVICE_FUNCTION(name) \ - name = (PFN_##name)vkGetDeviceProcAddr(vulkanContext->device, #name); \ - if (!name) { \ - SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, \ - "vkGetDeviceProcAddr(device, \"" #name "\") failed\n"); \ - quit(2); \ +#define VULKAN_DEVICE_FUNCTION(name) \ + name = (PFN_##name)vkGetDeviceProcAddr(vulkanContext->device, #name); \ + if (!name) { \ + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, \ + "vkGetDeviceProcAddr(device, \"" #name "\") failed"); \ + quit(2); \ } #define VULKAN_GLOBAL_FUNCTION(name) #define VULKAN_INSTANCE_FUNCTION(name) @@ -528,7 +528,7 @@ static void createSemaphore(VkSemaphore *semaphore) if (result != VK_SUCCESS) { *semaphore = VK_NULL_HANDLE; SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, - "vkCreateSemaphore(): %s\n", + "vkCreateSemaphore(): %s", getVulkanResultString(result)); quit(2); } @@ -545,7 +545,7 @@ static void getSurfaceCaps(void) VkResult result = vkGetPhysicalDeviceSurfaceCapabilitiesKHR(vulkanContext->physicalDevice, vulkanContext->surface, &vulkanContext->surfaceCapabilities); if (result != VK_SUCCESS) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, - "vkGetPhysicalDeviceSurfaceCapabilitiesKHR(): %s\n", + "vkGetPhysicalDeviceSurfaceCapabilitiesKHR(): %s", getVulkanResultString(result)); quit(2); } @@ -553,7 +553,7 @@ static void getSurfaceCaps(void) // check surface usage if (!(vulkanContext->surfaceCapabilities.supportedUsageFlags & VK_IMAGE_USAGE_TRANSFER_DST_BIT)) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, - "Vulkan surface doesn't support VK_IMAGE_USAGE_TRANSFER_DST_BIT\n"); + "Vulkan surface doesn't support VK_IMAGE_USAGE_TRANSFER_DST_BIT"); quit(2); } } @@ -567,7 +567,7 @@ static void getSurfaceFormats(void) if (result != VK_SUCCESS) { vulkanContext->surfaceFormatsCount = 0; SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, - "vkGetPhysicalDeviceSurfaceFormatsKHR(): %s\n", + "vkGetPhysicalDeviceSurfaceFormatsKHR(): %s", getVulkanResultString(result)); quit(2); } @@ -587,7 +587,7 @@ static void getSurfaceFormats(void) if (result != VK_SUCCESS) { vulkanContext->surfaceFormatsCount = 0; SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, - "vkGetPhysicalDeviceSurfaceFormatsKHR(): %s\n", + "vkGetPhysicalDeviceSurfaceFormatsKHR(): %s", getVulkanResultString(result)); quit(2); } @@ -603,7 +603,7 @@ static void getSwapchainImages(void) if (result != VK_SUCCESS) { vulkanContext->swapchainImageCount = 0; SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, - "vkGetSwapchainImagesKHR(): %s\n", + "vkGetSwapchainImagesKHR(): %s", getVulkanResultString(result)); quit(2); } @@ -620,7 +620,7 @@ static void getSwapchainImages(void) vulkanContext->swapchainImages = NULL; vulkanContext->swapchainImageCount = 0; SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, - "vkGetSwapchainImagesKHR(): %s\n", + "vkGetSwapchainImagesKHR(): %s", getVulkanResultString(result)); quit(2); } @@ -706,7 +706,7 @@ static bool createSwapchain(void) if (result != VK_SUCCESS) { vulkanContext->swapchain = VK_NULL_HANDLE; SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, - "vkCreateSwapchainKHR(): %s\n", + "vkCreateSwapchainKHR(): %s", getVulkanResultString(result)); quit(2); } @@ -756,7 +756,7 @@ static void createCommandPool(void) if (result != VK_SUCCESS) { vulkanContext->commandPool = VK_NULL_HANDLE; SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, - "vkCreateCommandPool(): %s\n", + "vkCreateCommandPool(): %s", getVulkanResultString(result)); quit(2); } @@ -776,7 +776,7 @@ static void createCommandBuffers(void) SDL_free(vulkanContext->commandBuffers); vulkanContext->commandBuffers = NULL; SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, - "vkAllocateCommandBuffers(): %s\n", + "vkAllocateCommandBuffers(): %s", getVulkanResultString(result)); quit(2); } @@ -803,7 +803,7 @@ static void createFences(void) SDL_free(vulkanContext->fences); vulkanContext->fences = NULL; SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, - "vkCreateFence(): %s\n", + "vkCreateFence(): %s", getVulkanResultString(result)); quit(2); } @@ -868,7 +868,7 @@ static void rerecordCommandBuffer(uint32_t frameIndex, const VkClearColorValue * VkResult result = vkResetCommandBuffer(commandBuffer, 0); if (result != VK_SUCCESS) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, - "vkResetCommandBuffer(): %s\n", + "vkResetCommandBuffer(): %s", getVulkanResultString(result)); quit(2); } @@ -877,7 +877,7 @@ static void rerecordCommandBuffer(uint32_t frameIndex, const VkClearColorValue * result = vkBeginCommandBuffer(commandBuffer, &beginInfo); if (result != VK_SUCCESS) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, - "vkBeginCommandBuffer(): %s\n", + "vkBeginCommandBuffer(): %s", getVulkanResultString(result)); quit(2); } @@ -902,7 +902,7 @@ static void rerecordCommandBuffer(uint32_t frameIndex, const VkClearColorValue * result = vkEndCommandBuffer(commandBuffer); if (result != VK_SUCCESS) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, - "vkEndCommandBuffer(): %s\n", + "vkEndCommandBuffer(): %s", getVulkanResultString(result)); quit(2); } @@ -1034,7 +1034,7 @@ static bool render(void) if ((rc != VK_SUBOPTIMAL_KHR) && (rc != VK_SUCCESS)) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, - "vkAcquireNextImageKHR(): %s\n", + "vkAcquireNextImageKHR(): %s", getVulkanResultString(rc)); quit(2); } @@ -1081,7 +1081,7 @@ static bool render(void) if (rc != VK_SUCCESS) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, - "vkQueuePresentKHR(): %s\n", + "vkQueuePresentKHR(): %s", getVulkanResultString(rc)); quit(2); }