X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fdata%2Fcaseproto.c;h=d62af283de2945cc2139f980d8c4dea5a0a431b2;hb=9ade26c8349b4434008c46cf09bc7473ec743972;hp=1b6827dbc3327847d13e5961ccce224d8c4f1967;hpb=5c3291dc396b795696e94f47780308fd7ace6fc4;p=pspp-builds.git diff --git a/src/data/caseproto.c b/src/data/caseproto.c index 1b6827db..d62af283 100644 --- a/src/data/caseproto.c +++ b/src/data/caseproto.c @@ -1,5 +1,5 @@ /* PSPP - a program for statistical analysis. - Copyright (C) 2009 Free Software Foundation, Inc. + Copyright (C) 2009, 2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -16,14 +16,15 @@ #include -#include -#include -#include -#include -#include -#include +#include "data/caseproto.h" -#include "minmax.h" +#include "data/val-type.h" +#include "data/value.h" +#include "libpspp/array.h" +#include "libpspp/assertion.h" +#include "libpspp/pool.h" + +#include "gl/minmax.h" static struct caseproto *caseproto_unshare (struct caseproto *); static bool try_init_long_strings (const struct caseproto *, @@ -320,7 +321,7 @@ caseproto_free__ (struct caseproto *proto) void caseproto_refresh_long_string_cache__ (const struct caseproto *proto_) { - struct caseproto *proto = (struct caseproto *) proto_; + struct caseproto *proto = CONST_CAST (struct caseproto *, proto_); size_t n, i; assert (proto->long_strings == NULL); @@ -330,7 +331,7 @@ caseproto_refresh_long_string_cache__ (const struct caseproto *proto_) * sizeof *proto->long_strings); n = 0; for (i = 0; i < proto->n_widths; i++) - if (proto->widths[i] >= MIN_LONG_STRING) + if (proto->widths[i] > MAX_SHORT_STRING) proto->long_strings[n++] = i; assert (n == proto->n_long_strings); } @@ -406,6 +407,6 @@ count_long_strings (const struct caseproto *proto, size_t idx, size_t count) n = 0; for (i = 0; i < count; i++) - n += proto->widths[idx + i] >= MIN_LONG_STRING; + n += proto->widths[idx + i] > MAX_SHORT_STRING; return n; }