mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-25 11:42:10 +01:00
GTree: Annotate the real return value type of g_tree_nnodes ()
g_tree_nnodes () is returning a signed integer type (gint), however the tree node counter value type is really an unsigned integer (guint). This means that the returned size will be negative if the container holds more than G_MAXINT elements. Add a note to this function that its return value can be cast back to guint in order to support its full range of values. This will also make sure that we take this into account in future Glib versions. Signed-off-by: Maciej S. Szmigiero <maciej.szmigiero@oracle.com>
This commit is contained in:
parent
76f7961a7b
commit
1237525da2
@ -1454,6 +1454,11 @@ g_tree_height (GTree *tree)
|
||||
* Gets the number of nodes in a #GTree.
|
||||
*
|
||||
* Returns: the number of nodes in @tree
|
||||
*
|
||||
* The node counter value type is really a #guint,
|
||||
* but it is returned as a #gint due to backward
|
||||
* compatibility issues (can be cast back to #guint to
|
||||
* support its full range of values).
|
||||
*/
|
||||
gint
|
||||
g_tree_nnodes (GTree *tree)
|
||||
|
Loading…
x
Reference in New Issue
Block a user