| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 | 5 |
| 6 // Defined when linking against shared lib on Windows. | 6 // Defined when linking against shared lib on Windows. |
| 7 #if defined(USING_V8_SHARED) && !defined(V8_SHARED) | 7 #if defined(USING_V8_SHARED) && !defined(V8_SHARED) |
| 8 #define V8_SHARED | 8 #define V8_SHARED |
| 9 #endif | 9 #endif |
| 10 | 10 |
| (...skipping 1559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1570 delete[] snapshot_.data; | 1570 delete[] snapshot_.data; |
| 1571 } | 1571 } |
| 1572 | 1572 |
| 1573 private: | 1573 private: |
| 1574 static char* RelativePath(char** buffer, const char* exec_path, | 1574 static char* RelativePath(char** buffer, const char* exec_path, |
| 1575 const char* name) { | 1575 const char* name) { |
| 1576 DCHECK(exec_path); | 1576 DCHECK(exec_path); |
| 1577 const char* last_slash = strrchr(exec_path, '/'); | 1577 const char* last_slash = strrchr(exec_path, '/'); |
| 1578 if (last_slash) { | 1578 if (last_slash) { |
| 1579 int after_slash = last_slash - exec_path + 1; | 1579 int after_slash = last_slash - exec_path + 1; |
| 1580 int name_length = strlen(name); | 1580 int name_length = static_cast<int>(strlen(name)); |
| 1581 *buffer = | 1581 *buffer = |
| 1582 reinterpret_cast<char*>(calloc(after_slash + name_length + 1, 1)); | 1582 reinterpret_cast<char*>(calloc(after_slash + name_length + 1, 1)); |
| 1583 strncpy(*buffer, exec_path, after_slash); | 1583 strncpy(*buffer, exec_path, after_slash); |
| 1584 strncat(*buffer, name, name_length); | 1584 strncat(*buffer, name, name_length); |
| 1585 } else { | 1585 } else { |
| 1586 *buffer = strdup(name); | 1586 *buffer = strdup(name); |
| 1587 } | 1587 } |
| 1588 return *buffer; | 1588 return *buffer; |
| 1589 } | 1589 } |
| 1590 | 1590 |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1750 } | 1750 } |
| 1751 | 1751 |
| 1752 } // namespace v8 | 1752 } // namespace v8 |
| 1753 | 1753 |
| 1754 | 1754 |
| 1755 #ifndef GOOGLE3 | 1755 #ifndef GOOGLE3 |
| 1756 int main(int argc, char* argv[]) { | 1756 int main(int argc, char* argv[]) { |
| 1757 return v8::Shell::Main(argc, argv); | 1757 return v8::Shell::Main(argc, argv); |
| 1758 } | 1758 } |
| 1759 #endif | 1759 #endif |
| OLD | NEW |