diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2013-04-23 14:42:47 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2013-04-23 14:42:47 +0000 |
commit | dd3e2d90418de46b77a9dde3bb992390610e343a (patch) | |
tree | 966b10166e648df27bb634bbfc89ab12687858c5 /lib/Frontend | |
parent | aae7bad5cdd804cb88e918e9defbf5faf69f4cfd (diff) |
Make compares unsigned. The expression can't become negative anyways.
Silences a sign compare warning on 32 bit archs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180110 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend')
-rw-r--r-- | lib/Frontend/TextDiagnostic.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Frontend/TextDiagnostic.cpp b/lib/Frontend/TextDiagnostic.cpp index ca4ad60c52..1572d0f1d0 100644 --- a/lib/Frontend/TextDiagnostic.cpp +++ b/lib/Frontend/TextDiagnostic.cpp @@ -1095,7 +1095,7 @@ void TextDiagnostic::emitSnippetAndCaret( unsigned ColNo = SM.getColumnNumber(FID, FileOffset); // Arbitrarily stop showing snippets when the line is too long. - static const ptrdiff_t MaxLineLengthToPrint = 4096; + static const size_t MaxLineLengthToPrint = 4096; if (ColNo > MaxLineLengthToPrint) return; @@ -1110,7 +1110,7 @@ void TextDiagnostic::emitSnippetAndCaret( ++LineEnd; // Arbitrarily stop showing snippets when the line is too long. - if (LineEnd - LineStart > MaxLineLengthToPrint) + if (size_t(LineEnd - LineStart) > MaxLineLengthToPrint) return; // Copy the line of code into an std::string for ease of manipulation. |