]> git.ozlabs.org Git - ccan/blobdiff - ccan/idtree/idtree.c
sha256: Mark parameters as potentially unused
[ccan] / ccan / idtree / idtree.c
index e8873926a79c07a21b7b843f06b3b4cfaa7078c9..6e75450e67e85af287a9967cd7e88af66e147a5b 100644 (file)
@@ -100,7 +100,8 @@ static int sub_alloc(struct idtree *idp, const void *ptr, int *starting_id)
        int n, m, sh;
        struct idtree_layer *p, *pn;
        struct idtree_layer *pa[MAX_LEVEL+1];
-       unsigned int l, id, oid;
+       unsigned int l;
+       int id, oid;
        uint32_t bm;
 
        memset(pa, 0, sizeof(pa));
@@ -134,7 +135,7 @@ restart:
                         */
                        sh = IDTREE_BITS * (l + 1);
                        if (oid >> sh == id >> sh)
-                       continue;
+                               continue;
                        else
                                goto restart;
                }
@@ -277,7 +278,7 @@ void *idtree_lookup(const struct idtree *idp, int id)
         * present.  If so, tain't one of ours!
         */
        if (n + IDTREE_BITS < 31 &&
-           (id & ~(~0 << MAX_ID_SHIFT)) >> (n + IDTREE_BITS))
+           (id & ~(~0U << MAX_ID_SHIFT)) >> (n + IDTREE_BITS))
             return NULL;
 
        /* Mask off upper bits we don't use for the search. */