Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mRemoteNG/PuTTYNG.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/unix
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2022-08-24 09:56:45 +0300
committerSimon Tatham <anakin@pobox.com>2022-09-01 22:43:23 +0300
commit761df2fca63ad4ac2badec4e0d359ae18a94608d (patch)
treee43f26e4d7642aaf7a4f42d30060434e885c395c /unix
parent6a1b713e135a7db1f57017b5bbbb7fcba365204b (diff)
Replace integer context2 encoding in conf_editbox_handler.
I was just about to add another ordinary edit box control, and found I couldn't remember what went in the context2 argument to conf_editbox. When I looked it up, I realised it was one of those horrid integer encodings of the form '1 means this, -1 means that, less than -1 means some parametrised property where the parameter is obtained by negating the encoded integer'. Those are always awkward to remember, and worse to extend. So I've replaced the integer context2 used with conf_editbox_handler with a pointer to a small struct type in which the types and parameters have sensible names and are documented. (To avoid annoying const warnings everywhere, this also meant extending the 'intorptr' union to have a const void * branch as well as a 'void *'. Surprised I haven't needed that before. But if I introduce any more of these parameter structures, it'll come in useful again.)
Diffstat (limited to 'unix')
-rw-r--r--unix/config-gtk.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/unix/config-gtk.c b/unix/config-gtk.c
index 0ffb1ad9..be70f5cb 100644
--- a/unix/config-gtk.c
+++ b/unix/config-gtk.c
@@ -112,7 +112,7 @@ void gtk_setup_config_box(struct controlbox *b, bool midsession, void *win)
HELPCTX(no_help));
ctrl_editbox(s, "Horizontal offset for shadow bold:", 'z', 20,
HELPCTX(no_help), conf_editbox_handler,
- I(CONF_shadowboldoffset), I(-1));
+ I(CONF_shadowboldoffset), ED_INT);
/*
* Markus Kuhn feels, not totally unreasonably, that it's good
@@ -155,6 +155,6 @@ void gtk_setup_config_box(struct controlbox *b, bool midsession, void *win)
"X Window System settings");
ctrl_editbox(s, "Window class name:", 'z', 50,
HELPCTX(no_help), conf_editbox_handler,
- I(CONF_winclass), I(1));
+ I(CONF_winclass), ED_STR);
}
}