Skip to content

Commit

Permalink
fix a narrowing warning on aarch64
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesge committed Apr 28, 2020
1 parent 2f8fc37 commit 87f149c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/butil/containers/case_ignored_flat_map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
2 changes: 1 addition & 1 deletion src/butil/containers/case_ignored_flat_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}

Expand Down

0 comments on commit 87f149c

Please sign in to comment.