]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
libctf: ctf_next_t.ctn_size: make a size_t
authorNick Alcock <nick.alcock@oracle.com>
Thu, 24 Apr 2025 13:04:39 +0000 (14:04 +0100)
committerNick Alcock <nick.alcock@oracle.com>
Thu, 30 Oct 2025 14:27:43 +0000 (14:27 +0000)
Literally every single user would rather this is a size_t, rather
than an ssize_t.  Change it.

libctf/ctf-hash.c
libctf/ctf-impl.h

index 17eb565a126ba09662fdcd98d908f59665ed9d35..a599607e3d2b59fa740da503f06f652f18c5c203 100644 (file)
@@ -545,7 +545,7 @@ ctf_dynhash_next (ctf_dynhash_t *h, ctf_next_t **it, void **key, void **value)
       i->u.ctn_hash_slot = h->htab->entries;
       i->cu.ctn_h = h;
       i->ctn_n = 0;
-      i->ctn_size = (ssize_t) size;
+      i->ctn_size = size;
       i->ctn_iter_fun = (void (*) (void)) ctf_dynhash_next;
       *it = i;
     }
@@ -556,10 +556,10 @@ ctf_dynhash_next (ctf_dynhash_t *h, ctf_next_t **it, void **key, void **value)
   if (h != i->cu.ctn_h)
     return ECTF_NEXT_WRONGFP;
 
-  if ((ssize_t) i->ctn_n == i->ctn_size)
+  if (i->ctn_n == i->ctn_size)
     goto hash_end;
 
-  while ((ssize_t) i->ctn_n < i->ctn_size
+  while (i->ctn_n < i->ctn_size
         && (*i->u.ctn_hash_slot == HTAB_EMPTY_ENTRY
             || *i->u.ctn_hash_slot == HTAB_DELETED_ENTRY))
     {
@@ -567,7 +567,7 @@ ctf_dynhash_next (ctf_dynhash_t *h, ctf_next_t **it, void **key, void **value)
       i->ctn_n++;
     }
 
-  if ((ssize_t) i->ctn_n == i->ctn_size)
+  if (i->ctn_n == i->ctn_size)
     goto hash_end;
 
   slot = *i->u.ctn_hash_slot;
@@ -675,7 +675,7 @@ ctf_dynhash_next_sorted (ctf_dynhash_t *h, ctf_next_t **it, void **key,
                       (int (*) (const void *, const void *, void *)) sort_fun,
                       sort_arg);
       i->ctn_n = 0;
-      i->ctn_size = (ssize_t) els;
+      i->ctn_size = els;
       i->ctn_iter_fun = (void (*) (void)) ctf_dynhash_next_sorted;
       *it = i;
     }
@@ -686,7 +686,7 @@ ctf_dynhash_next_sorted (ctf_dynhash_t *h, ctf_next_t **it, void **key,
   if (h != i->cu.ctn_h)
     return ECTF_NEXT_WRONGFP;
 
-  if ((ssize_t) i->ctn_n == i->ctn_size)
+  if (i->ctn_n == i->ctn_size)
     {
       ctf_next_destroy (i);
       *it = NULL;
@@ -872,7 +872,7 @@ ctf_dynset_next (ctf_dynset_t *hp, ctf_next_t **it, void **key)
       i->u.ctn_hash_slot = htab->entries;
       i->cu.ctn_s = hp;
       i->ctn_n = 0;
-      i->ctn_size = (ssize_t) size;
+      i->ctn_size = size;
       i->ctn_iter_fun = (void (*) (void)) ctf_dynset_next;
       *it = i;
     }
@@ -883,10 +883,10 @@ ctf_dynset_next (ctf_dynset_t *hp, ctf_next_t **it, void **key)
   if (hp != i->cu.ctn_s)
     return ECTF_NEXT_WRONGFP;
 
-  if ((ssize_t) i->ctn_n == i->ctn_size)
+  if (i->ctn_n == i->ctn_size)
     goto set_end;
 
-  while ((ssize_t) i->ctn_n < i->ctn_size
+  while (i->ctn_n < i->ctn_size
         && (*i->u.ctn_hash_slot == HTAB_EMPTY_ENTRY
             || *i->u.ctn_hash_slot == HTAB_DELETED_ENTRY))
     {
@@ -894,7 +894,7 @@ ctf_dynset_next (ctf_dynset_t *hp, ctf_next_t **it, void **key)
       i->ctn_n++;
     }
 
-  if ((ssize_t) i->ctn_n == i->ctn_size)
+  if (i->ctn_n == i->ctn_size)
     goto set_end;
 
   slot = *i->u.ctn_hash_slot;
index 808e70e21796753511e7e10425c171d552aedc55..935b4e22507860db553412792f4ef9e6ca725b1c 100644 (file)
@@ -551,7 +551,7 @@ struct ctf_next
 {
   void (*ctn_iter_fun) (void);
   ctf_id_t ctn_type;
-  ssize_t ctn_size;
+  size_t ctn_size;
   ssize_t ctn_increment;
   const ctf_type_t *ctn_tp;
   uint32_t ctn_n;