mirror of
				https://gitlab.gnome.org/GNOME/glib.git
				synced 2025-10-31 08:22:16 +01:00 
			
		
		
		
	Merge branch 'gboolean-docs' into 'master'
docs: Add note on how to check a gboolean condition See merge request GNOME/glib!571
This commit is contained in:
		| @@ -64,6 +64,15 @@ | |||||||
|  * A standard boolean type. |  * A standard boolean type. | ||||||
|  * Variables of this type should only contain the value |  * Variables of this type should only contain the value | ||||||
|  * %TRUE or %FALSE. |  * %TRUE or %FALSE. | ||||||
|  |  * | ||||||
|  |  * Never directly compare the contents of a #gboolean variable with the values | ||||||
|  |  * %TRUE or %FALSE. Use `if (condition)` to check a #gboolean is "true", instead | ||||||
|  |  * of `if (condition == TRUE)`. Likewise use `if (!condition)` to check a | ||||||
|  |  * #gboolean is "false". | ||||||
|  |  * | ||||||
|  |  * There is no validation when assigning to a #gboolean variable and so it could | ||||||
|  |  * contain any value represented by a #gint. This is why the use of `if | ||||||
|  |  * (condition)` is recommended. All non-zero values in C evaluate to "true". | ||||||
|  */ |  */ | ||||||
|  |  | ||||||
| /** | /** | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user