[llvm] r200610 - Silence GCC warnings.

Benjamin Kramer benny.kra at googlemail.com
Sat Feb 1 03:26:18 PST 2014


Author: d0k
Date: Sat Feb  1 05:26:18 2014
New Revision: 200610

URL: http://llvm.org/viewvc/llvm-project?rev=200610&view=rev
Log:
Silence GCC warnings.

Modified:
    llvm/trunk/lib/LineEditor/LineEditor.cpp

Modified: llvm/trunk/lib/LineEditor/LineEditor.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/LineEditor/LineEditor.cpp?rev=200610&r1=200609&r2=200610&view=diff
==============================================================================
--- llvm/trunk/lib/LineEditor/LineEditor.cpp (original)
+++ llvm/trunk/lib/LineEditor/LineEditor.cpp Sat Feb  1 05:26:18 2014
@@ -131,7 +131,7 @@ static unsigned char ElCompletionFn(Edit
       // Push a sequence of Ctrl-B characters to move the cursor back to its
       // original position.
       std::string Prevs(Data->PrevCount, '\02');
-      ::el_push(EL, (char *)Prevs.c_str());
+      ::el_push(EL, const_cast<char *>(Prevs.c_str()));
 
       Data->ContinuationOutput.clear();
 
@@ -158,7 +158,7 @@ static unsigned char ElCompletionFn(Edit
         // from here to cause libedit to move the cursor immediately. This will
         // break horribly if the user has rebound their keys, so for now we do
         // not permit user rebinding.
-        ::el_push(EL, (char *)"\05\t");
+        ::el_push(EL, const_cast<char *>("\05\t"));
 
         // This assembles the output for the continuation block above.
         raw_string_ostream OS(Data->ContinuationOutput);
@@ -186,9 +186,8 @@ static unsigned char ElCompletionFn(Edit
         return CC_REFRESH;
       }
     }
-  } else {
-    return CC_ERROR;
   }
+  return CC_ERROR;
 }
 
 LineEditor::LineEditor(StringRef ProgName, StringRef HistoryPath, FILE *In,





More information about the llvm-commits mailing list