summaryrefslogtreecommitdiffabout
authorSergey Poznyakoff <gray@gnu.org>2020-06-14 10:42:52 (GMT)
committer Sergey Poznyakoff <gray@gnu.org>2020-06-14 10:44:31 (GMT)
commit17e80d2f2a9bb5fe8f64d4c77fb9207dda360fca (patch) (side-by-side diff)
tree0e7329b7539032a5f3d678eba32f14a68ad31643
parent8d4d064a9c467148be15cb54d625933e2cd0845f (diff)
downloadjumper-17e80d2f2a9bb5fe8f64d4c77fb9207dda360fca.tar.gz
jumper-17e80d2f2a9bb5fe8f64d4c77fb9207dda360fca.tar.bz2
Use grecs with wordsplit v1.1. Minor bugfixes.HEADmaster
* extra/expr.y (expr_eval): Fix size of the IFSTAT argument. * extra/ifalive.h (IFSTAT_SIZE): New define. (error,lex_init): New protos.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--extra/expr.y5
-rw-r--r--extra/ifalive.h6
m---------grecs0
3 files changed, 9 insertions, 2 deletions
diff --git a/extra/expr.y b/extra/expr.y
index 098fc3e..d7e9957 100644
--- a/extra/expr.y
+++ b/extra/expr.y
@@ -139,6 +139,7 @@ expr_binop_comp(struct expr_node *a, struct expr_node *b,
}
void yyerror(char const *s);
+int yylex (void);
static struct expr_node *parse_tree;
%}
@@ -408,8 +409,8 @@ expr_eval(int argc, char **argv, IFSTAT a, IFSTAT b)
lex_init(argc, argv);
if (yyparse())
exit(1);
- memcpy(env.stat[0], a, sizeof a);
- memcpy(env.stat[1], b, sizeof b);
+ memcpy(env.stat[0], a, IFSTAT_SIZE);
+ memcpy(env.stat[1], b, IFSTAT_SIZE);
node_eval(parse_tree, &env, &res);
return res.v_bool;
}
diff --git a/extra/ifalive.h b/extra/ifalive.h
index da070fa..127885e 100644
--- a/extra/ifalive.h
+++ b/extra/ifalive.h
@@ -25,4 +25,10 @@ enum {
};
typedef uintmax_t IFSTAT[MAX_STATS];
+#define IFSTAT_SIZE (sizeof(uintmax_t) * MAX_STATS)
int expr_eval(int argc, char **argv, IFSTAT a, IFSTAT b);
+
+void error(int ec, char const *fmt, ...);
+void lex_init(int argc, char **argv);
+
+
diff --git a/grecs b/grecs
-Subproject b06fb7d30415eec1d2efb39286ab96070c724fd
+Subproject 893d875a4065acb757fef55876c391b1dd07004

Return to:

Send suggestions and report system problems to the System administrator.