libctf, testsuite: adjust for real return type of ctf_member_count
authorNick Alcock <nick.alcock@oracle.com>
Tue, 5 Jan 2021 19:34:56 +0000 (19:34 +0000)
committerNick Alcock <nick.alcock@oracle.com>
Tue, 5 Jan 2021 19:34:56 +0000 (19:34 +0000)
This returns an int, not a long int or an ssize_t (as one test was
inconsistently assuming).

libctf/ChangeLog
2021-01-05  Nick Alcock  <nick.alcock@oracle.com>

* testsuite/libctf-lookup/struct-iteration.c (main):
ctf_member_count returns an int.

libctf/ChangeLog
libctf/testsuite/libctf-lookup/struct-iteration.c

index 0f5e96a2c839c437113eb9c21935eb5850d188a5..dfac7be183324aa89bc1ebc461f0c541177d445a 100644 (file)
@@ -1,3 +1,8 @@
+2021-01-05  Nick Alcock  <nick.alcock@oracle.com>
+
+       * testsuite/libctf-lookup/struct-iteration.c (main):
+       ctf_member_count returns an int.
+
 2021-01-05  Nick Alcock  <nick.alcock@oracle.com>
 
        * Makefile.am (BASEDIR): New.
index 03750604ecfd963cbf0b87dce4ea673e7edb6f59..080edfadca40510b262baf9cd9aac0f731992c1e 100644 (file)
@@ -26,7 +26,7 @@ main (int argc, char *argv[])
   const char *name;
   ctf_id_t membtype;
   ssize_t offset;
-  ssize_t icount = 0;
+  int icount = 0;
   int err;
 
   if (argc != 2)
@@ -69,8 +69,8 @@ main (int argc, char *argv[])
     goto nerr;
 
   if (icount != ctf_member_count (fp, type))
-    printf ("member counts differ: %li by direct iteration, "
-           "%li by ctf_member_count\n", icount, ctf_member_count (fp, type));
+    printf ("member counts differ: %i by direct iteration, "
+           "%i by ctf_member_count\n", icount, ctf_member_count (fp, type));
 
   ctf_dict_close (fp);
   ctf_close (ctf);