| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium 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 // Architecture-neutral plug compatible replacements for strtol() friends. | 5 // Architecture-neutral plug compatible replacements for strtol() friends. |
| 6 // | 6 // |
| 7 // Long's have different lengths on ILP-32 and LP-64 platforms, and so overflow | 7 // Long's have different lengths on ILP-32 and LP-64 platforms, and so overflow |
| 8 // behavior across the two varies when strtol() and similar are used to parse | 8 // behavior across the two varies when strtol() and similar are used to parse |
| 9 // 32-bit integers. Similar problems exist with atoi(), because although it | 9 // 32-bit integers. Similar problems exist with atoi(), because although it |
| 10 // has an all-integer interface, it uses strtol() internally, and so suffers | 10 // has an all-integer interface, it uses strtol() internally, and so suffers |
| 11 // from the same narrowing problems on assignments to int. | 11 // from the same narrowing problems on assignments to int. |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 // Convenience versions of the above that take a string argument. | 84 // Convenience versions of the above that take a string argument. |
| 85 inline int32 atoi32(const string &s) { | 85 inline int32 atoi32(const string &s) { |
| 86 return atoi32(s.c_str()); | 86 return atoi32(s.c_str()); |
| 87 } | 87 } |
| 88 | 88 |
| 89 inline int64 atoi64(const string &s) { | 89 inline int64 atoi64(const string &s) { |
| 90 return atoi64(s.c_str()); | 90 return atoi64(s.c_str()); |
| 91 } | 91 } |
| 92 | 92 |
| 93 #endif // BASE_STRTOINT_H_ | 93 #endif // BASE_STRTOINT_H_ |
| OLD | NEW |