daniel@transgaming.com | 91ed149 | 2010-10-29 03:11:43 +0000 | [diff] [blame] | 1 | // |
| 2 | // Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved. |
| 3 | // Use of this source code is governed by a BSD-style license that can be |
| 4 | // found in the LICENSE file. |
| 5 | // |
| 6 | |
| 7 | #ifndef COMPILER_UTIL_H |
| 8 | #define COMPILER_UTIL_H |
| 9 | |
Zhenyao Mo | f1d723c | 2013-09-23 14:57:07 -0400 | [diff] [blame] | 10 | // atof_clamp is like atof but |
| 11 | // 1. it forces C locale, i.e. forcing '.' as decimal point. |
| 12 | // 2. it clamps the value to -FLT_MAX or FLT_MAX if overflow happens. |
| 13 | // Return false if overflow happens. |
| 14 | extern bool atof_clamp(const char *str, float *value); |
daniel@transgaming.com | 91ed149 | 2010-10-29 03:11:43 +0000 | [diff] [blame] | 15 | |
Zhenyao Mo | f1d723c | 2013-09-23 14:57:07 -0400 | [diff] [blame] | 16 | // If overflow happens, clamp the value to INT_MIN or INT_MAX. |
| 17 | // Return false if overflow happens. |
| 18 | extern bool atoi_clamp(const char *str, int *value); |
daniel@transgaming.com | 91ed149 | 2010-10-29 03:11:43 +0000 | [diff] [blame] | 19 | |
| 20 | #endif // COMPILER_UTIL_H |