Matches work completed in #5169 for Keyman Core, kmx_file.cpp.
While this code will hopefully disappear in 15.0, it's good to make sure
we aren't diverging beforehand.
Also tidies up a couple of other cases in `CopyKeyboard` in Keyman Core.
(cherry picked from commit c9897bb38f)
This change fixes the FixupKeyboard method. In the .kmx files on
disk array pointers for an empty array point to the end of the file
(one byte after the end of the data structure). When we expand the
pointers in FixupKeyboard this leads to `cgp->dpKeyArray` to point to an
unallocated memory location - this shouldn't matter since we don't
try to read or write at this location if the Key array is empty,
but armhf still seems to raise a SIGBUS, probably because we cast
the value to a `LPKEY`. This change sets `cgp->dpKeyArray` to `NULL`
if we have an empty key array, similar to what's done for the strings.
Closes#5072.
(cherry picked from commit 68706c9451)
s390x is big-endian which we currently don't support (#5111).
Only build on architectures supported by Debian. This excludes the
following little-endian architectures:
alpha arm ia64 riscv64 sh4 x32 arm64ilp32 mipsn32el
and the following big-endian ones:
avr32 hppa m68k mips mips64 mipsn32 powerpc ppc64 s390 sparc sparc64
See https://wiki.debian.org/SupportedArchitectures
and https://wiki.debian.org/ArchitectureSpecificsMemo
(cherry picked from commit 9c2d30948c)
Compiling on armhf outputs two warnings:
- NULL used in arithmetic [-Wpointer-arith] (line 289 and 290)
- unused parameter ‘dwFileSize’ [-Wunused-parameter] (line 264)
(related to #5072)
(cherry picked from commit 99e9a7cf61)
Don't re-set context if it changed because the cursor location was
wrong. When the user switches to the EuroLatin keyboard in the
middle of the line, we're getting a wrong cursor location. This will
be fixed with the next keypress, but it leads to the context string
suddenly having more characters added to the front. If we re-set the
context because it's different now we will loose the information we
previously added to the context.
We now compare the end of the string. If the new context string ends
with the old context string we assume that the cursor position got
updated and don't re-set the context.
This fixes#4678.