changeset 2285:3e0a2661f0a0

[project @ 1996-05-29 02:29:25 by jwe]
author jwe
date Wed, 29 May 1996 02:29:25 +0000
parents a83ae9534d2c
children c0eed36e660d
files src/utils.cc
diffstat 1 files changed, 16 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/utils.cc	Tue May 28 17:03:46 1996 +0000
+++ b/src/utils.cc	Wed May 29 02:29:25 1996 +0000
@@ -487,6 +487,14 @@
 #endif
 }
 
+static void
+warn_old_style_preference (bool val, const string& sval)
+{
+  warning
+    ("preference of \"%s\" is obsolete -- use numeric value of %d instead",
+     sval.c_str (), (val ? 1 : 0));
+}
+
 // Check the value of a string variable to see if it it's ok to do
 // something.
 //
@@ -511,11 +519,17 @@
     {
       if (val.compare ("yes", 0, 3) == 0
 	  || val.compare ("true", 0, 4) == 0)
-	pref = 1;
+	{
+	  warn_old_style_preference (true, val);
+	  pref = 1;
+	}
       else if (val.compare ("never", 0, 5) == 0
 	       || val.compare ("no", 0, 2) == 0
 	       || val.compare ("false", 0, 5) == 0)
-	pref = 0;
+	{
+	  warn_old_style_preference (false, val);
+	  pref = 0;
+	}
     }
 
   return pref;