From: Simon Tatham Date: Sat, 8 Jan 2005 13:08:32 +0000 (+0000) Subject: Jacob points out that changing TICKSPERSEC in unix.h changed the X-Git-Tag: 0.58~245 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=7647f57dc43155606132afc75f354b99c41a899a;p=PuTTY.git Jacob points out that changing TICKSPERSEC in unix.h changed the meaning of BellOverload{T,S} in Unix saved sessions. Add a Unix- specific backwards compatibility wart to settings.c to compensate. Of course when I do the serious config format revamp, I will ensure that no config item depends on internal #defines (these time intervals will be specified as a floating-point number of seconds) and this horror will be relegated to the old-config-compatibility code. [originally from svn r5080] --- diff --git a/settings.c b/settings.c index 4a93400e..eaae3436 100644 --- a/settings.c +++ b/settings.c @@ -287,8 +287,16 @@ void save_open_settings(void *sesskey, int do_host, Config *cfg) write_setting_filename(sesskey, "BellWaveFile", cfg->bell_wavefile); write_setting_i(sesskey, "BellOverload", cfg->bellovl); write_setting_i(sesskey, "BellOverloadN", cfg->bellovl_n); - write_setting_i(sesskey, "BellOverloadT", cfg->bellovl_t); - write_setting_i(sesskey, "BellOverloadS", cfg->bellovl_s); + write_setting_i(sesskey, "BellOverloadT", cfg->bellovl_t +#ifdef PUTTY_UNIX_H + * 1000 +#endif + ); + write_setting_i(sesskey, "BellOverloadS", cfg->bellovl_s +#ifdef PUTTY_UNIX_H + * 1000 +#endif + ); write_setting_i(sesskey, "ScrollbackLines", cfg->savelines); write_setting_i(sesskey, "DECOriginMode", cfg->dec_om); write_setting_i(sesskey, "AutoWrapMode", cfg->wrap_mode); @@ -574,8 +582,18 @@ void load_open_settings(void *sesskey, int do_host, Config *cfg) gppfile(sesskey, "BellWaveFile", &cfg->bell_wavefile); gppi(sesskey, "BellOverload", 1, &cfg->bellovl); gppi(sesskey, "BellOverloadN", 5, &cfg->bellovl_n); - gppi(sesskey, "BellOverloadT", 2*TICKSPERSEC, &cfg->bellovl_t); - gppi(sesskey, "BellOverloadS", 5*TICKSPERSEC, &cfg->bellovl_s); + gppi(sesskey, "BellOverloadT", 2*TICKSPERSEC, &i); + cfg->bellovl_t = i +#ifdef PUTTY_UNIX_H + / 1000 +#endif + ; + gppi(sesskey, "BellOverloadS", 5*TICKSPERSEC, &i); + cfg->bellovl_s = i +#ifdef PUTTY_UNIX_H + / 1000 +#endif + ; gppi(sesskey, "ScrollbackLines", 200, &cfg->savelines); gppi(sesskey, "DECOriginMode", 0, &cfg->dec_om); gppi(sesskey, "AutoWrapMode", 1, &cfg->wrap_mode);