X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fcase.c;h=fee69d4d2b24056d9f7351b97df88e9df0b6ae8f;hb=1f8dd363d6c20d07fcca14cb948018465fa5ed8b;hp=a1c65d6b68362322c038a0e62026b0e6aabb31d6;hpb=2feb80cc7e27079c77255ee8ab6a9aa373980abb;p=pspp-builds.git diff --git a/src/case.c b/src/case.c index a1c65d6b..fee69d4d 100644 --- a/src/case.c +++ b/src/case.c @@ -14,8 +14,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - 02111-1307, USA. */ + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301, USA. */ #include #include "case.h" @@ -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. */