From 607dc5a7486e0ca87cd7f8fa9e2e8223e1eec490 Mon Sep 17 00:00:00 2001 From: Ruihang Lai Date: Tue, 27 Feb 2024 09:28:38 -0500 Subject: [PATCH] [Fix] Fix `u_char` for Windows build (#1848) Prior to this PR, `u_char` was used while it is not a standard type in C++, which causes Windows build failure. This PR fixes it by using `unsigned char`. --- cpp/serve/data.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/serve/data.cc b/cpp/serve/data.cc index 54e404ae1f..770619f7c3 100644 --- a/cpp/serve/data.cc +++ b/cpp/serve/data.cc @@ -103,7 +103,7 @@ inline void TokenToLogProbJSON(const Tokenizer& tokenizer, const TokenProbPair& (*os) << "\"bytes\": ["; int token_len = token.size(); for (int pos = 0; pos < token_len; ++pos) { - (*os) << static_cast(static_cast(token[pos])); + (*os) << static_cast(static_cast(token[pos])); if (pos != token_len - 1) { (*os) << ", "; }