babl r358 - in trunk: . babl



Author: ok
Date: Sun Nov 16 20:35:57 2008
New Revision: 358
URL: http://svn.gnome.org/viewvc/babl?rev=358&view=rev

Log:
* babl/babl-fish-stats.c: (legal_error), (each_conv): show in red the
conversions that are worse than the current BABL_TOLERANCE instead of
the earlier arbitrary 0.01.


Modified:
   trunk/ChangeLog
   trunk/babl/babl-fish-stats.c

Modified: trunk/babl/babl-fish-stats.c
==============================================================================
--- trunk/babl/babl-fish-stats.c	(original)
+++ trunk/babl/babl-fish-stats.c	Sun Nov 16 20:35:57 2008
@@ -202,6 +202,24 @@
   return 0;
 }
 
+/* copied from babl-fish-path.c */
+#define BABL_LEGAL_ERROR    0.000001
+static double legal_error (void)
+{
+  static double error = 0.0;
+  const char   *env;
+
+  if (error != 0.0)
+    return error;
+
+  env = getenv ("BABL_TOLERANCE");
+  if (env && env[0] != '\0')
+    error = atof (env);
+  else
+    error = BABL_LEGAL_ERROR;
+  return error;
+}
+
 static int
 each_conv (Babl *babl,
            void *data)
@@ -214,7 +232,7 @@
   error = babl_conversion_error (&babl->conversion);
   cost  = babl_conversion_cost (&babl->conversion);
 
-  if (error > 0.01)
+  if (error > legal_error ())
     {
       fprintf (output_file, "<dt style='background-color: #fcc;'>%s</dt>", babl->instance.name);
       fprintf (output_file, "<dd style='background-color: #fcc;'>");



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]