From 209a89e51d159baddbde39bd99144cd9c5bccfa5 Mon Sep 17 00:00:00 2001 From: Yonggang Luo Date: Tue, 20 Sep 2022 02:04:51 +0800 Subject: [PATCH] aco: Convert to use u8 literal for Unicode character to fixes msvc warning Warning: aco_register_allocation.cpp(383): warning C4819: The file contains a character that cannot be represented in the current code page (0). Save the file in Unicode format to prevent data loss This warning was treated as error with compiling with msvc u8 is belongs to c11 standard so it's safe to use it Signed-off-by: Yonggang Luo Reviewed-by: Samuel Pitoiset Part-of: --- src/amd/compiler/aco_register_allocation.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/amd/compiler/aco_register_allocation.cpp b/src/amd/compiler/aco_register_allocation.cpp index 734e20b364f..437cf4998f0 100644 --- a/src/amd/compiler/aco_register_allocation.cpp +++ b/src/amd/compiler/aco_register_allocation.cpp @@ -379,16 +379,16 @@ UNUSED void print_reg(const RegisterFile& reg_file, PhysReg reg, bool has_adjacent_variable) { if (reg_file[reg] == 0xFFFFFFFF) { - printf("☐"); + printf(u8"☐"); } else if (reg_file[reg]) { const bool show_subdword_alloc = (reg_file[reg] == 0xF0000000); if (show_subdword_alloc) { const char* block_chars[] = { // clang-format off - "?", "▘", "▝", "▀", - "▖", "▌", "▞", "▛", - "▗", "▚", "▐", "▜", - "▄", "▙", "▟", "▉" + u8"?", u8"▘", u8"▝", u8"▀", + u8"▖", u8"▌", u8"▞", u8"▛", + u8"▗", u8"▚", u8"▐", u8"▜", + u8"▄", u8"▙", u8"▟", u8"▉" // clang-format on }; unsigned index = 0; @@ -401,14 +401,14 @@ print_reg(const RegisterFile& reg_file, PhysReg reg, bool has_adjacent_variable) } else { /* Indicate filled register slot */ if (!has_adjacent_variable) { - printf("█"); + printf(u8"█"); } else { /* Use a slightly shorter box to leave a small gap between adjacent variables */ - printf("▉"); + printf(u8"▉"); } } } else { - printf("·"); + printf(u8"·"); } }