Compiler warning: comma at end of enumerator list [-Wpedantic]
Note 1: I decided to fix these warnings although trailing commas in
enums are allowed at least since C++11.
Note 2: I fixed only public headers because these headers may be
compiled in user code. To do: check internal headers.
fltk-config has been extended to allow more than one source file
and additional compiler flags and link libraries. This commit adds
documentation (no functional changes).
- add public getter and setter for
- document the new methods
- document that these methods are not yet used internally
- remove unnecessary friend declaration 'NEEDS_KEYBOARD' flag
- simplify Fl::focus(Fl_Widget *) using the new methods.
This commit fixes two similar warnings:
"cast between incompatible function types from ‘void (*)(Fl_Widget*)’
to ‘void (*)(Fl_Widget*, void*)’ [-Wcast-function-type]"
Unfortunately `execute_process(COMMAND pkg-config ...)` used for
CMake versions lower than 3.4 appends a trailing newline ('\n')
to the output variable which must be removed.
Replace double slash '//' returned by pkg-config with a single '/'
for consistency (applies to all CMake versions).
Tested with CMake 3.2.3 but we should probably raise the minimal
CMake version to a more recent version in the future.
Also refactor, reformat, and simplify code:
- move all variable substitutions to the beginning of the file
- simplify Cairo support and nesting of 'if' clauses
- unify indenting: 4 spaces, no tabs
See GitHub issue #710: "Fl_Preferences not stored on Windows 10"
Summary: don't use the undocumented registry key "Shell Folders",
use function SHGetFolderPathW() instead although this function is
meanwhile deprecated (but available since Windows XP).
Note: tested with 32-bit build running on Windows XP (works).
The previous attempt to fix this issue in commit
dcb4c39956 missed to remove the keyword
'struct' in the offending statement. This new commit actually removes
the compiler warning.
For some obscure reason finding the jpeg lib *after* configuring for
local zlib and/or local png lib failed and thus switched to using the
local jpeg unexpectedly. Searching for jpeg libs before png/zlib fixes
this issue.
Note: this is a pragmatic fix (aka workaround) rather than fixing the
underlying issue. It would be interesting to find out why this happened.