Jacob points out that changing TICKSPERSEC in unix.h changed the
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Sat, 8 Jan 2005 13:08:32 +0000 (13:08 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Sat, 8 Jan 2005 13:08:32 +0000 (13:08 +0000)
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.

git-svn-id: svn://svn.tartarus.org/sgt/putty@5080 cda61777-01e9-0310-a592-d414129be87e

settings.c

index 4a93400..eaae343 100644 (file)
@@ -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);