# HG changeset patch # User Julien Cristau # Date 2022-03-14 16:57:03 # Node ID 9ce563fb2989eda394330d3a9d37a8a75995a304 # Parent 59be65b7cdfded782e992c9d2e5557a7e78be878 revlog: fix wrong type of rank_unknown variable We treat "rank" as an int everywhere, but declare rank_unknown as a char. On architectures where char is signed, that works out ok, but when char is unsigned, rank_unknown is 255 instead of -1. Differential Revision: https://phab.mercurial-scm.org/D12374 diff --git a/mercurial/cext/revlog.c b/mercurial/cext/revlog.c --- a/mercurial/cext/revlog.c +++ b/mercurial/cext/revlog.c @@ -179,7 +179,7 @@ static const long entry_cl2_offset_rank /* next free offset: 73 */ static const char comp_mode_inline = 2; -static const char rank_unknown = -1; +static const int rank_unknown = -1; static void raise_revlog_error(void) {