From acb3925bb4fd6b0805ed9f38b5dbfbafe5e2815b Mon Sep 17 00:00:00 2001 From: Ville Lindholm Date: Thu, 28 May 2026 22:05:20 +0300 Subject: [PATCH] Cleanup: fix logger warnings introduced by SDL 3 migration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - logger.c:103 log_write_raw() missing return in unreachable assert(0) branch; clang flagged the missing return statement. - logger.c:191 SDL_GetTicks() now returns Uint64 in SDL 3; widen the printf format from %d to %llu and bump the local buffer size. Build is clean. Remaining warnings (strncat-size in a_wave.c, invalid-source-encoding in a_midifile.c) are pre-2007 code-style issues unrelated to SDL. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- logger.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/logger.c b/logger.c index 5420c27..17ccf9a 100644 --- a/logger.c +++ b/logger.c @@ -100,6 +100,7 @@ static inline int log_write_raw(int target, const char *text) /* We should never get here. */ assert(0); } + return 0; } @@ -187,8 +188,9 @@ static inline void put_timestamp(int level) { if(l_targets[l_levels[level].target].flags & LOG_TIMESTAMP) { - char buf[16]; - snprintf(buf, sizeof(buf)-1, "[%d] ", SDL_GetTicks() - start_time); + char buf[24]; + snprintf(buf, sizeof(buf)-1, "[%llu] ", + (unsigned long long)(SDL_GetTicks() - start_time)); log_write_raw(l_levels[level].target, buf); } }