X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=src%2Fdata%2Fcaseproto.c;fp=src%2Fdata%2Fcaseproto.c;h=c47b6ae98221930d7a201c946704c1a78cb33f75;hb=6953fd7f0ef58595a14548c4262f0e4c65b8939a;hp=f390c3f87cfd113ad1262504da30867181c60c8b;hpb=b7968b37a3825943816f9c262d4b2979397f6a83;p=pspp diff --git a/src/data/caseproto.c b/src/data/caseproto.c index f390c3f87c..c47b6ae982 100644 --- a/src/data/caseproto.c +++ b/src/data/caseproto.c @@ -207,9 +207,9 @@ caseproto_is_conformable (const struct caseproto *a, const struct caseproto *b) same as the N widths starting at B_START in B, false if any of the corresponding widths differ. */ bool -caseproto_equal (const struct caseproto *a, size_t a_start, - const struct caseproto *b, size_t b_start, - size_t n) +caseproto_range_equal (const struct caseproto *a, size_t a_start, + const struct caseproto *b, size_t b_start, + size_t n) { size_t i; @@ -221,6 +221,15 @@ caseproto_equal (const struct caseproto *a, size_t a_start, return true; } +/* Returns true if A and B have the same widths, false otherwise. */ +bool +caseproto_equal (const struct caseproto *a, const struct caseproto *b) +{ + return (a == b ? true + : a->n_widths != b->n_widths ? false + : caseproto_range_equal (a, 0, b, 0, a->n_widths)); +} + /* Returns true if an array of values that is to be used for data of the format specified in PROTO needs to be initialized by calling caseproto_init_values, false if that step may be