[GRASS-SVN] r38570 - grass/branches/releasebranch_6_4/lib/gis

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Aug 2 06:01:24 EDT 2009


Author: neteler
Date: 2009-08-02 06:01:24 -0400 (Sun, 02 Aug 2009)
New Revision: 38570

Modified:
   grass/branches/releasebranch_6_4/lib/gis/cats.c
   grass/branches/releasebranch_6_4/lib/gis/color_rules.c
Log:
backport of minor changes

Modified: grass/branches/releasebranch_6_4/lib/gis/cats.c
===================================================================
--- grass/branches/releasebranch_6_4/lib/gis/cats.c	2009-08-02 09:28:07 UTC (rev 38569)
+++ grass/branches/releasebranch_6_4/lib/gis/cats.c	2009-08-02 10:01:24 UTC (rev 38570)
@@ -668,7 +668,9 @@
     *label = 0;
     val = G_get_raster_value_d(rast, data_type);
     i = G_quant_get_cell_value(&pcats->q, val);
-    /* DEBUG fprintf (stderr, "val %lf found i %d\n", val, i); */
+
+    G_debug(5, "G_get_raster_cat(): val %lf found i %d", val, i);
+
     if (!G_is_c_null_value(&i) && i < pcats->ncats) {
 	if (pcats->labels[i] != NULL)
 	    return pcats->labels[i];

Modified: grass/branches/releasebranch_6_4/lib/gis/color_rules.c
===================================================================
--- grass/branches/releasebranch_6_4/lib/gis/color_rules.c	2009-08-02 09:28:07 UTC (rev 38569)
+++ grass/branches/releasebranch_6_4/lib/gis/color_rules.c	2009-08-02 10:01:24 UTC (rev 38570)
@@ -254,11 +254,17 @@
 static int load_rules_name(struct Colors *colors, const char *name, DCELL min,
 			   DCELL max)
 {
+    int ret;
     char path[GPATH_MAX];
 
     sprintf(path, "%s/etc/colors/%s", G_gisbase(), name);
 
-    return load_rules_file(colors, path, min, max);
+    ret = load_rules_file(colors, path, min, max);
+
+    if (!ret)
+	G_fatal_error(_("Unable to load color rules <%s>"), name);
+
+    return ret;
 }
 
 int G_make_colors(struct Colors *colors, const char *name, CELL min, CELL max)



More information about the grass-commit mailing list