fix:core:fix handling of error number
authorhorwitz <horwitz@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Mon, 1 Mar 2010 22:06:08 +0000 (22:06 +0000)
committerhorwitz <horwitz@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Mon, 1 Mar 2010 22:06:08 +0000 (22:06 +0000)
git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@2976 ffa7fe5e-494d-0410-b361-a75ebd5db220

navit/navit/command.c
navit/navit/command.h

index 6872522..12d5d7d 100644 (file)
@@ -754,7 +754,7 @@ command_evaluate_to(struct attr *attr, char *expr, struct context *ctx, struct r
 }
 
 void
-command_evaluate_to_void(struct attr *attr, char *expr, int **error)
+command_evaluate_to_void(struct attr *attr, char *expr, int *error)
 {
        struct result res;
        struct context ctx;
@@ -762,12 +762,12 @@ command_evaluate_to_void(struct attr *attr, char *expr, int **error)
        if (!ctx.error)
                resolve(&ctx, &res, NULL);
        if (error)
-               *error=&ctx.error;
+               *error=ctx.error;
 
 }
 
 char *
-command_evaluate_to_string(struct attr *attr, char *expr, int **error)
+command_evaluate_to_string(struct attr *attr, char *expr, int *error)
 {
        struct result res;
        struct context ctx;
@@ -779,7 +779,7 @@ command_evaluate_to_string(struct attr *attr, char *expr, int **error)
        if (!ctx.error)
                ret=get_string(&ctx, &res);
        if (error)
-               *error=&ctx.error;
+               *error=ctx.error;
        if (ctx.error)
                return NULL;
        else
@@ -787,7 +787,7 @@ command_evaluate_to_string(struct attr *attr, char *expr, int **error)
 }
 
 int
-command_evaluate_to_int(struct attr *attr, char *expr, int **error)
+command_evaluate_to_int(struct attr *attr, char *expr, int *error)
 {
        struct result res;
        struct context ctx;
@@ -799,7 +799,7 @@ command_evaluate_to_int(struct attr *attr, char *expr, int **error)
        if (!ctx.error)
                ret=get_int(&ctx, &res);
        if (error)
-               *error=&ctx.error;
+               *error=ctx.error;
        if (ctx.error)
                return 0;
        else
@@ -807,7 +807,7 @@ command_evaluate_to_int(struct attr *attr, char *expr, int **error)
 }
 
 int
-command_evaluate_to_boolean(struct attr *attr, char *expr, int **error)
+command_evaluate_to_boolean(struct attr *attr, char *expr, int *error)
 {
        struct result res;
        struct context ctx;
@@ -826,7 +826,7 @@ command_evaluate_to_boolean(struct attr *attr, char *expr, int **error)
                        ret=res.attr.u.data != NULL;
        }
        if (error)
-               *error=&ctx.error;
+               *error=ctx.error;
        if (ctx.error)
                return 0;
        else    
index cb33a2e..ca30a9a 100644 (file)
@@ -13,10 +13,10 @@ struct callback_list;
 struct command_saved;
 struct command_table;
 struct navit;
-void command_evaluate_to_void(struct attr *attr, char *expr, int **error);
-char *command_evaluate_to_string(struct attr *attr, char *expr, int **error);
-int command_evaluate_to_int(struct attr *attr, char *expr, int **error);
-int command_evaluate_to_boolean(struct attr *attr, char *expr, int **error);
+void command_evaluate_to_void(struct attr *attr, char *expr, int *error);
+char *command_evaluate_to_string(struct attr *attr, char *expr, int *error);
+int command_evaluate_to_int(struct attr *attr, char *expr, int *error);
+int command_evaluate_to_boolean(struct attr *attr, char *expr, int *error);
 void command_evaluate(struct attr *attr, char *expr);
 void command_add_table_attr(struct command_table *table, int count, void *data, struct attr *attr);
 void command_add_table(struct callback_list *cbl, struct command_table *table, int count, void *data);