Jelajahi Sumber

Use G_add_error_handler() instead of G_set_error_routine()

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@40522 15284696-431f-4ddb-bdfa-cd5b030d7da7
Glynn Clements 15 tahun lalu
induk
melakukan
154df259d2
1 mengubah file dengan 2 tambahan dan 9 penghapusan
  1. 2 9
      raster/r.mapcalc/evaluate.c

+ 2 - 9
raster/r.mapcalc/evaluate.c

@@ -241,13 +241,10 @@ static expr_list *exprs;
 
 
 /****************************************************************************/
 /****************************************************************************/
 
 
-static int error_handler(const char *msg, int fatal)
+static void error_handler(void *p)
 {
 {
     expr_list *l;
     expr_list *l;
 
 
-    if (!fatal)
-	return 0;
-
     for (l = exprs; l; l = l->next) {
     for (l = exprs; l; l = l->next) {
 	expression *e = l->exp;
 	expression *e = l->exp;
 	int fd = e->data.bind.fd;
 	int fd = e->data.bind.fd;
@@ -255,10 +252,6 @@ static int error_handler(const char *msg, int fatal)
 	if (fd >= 0)
 	if (fd >= 0)
 	    unopen_output_map(fd);
 	    unopen_output_map(fd);
     }
     }
-
-    G_unset_error_routine();
-    G_fatal_error("%s", msg);
-    return 0;
 }
 }
 
 
 static void setup_rand(void)
 static void setup_rand(void)
@@ -291,7 +284,7 @@ void execute(expr_list * ee)
     setup_rand();
     setup_rand();
 
 
     exprs = ee;
     exprs = ee;
-    G_set_error_routine(error_handler);
+    G_add_error_handler(error_handler, NULL);
 
 
     for (l = ee; l; l = l->next) {
     for (l = ee; l; l = l->next) {
 	expression *e = l->exp;
 	expression *e = l->exp;