From 04fb909bd65eee66428d131ff34a6e1fde42e243 Mon Sep 17 00:00:00 2001 From: John Darrington Date: Wed, 27 Sep 2006 10:21:35 +0000 Subject: [PATCH] Fixed warnings generated by gcc 4.1.2 Fixed bug in N OF CASES command which these warnings exposed. Added a test for this bug (how many years had it gone unreported?) --- po/de.po | 130 +++++++++++++-------------- po/pspp.pot | 130 +++++++++++++-------------- src/data/ChangeLog | 5 ++ src/data/procedure.c | 2 +- src/data/sfm-private.h | 44 +++++---- src/data/sys-file-reader.c | 19 ++-- src/data/sys-file-writer.c | 103 ++++++++++----------- src/language/dictionary/split-file.c | 2 +- tests/automake.mk | 1 + tests/command/n_of_cases.sh | 106 ++++++++++++++++++++++ 10 files changed, 324 insertions(+), 218 deletions(-) create mode 100755 tests/command/n_of_cases.sh diff --git a/po/de.po b/po/de.po index e9998f07..c1ca5413 100644 --- a/po/de.po +++ b/po/de.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: PSPP 0.4.2\n" "Report-Msgid-Bugs-To: pspp-dev@gnu.org\n" -"POT-Creation-Date: 2006-09-25 16:28+0800\n" +"POT-Creation-Date: 2006-09-27 08:45+0800\n" "PO-Revision-Date: 2006-05-26 17:49+0800\n" "Last-Translator: John Darrington \n" "Language-Team: German \n" @@ -391,27 +391,27 @@ msgid "%s variables are not compatible with %s format %s." msgstr "" #: src/data/format.c:212 src/data/por-file-reader.c:481 -#: src/data/sys-file-reader.c:1220 src/data/sys-file-reader.c:1229 +#: src/data/sys-file-reader.c:1221 src/data/sys-file-reader.c:1230 #: src/ui/gui/psppire.glade:1192 src/ui/gui/psppire-var-store.c:451 msgid "String" msgstr "Zeichenkette" #: src/data/format.c:212 src/data/por-file-reader.c:481 -#: src/data/sys-file-reader.c:1220 src/data/sys-file-reader.c:1229 +#: src/data/sys-file-reader.c:1221 src/data/sys-file-reader.c:1230 #: src/ui/gui/psppire.glade:1053 src/ui/gui/psppire-var-store.c:444 msgid "Numeric" msgstr "Nummer" -#: src/data/format.c:213 src/data/sys-file-reader.c:1222 -#: src/data/sys-file-reader.c:1367 src/data/sys-file-reader.c:1368 +#: src/data/format.c:213 src/data/sys-file-reader.c:1223 +#: src/data/sys-file-reader.c:1368 src/data/sys-file-reader.c:1369 #: src/data/variable.c:42 src/language/dictionary/apply-dictionary.c:76 #: src/language/dictionary/apply-dictionary.c:77 #: src/language/xforms/recode.c:478 src/language/xforms/recode.c:479 msgid "numeric" msgstr "numerisch" -#: src/data/format.c:213 src/data/sys-file-reader.c:1222 -#: src/data/sys-file-reader.c:1367 src/data/sys-file-reader.c:1368 +#: src/data/format.c:213 src/data/sys-file-reader.c:1223 +#: src/data/sys-file-reader.c:1368 src/data/sys-file-reader.c:1369 #: src/data/variable.c:42 src/data/variable.c:50 #: src/language/dictionary/apply-dictionary.c:76 #: src/language/dictionary/apply-dictionary.c:77 @@ -481,12 +481,12 @@ msgstr "" msgid "Bad time string length %d." msgstr "" -#: src/data/por-file-reader.c:473 src/data/sys-file-reader.c:1212 +#: src/data/por-file-reader.c:473 src/data/sys-file-reader.c:1213 #, c-format msgid "%s: Bad format specifier byte (%d)." msgstr "" -#: src/data/por-file-reader.c:480 src/data/sys-file-reader.c:1228 +#: src/data/por-file-reader.c:480 src/data/sys-file-reader.c:1229 #, c-format msgid "%s variable %s has invalid format specifier %s." msgstr "" @@ -630,95 +630,95 @@ msgid "" "%s: Invalid variable display parameters. Default parameters substituted." msgstr "" -#: src/data/sys-file-reader.c:506 +#: src/data/sys-file-reader.c:507 #, c-format msgid "%s: Trailing garbage in long variable name map." msgstr "" -#: src/data/sys-file-reader.c:513 +#: src/data/sys-file-reader.c:514 #, c-format msgid "%s: Long variable mapping to invalid variable name `%s'." msgstr "" -#: src/data/sys-file-reader.c:523 +#: src/data/sys-file-reader.c:524 #, c-format msgid "%s: Long variable mapping for nonexistent variable %s." msgstr "" -#: src/data/sys-file-reader.c:532 +#: src/data/sys-file-reader.c:533 #, c-format msgid "%s: Duplicate long variable name `%s' within system file." msgstr "" -#: src/data/sys-file-reader.c:624 +#: src/data/sys-file-reader.c:625 #, c-format msgid "%s: No variable called %s but it is listed in length table." msgstr "" -#: src/data/sys-file-reader.c:680 +#: src/data/sys-file-reader.c:681 #, c-format msgid "%s: Unrecognized record type 7, subtype %d encountered in system file." msgstr "" -#: src/data/sys-file-reader.c:706 +#: src/data/sys-file-reader.c:707 #, c-format msgid "%s: Unrecognized record type %d." msgstr "" -#: src/data/sys-file-reader.c:761 +#: src/data/sys-file-reader.c:762 #, c-format msgid "" "%s: Bad size (%d) or count (%d) field on record type 7, subtype 3.\tExpected " "size %d, count 8." msgstr "" -#: src/data/sys-file-reader.c:772 +#: src/data/sys-file-reader.c:773 #, c-format msgid "" "%s: Floating-point representation in system file is not IEEE-754. PSPP " "cannot convert between floating-point formats." msgstr "" -#: src/data/sys-file-reader.c:788 +#: src/data/sys-file-reader.c:789 #, c-format msgid "" "%s: File-indicated endianness (%s) does not match endianness intuited from " "file header (%s)." msgstr "" -#: src/data/sys-file-reader.c:791 src/data/sys-file-reader.c:792 +#: src/data/sys-file-reader.c:792 src/data/sys-file-reader.c:793 msgid "big-endian" msgstr "" -#: src/data/sys-file-reader.c:791 src/data/sys-file-reader.c:792 +#: src/data/sys-file-reader.c:792 src/data/sys-file-reader.c:793 msgid "little-endian" msgstr "" -#: src/data/sys-file-reader.c:793 +#: src/data/sys-file-reader.c:794 msgid "unknown" msgstr "" -#: src/data/sys-file-reader.c:797 +#: src/data/sys-file-reader.c:798 #, c-format msgid "%s: File-indicated character representation code (%s) is not ASCII." msgstr "" -#: src/data/sys-file-reader.c:801 +#: src/data/sys-file-reader.c:802 msgid "DEC Kanji" msgstr "" -#: src/data/sys-file-reader.c:801 src/language/dictionary/sys-file-info.c:124 +#: src/data/sys-file-reader.c:802 src/language/dictionary/sys-file-info.c:124 msgid "Unknown" msgstr "" -#: src/data/sys-file-reader.c:817 +#: src/data/sys-file-reader.c:818 #, c-format msgid "" "%s: Bad size (%d) or count (%d) field on record type 7, subtype 4.\tExpected " "size %d, count 8." msgstr "" -#: src/data/sys-file-reader.c:832 +#: src/data/sys-file-reader.c:833 #, c-format msgid "" "%s: File-indicated value is different from internal value for at least one " @@ -726,198 +726,198 @@ msgid "" "%g; LOWEST: %g, %g." msgstr "" -#: src/data/sys-file-reader.c:859 +#: src/data/sys-file-reader.c:860 #, c-format msgid "" "%s: Bad magic. Proper system files begin with the four characters `$FL2'. " "This file will not be read." msgstr "" -#: src/data/sys-file-reader.c:901 +#: src/data/sys-file-reader.c:902 #, c-format msgid "" "%s: File layout code has unexpected value %d. Value should be 2, in big-" "endian or little-endian format." msgstr "" -#: src/data/sys-file-reader.c:930 +#: src/data/sys-file-reader.c:931 #, c-format msgid "%s: Number of cases in file (%ld) is not between -1 and %d." msgstr "" -#: src/data/sys-file-reader.c:935 +#: src/data/sys-file-reader.c:936 #, c-format msgid "%s: Compression bias (%g) is not the usual value of 100." msgstr "" -#: src/data/sys-file-reader.c:1046 +#: src/data/sys-file-reader.c:1047 #, c-format msgid "" "%s: position %d: String variable does not have proper number of continuation " "records." msgstr "" -#: src/data/sys-file-reader.c:1056 +#: src/data/sys-file-reader.c:1057 #, c-format msgid "%s: position %d: Superfluous long string continuation record." msgstr "" -#: src/data/sys-file-reader.c:1062 +#: src/data/sys-file-reader.c:1063 #, c-format msgid "%s: position %d: Bad variable type code %d." msgstr "" -#: src/data/sys-file-reader.c:1065 +#: src/data/sys-file-reader.c:1066 #, c-format msgid "%s: position %d: Variable label indicator field is not 0 or 1." msgstr "" -#: src/data/sys-file-reader.c:1069 +#: src/data/sys-file-reader.c:1070 #, c-format msgid "" "%s: position %d: Missing value indicator field is not -3, -2, 0, 1, 2, or 3." msgstr "" -#: src/data/sys-file-reader.c:1074 +#: src/data/sys-file-reader.c:1075 #, c-format msgid "%s: position %d: Variable name begins with invalid character." msgstr "" -#: src/data/sys-file-reader.c:1093 +#: src/data/sys-file-reader.c:1094 #, c-format msgid "%s: Invalid variable name `%s' within system file." msgstr "" -#: src/data/sys-file-reader.c:1099 +#: src/data/sys-file-reader.c:1100 #, c-format msgid "%s: Duplicate variable name `%s' within system file." msgstr "" -#: src/data/sys-file-reader.c:1123 +#: src/data/sys-file-reader.c:1124 #, c-format msgid "%s: Variable %s indicates variable label of invalid length %d." msgstr "" -#: src/data/sys-file-reader.c:1144 +#: src/data/sys-file-reader.c:1145 #, c-format msgid "%s: Long string variable %s may not have missing values." msgstr "" -#: src/data/sys-file-reader.c:1165 +#: src/data/sys-file-reader.c:1166 #, c-format msgid "" "%s: String variable %s may not have missing values specified as a range." msgstr "" -#: src/data/sys-file-reader.c:1188 +#: src/data/sys-file-reader.c:1189 #, c-format msgid "%s: Long string continuation records omitted at end of dictionary." msgstr "" -#: src/data/sys-file-reader.c:1193 +#: src/data/sys-file-reader.c:1194 #, c-format msgid "" "%s: System file header indicates %d variable positions but %d were read from " "file." msgstr "" -#: src/data/sys-file-reader.c:1218 +#: src/data/sys-file-reader.c:1219 #, c-format msgid "%s: %s variable %s has %s format specifier %s." msgstr "" -#: src/data/sys-file-reader.c:1271 +#: src/data/sys-file-reader.c:1272 #, c-format msgid "%s: Invalid number of labels: %d. Ignoring labels." msgstr "" -#: src/data/sys-file-reader.c:1313 +#: src/data/sys-file-reader.c:1314 #, c-format msgid "" "%s: Variable index record (type 4) does not immediately follow value label " "record (type 3) as it should." msgstr "" -#: src/data/sys-file-reader.c:1324 +#: src/data/sys-file-reader.c:1325 #, c-format msgid "" "%s: Number of variables associated with a value label (%d) is not between 1 " "and the number of variables (%d)." msgstr "" -#: src/data/sys-file-reader.c:1340 +#: src/data/sys-file-reader.c:1341 #, c-format msgid "" "%s: Variable index associated with value label (%d) is not between 1 and the " "number of values (%d)." msgstr "" -#: src/data/sys-file-reader.c:1347 +#: src/data/sys-file-reader.c:1348 #, c-format msgid "" "%s: Variable index associated with value label (%d) refers to a continuation " "of a string variable, not to an actual variable." msgstr "" -#: src/data/sys-file-reader.c:1352 +#: src/data/sys-file-reader.c:1353 #, c-format msgid "%s: Value labels are not allowed on long string variables (%s)." msgstr "" -#: src/data/sys-file-reader.c:1363 +#: src/data/sys-file-reader.c:1364 #, c-format msgid "" "%s: Variables associated with value label are not all of identical type. " "Variable %s has %s type, but variable %s has %s type." msgstr "" -#: src/data/sys-file-reader.c:1404 +#: src/data/sys-file-reader.c:1405 #, c-format msgid "%s: File contains duplicate label for value %g for variable %s." msgstr "" -#: src/data/sys-file-reader.c:1408 +#: src/data/sys-file-reader.c:1409 #, c-format msgid "%s: File contains duplicate label for value `%.*s' for variable %s." msgstr "" -#: src/data/sys-file-reader.c:1450 src/data/sys-file-reader.c:1746 +#: src/data/sys-file-reader.c:1451 src/data/sys-file-reader.c:1747 #, c-format msgid "%s: Reading system file: %s." msgstr "" -#: src/data/sys-file-reader.c:1453 src/data/sys-file-reader.c:1572 -#: src/data/sys-file-reader.c:1613 +#: src/data/sys-file-reader.c:1454 src/data/sys-file-reader.c:1573 +#: src/data/sys-file-reader.c:1614 #, c-format msgid "%s: Unexpected end of file." msgstr "" -#: src/data/sys-file-reader.c:1470 +#: src/data/sys-file-reader.c:1471 #, c-format msgid "%s: Seeking system file: %s." msgstr "" -#: src/data/sys-file-reader.c:1485 +#: src/data/sys-file-reader.c:1486 #, c-format msgid "%s: System file contains multiple type 6 (document) records." msgstr "" -#: src/data/sys-file-reader.c:1491 +#: src/data/sys-file-reader.c:1492 #, c-format msgid "%s: Number of document lines (%ld) must be greater than 0." msgstr "" -#: src/data/sys-file-reader.c:1525 +#: src/data/sys-file-reader.c:1526 #, c-format msgid "%s: Error reading file: %s." msgstr "" -#: src/data/sys-file-reader.c:1564 +#: src/data/sys-file-reader.c:1565 #, c-format msgid "%s: Compressed data is corrupted. Data ends in partial case." msgstr "" -#: src/data/sys-file-reader.c:1752 +#: src/data/sys-file-reader.c:1753 #, c-format msgid "%s: Partial record at end of system file." msgstr "" @@ -932,7 +932,7 @@ msgstr "" msgid "Error opening \"%s\" for writing as a system file: %s." msgstr "" -#: src/data/sys-file-writer.c:1040 +#: src/data/sys-file-writer.c:1035 #, c-format msgid "An I/O error occurred writing system file \"%s\"." msgstr "" @@ -3371,7 +3371,7 @@ msgstr "" msgid "Coefficient Correlations" msgstr "" -#: src/language/stats/regression.q:1129 +#: src/language/stats/regression.q:1131 msgid "Dependent variable must be numeric." msgstr "" diff --git a/po/pspp.pot b/po/pspp.pot index 74ece980..bd26c476 100644 --- a/po/pspp.pot +++ b/po/pspp.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: pspp-dev@gnu.org\n" -"POT-Creation-Date: 2006-09-25 16:28+0800\n" +"POT-Creation-Date: 2006-09-27 08:45+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -390,27 +390,27 @@ msgid "%s variables are not compatible with %s format %s." msgstr "" #: src/data/format.c:212 src/data/por-file-reader.c:481 -#: src/data/sys-file-reader.c:1220 src/data/sys-file-reader.c:1229 +#: src/data/sys-file-reader.c:1221 src/data/sys-file-reader.c:1230 #: src/ui/gui/psppire.glade:1192 src/ui/gui/psppire-var-store.c:451 msgid "String" msgstr "" #: src/data/format.c:212 src/data/por-file-reader.c:481 -#: src/data/sys-file-reader.c:1220 src/data/sys-file-reader.c:1229 +#: src/data/sys-file-reader.c:1221 src/data/sys-file-reader.c:1230 #: src/ui/gui/psppire.glade:1053 src/ui/gui/psppire-var-store.c:444 msgid "Numeric" msgstr "" -#: src/data/format.c:213 src/data/sys-file-reader.c:1222 -#: src/data/sys-file-reader.c:1367 src/data/sys-file-reader.c:1368 +#: src/data/format.c:213 src/data/sys-file-reader.c:1223 +#: src/data/sys-file-reader.c:1368 src/data/sys-file-reader.c:1369 #: src/data/variable.c:42 src/language/dictionary/apply-dictionary.c:76 #: src/language/dictionary/apply-dictionary.c:77 #: src/language/xforms/recode.c:478 src/language/xforms/recode.c:479 msgid "numeric" msgstr "" -#: src/data/format.c:213 src/data/sys-file-reader.c:1222 -#: src/data/sys-file-reader.c:1367 src/data/sys-file-reader.c:1368 +#: src/data/format.c:213 src/data/sys-file-reader.c:1223 +#: src/data/sys-file-reader.c:1368 src/data/sys-file-reader.c:1369 #: src/data/variable.c:42 src/data/variable.c:50 #: src/language/dictionary/apply-dictionary.c:76 #: src/language/dictionary/apply-dictionary.c:77 @@ -480,12 +480,12 @@ msgstr "" msgid "Bad time string length %d." msgstr "" -#: src/data/por-file-reader.c:473 src/data/sys-file-reader.c:1212 +#: src/data/por-file-reader.c:473 src/data/sys-file-reader.c:1213 #, c-format msgid "%s: Bad format specifier byte (%d)." msgstr "" -#: src/data/por-file-reader.c:480 src/data/sys-file-reader.c:1228 +#: src/data/por-file-reader.c:480 src/data/sys-file-reader.c:1229 #, c-format msgid "%s variable %s has invalid format specifier %s." msgstr "" @@ -629,95 +629,95 @@ msgid "" "%s: Invalid variable display parameters. Default parameters substituted." msgstr "" -#: src/data/sys-file-reader.c:506 +#: src/data/sys-file-reader.c:507 #, c-format msgid "%s: Trailing garbage in long variable name map." msgstr "" -#: src/data/sys-file-reader.c:513 +#: src/data/sys-file-reader.c:514 #, c-format msgid "%s: Long variable mapping to invalid variable name `%s'." msgstr "" -#: src/data/sys-file-reader.c:523 +#: src/data/sys-file-reader.c:524 #, c-format msgid "%s: Long variable mapping for nonexistent variable %s." msgstr "" -#: src/data/sys-file-reader.c:532 +#: src/data/sys-file-reader.c:533 #, c-format msgid "%s: Duplicate long variable name `%s' within system file." msgstr "" -#: src/data/sys-file-reader.c:624 +#: src/data/sys-file-reader.c:625 #, c-format msgid "%s: No variable called %s but it is listed in length table." msgstr "" -#: src/data/sys-file-reader.c:680 +#: src/data/sys-file-reader.c:681 #, c-format msgid "%s: Unrecognized record type 7, subtype %d encountered in system file." msgstr "" -#: src/data/sys-file-reader.c:706 +#: src/data/sys-file-reader.c:707 #, c-format msgid "%s: Unrecognized record type %d." msgstr "" -#: src/data/sys-file-reader.c:761 +#: src/data/sys-file-reader.c:762 #, c-format msgid "" "%s: Bad size (%d) or count (%d) field on record type 7, subtype 3.\tExpected " "size %d, count 8." msgstr "" -#: src/data/sys-file-reader.c:772 +#: src/data/sys-file-reader.c:773 #, c-format msgid "" "%s: Floating-point representation in system file is not IEEE-754. PSPP " "cannot convert between floating-point formats." msgstr "" -#: src/data/sys-file-reader.c:788 +#: src/data/sys-file-reader.c:789 #, c-format msgid "" "%s: File-indicated endianness (%s) does not match endianness intuited from " "file header (%s)." msgstr "" -#: src/data/sys-file-reader.c:791 src/data/sys-file-reader.c:792 +#: src/data/sys-file-reader.c:792 src/data/sys-file-reader.c:793 msgid "big-endian" msgstr "" -#: src/data/sys-file-reader.c:791 src/data/sys-file-reader.c:792 +#: src/data/sys-file-reader.c:792 src/data/sys-file-reader.c:793 msgid "little-endian" msgstr "" -#: src/data/sys-file-reader.c:793 +#: src/data/sys-file-reader.c:794 msgid "unknown" msgstr "" -#: src/data/sys-file-reader.c:797 +#: src/data/sys-file-reader.c:798 #, c-format msgid "%s: File-indicated character representation code (%s) is not ASCII." msgstr "" -#: src/data/sys-file-reader.c:801 +#: src/data/sys-file-reader.c:802 msgid "DEC Kanji" msgstr "" -#: src/data/sys-file-reader.c:801 src/language/dictionary/sys-file-info.c:124 +#: src/data/sys-file-reader.c:802 src/language/dictionary/sys-file-info.c:124 msgid "Unknown" msgstr "" -#: src/data/sys-file-reader.c:817 +#: src/data/sys-file-reader.c:818 #, c-format msgid "" "%s: Bad size (%d) or count (%d) field on record type 7, subtype 4.\tExpected " "size %d, count 8." msgstr "" -#: src/data/sys-file-reader.c:832 +#: src/data/sys-file-reader.c:833 #, c-format msgid "" "%s: File-indicated value is different from internal value for at least one " @@ -725,198 +725,198 @@ msgid "" "%g; LOWEST: %g, %g." msgstr "" -#: src/data/sys-file-reader.c:859 +#: src/data/sys-file-reader.c:860 #, c-format msgid "" "%s: Bad magic. Proper system files begin with the four characters `$FL2'. " "This file will not be read." msgstr "" -#: src/data/sys-file-reader.c:901 +#: src/data/sys-file-reader.c:902 #, c-format msgid "" "%s: File layout code has unexpected value %d. Value should be 2, in big-" "endian or little-endian format." msgstr "" -#: src/data/sys-file-reader.c:930 +#: src/data/sys-file-reader.c:931 #, c-format msgid "%s: Number of cases in file (%ld) is not between -1 and %d." msgstr "" -#: src/data/sys-file-reader.c:935 +#: src/data/sys-file-reader.c:936 #, c-format msgid "%s: Compression bias (%g) is not the usual value of 100." msgstr "" -#: src/data/sys-file-reader.c:1046 +#: src/data/sys-file-reader.c:1047 #, c-format msgid "" "%s: position %d: String variable does not have proper number of continuation " "records." msgstr "" -#: src/data/sys-file-reader.c:1056 +#: src/data/sys-file-reader.c:1057 #, c-format msgid "%s: position %d: Superfluous long string continuation record." msgstr "" -#: src/data/sys-file-reader.c:1062 +#: src/data/sys-file-reader.c:1063 #, c-format msgid "%s: position %d: Bad variable type code %d." msgstr "" -#: src/data/sys-file-reader.c:1065 +#: src/data/sys-file-reader.c:1066 #, c-format msgid "%s: position %d: Variable label indicator field is not 0 or 1." msgstr "" -#: src/data/sys-file-reader.c:1069 +#: src/data/sys-file-reader.c:1070 #, c-format msgid "" "%s: position %d: Missing value indicator field is not -3, -2, 0, 1, 2, or 3." msgstr "" -#: src/data/sys-file-reader.c:1074 +#: src/data/sys-file-reader.c:1075 #, c-format msgid "%s: position %d: Variable name begins with invalid character." msgstr "" -#: src/data/sys-file-reader.c:1093 +#: src/data/sys-file-reader.c:1094 #, c-format msgid "%s: Invalid variable name `%s' within system file." msgstr "" -#: src/data/sys-file-reader.c:1099 +#: src/data/sys-file-reader.c:1100 #, c-format msgid "%s: Duplicate variable name `%s' within system file." msgstr "" -#: src/data/sys-file-reader.c:1123 +#: src/data/sys-file-reader.c:1124 #, c-format msgid "%s: Variable %s indicates variable label of invalid length %d." msgstr "" -#: src/data/sys-file-reader.c:1144 +#: src/data/sys-file-reader.c:1145 #, c-format msgid "%s: Long string variable %s may not have missing values." msgstr "" -#: src/data/sys-file-reader.c:1165 +#: src/data/sys-file-reader.c:1166 #, c-format msgid "" "%s: String variable %s may not have missing values specified as a range." msgstr "" -#: src/data/sys-file-reader.c:1188 +#: src/data/sys-file-reader.c:1189 #, c-format msgid "%s: Long string continuation records omitted at end of dictionary." msgstr "" -#: src/data/sys-file-reader.c:1193 +#: src/data/sys-file-reader.c:1194 #, c-format msgid "" "%s: System file header indicates %d variable positions but %d were read from " "file." msgstr "" -#: src/data/sys-file-reader.c:1218 +#: src/data/sys-file-reader.c:1219 #, c-format msgid "%s: %s variable %s has %s format specifier %s." msgstr "" -#: src/data/sys-file-reader.c:1271 +#: src/data/sys-file-reader.c:1272 #, c-format msgid "%s: Invalid number of labels: %d. Ignoring labels." msgstr "" -#: src/data/sys-file-reader.c:1313 +#: src/data/sys-file-reader.c:1314 #, c-format msgid "" "%s: Variable index record (type 4) does not immediately follow value label " "record (type 3) as it should." msgstr "" -#: src/data/sys-file-reader.c:1324 +#: src/data/sys-file-reader.c:1325 #, c-format msgid "" "%s: Number of variables associated with a value label (%d) is not between 1 " "and the number of variables (%d)." msgstr "" -#: src/data/sys-file-reader.c:1340 +#: src/data/sys-file-reader.c:1341 #, c-format msgid "" "%s: Variable index associated with value label (%d) is not between 1 and the " "number of values (%d)." msgstr "" -#: src/data/sys-file-reader.c:1347 +#: src/data/sys-file-reader.c:1348 #, c-format msgid "" "%s: Variable index associated with value label (%d) refers to a continuation " "of a string variable, not to an actual variable." msgstr "" -#: src/data/sys-file-reader.c:1352 +#: src/data/sys-file-reader.c:1353 #, c-format msgid "%s: Value labels are not allowed on long string variables (%s)." msgstr "" -#: src/data/sys-file-reader.c:1363 +#: src/data/sys-file-reader.c:1364 #, c-format msgid "" "%s: Variables associated with value label are not all of identical type. " "Variable %s has %s type, but variable %s has %s type." msgstr "" -#: src/data/sys-file-reader.c:1404 +#: src/data/sys-file-reader.c:1405 #, c-format msgid "%s: File contains duplicate label for value %g for variable %s." msgstr "" -#: src/data/sys-file-reader.c:1408 +#: src/data/sys-file-reader.c:1409 #, c-format msgid "%s: File contains duplicate label for value `%.*s' for variable %s." msgstr "" -#: src/data/sys-file-reader.c:1450 src/data/sys-file-reader.c:1746 +#: src/data/sys-file-reader.c:1451 src/data/sys-file-reader.c:1747 #, c-format msgid "%s: Reading system file: %s." msgstr "" -#: src/data/sys-file-reader.c:1453 src/data/sys-file-reader.c:1572 -#: src/data/sys-file-reader.c:1613 +#: src/data/sys-file-reader.c:1454 src/data/sys-file-reader.c:1573 +#: src/data/sys-file-reader.c:1614 #, c-format msgid "%s: Unexpected end of file." msgstr "" -#: src/data/sys-file-reader.c:1470 +#: src/data/sys-file-reader.c:1471 #, c-format msgid "%s: Seeking system file: %s." msgstr "" -#: src/data/sys-file-reader.c:1485 +#: src/data/sys-file-reader.c:1486 #, c-format msgid "%s: System file contains multiple type 6 (document) records." msgstr "" -#: src/data/sys-file-reader.c:1491 +#: src/data/sys-file-reader.c:1492 #, c-format msgid "%s: Number of document lines (%ld) must be greater than 0." msgstr "" -#: src/data/sys-file-reader.c:1525 +#: src/data/sys-file-reader.c:1526 #, c-format msgid "%s: Error reading file: %s." msgstr "" -#: src/data/sys-file-reader.c:1564 +#: src/data/sys-file-reader.c:1565 #, c-format msgid "%s: Compressed data is corrupted. Data ends in partial case." msgstr "" -#: src/data/sys-file-reader.c:1752 +#: src/data/sys-file-reader.c:1753 #, c-format msgid "%s: Partial record at end of system file." msgstr "" @@ -931,7 +931,7 @@ msgstr "" msgid "Error opening \"%s\" for writing as a system file: %s." msgstr "" -#: src/data/sys-file-writer.c:1040 +#: src/data/sys-file-writer.c:1035 #, c-format msgid "An I/O error occurred writing system file \"%s\"." msgstr "" @@ -3370,7 +3370,7 @@ msgstr "" msgid "Coefficient Correlations" msgstr "" -#: src/language/stats/regression.q:1129 +#: src/language/stats/regression.q:1131 msgid "Dependent variable must be numeric." msgstr "" diff --git a/src/data/ChangeLog b/src/data/ChangeLog index 795b4025..856a177d 100644 --- a/src/data/ChangeLog +++ b/src/data/ChangeLog @@ -1,3 +1,8 @@ +Wed Sep 27 09:37:49 WST 2006 John Darrington + + * procedure.c (case_limit_trns_proc): Fixed buglet which rendered the + entire function useless. + Mon Sep 25 17:11:46 WST 2006 John Darrington * casefile-private.h casefile.c casefile.h fastfile.c: Created new diff --git a/src/data/procedure.c b/src/data/procedure.c index a779771c..1843852a 100644 --- a/src/data/procedure.c +++ b/src/data/procedure.c @@ -880,7 +880,7 @@ case_limit_trns_proc (void *cases_remaining_, size_t *cases_remaining = cases_remaining_; if (*cases_remaining > 0) { - *cases_remaining--; + (*cases_remaining)--; return TRNS_CONTINUE; } else diff --git a/src/data/sfm-private.h b/src/data/sfm-private.h index 7ed15adf..96d08948 100644 --- a/src/data/sfm-private.h +++ b/src/data/sfm-private.h @@ -24,8 +24,6 @@ #include #include "variable.h" -/* This attribute might avoid some problems. On the other hand... */ -#define P ATTRIBUTE ((packed)) #if __BORLANDC__ #pragma option -a- /* Turn off alignment. */ @@ -56,34 +54,34 @@ /* Record Type 1: General Information. */ struct sysfile_header { - char rec_type[4] P; /* 00: Record-type code, "$FL2". */ - char prod_name[60] P; /* 04: Product identification. */ - int32_t layout_code P; /* 40: 2. */ - int32_t nominal_case_size P; /* 44: Number of `value's per case. + char rec_type[4] ; /* 00: Record-type code, "$FL2". */ + char prod_name[60] ; /* 04: Product identification. */ + int32_t layout_code ; /* 40: 2. */ + int32_t nominal_case_size ; /* 44: Number of `value's per case. Note: some systems set this to -1 */ - int32_t compress P; /* 48: 1=compressed, 0=not compressed. */ - int32_t weight_idx P; /* 4c: 1-based index of weighting var, or 0. */ - int32_t case_cnt P; /* 50: Number of cases, -1 if unknown. */ - flt64 bias P; /* 54: Compression bias (100.0). */ - char creation_date[9] P; /* 5c: `dd mmm yy' creation date of file. */ - char creation_time[8] P; /* 65: `hh:mm:ss' 24-hour creation time. */ - char file_label[64] P; /* 6d: File label. */ - char padding[3] P; /* ad: Ignored padding. */ - }; + int32_t compress ; /* 48: 1=compressed, 0=not compressed. */ + int32_t weight_idx ; /* 4c: 1-based index of weighting var, or 0. */ + int32_t case_cnt ; /* 50: Number of cases, -1 if unknown. */ + flt64 bias ; /* 54: Compression bias (100.0). */ + char creation_date[9] ; /* 5c: `dd mmm yy' creation date of file. */ + char creation_time[8] ; /* 65: `hh:mm:ss' 24-hour creation time. */ + char file_label[64] ; /* 6d: File label. */ + char padding[3] ; /* ad: Ignored padding. */ + } ATTRIBUTE((packed)) ; /* Record Type 2: Variable. */ struct sysfile_variable { - int32_t rec_type P; /* 2. */ - int32_t type P; /* 0=numeric, 1-255=string width, + int32_t rec_type ; /* 2. */ + int32_t type ; /* 0=numeric, 1-255=string width, -1=continued string. */ - int32_t has_var_label P; /* 1=has a variable label, 0=doesn't. */ - int32_t n_missing_values P; /* Missing value code of -3,-2,0,1,2, or 3. */ - int32_t print P; /* Print format. */ - int32_t write P; /* Write format. */ - char name[SHORT_NAME_LEN] P; /* Variable name. */ + int32_t has_var_label ; /* 1=has a variable label, 0=doesn't. */ + int32_t n_missing_values ; /* Missing value code of -3,-2,0,1,2, or 3. */ + int32_t print ; /* Print format. */ + int32_t write ; /* Write format. */ + char name[SHORT_NAME_LEN] ; /* Variable name. */ /* The rest of the structure varies. */ - }; + } ATTRIBUTE((packed)) ; #if __BORLANDC__ #pragma -a4 diff --git a/src/data/sys-file-reader.c b/src/data/sys-file-reader.c index 072fca3b..20713a56 100644 --- a/src/data/sys-file-reader.c +++ b/src/data/sys-file-reader.c @@ -387,10 +387,10 @@ sfm_open_reader (struct file_handle *fh, struct dictionary **dict, { struct { - int32_t subtype P; - int32_t size P; - int32_t count P; - } + int32_t subtype ; + int32_t size ; + int32_t count ; + } ATTRIBUTE((packed)) data; unsigned long bytes; @@ -443,10 +443,10 @@ sfm_open_reader (struct file_handle *fh, struct dictionary **dict, { struct { - int32_t measure P; - int32_t width P; - int32_t align P; - } + int32_t measure ; + int32_t width ; + int32_t align ; + } ATTRIBUTE((packed)) params; struct variable *v; @@ -474,7 +474,8 @@ sfm_open_reader (struct file_handle *fh, struct dictionary **dict, case 13: /* SPSS 12.0 Long variable name map */ { - char *short_name, *save_ptr; + char *short_name; + char *save_ptr = NULL; int idx; /* Read data. */ diff --git a/src/data/sys-file-writer.c b/src/data/sys-file-writer.c index 2639c358..000534c4 100644 --- a/src/data/sys-file-writer.c +++ b/src/data/sys-file-writer.c @@ -295,9 +295,9 @@ sfm_open_writer (struct file_handle *fh, struct dictionary *d, { struct { - int32_t rec_type P; - int32_t filler P; - } + int32_t rec_type ; + int32_t filler ; + } ATTRIBUTE((packed)) rec_999; rec_999.rec_type = 999; @@ -489,9 +489,9 @@ write_variable (struct sfm_writer *w, const struct variable *v) { struct label { - int32_t label_len P; - char label[255] P; - } + int32_t label_len ; + char label[255] ; + } ATTRIBUTE((packed)) l; int ext_len; @@ -533,17 +533,17 @@ write_value_labels (struct sfm_writer *w, struct variable *v, int idx) { struct value_label_rec { - int32_t rec_type P; - int32_t n_labels P; - flt64 labels[1] P; - }; + int32_t rec_type ; + int32_t n_labels ; + flt64 labels[1] ; + } ATTRIBUTE((packed)); struct var_idx_rec { - int32_t rec_type P; - int32_t n_vars P; - int32_t vars[1] P; - }; + int32_t rec_type ; + int32_t n_vars ; + int32_t vars[1] ; + } ATTRIBUTE((packed)); struct val_labs_iterator *i; struct value_label_rec *vlr; @@ -594,11 +594,10 @@ static void write_documents (struct sfm_writer *w, const struct dictionary *d) { struct - { - int32_t rec_type P; /* Always 6. */ - int32_t n_lines P; /* Number of lines of documents. */ - } - rec_6; + { + int32_t rec_type ; /* Always 6. */ + int32_t n_lines ; /* Number of lines of documents. */ + } ATTRIBUTE((packed)) rec_6; const char *documents; size_t n_lines; @@ -621,11 +620,11 @@ write_variable_display_parameters (struct sfm_writer *w, struct { - int32_t rec_type P; - int32_t subtype P; - int32_t elem_size P; - int32_t n_elem P; - } vdp_hdr; + int32_t rec_type ; + int32_t subtype ; + int32_t elem_size ; + int32_t n_elem ; + } ATTRIBUTE((packed)) vdp_hdr; vdp_hdr.rec_type = 7; vdp_hdr.subtype = 11; @@ -639,11 +638,10 @@ write_variable_display_parameters (struct sfm_writer *w, struct variable *v; struct { - int32_t measure P; - int32_t width P; - int32_t align P; - } - params; + int32_t measure ; + int32_t width ; + int32_t align ; + } ATTRIBUTE((packed)) params; v = dict_get_var(dict, i); @@ -676,13 +674,12 @@ write_vls_length_table (struct sfm_writer *w, { int i; struct - { - int32_t rec_type P; - int32_t subtype P; - int32_t elem_size P; - int32_t n_elem P; - } - vls_hdr; + { + int32_t rec_type ; + int32_t subtype ; + int32_t elem_size ; + int32_t n_elem ; + } ATTRIBUTE((packed)) vls_hdr; struct string vls_length_map; @@ -722,12 +719,11 @@ write_longvar_table (struct sfm_writer *w, const struct dictionary *dict) { struct { - int32_t rec_type P; - int32_t subtype P; - int32_t elem_size P; - int32_t n_elem P; - } - lv_hdr; + int32_t rec_type ; + int32_t subtype ; + int32_t elem_size ; + int32_t n_elem ; + } ATTRIBUTE((packed)) lv_hdr; struct string long_name_map; size_t i; @@ -759,18 +755,17 @@ write_rec_7_34 (struct sfm_writer *w) { struct { - int32_t rec_type_3 P; - int32_t subtype_3 P; - int32_t data_type_3 P; - int32_t n_elem_3 P; - int32_t elem_3[8] P; - int32_t rec_type_4 P; - int32_t subtype_4 P; - int32_t data_type_4 P; - int32_t n_elem_4 P; - flt64 elem_4[3] P; - } - rec_7; + int32_t rec_type_3 ; + int32_t subtype_3 ; + int32_t data_type_3 ; + int32_t n_elem_3 ; + int32_t elem_3[8] ; + int32_t rec_type_4 ; + int32_t subtype_4 ; + int32_t data_type_4 ; + int32_t n_elem_4 ; + flt64 elem_4[3] ; + } ATTRIBUTE((packed)) rec_7; /* Components of the version number, from major to minor. */ int version_component[3]; diff --git a/src/language/dictionary/split-file.c b/src/language/dictionary/split-file.c index 5e327984..78769ca1 100644 --- a/src/language/dictionary/split-file.c +++ b/src/language/dictionary/split-file.c @@ -51,7 +51,7 @@ cmd_split_file (void) size_t n; /* For now, ignore SEPARATE and LAYERED. */ - lex_match_id ("SEPARATE") || lex_match_id ("LAYERED"); + (void) ( lex_match_id ("SEPARATE") || lex_match_id ("LAYERED") ); lex_match (T_BY); if (!parse_variables (default_dict, &v, &n, PV_NO_DUPLICATE)) diff --git a/tests/automake.mk b/tests/automake.mk index 5722ba4f..3482ef2d 100644 --- a/tests/automake.mk +++ b/tests/automake.mk @@ -26,6 +26,7 @@ TESTS = \ tests/command/match-files.sh \ tests/command/missing-values.sh \ tests/command/no_case_size.sh \ + tests/command/n_of_cases.sh \ tests/command/oneway.sh \ tests/command/oneway-missing.sh \ tests/command/oneway-with-splits.sh \ diff --git a/tests/command/n_of_cases.sh b/tests/command/n_of_cases.sh new file mode 100755 index 00000000..472a3457 --- /dev/null +++ b/tests/command/n_of_cases.sh @@ -0,0 +1,106 @@ +#!/bin/sh + +# This program tests the N OF CASES command to make sure +# that it actually works. + +TEMPDIR=/tmp/pspp-tst-$$ +TESTFILE=$TEMPDIR/`basename $0`.sps + +# ensure that top_srcdir and top_builddir are absolute +if [ -z "$top_srcdir" ] ; then top_srcdir=. ; fi +if [ -z "$top_builddir" ] ; then top_builddir=. ; fi +top_srcdir=`cd $top_srcdir; pwd` +top_builddir=`cd $top_builddir; pwd` + +PSPP=$top_builddir/src/ui/terminal/pspp + +STAT_CONFIG_PATH=$top_srcdir/config +export STAT_CONFIG_PATH + +LANG=C +export LANG + + +cleanup() +{ + if [ x"$PSPP_TEST_NO_CLEANUP" != x ] ; then + echo "NOT cleaning $TEMPDIR" + return ; + fi + rm -rf $TEMPDIR +} + + +fail() +{ + echo $activity + echo FAILED + cleanup; + exit 1; +} + + +no_result() +{ + echo $activity + echo NO RESULT; + cleanup; + exit 2; +} + +pass() +{ + cleanup; + exit 0; +} + +mkdir -p $TEMPDIR + +cd $TEMPDIR + +cat > $TESTFILE <