From 87f149c464ea0322a5b59d040bb80e7847f365be Mon Sep 17 00:00:00 2001 From: jamesge Date: Tue, 28 Apr 2020 11:37:01 +0800 Subject: [PATCH] fix a narrowing warning on aarch64 --- src/butil/containers/case_ignored_flat_map.cpp | 4 ++-- src/butil/containers/case_ignored_flat_map.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/butil/containers/case_ignored_flat_map.cpp b/src/butil/containers/case_ignored_flat_map.cpp index 7f2fadc5c7..a747156182 100644 --- a/src/butil/containers/case_ignored_flat_map.cpp +++ b/src/butil/containers/case_ignored_flat_map.cpp @@ -19,7 +19,7 @@ namespace butil { -static const char g_tolower_map_base[] = { +static const signed char g_tolower_map_base[] = { -128, -127, -126, -125, -124, -123, -122, -121, -120, -119, -118, -117, -116, -115, -114, -113, -112, -111, -110, -109, -108, -107, -106, -105, -104, -103, -102, -101, -100, @@ -48,6 +48,6 @@ static const char g_tolower_map_base[] = { 120, 121, 122, 123, 124, 125, 126, 127 }; -extern const char* const g_tolower_map = g_tolower_map_base + 128; +extern const signed char* const g_tolower_map = g_tolower_map_base + 128; } // namespace butil diff --git a/src/butil/containers/case_ignored_flat_map.h b/src/butil/containers/case_ignored_flat_map.h index ed6e58b4d6..6bc1a9af74 100644 --- a/src/butil/containers/case_ignored_flat_map.h +++ b/src/butil/containers/case_ignored_flat_map.h @@ -27,7 +27,7 @@ namespace butil { // NOTE: Using ascii_tolower instead of ::tolower shortens 150ns in // FlatMapTest.perf_small_string_map (with -O2 added, -O0 by default) inline char ascii_tolower(char c) { - extern const char* const g_tolower_map; + extern const signed char* const g_tolower_map; return g_tolower_map[(int)c]; }