| 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 | 5 |
| 6 /** | 6 /** |
| 7 * This file defines the <code>PP_Bool</code> enumeration for use in PPAPI C | 7 * This file defines the <code>PP_Bool</code> enumeration for use in PPAPI C |
| 8 * headers. | 8 * headers. |
| 9 */ | 9 */ |
| 10 | 10 |
| 11 /** | 11 /** |
| 12 * The <code>PP_Bool</code> enum is a boolean value for use in PPAPI C headers. | 12 * The <code>PP_Bool</code> enum is a boolean value for use in PPAPI C headers. |
| 13 * The standard bool type is not available to pre-C99 compilers, and is not | 13 * The standard bool type is not available to pre-C99 compilers, and is not |
| 14 * guaranteed to be compatible between C and C++, whereas the PPAPI C headers | 14 * guaranteed to be compatible between C and C++, whereas the PPAPI C headers |
| 15 * can be included from C or C++ code. | 15 * can be included from C or C++ code. |
| 16 */ | 16 */ |
| 17 [assert_size(4)] enum PP_Bool { | 17 [assert_size(4)] enum PP_Bool { |
| 18 PP_FALSE = 0, | 18 PP_FALSE = 0, |
| 19 PP_TRUE = 1 | 19 PP_TRUE = 1 |
| 20 }; | 20 }; |
| 21 | 21 |
| 22 #inline cc | 22 #inline cc |
| 23 /** | 23 /** |
| 24 * Converts a C++ "bool" type to a PP_Bool. | 24 * Converts a C++ "bool" type to a PP_Bool. |
| 25 * |
| 26 * @param[in] b A C++ "bool" type. |
| 27 * |
| 28 * @return A PP_Bool. |
| 25 */ | 29 */ |
| 26 inline PP_Bool PP_FromBool(bool b) { | 30 inline PP_Bool PP_FromBool(bool b) { |
| 27 return b ? PP_TRUE : PP_FALSE; | 31 return b ? PP_TRUE : PP_FALSE; |
| 28 } | 32 } |
| 29 | 33 |
| 30 /** | 34 /** |
| 31 * Converts a PP_Bool to a C++ "bool" type. | 35 * Converts a PP_Bool to a C++ "bool" type. |
| 36 * |
| 37 * @param[in] b A PP_Bool. |
| 38 * |
| 39 * @return A C++ "bool" type. |
| 32 */ | 40 */ |
| 33 inline bool PP_ToBool(PP_Bool b) { | 41 inline bool PP_ToBool(PP_Bool b) { |
| 34 return (b != PP_FALSE); | 42 return (b != PP_FALSE); |
| 35 } | 43 } |
| 36 #endinl | 44 #endinl |
| 37 | 45 |
| OLD | NEW |