From 48afbcb0783c1b791051acb561aadebd80d26f44 Mon Sep 17 00:00:00 2001 From: "Sven M. Hallberg" <pesco@khjk.org> Date: Fri, 24 May 2013 22:48:15 +0200 Subject: [PATCH] justify a const cast --- src/cfgrammar.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/cfgrammar.c b/src/cfgrammar.c index e9c9d5dc..0ce3cbf2 100644 --- a/src/cfgrammar.c +++ b/src/cfgrammar.c @@ -462,7 +462,8 @@ static void remove_all_shorter(size_t k, HCFStringMap *m) } // h_follow adapted to the signature of StringSetFun -static inline const HCFStringMap *h_follow_(size_t k, HCFGrammar *g, HCFChoice **s) +static inline +const HCFStringMap *h_follow_(size_t k, HCFGrammar *g, HCFChoice **s) { return h_follow(k, g, *s); } @@ -538,6 +539,10 @@ HCFStringMap *h_predict(size_t k, HCFGrammar *g, // { ab | a <- first_k(rhs), b <- follow_k(A), |ab|=k } const HCFStringMap *first_rhs = h_first_seq(k, g, rhs->items); + + // casting the const off of A below. note: stringset_extend does + // not touch this argument, only passes it through to h_follow + // in this case, which accepts it, once again, as const. stringset_extend(g, ret, k, first_rhs, h_follow_, (HCFChoice **)&A); // make sure there are only strings of length _exactly_ k -- GitLab