]> Savannah Git Hosting - gnulib.git/commitdiff
Fix comments.
authorBruno Haible <bruno@clisp.org>
Sat, 8 Dec 2018 14:25:51 +0000 (15:25 +0100)
committerBruno Haible <bruno@clisp.org>
Sat, 8 Dec 2018 19:42:44 +0000 (20:42 +0100)
* lib/gl_list.h (gl_list_free): Clarify what it does.
* lib/gl_oset.h (gl_oset_free): Likewise.
* lib/gl_set.h (gl_set_free): Likewise.
* lib/gl_anytree_oset.h (gl_tree_search_atleast): Fix typo in comment.
* lib/gl_array_oset.c (gl_array_search_atleast): Likewise.
* lib/gl_anyavltree_list1.h (MAXHEIGHT): Likewise.
* lib/gl_avltree_oset.c (MAXHEIGHT): Likewise.

ChangeLog
lib/gl_anyavltree_list1.h
lib/gl_anytree_oset.h
lib/gl_array_oset.c
lib/gl_avltree_oset.c
lib/gl_list.h
lib/gl_oset.h
lib/gl_set.h

index fd31719896c4c3ba674b1895940721a053bc187f..70e269d88494d4852e811c53ead5f45e4bae932b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2018-12-08  Bruno Haible  <bruno@clisp.org>
+
+       Fix comments.
+       * lib/gl_list.h (gl_list_free): Clarify what it does.
+       * lib/gl_oset.h (gl_oset_free): Likewise.
+       * lib/gl_set.h (gl_set_free): Likewise.
+       * lib/gl_anytree_oset.h (gl_tree_search_atleast): Fix typo in comment.
+       * lib/gl_array_oset.c (gl_array_search_atleast): Likewise.
+       * lib/gl_anyavltree_list1.h (MAXHEIGHT): Likewise.
+       * lib/gl_avltree_oset.c (MAXHEIGHT): Likewise.
+
 2018-12-03  Bruno Haible  <bruno@clisp.org>
 
        hash-set: Add tests.
index a65b4a027afbf70016645089420552d15c587d54..d5a491b63b5f4c8959d981df08171795eb2b7f7c 100644 (file)
@@ -62,9 +62,9 @@ struct gl_list_impl
   struct gl_list_node_impl *root;   /* root node or NULL */
 };
 
-/* An AVL tree of height h has at least F_(h+2) [Fibonacci number] and at most
-   2^h - 1 elements.  So, h <= 84 (because a tree of height h >= 85 would have
-   at least F_87 elements, and because even on 64-bit machines,
-     sizeof (gl_list_node_impl) * F_87 > 2^64
+/* An AVL tree of height h has at least F_(h+2) - 1 [Fibonacci number] and at
+   most 2^h - 1 elements.  So, h <= 84 (because a tree of height h >= 85 would
+   have at least F_87 - 1 elements, and because even on 64-bit machines,
+     sizeof (gl_list_node_impl) * (F_87 - 1) > 2^64
    this would exceed the address space of the machine.  */
 #define MAXHEIGHT 83
index ee71f5e0a349cda5b1fc386f99700e663c93a9b1..8adf645c3f93add5ec54f46807f500ac68245294 100644 (file)
@@ -91,7 +91,7 @@ gl_tree_search_atleast (gl_oset_t set,
         node = node->right;
       else
         {
-          /* We have an element >= VALUE.  But we need the leftmost such
+          /* We have an element >= THRESHOLD.  But we need the leftmost such
              element.  */
           gl_oset_node_t found = node;
           node = node->left;
index bd4f8d3874b2326306f16df4be975637982772e6..f8b2bc1681d175c79ecf3ec71bf65fa822f08d33 100644 (file)
@@ -136,7 +136,7 @@ gl_array_search_atleast (gl_oset_t set,
                  minimal such index.  */
               high = mid;
               /* At each loop iteration, low <= high and
-                   compar (list->elements[high], value) >= 0,
+                   compar (set->elements[high], threshold) >= 0,
                  and we know that the first occurrence of the element is at
                  low <= position <= high.  */
               while (low < high)
index 45aadcc6092eb3d030deac60c1590e02d9ff33c5..ead337c0e11f9e0f251730c1691702fc995a455a 100644 (file)
@@ -59,10 +59,10 @@ struct gl_oset_impl
   size_t count;                     /* number of nodes */
 };
 
-/* An AVL tree of height h has at least F_(h+2) [Fibonacci number] and at most
-   2^h - 1 elements.  So, h <= 84 (because a tree of height h >= 85 would have
-   at least F_87 elements, and because even on 64-bit machines,
-     sizeof (gl_oset_node_impl) * F_87 > 2^64
+/* An AVL tree of height h has at least F_(h+2) - 1 [Fibonacci number] and at
+   most 2^h - 1 elements.  So, h <= 84 (because a tree of height h >= 85 would
+   have at least F_87 - 1 elements, and because even on 64-bit machines,
+     sizeof (gl_oset_node_impl) * (F_87 - 1) > 2^64
    this would exceed the address space of the machine.  */
 #define MAXHEIGHT 83
 
index f050fe6d73e064188cde23413989148a5fd3c061..66d1ad904ae6de141306bf1c92cd93bc464fa65c 100644 (file)
@@ -333,7 +333,9 @@ extern bool gl_list_remove_at (gl_list_t list, size_t position);
 extern bool gl_list_remove (gl_list_t list, const void *elt);
 
 /* Free an entire list.
-   (But this call does not free the elements of the list.)  */
+   (But this call does not free the elements of the list.  It only invokes
+   the DISPOSE_FN on each of the elements of the list, and only if the list
+   is not a sublist.)  */
 extern void gl_list_free (gl_list_t list);
 
 #endif /* End of inline and gl_xlist.h-defined functions.  */
index abe3eb4a61a2e689da76242635f123cea838a1cf..366a95b871244ec464a4a38e6cdf94a5da7f02aa 100644 (file)
@@ -144,7 +144,8 @@ extern int gl_oset_nx_add (gl_oset_t set, const void *elt)
 extern bool gl_oset_remove (gl_oset_t set, const void *elt);
 
 /* Free an entire ordered set.
-   (But this call does not free the elements of the set.)  */
+   (But this call does not free the elements of the set.  It only invokes
+   the DISPOSE_FN on each of the elements of the set.)  */
 extern void gl_oset_free (gl_oset_t set);
 
 #endif /* End of inline and gl_xoset.h-defined functions.  */
index bc615c3d8ec7453fed9fb8e2769f3a26c09a613a..b3578ba2e11e2d9c59e1d3b3b2c5b0c912c906ea 100644 (file)
@@ -136,7 +136,8 @@ extern int gl_set_nx_add (gl_set_t set, const void *elt)
 extern bool gl_set_remove (gl_set_t set, const void *elt);
 
 /* Free an entire set.
-   (But this call does not free the elements of the set.)  */
+   (But this call does not free the elements of the set.  It only invokes
+   the DISPOSE_FN on each of the elements of the set.)  */
 extern void gl_set_free (gl_set_t set);
 
 #endif /* End of inline and gl_xset.h-defined functions.  */