Making lint happy.
authorantonm@chromium.org <antonm@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 10 Feb 2010 11:48:53 +0000 (11:48 +0000)
committerantonm@chromium.org <antonm@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 10 Feb 2010 11:48:53 +0000 (11:48 +0000)
Review URL: http://codereview.chromium.org/593014

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3827 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

samples/lineprocessor.cc
src/d8-readline.cc
test/cctest/test-debug.cc

index 505dabf9459b7d5d471f870ae55ce7f70ee86304..61517d36e54d3550a5023e1f41e0f01776f8fdff 100644 (file)
@@ -152,7 +152,7 @@ int RunMain(int argc, char* argv[]) {
     } else if (strcmp(str, "--main-cycle-in-js") == 0) {
       cycle_type = CycleInJs;
     } else if (strcmp(str, "-p") == 0 && i + 1 < argc) {
-      port_number = atoi(argv[i + 1]);
+      port_number = atoi(argv[i + 1]);  // NOLINT
       i++;
     } else if (strncmp(str, "--", 2) == 0) {
       printf("Warning: unknown flag %s.\nTry --help for options\n", str);
index 34b7b60df2aff1a1a7a7264e859525f23479389e..67fc9eff7e528fd66dba1e724f2e42909dd76668 100644 (file)
@@ -27,8 +27,8 @@
 
 
 #include <cstdio>  // NOLINT
-#include <readline/readline.h>
-#include <readline/history.h>
+#include <readline/readline.h> // NOLINT
+#include <readline/history.h> // NOLINT
 
 
 #include "d8.h"
index 92e18e06857d7db356d80436e75163872c81504f..23d1a576fa8adbe2c798d3094178bcef14b05632 100644 (file)
@@ -3884,6 +3884,11 @@ bool IsEvaluateResponseMessage(char* message) {
 }
 
 
+static int StringToInt(const char* s) {
+  return atoi(s);  // NOLINT
+}
+
+
 // We match parts of the message to get evaluate result int value.
 int GetEvaluateIntResult(char *message) {
   const char* value = "\"value\":";
@@ -3892,7 +3897,7 @@ int GetEvaluateIntResult(char *message) {
     return -1;
   }
   int res = -1;
-  res = atoi(pos + strlen(value));
+  res = StringToInt(pos + strlen(value));
   return res;
 }
 
@@ -3905,7 +3910,7 @@ int GetBreakpointIdFromBreakEventMessage(char *message) {
     return -1;
   }
   int res = -1;
-  res = atoi(pos + strlen(breakpoints));
+  res = StringToInt(pos + strlen(breakpoints));
   return res;
 }
 
@@ -3918,11 +3923,7 @@ int GetTotalFramesInt(char *message) {
     return -1;
   }
   pos += strlen(prefix);
-  char* pos_end = pos;
-  int res = static_cast<int>(strtol(pos, &pos_end, 10));
-  if (pos_end == pos) {
-    return -1;
-  }
+  int res = StringToInt(pos);
   return res;
 }