1
0
Fork 0
Commit graph

79 commits

Author SHA1 Message Date
James Turner
ec30b0d5db HTS: fix a crash if malloc returns null
This is probably only a partial fix, but won’t hurt.

Sentry-Id: FLIGHTGEAR-39N
2020-12-18 14:02:03 +00:00
James Turner
fe17cfc84d Fix a crash on macOS if a joystick fails to open 2020-12-17 13:53:00 +00:00
Scott Giese
43c530b660 Modernize: std::string_literals 2020-12-05 14:25:59 -06:00
James Turner
329d3cdd13 PLIB includes fix from Florent 2020-09-29 12:30:34 +01:00
James Turner
22bad9db33 Fix for CMake/system libSGM issue: consistent path
Our copy of libGSM, and a system-wide version have different include
suffixes, so adjust the FindGsm.cmake so that the returned include-path
is consistent with our internal version.

See discussion in:https://sourceforge.net/p/flightgear/codetickets/2368/
2020-09-03 19:18:57 +01:00
Scott Giese
ad2bf3cd09 Revert "Resolve Deprecation Warnings"
This reverts commit 8cede3f065.
2020-08-30 17:58:36 -05:00
Scott Giese
5a29e7aade Resolve warning: Double Delete 2020-08-29 10:47:12 -05:00
Scott Giese
8cede3f065 Resolve Deprecation Warnings 2020-08-29 10:12:35 -05:00
James Turner
55e971f808 Asan: fix an Flite error found by Michael Danilov
We have been missing a build flag for FLite, to specify the alignment
of some unions. ASan detected this as access outwith allocated memory.
Fix is to pass a defining indicating we’re on a 64-bit system.

See discussion here:
https://sourceforge.net/p/flightgear/codetickets/2361/
2020-08-24 17:40:35 +01:00
James Turner
fef50310bf Cmake: fix some issues Scott spotted. 2020-08-23 18:15:07 +01:00
James Turner
87a7221051 Linux Cmake fixes 2020-08-23 11:31:37 +01:00
James Turner
47ff3e9f67 Improve CMake strucutre 2020-08-23 11:31:37 +01:00
James Turner
2084e11d60 Trying to fix read of uninitialised memory on Linux
This should ‘already work’, but seeing if this makes any difference.
2020-08-12 15:30:33 +01:00
James Turner
3bbb9ed9ac Update to latest Sqlite.
Amongst other things, this fixes a warning with newer macOS SDK version
(use of OSAtomic which is deprecated).
2020-06-22 10:25:51 +01:00
James Turner
dce282d7b8 Rename js.h -> FlightGear_js.h
Ensure we don’t get weird conflicts as our internal version is
starting to diverge from the original PLIB one.
2020-06-11 17:48:49 +01:00
James Turner
00cffc2f01 Allow correct re-init of joysticks on macOS
With this change, “Reload Input” will discover newly attached devices
on macOS, which previously did not work.

Also add correct detection of disconnected devices, which previously
was not handled well, especially with the new ‘keep trying to open
devices’ behaviour of FGJoystickInput.

Should fix:
https://sourceforge.net/p/flightgear/codetickets/2259/
2020-06-11 17:43:55 +01:00
James Turner
a7d8d9c2ab Use -fPIC for building Sqlite 2020-06-09 10:34:02 +01:00
James Turner
61ed9efac8 FreeBSD: Merge from fixes from martymac
These were applied to upstream PLIB, ensure they’re applied to our
fork
2020-05-09 14:22:13 +01:00
James Turner
67af9ebc25 Fix Cmake typo, don’t quote multiple definitions 2020-05-08 14:53:09 +01:00
James Turner
fe16551cf6 Better RelWithDebInfo flags for CL.exe 2020-05-08 14:32:40 +01:00
James Turner
96be636240 Fixing up HID event input on Mac/Windows
Removing old macOS separate input - the HID version is better in
every way.
2020-04-01 15:29:58 +01:00
James Turner
f93aadbae6 Clang: fix a warning (char used as array subscript) 2020-03-24 22:37:23 +00:00
James Turner
c2ce25136a Tweak HTS code to allow UTF-8 paths on Windows 2020-03-13 12:22:22 +00:00
James Turner
7e9930e871 Move fnt code from PLIB into 3rdparty
This enables us to fix TXF loading to use UTF8 paths, required for
handling non-ASCII paths on Windows.
2020-03-13 12:21:56 +00:00
Julian Smith
f3d1135320 Various fixes for building on OpenBSD. 2019-09-04 10:55:43 +01:00
James Turner
309aaa794f Flite always compiled now. 2019-06-03 16:51:08 +01:00
James Turner
84c5ea976b Try to make UDev detection quieter 2019-05-28 09:14:49 -07:00
James Turner
396d9e4c3b Soften the HID dependency, so we can build
without HID if the necessary 3rdparty libs are not found.
2019-05-28 17:09:58 +01:00
Florent Rougon
df352346ad jsWindows: fail gracefully when joyGetDevCaps() returns undocumented values
According to Pfeffer's report[1] and many other messages on the
Internet, joyGetDevCaps() can return the (so far) undocumented value
165, which some say is JOYERR_PARMS. Since this is a valid return code
for joyGetPosEx() (not joyGetDevCaps()!), handle a few return codes from
that function too, and don't throw an exception when joyGetDevCaps()'s
return value is not one of the documented ones (we simply can't trust
its documentation).

