mirror of https://github.com/gabime/spdlog.git
Fix sign conversion warnings in qt_sinks.h
Add static_cast to fix compiler warnings when building with -Werror=sign-conversion and -Werror=shorten-64-to-32: 1. Cast msg.color_range_start/end to qsizetype when passing to QString::fromUtf8(), since QString expects signed qsizetype but the message fields are size_t (unsigned). 2. Cast msg.level to size_t when indexing into colors_ array, since level_enum is a signed int but array indexing expects size_t. These casts are safe because: - qsizetype is guaranteed to be the same size as size_t per Qt docs - color_range values come from valid string positions - level values are from a small enum range Fixes #3321pull/3487/head
parent
88a0e07ad5
commit
6770ddbd53
Loading…
Reference in New Issue