justify a const cast

This commit is contained in:
Sven M. Hallberg 2013-05-24 22:48:15 +02:00
parent f55ec2f1ed
commit 48afbcb078

View file

@ -462,7 +462,8 @@ static void remove_all_shorter(size_t k, HCFStringMap *m)
} }
// h_follow adapted to the signature of StringSetFun // 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); 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 } // { ab | a <- first_k(rhs), b <- follow_k(A), |ab|=k }
const HCFStringMap *first_rhs = h_first_seq(k, g, rhs->items); 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); stringset_extend(g, ret, k, first_rhs, h_follow_, (HCFChoice **)&A);
// make sure there are only strings of length _exactly_ k // make sure there are only strings of length _exactly_ k