diff options
author | Eugene Zelenko <eugene.zelenko@gmail.com> | 2016-03-28 17:40:08 +0000 |
---|---|---|
committer | Eugene Zelenko <eugene.zelenko@gmail.com> | 2016-03-28 17:40:08 +0000 |
commit | d0a33c410b0f2cc4ef9ccae76ece049066722db1 (patch) | |
tree | 6cf67f042d972d1d1a63d1d938723fee42b9a363 /lib/LineEditor/LineEditor.cpp | |
parent | 4c613e1e1955ca8c122731584ffa2b645de08f16 (diff) |
Fix Clang-tidy modernize-deprecated-headers warnings in some files; other minor fixes.
Differential revision: http://reviews.llvm.org/D18469
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264598 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/LineEditor/LineEditor.cpp')
-rw-r--r-- | lib/LineEditor/LineEditor.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/lib/LineEditor/LineEditor.cpp b/lib/LineEditor/LineEditor.cpp index a50ccc388f1..533a928b2df 100644 --- a/lib/LineEditor/LineEditor.cpp +++ b/lib/LineEditor/LineEditor.cpp @@ -12,7 +12,9 @@ #include "llvm/Config/config.h" #include "llvm/Support/Path.h" #include "llvm/Support/raw_ostream.h" -#include <stdio.h> +#include <algorithm> +#include <cassert> +#include <cstdio> #ifdef HAVE_LIBEDIT #include <histedit.h> #endif @@ -106,7 +108,9 @@ struct LineEditor::InternalData { FILE *Out; }; -static const char *ElGetPromptFn(EditLine *EL) { +namespace { + +const char *ElGetPromptFn(EditLine *EL) { LineEditor::InternalData *Data; if (el_get(EL, EL_CLIENTDATA, &Data) == 0) return Data->LE->getPrompt().c_str(); @@ -117,7 +121,7 @@ static const char *ElGetPromptFn(EditLine *EL) { // // This function is really horrible. But since the alternative is to get into // the line editor business, here we are. -static unsigned char ElCompletionFn(EditLine *EL, int ch) { +unsigned char ElCompletionFn(EditLine *EL, int ch) { LineEditor::InternalData *Data; if (el_get(EL, EL_CLIENTDATA, &Data) == 0) { if (!Data->ContinuationOutput.empty()) { @@ -190,6 +194,8 @@ static unsigned char ElCompletionFn(EditLine *EL, int ch) { return CC_ERROR; } +} // end anonymous namespace + LineEditor::LineEditor(StringRef ProgName, StringRef HistoryPath, FILE *In, FILE *Out, FILE *Err) : Prompt((ProgName + "> ").str()), HistoryPath(HistoryPath), @@ -269,7 +275,7 @@ Optional<std::string> LineEditor::readLine() const { return std::string(Line, LineLen); } -#else +#else // HAVE_LIBEDIT // Simple fgets-based implementation. @@ -316,4 +322,4 @@ Optional<std::string> LineEditor::readLine() const { return Line; } -#endif +#endif // HAVE_LIBEDIT |