From 4f8462c882f28fed5345be2dab9d2cc73cd0b2da Mon Sep 17 00:00:00 2001 From: John Darrington Date: Sat, 3 Oct 2020 07:37:26 +0200 Subject: [PATCH] Remove width specifications from range strings (eg %3d-%3d) src/language/data-io/data-parser.c: Change %3d to %d src/language/data-io/print.c: ditto Having these width specifications resulted in an ugly space after the dash. Removing them means the the output is more aesthetically pleasing in my opinion. --- src/language/data-io/data-parser.c | 2 +- src/language/data-io/print.c | 2 +- tests/language/data-io/data-reader.at | 8 +++--- tests/language/data-io/dataset.at | 4 +-- tests/language/data-io/list.at | 8 +++--- tests/language/dictionary/weight.at | 4 +-- tests/language/expressions/evaluate.at | 2 +- tests/language/stats/autorecode.at | 8 +++--- tests/language/stats/crosstabs.at | 12 ++++----- tests/language/stats/descriptives.at | 34 +++++++++++++------------- tests/language/utilities/title.at | 4 +-- tests/language/xforms/compute.at | 2 +- tests/language/xforms/count.at | 4 +-- 13 files changed, 47 insertions(+), 47 deletions(-) diff --git a/src/language/data-io/data-parser.c b/src/language/data-io/data-parser.c index e14cba7dc2..2f24b8a238 100644 --- a/src/language/data-io/data-parser.c +++ b/src/language/data-io/data-parser.c @@ -695,7 +695,7 @@ dump_fixed_table (const struct data_parser *parser, int first_column = f->first_column; int last_column = f->first_column + f->format.w - 1; - char *columns = xasprintf ("%3d-%3d", first_column, last_column); + char *columns = xasprintf ("%d-%d", first_column, last_column); pivot_table_put2 (table, 1, variable_idx, pivot_value_new_user_text (columns, -1)); free (columns); diff --git a/src/language/data-io/print.c b/src/language/data-io/print.c index 5ee7fdd369..3b34dfcd87 100644 --- a/src/language/data-io/print.c +++ b/src/language/data-io/print.c @@ -450,7 +450,7 @@ dump_table (struct print_trns *trns) pivot_value_new_integer (spec->record)); int last_column = spec->first_column + spec->format.w - 1; pivot_table_put2 (table, 1, row, pivot_value_new_user_text_nocopy ( - xasprintf ("%3d-%3d", + xasprintf ("%d-%d", spec->first_column, last_column))); char fmt_string[FMT_STRING_LEN_MAX + 1]; diff --git a/tests/language/data-io/data-reader.at b/tests/language/data-io/data-reader.at index 85a5e87851..4156abf869 100644 --- a/tests/language/data-io/data-reader.at +++ b/tests/language/data-io/data-reader.at @@ -35,8 +35,8 @@ END DATA. AT_CHECK([pspp -O format=csv begin-data.sps], [0], [dnl Table: Reading 1 record from INLINE. Variable,Record,Columns,Format -a,1,1- 1,F1.0 -b,1,2- 2,F1.0 +a,1,1-1,F1.0 +b,1,2-2,F1.0 Table: Data List a,b @@ -64,8 +64,8 @@ list. AT_CHECK([pspp -O format=csv begin-data.sps], [0], [dnl Table: Reading 1 record from INLINE. Variable,Record,Columns,Format -A,1,1- 1,F1.0 -B,1,2- 2,F1.0 +A,1,1-1,F1.0 +B,1,2-2,F1.0 Table: Data List A,B diff --git a/tests/language/data-io/dataset.at b/tests/language/data-io/dataset.at index 885520ed09..ea3bcc6f09 100644 --- a/tests/language/data-io/dataset.at +++ b/tests/language/data-io/dataset.at @@ -319,11 +319,11 @@ LIST. AT_CHECK([pspp -O format=csv dataset.pspp], [0], [dnl Table: Reading 1 record from INLINE. Variable,Record,Columns,Format -x,1,1- 1,F1.0 +x,1,1-1,F1.0 Table: Reading 1 record from INLINE. Variable,Record,Columns,Format -y,1,2- 4,F3.0 +y,1,2-4,F3.0 ]) AT_CLEANUP \ No newline at end of file diff --git a/tests/language/data-io/list.at b/tests/language/data-io/list.at index 35acbbec77..0eb7c8c9c5 100644 --- a/tests/language/data-io/list.at +++ b/tests/language/data-io/list.at @@ -39,8 +39,8 @@ AT_CHECK([pspp -o pspp.csv list.sps]) AT_CHECK([cat pspp.csv], [0], [dnl Table: Reading 1 record from `data.txt'. Variable,Record,Columns,Format -avar,1,1- 5,F5.0 -bvar,1,6- 10,F5.0 +avar,1,1-5,F5.0 +bvar,1,6-10,F5.0 Table: Data List avar,bvar @@ -82,8 +82,8 @@ AT_CHECK([pspp -o pspp.csv list.sps]) AT_CHECK([cat pspp.csv], [0], [dnl Table: Reading 1 record from `data.txt'. Variable,Record,Columns,Format -avar,1,1- 5,F5.0 -bvar,1,6- 10,F5.0 +avar,1,1-5,F5.0 +bvar,1,6-10,F5.0 Table: Data List Case Number,avar,bvar diff --git a/tests/language/dictionary/weight.at b/tests/language/dictionary/weight.at index a4a927b9a2..36da46f4e3 100644 --- a/tests/language/dictionary/weight.at +++ b/tests/language/dictionary/weight.at @@ -83,8 +83,8 @@ AT_CHECK([pspp -o pspp.csv -o pspp.txt weight.sps]) AT_CHECK([cat pspp.csv], [0], [dnl Table: Reading 1 record from `weight.txt'. Variable,Record,Columns,Format -AVAR,1,1- 5,F5.0 -BVAR,1,6- 10,F5.0 +AVAR,1,1-5,F5.0 +BVAR,1,6-10,F5.0 Table: Descriptive Statistics ,N,Mean,S.E. Mean,Std Dev,Variance,Kurtosis,S.E. Kurt,Skewness,S.E. Skew,Range,Minimum,Maximum,Sum diff --git a/tests/language/expressions/evaluate.at b/tests/language/expressions/evaluate.at index cec32e7621..52123c75ad 100644 --- a/tests/language/expressions/evaluate.at +++ b/tests/language/expressions/evaluate.at @@ -2006,7 +2006,7 @@ AT_CHECK([pspp -o pspp.csv lag.sps]) AT_CHECK([cat pspp.csv], [0], [dnl Table: Reading 1 record from INLINE. Variable,Record,Columns,Format -W,1,1- 1,F1.0 +W,1,1-1,F1.0 Table: Data List W,X,Y,Z diff --git a/tests/language/stats/autorecode.at b/tests/language/stats/autorecode.at index 7e886fa08c..371746117f 100644 --- a/tests/language/stats/autorecode.at +++ b/tests/language/stats/autorecode.at @@ -142,8 +142,8 @@ list. AT_CHECK([pspp -O format=csv autorecode.sps], [0], [Table: Reading 1 record from INLINE. Variable,Record,Columns,Format -X,1,1- 5,A5 -Y,1,7- 7,F1.0 +X,1,1-5,A5 +Y,1,7-7,F1.0 Table: Recoding X into A. Old Value,New Value,Value Label @@ -454,8 +454,8 @@ list. AT_CHECK([pspp -O format=csv autorecode.sps], [0], [dnl Table: Reading 1 record from INLINE. Variable,Record,Columns,Format -X,1,1- 5,A5 -Y,1,7- 7,F1.0 +X,1,1-5,A5 +Y,1,7-7,F1.0 Table: Recoding X into A. Old Value,New Value,Value Label diff --git a/tests/language/stats/crosstabs.at b/tests/language/stats/crosstabs.at index 21154183fc..40117dc7e9 100644 --- a/tests/language/stats/crosstabs.at +++ b/tests/language/stats/crosstabs.at @@ -153,9 +153,9 @@ CROSSTABS TABLES y by z. AT_CHECK([pspp -o - -O format=csv -o pspp.txt crosstabs.sps], [0], [Table: Reading 1 record from INLINE. Variable,Record,Columns,Format -x,1,1- 2,F2.0 -y,1,3- 3,F1.0 -z,1,4- 4,F1.0 +x,1,1-2,F2.0 +y,1,3-3,F1.0 +z,1,4-4,F1.0 Table: Data List x,y,z @@ -355,9 +355,9 @@ CROSSTABS TABLES x BY y BY z/STATISTICS=ALL. AT_CHECK([pspp -o - -O format=csv -o pspp.csv -o pspp.txt crosstabs.sps], [0], [Table: Reading 1 record from INLINE. Variable,Record,Columns,Format -x,1,1- 2,F2.0 -y,1,3- 3,F1.0 -z,1,4- 4,F1.0 +x,1,1-2,F2.0 +y,1,3-3,F1.0 +z,1,4-4,F1.0 Table: Data List x,y,z diff --git a/tests/language/stats/descriptives.at b/tests/language/stats/descriptives.at index b737890253..7b4d29662c 100644 --- a/tests/language/stats/descriptives.at +++ b/tests/language/stats/descriptives.at @@ -39,23 +39,23 @@ descript all/stat=all/format=serial. AT_CHECK([pspp -O format=csv descriptives.sps], [0], [dnl Table: Reading 1 record from INLINE. Variable,Record,Columns,Format -V0,1,1- 1,F1.0 -V1,1,2- 2,F1.0 -V2,1,3- 3,F1.0 -V3,1,4- 4,F1.0 -V4,1,5- 5,F1.0 -V5,1,6- 6,F1.0 -V6,1,7- 7,F1.0 -V7,1,8- 8,F1.0 -V8,1,9- 9,F1.0 -V9,1,10- 10,F1.0 -V10,1,11- 11,F1.0 -V11,1,12- 12,F1.0 -V12,1,13- 13,F1.0 -V13,1,14- 14,F1.0 -V14,1,15- 15,F1.0 -V15,1,16- 16,F1.0 -V16,1,17- 17,F1.0 +V0,1,1-1,F1.0 +V1,1,2-2,F1.0 +V2,1,3-3,F1.0 +V3,1,4-4,F1.0 +V4,1,5-5,F1.0 +V5,1,6-6,F1.0 +V6,1,7-7,F1.0 +V7,1,8-8,F1.0 +V8,1,9-9,F1.0 +V9,1,10-10,F1.0 +V10,1,11-11,F1.0 +V11,1,12-12,F1.0 +V12,1,13-13,F1.0 +V13,1,14-14,F1.0 +V14,1,15-15,F1.0 +V15,1,16-16,F1.0 +V16,1,17-17,F1.0 Table: Descriptive Statistics ,N,Mean,S.E. Mean,Std Dev,Variance,Kurtosis,S.E. Kurt,Skewness,S.E. Skew,Range,Minimum,Maximum,Sum diff --git a/tests/language/utilities/title.at b/tests/language/utilities/title.at index bcc0320a2d..822b5c5091 100644 --- a/tests/language/utilities/title.at +++ b/tests/language/utilities/title.at @@ -77,8 +77,8 @@ dnl Filter out the dates/times AT_CHECK([[sed 's/(Entered [^)]*)/(Entered )/' pspp.csv]], [0], [dnl Table: Reading 1 record from INLINE. Variable,Record,Columns,Format -X,1,1- 1,F1.0 -Y,1,2- 2,F1.0 +X,1,1-1,F1.0 +Y,1,2-2,F1.0 Table: Documents "document First line of a document diff --git a/tests/language/xforms/compute.at b/tests/language/xforms/compute.at index 981561aad5..65ca4af121 100644 --- a/tests/language/xforms/compute.at +++ b/tests/language/xforms/compute.at @@ -105,7 +105,7 @@ END DATA. AT_CHECK([pspp -O format=csv compute.sps], [0], [Table: Reading 1 record from INLINE. Variable,Record,Columns,Format -ITEM,1,1- 3,F3.0 +ITEM,1,1-3,F3.0 ]) AT_CHECK([cat compute-sum.out], [0], [ 123 123.00 @&t@ diff --git a/tests/language/xforms/count.at b/tests/language/xforms/count.at index 0812bc0699..4a67b0273b 100644 --- a/tests/language/xforms/count.at +++ b/tests/language/xforms/count.at @@ -75,8 +75,8 @@ LIST. AT_CHECK([pspp -O format=csv count.sps], [0], [dnl Table: Reading 1 record from INLINE. Variable,Record,Columns,Format -v1,1,1- 2,A2 -v2,1,3- 4,A2 +v1,1,1-2,A2 +v2,1,3-4,A2 Table: Data List v1,v2,c -- 2.30.2