X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fcase.c;h=1384791c82665c359eb3755e37516641c41f788d;hb=5ff91bd55867848d448c2f09bc7057cc1fb77b18;hp=3e35e973c33a0a4d9d350f5b88eb8a477bd95e95;hpb=4fdeb2145d081ff1b84e3f6c99f9d1c048c0d64a;p=pspp diff --git a/src/case.c b/src/case.c index 3e35e973c3..1384791c82 100644 --- a/src/case.c +++ b/src/case.c @@ -92,7 +92,7 @@ void case_create (struct ccase *c, size_t value_cnt) { if (!case_try_create (c, value_cnt)) - out_of_memory (); + xalloc_die (); } #ifdef GLOBAL_DEBUGGING @@ -356,32 +356,9 @@ int case_compare (const struct ccase *a, const struct ccase *b, struct variable *const *vp, size_t var_cnt) { - for (; var_cnt-- > 0; vp++) - { - struct variable *v = *vp; - - if (v->width == 0) - { - double af = case_num (a, v->fv); - double bf = case_num (b, v->fv); - - if (af != bf) - return af > bf ? 1 : -1; - } - else - { - const char *as = case_str (a, v->fv); - const char *bs = case_str (b, v->fv); - int cmp = memcmp (as, bs, v->width); - - if (cmp != 0) - return cmp; - } - } - return 0; + return case_compare_2dict (a, b, vp, vp, var_cnt); } - /* Compares the values of the VAR_CNT variables in VAP in case CA to the values of the VAR_CNT variables in VBP in CB and returns a strcmp()-type result. */