Print this page
rm code review


 720 
 721         for (i = 0; i < fi.ctc_argc; i++) {
 722                 if (ctf_type_name(fp, args[i], buf, sizeof (buf)) == NULL) {
 723                         warnx("failed to obtain type name for argument %u",
 724                             i, ctf_errmsg(ctf_errno(fp)));
 725                         ret = B_FALSE;
 726                         break;
 727                 }
 728 
 729                 if (strcmp(buf, argv[i]) != 0) {
 730                         warnx("argument %u has wrong type: found %s, "
 731                             "expected %s", i, buf, argv[i]);
 732                         ret = B_FALSE;
 733                         break;
 734                 }
 735         }
 736 
 737         free(args);
 738         return (ret);
 739 }

 740 boolean_t
 741 ctftest_check_size(const char *type, ctf_file_t *fp, size_t size)
 742 {
 743         ctf_id_t base;
 744 
 745         if ((base = ctftest_lookup_type(fp, type)) == CTF_ERR) {
 746                 warnx("Failed to look up type %s", type);
 747                 return (B_FALSE);
 748         }
 749 
 750         if (size != ctf_type_size(fp, base)) {
 751                 warnx("%s has bad size, expected %lu, found %lu",
 752                     type, size, ctf_type_size(fp, base));
 753                 return (B_FALSE);
 754         }
 755 
 756         return (B_TRUE);
 757 }
 758 
 759 typedef struct ctftest_duplicates {




 720 
 721         for (i = 0; i < fi.ctc_argc; i++) {
 722                 if (ctf_type_name(fp, args[i], buf, sizeof (buf)) == NULL) {
 723                         warnx("failed to obtain type name for argument %u",
 724                             i, ctf_errmsg(ctf_errno(fp)));
 725                         ret = B_FALSE;
 726                         break;
 727                 }
 728 
 729                 if (strcmp(buf, argv[i]) != 0) {
 730                         warnx("argument %u has wrong type: found %s, "
 731                             "expected %s", i, buf, argv[i]);
 732                         ret = B_FALSE;
 733                         break;
 734                 }
 735         }
 736 
 737         free(args);
 738         return (ret);
 739 }
 740 
 741 boolean_t
 742 ctftest_check_size(const char *type, ctf_file_t *fp, size_t size)
 743 {
 744         ctf_id_t base;
 745 
 746         if ((base = ctftest_lookup_type(fp, type)) == CTF_ERR) {
 747                 warnx("Failed to look up type %s", type);
 748                 return (B_FALSE);
 749         }
 750 
 751         if (size != ctf_type_size(fp, base)) {
 752                 warnx("%s has bad size, expected %lu, found %lu",
 753                     type, size, ctf_type_size(fp, base));
 754                 return (B_FALSE);
 755         }
 756 
 757         return (B_TRUE);
 758 }
 759 
 760 typedef struct ctftest_duplicates {