[1] https://sourceforge.net/p/flightgear/mailman/message/36657149/
2019-05-04 08:58:15 +02:00
Florent Rougon
a5792617f7 jsWindows: throw exception instead of using an assert
Since asserts can be compiled as no-ops, throw an exception rather than
doing assert(false), in case the code passed to
joyGetDevCaps_errorString() is not one of the expected values.
2019-04-30 08:14:35 +02:00
Florent Rougon
babf0ded0c jsWindows: add debug output
Every code path that causes a joystick to report notWorking() should now
have an associated error message logged with class 'input' at level
'debug' or higher.
2019-04-29 16:38:11 +02:00
Florent Rougon
8e0271d9f6 jsWindows: remove undefined behavior when joyGetNumDevs() > INT_MAX
If joyGetNumDevs() > INT_MAX, casting it to an 'int' leads to undefined
behavior. On the other hand, after the 'ident >= 0' test succeeded, it
is perfectly safe to use static_cast<unsigned int>(ident), since 'ident'
is of type 'int'. Then we get to compare two unsigned ints, which is
well defined.
2019-04-29 13:42:32 +02:00
James Turner
9d71d09072 Enable HID-input on Windows 2019-04-27 18:54:13 +01:00
James Turner
6366dea197 HID event-input debugging
Adding more debugEvents-enabled log output to HDI input
2018-10-04 12:17:01 +01:00
Ganael Laplanche
bc01619fe1 jsSetError() takes only two arguments (unlike ulSetError()) 2018-06-12 12:10:00 +02:00
Ganael Laplanche
327d8021d0 Add missing defines and includes from removed ul.h 2018-06-12 12:09:41 +02:00
James Turner
87e461bb7e Hopefully fix FreeBSD joystick support 2018-05-21 17:17:42 +02:00
James Turner
4a38fa7f19 Windows build fix 2018-05-04 08:31:11 +01:00
Florent Rougon
0aa692a4df PLIB joystick: don't nuke kernel-level deadband settings on Linux
So far, the Linux PLIB implementation used to nuke any deadband set at
kernel level with jscal(1) as soon as the joystick was opened. This
broke joystick calibration for FG and unrelated programs, for people who
cared to tune their kernel-level deadband setting.

This fixes PLIB bug #47[1]. Note that the fix has already been in Debian
buster's plib for some time (plib 1.8.5-8 uploaded on 24 Jul 2017[2]).

[1] https://sourceforge.net/p/plib/bugs/47/

[2] https://tracker.debian.org/news/858564/accepted-plib-185-8-source-into-unstable/
2018-05-03 21:51:36 +02:00
James Turner
102fe04e91 Import PLIB JS code into FlightGear
- will permit bug-fixing which cannot occur for
  official PLIB.
2018-05-03 00:02:09 +01:00
Edward d'Auvergne
f539e03729 TestSuite: Added the Autotools auto-generated CppUnit config-auto.h file. 2018-03-23 17:26:05 +01:00
Edward d'Auvergne
e66db5ca3a TestSuite: Support for building the FlightGear bundled CppUnit library.
The CppUnit source is built as a static library and linked to the run_test_suite
executable.  The FlightGear CppUnit library is now build using CMake rather than
using the Autotools build system.
2018-03-23 17:26:05 +01:00
Edward d'Auvergne
3c73600237 TestSuite: Addition of the SYSTEM_CPPUNIT option for distributors.
This is to allow for selecting between a system installed version of CppUnit or
the version bundled with flightgear.
2018-03-23 17:26:05 +01:00
Edward d'Auvergne
f4ee276472 TestSuite: Addition of a stripped down version of CppUnit 1.14.0.
This is the version maintained by the freedesktop.org organisation and is
documented at https://www.freedesktop.org/wiki/Software/cppunit/.  All
unnecessary files have been stripped out.
2018-03-23 17:26:05 +01:00
James Turner
407a6d4b3e Linux fixes for HID-input 2017-12-20 04:04:17 -08:00
James Turner
c14f37edc0 HID-api codebase
This is based off James’ fork on GitHub, with report-descriptor
parsing added to the basic HIDAPi codebase.
2017-12-15 15:46:57 +00:00
James Turner
09fe744de0 Test helper CMake macro.
Also build the test code first, so tests can reside in source tree as
well as the test tree.

Finally, build local Sqlite with -fpic to give consistent linkage when
using either built-in or system sqlite.
2017-03-26 12:15:29 +01:00
Erik Hofman
bb781e5e10 Fix the REPLACE statement for WITHOUT ROWID tables that lack secondary indexes so that it works correctly with triggers and foreign keys. This was a new bug caused by performance optimizations added in version 3.16.0. Ticket 30027b613b4
Fix the sqlite3_value_text() interface so that it correctly translates content generated by zeroblob() into a string of all 0x00 characters. This is a long-standing issue discovered after the 3.16.1 release by OSS-Fuzz
Fix the bytecode generator to deal with a subquery in the FROM clause that is itself a UNION ALL where one side of the UNION ALL is a view that contains an ORDER BY. This is a long-standing issue that was discovered after the release of 3.16.1. See ticket 190c2507.
Adjust the sqlite3_column_count() API so it more often returns the same values for PRAGMA statements as it did in prior releases, to minimize disruption to applications that might be using that interface in unexpected ways.
2017-01-07 15:51:23 +01:00
Erik Hofman
7618cbffc2 Fix a bug concerning the use of row values within triggers (see ticket 8c9458e7) that was in version 3.15.0 but was not reported until moments after the 3.16.0 release was published. 2017-01-06 12:58:03 +01:00
Erik Hofman
a50d614c77 Switch to SQLite 3.16 which promises about 9% fewer CPU cycles 2017-01-03 11:14:25 +01:00