From: Aina Niemetz Date: Tue, 11 Sep 2018 23:26:16 +0000 (-0700) Subject: Fixe compiler warning in line_buffer.cpp. (#2453) X-Git-Tag: cvc5-1.0.0~4659 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=078c8bcafbdeeb920642ff9326cf46fc72a2efe8;p=cvc5.git Fixe compiler warning in line_buffer.cpp. (#2453) --- diff --git a/src/parser/line_buffer.cpp b/src/parser/line_buffer.cpp index 4213eec23..71b913227 100644 --- a/src/parser/line_buffer.cpp +++ b/src/parser/line_buffer.cpp @@ -54,10 +54,12 @@ uint8_t* LineBuffer::getPtrWithOffset(size_t line, size_t pos_in_line, } bool LineBuffer::isPtrBefore(uint8_t* ptr, size_t line, size_t pos_in_line) { - for (ssize_t i = line; i >= 0; i--) { + for (size_t j = 0; j < line; j++) + { // NOTE: std::less is guaranteed to give consistent results when comparing // pointers of different arrays (in contrast to built-in comparison // operators). + size_t i = line - j; uint8_t* end = d_lines[i] + ((i == line) ? pos_in_line : d_sizes[i]); if (std::less()(d_lines[i] - 1, ptr) && std::less()(ptr, end)) {