]> 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>
Fri, 25 Apr 2025 17:07:41 +0000 (18:07 +0100)
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 8b5c379bcb3b2e3b78f93c0f394fda76d3da7c8c..a170b6c8ef84f6769f255b0ab9696e456e44690e 100644 (file)
@@ -544,7 +544,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;
     }
@@ -555,10 +555,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))
     {
@@ -566,7 +566,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;
@@ -650,7 +650,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;
     }
@@ -661,7 +661,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;
@@ -847,7 +847,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;
     }
@@ -858,10 +858,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))
     {
@@ -869,7 +869,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 6a6ed8eda7ad0b6ee3e3455df627058051562983..9be356377432a831bf55791559dc341ff7fbfb14 100644 (file)
@@ -542,7 +542,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;