[glib: 1/2] Fix up g_bytes_compare() documentation



commit a81b925d98be04b6b63a987f12ee5f35fcc6f194
Author: Sebastian Dröge <sebastian centricular com>
Date:   Mon Aug 6 11:30:29 2018 +0300

    Fix up g_bytes_compare() documentation
    
    It was declaring the opposite of what the function was actually doing,
    and what every other comparison function is doing.

 glib/gbytes.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/glib/gbytes.c b/glib/gbytes.c
index 74f8148f6..7b72886e5 100644
--- a/glib/gbytes.c
+++ b/glib/gbytes.c
@@ -403,10 +403,18 @@ g_bytes_hash (gconstpointer bytes)
  *
  * Compares the two #GBytes values.
  *
- * This function can be used to sort GBytes instances in lexographical order.
+ * This function can be used to sort GBytes instances in lexicographical order.
+ *
+ * If @bytes1 and @bytes2 have different length but the shorter one is a
+ * prefix of the longer one then the shorter one is considered to be less than
+ * the longer one. Otherwise the first byte where both differ is used for
+ * comparison. If @bytes1 has a smaller value at that position it is
+ * considered less, otherwise greater than @bytes2.
+ *
+ * Returns: a negative value if @bytes1 is less than @bytes2, a positive value
+ *          if @bytes1 is greater than @bytes2, and zero if @bytes1 is equal to
+ *          @bytes2
  *
- * Returns: a negative value if bytes2 is lesser, a positive value if bytes2 is
- *          greater, and zero if bytes2 is equal to bytes1
  *
  * Since: 2.32
  */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]