simon-git: puzzles (main): Simon Tatham
Commits to Tartarus hosted VCS
tartarus-commits at lists.tartarus.org
Sun Apr 23 15:04:21 BST 2023
TL;DR:
35cd44c make_prefs_path(): tolerate NULL inputs.
1fa2834 Support user preferences on Windows.
f01b167 GTK: stop referring to &thegame in prefs I/O functions.
Repository: https://git.tartarus.org/simon/puzzles.git
On the web: https://git.tartarus.org/?p=simon/puzzles.git
Branch updated: main
Committer: Simon Tatham <anakin at pobox.com>
Date: 2023-04-23 15:04:21
commit 35cd44c563ec58e00a89109ef1f5450b08a3faa6
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=35cd44c563ec58e00a89109ef1f5450b08a3faa6;hp=5c0def1850b2c09af300f09cd48f714f2505d217
Author: Simon Tatham <anakin at pobox.com>
Date: Sun Apr 23 14:53:11 2023 +0100
make_prefs_path(): tolerate NULL inputs.
Just noticed that if prefs_dir() returns NULL, we'll already have
passed it to this function before the calling functions get round to
checking. I think it's less wordy all round to make this helper
function propagate NULL than to mess about with lots of extra if
statements in between all the calls.
misc.c | 3 +++
1 file changed, 3 insertions(+)
commit 1fa28340e8e8d8459456469c72f7156ccf1493f1
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=1fa28340e8e8d8459456469c72f7156ccf1493f1;hp=35cd44c563ec58e00a89109ef1f5450b08a3faa6
Author: Simon Tatham <anakin at pobox.com>
Date: Sun Apr 23 14:54:29 2023 +0100
Support user preferences on Windows.
This is done using basically the same methods as on Unix, and just
translating the system calls in save_prefs to a different API.
puzzles.but | 8 ++--
windows.c | 152 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 156 insertions(+), 4 deletions(-)
commit f01b1674bd862e1792b5216bd5d832cd52a170ae
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=f01b1674bd862e1792b5216bd5d832cd52a170ae;hp=1fa28340e8e8d8459456469c72f7156ccf1493f1
Author: Simon Tatham <anakin at pobox.com>
Date: Sun Apr 23 14:58:31 2023 +0100
GTK: stop referring to &thegame in prefs I/O functions.
I had to do this in the Windows front end to cope with compiling in
both COMBINED and one-puzzle mode: you can't refer to &thegame because
it might not exist in this build, so instead, if you want to load/save
preferences for a given midend, you ask that midend for _its_ game
structure, and use that to make the necessary file names.
On Unix, we don't have COMBINED mode. But now I've thought of it, this
seems like a good idiom anyway, for the sake of futureproofing against
the day someone decides to implement combined mode on Unix.
delete_prefs() doesn't get passed a frontend _or_ a midend, so that
just has to take a bare 'const game *' parameter, and in main() we
pass &thegame to it. So that will still need changing in a combined
mode, if one is ever added.
gtk.c | 28 +++++++++++++++-------------
1 file changed, 15 insertions(+), 13 deletions(-)
More information about the tartarus-commits
mailing list