]> Savannah Git Hosting - gnulib.git/commitdiff
array-omap, avltree-omap, rbtree-omap: Tweak style.
authorBruno Haible <bruno@clisp.org>
Wed, 12 Dec 2018 00:03:13 +0000 (01:03 +0100)
committerBruno Haible <bruno@clisp.org>
Wed, 12 Dec 2018 00:09:42 +0000 (01:09 +0100)
* lib/gl_anytree_omap.h (gl_tree_nx_getput): Return 1 or 0, not true or
false.
* lib/gl_array_omap.c (gl_array_nx_getput): Likewise.

ChangeLog
lib/gl_anytree_omap.h
lib/gl_array_omap.c

index 71acad6611866fafe088bcc6c7ddb1b6f084c91f..2b95de209dd782ba060947aa9805a0af6d17f768 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2018-12-11  Bruno Haible  <bruno@clisp.org>
 
+       array-omap, avltree-omap, rbtree-omap: Tweak style.
+       * lib/gl_anytree_omap.h (gl_tree_nx_getput): Return 1 or 0, not true or
+       false.
+       * lib/gl_array_omap.c (gl_array_nx_getput): Likewise.
+
        rbtree-omap: Add tests.
        * tests/test-rbtree_omap.c: New file.
        * modules/rbtree-omap-tests: New file.
index 0b437123695617b7a85c9aac22a13793031c77f6..0fd51928198e31ce7f5c9a479a09801795f96df0 100644 (file)
@@ -129,7 +129,7 @@ gl_tree_nx_getput (gl_omap_t map, const void *key, const void *value,
     {
       if (gl_tree_nx_add_first (map, key, value) == NULL)
         return -1;
-      return true;
+      return 1;
     }
 
   compar = map->base.compar_fn;
@@ -147,7 +147,7 @@ gl_tree_nx_getput (gl_omap_t map, const void *key, const void *value,
             {
               if (gl_tree_nx_add_after (map, node, key, value) == NULL)
                 return -1;
-              return true;
+              return 1;
             }
           node = node->right;
         }
@@ -157,7 +157,7 @@ gl_tree_nx_getput (gl_omap_t map, const void *key, const void *value,
             {
               if (gl_tree_nx_add_before (map, node, key, value) == NULL)
                 return -1;
-              return true;
+              return 1;
             }
           node = node->left;
         }
@@ -165,7 +165,7 @@ gl_tree_nx_getput (gl_omap_t map, const void *key, const void *value,
         {
           *oldvaluep = node->value;
           node->value = value;
-          return false;
+          return 0;
         }
     }
 }
index d643fbac142a35d3bb497b41c9dbf13e2b21fd89..a2b21bc3ad86c768f60c7bc045173f9bb8a494f3 100644 (file)
@@ -271,7 +271,7 @@ gl_array_nx_getput (gl_omap_t map, const void *key, const void *value,
             {
               *oldvaluep = map->pairs[mid].value;
               map->pairs[mid].value = value;
-              return false;
+              return 0;
             }
         }
       while (low < high);