From dfd69d5d4bebeca07ea0bc8ff20a4e96e88899a4 Mon Sep 17 00:00:00 2001 From: krasimir Date: Thu, 26 Feb 2015 12:17:59 +0000 Subject: [PATCH] bugfix in the parser which caused some items to be poped in the wrong order if their probability differ with less that 0.5 --- src/runtime/c/pgf/parser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime/c/pgf/parser.c b/src/runtime/c/pgf/parser.c index 88b001272..1fdcfda84 100644 --- a/src/runtime/c/pgf/parser.c +++ b/src/runtime/c/pgf/parser.c @@ -522,7 +522,7 @@ cmp_item_prob(GuOrder* self, const void* a, const void* b) prob_t prob1 = item1->inside_prob + item1->conts->outside_prob; prob_t prob2 = item2->inside_prob + item2->conts->outside_prob; - return (int) (prob1-prob2); + return (prob1>prob2) - (prob1