OLD | NEW |
1 /* Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 /* Copyright (c) 2011 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 #ifndef PPAPI_C_PP_BOOL_H_ | 5 #ifndef PPAPI_C_PP_BOOL_H_ |
6 #define PPAPI_C_PP_BOOL_H_ | 6 #define PPAPI_C_PP_BOOL_H_ |
7 | 7 |
8 #include "ppapi/c/pp_macros.h" | 8 #include "ppapi/c/pp_macros.h" |
9 | 9 |
10 /** | 10 /** |
(...skipping 19 matching lines...) Expand all Loading... |
30 PP_TRUE = 1 | 30 PP_TRUE = 1 |
31 } PP_Bool; | 31 } PP_Bool; |
32 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_Bool, 4); | 32 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_Bool, 4); |
33 /** | 33 /** |
34 * @} | 34 * @} |
35 */ | 35 */ |
36 | 36 |
37 #ifdef __cplusplus | 37 #ifdef __cplusplus |
38 /** | 38 /** |
39 * Converts a C++ "bool" type to a PP_Bool. | 39 * Converts a C++ "bool" type to a PP_Bool. |
| 40 * |
| 41 * @param[in] b A C++ "bool" type. |
| 42 * |
| 43 * @return A PP_Bool. |
40 */ | 44 */ |
41 inline PP_Bool PP_FromBool(bool b) { | 45 inline PP_Bool PP_FromBool(bool b) { |
42 return b ? PP_TRUE : PP_FALSE; | 46 return b ? PP_TRUE : PP_FALSE; |
43 } | 47 } |
44 | 48 |
45 /** | 49 /** |
46 * Converts a PP_Bool to a C++ "bool" type. | 50 * Converts a PP_Bool to a C++ "bool" type. |
| 51 * |
| 52 * @param[in] b A PP_Bool. |
| 53 * |
| 54 * @return A C++ "bool" type. |
47 */ | 55 */ |
48 inline bool PP_ToBool(PP_Bool b) { | 56 inline bool PP_ToBool(PP_Bool b) { |
49 return (b != PP_FALSE); | 57 return (b != PP_FALSE); |
50 } | 58 } |
51 #endif // __cplusplus | 59 #endif // __cplusplus |
52 | 60 |
53 #endif /* PPAPI_C_PP_BOOL_H_ */ | 61 #endif /* PPAPI_C_PP_BOOL_H_ */ |
54 | 62 |
OLD | NEW |