Fix Clang-tidy modernize-use-nullptr warnings in examples and include directories...
[oota-llvm.git] / examples / Kaleidoscope / Chapter3 / toy.cpp
index 328189c118465e66480ee303e74fa8d16454eeca..05697ea70a490e9e6a72635d24a65e22727fda66 100644 (file)
@@ -8,6 +8,7 @@
 #include <map>
 #include <string>
 #include <vector>
+
 using namespace llvm;
 
 //===----------------------------------------------------------------------===//
@@ -58,7 +59,7 @@ static int gettok() {
       LastChar = getchar();
     } while (isdigit(LastChar) || LastChar == '.');
 
-    NumVal = strtod(NumStr.c_str(), 0);
+    NumVal = strtod(NumStr.c_str(), nullptr);
     return tok_number;
   }
 
@@ -193,6 +194,7 @@ std::unique_ptr<ExprAST> Error(const char *Str) {
   fprintf(stderr, "Error: %s\n", Str);
   return nullptr;
 }
+
 std::unique_ptr<PrototypeAST> ErrorP(const char *Str) {
   Error(Str);
   return nullptr;