John Darrington [Sun, 30 Aug 2020 05:43:32 +0000 (07:43 +0200)]
dummy.c: Conform to exact prototypes
Apparently certain toolchains complain if the symbols in dummy.c do not
exactly match their declarations. This should not be a problem unless
the compiler has enabled a lot of warnings, and is treating those warnings
as errors, (which is inadvisable except under very special circumstances).
However, it appears that some people are doing that.
John Darrington [Sun, 30 Aug 2020 05:45:01 +0000 (07:45 +0200)]
Remove _base_init functions from custom widget definitions.
These served no purpose, and are in Gtk+ only for reasons of
legacy so far as I can make out. Also use G_TYPE_DEFINE macros
instead of explicit *_get_type function definitions.
xml-parser-generator - iterate over sorted dict - #58975
I sort the dict before iteration because the normal
iterator over a dict is not reproducible and will generate
different code in each run. This will work but the
build is not reproducible.
John Darrington [Sat, 29 Aug 2020 06:26:23 +0000 (08:26 +0200)]
src/ui/gui/psppire-conf.c: Use GError instead of strerror.
Apparently the use of strerror was causing problems on certain
platforms. In this case, since the function being checked provides
a GError argument it makes sense to use that instead.
Warning: adhere to const qualifier for initializations and assignments
This commit avoids the warnings:
warning: initialization discards ‘const’ qualifier from pointer target type
warning: assignment discards ‘const’ qualifier from pointer target type
Warnings: missing initializer for value_tables and function type cast (GObject)
I fixed the warnings:
warning: missing initializer for field ‘value_table’ of ‘GTypeInfo’
warning: cast between incompatible function types
by replacing the handwritten type info code with G_DEFINE_TYPE...
macros (preferred). When this was not possible due to usage of
base init functions I added casts and the initializer.
Warnings: add AM_CFLAGS also for the psppire build
With the new setup the psppire and glade build honours the
AM_CFLAGS setup. This includes the Wextra warnings which
show some more warnings. The two checks which are disabled are
-Wno-sign-compare : disabled also for core pspp
-Wno-unused-parameter : many callbacks result in unused parameters
limit the number of variables in barchart from crosstabs #58968
The barchart was created with more than two variables from
the crosstabs subcommand. I added an assertion and limit
the number of variables to two. This bug resulted in a
regression failure (crash) for test
fixed range check in parse_record_placement (32Bit/64Bit issue) #58968
The regression failed for test "lexer crash due to overflow" (403)
on i386 architecture. The reason is that long is 64Bit on amd64 while
it is 32Bit on i386. The code used long as type that can hold larger
values than int which does not work on 32Bit systems.
The change keeps the value as double as long as the range checks are done.
sys-file-reader: get_text_token did not set delimiter - bug #58943
parse_mrsets used loop local variables which were not initialized.
The regression worked with low compiler optimization levels because
the value for "delimiter" was kept over the loop iterations.
get_text_token did not set the delimiter value when only delimiters
are left in the string. I set the delimiter value to the last value
in the string in that case. I initialized the variables to see the
bug also in -O0.
Ben Pfaff [Sun, 2 Aug 2020 21:26:31 +0000 (21:26 +0000)]
tests: More character encoding issues on command line.
Unix-like systems don't have a command-line encoding, so we can pass
whatever bytes we want. mingw uses some particular encoding for
command line arguments, so this screws up trying to pass UTF-8 in. This
commit side-steps the problem by passing only ASCII characters on the
command line and making the test program decode the bytes.
Ben Pfaff [Sun, 2 Aug 2020 21:26:31 +0000 (21:26 +0000)]
tests: Avoid dealing with character encoding issues on command line.
Unix-like systems don't have a command-line encoding, so we can pass
whatever bytes we want. mingw uses some particular encoding for
command line arguments, so this screws up trying to pass UTF-8 in. This
commit side-steps the problem by passing only ASCII characters on the
command line and making the test program decode the bytes.
Ben Pfaff [Sun, 2 Aug 2020 19:03:42 +0000 (19:03 +0000)]
tests: Don't output to PDF without a good reason.
PDF output can cause spurious error messages from Pango to appear in the
output (which would be nice to fix but I'm not sure how) and it's not
always configured in, so omit it in MRSETS where it's not really needed.
gui: clipboard CUT and COPY store same data with/without label
clipboard store data with or without value labels depending on
the setting in the data view. clipboard cut was always storing
the raw data.
With this patch copy and cut both store raw data or labels
depending on the view setting.
With this patch pasting from clipboard also interprets labels as
valid data. First it is checked if the pasted data is a label for
the destination variable. Then the corresponding data is stored.
John Darrington [Sat, 11 Jul 2020 13:31:33 +0000 (15:31 +0200)]
src/ui/gui/org.fsf.pspp.desktop.in: Add translator hint
Add an instruction to not translate the Icon name. Recent versions of
xgettext (correctly) ignore this entry. But earlier versions erroneously
include it in the list of strings to translate.
John Darrington [Sat, 11 Jul 2020 07:35:29 +0000 (09:35 +0200)]
src/output/cairo-chart.h (xrchart_write_scale): Check the range and deal with the consequences.
If a chart was requested where either scale had an range of zero
(the minimum value and the maximum value were equal), then all
sorts of memory errors could occur later in the chart's rendering.
This change checks for this condition early and refuses to draw the
chart in this case.
gui: cut from editable to clipboard when cell is focused
When a cell is focused, then the cut operation
must operate on the selection in the cell editable
and not on the complete cell, i.e. the store content.
gui: trim displayed string for string variables (spaces)
The current gui always renders strings in the datasheet view
with the full width by adding spaces to the end of a string.
This patch renders the strings in the same way as they are rendered
in the status edit box above the cells array, i.e. trailing whitespace
is removed. Editing strings is straightforward.