From: millert Date: Mon, 13 Jan 2014 23:14:17 +0000 (+0000) Subject: Callers of get_state() and sole_reduction() always store the result X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=591b535253617ccb156f574e49b272550e11fcc4;p=openbsd Callers of get_state() and sole_reduction() always store the result as a short so make the return value match the type of the value we are returning. From Michael W. Bombardieri --- diff --git a/usr.bin/yacc/lr0.c b/usr.bin/yacc/lr0.c index 6ac2e91998e..3640f55ab5b 100644 --- a/usr.bin/yacc/lr0.c +++ b/usr.bin/yacc/lr0.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lr0.c,v 1.15 2014/01/08 22:36:37 millert Exp $ */ +/* $OpenBSD: lr0.c,v 1.16 2014/01/13 23:14:17 millert Exp $ */ /* $NetBSD: lr0.c,v 1.4 1996/03/19 03:21:35 jtc Exp $ */ /* @@ -44,7 +44,7 @@ core *first_state; shifts *first_shift; reductions *first_reduction; -int get_state(int); +short get_state(int); core *new_state(int); void allocate_itemsets(void); @@ -197,7 +197,7 @@ generate_states(void) -int +short get_state(int symbol) { int key; diff --git a/usr.bin/yacc/mkpar.c b/usr.bin/yacc/mkpar.c index 5f4083423c3..a08f25a5d5d 100644 --- a/usr.bin/yacc/mkpar.c +++ b/usr.bin/yacc/mkpar.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mkpar.c,v 1.16 2014/01/08 21:40:25 millert Exp $ */ +/* $OpenBSD: mkpar.c,v 1.17 2014/01/13 23:14:18 millert Exp $ */ /* $NetBSD: mkpar.c,v 1.4 1996/03/19 03:21:39 jtc Exp $ */ /* @@ -54,7 +54,7 @@ extern action *get_shifts(); extern action *add_reductions(); extern action *add_reduce(); -int sole_reduction(int); +short sole_reduction(int); void free_action_row(action *); void find_final_state(void); @@ -338,10 +338,11 @@ total_conflicts(void) } -int +short sole_reduction(int stateno) { - int count, ruleno; + int count; + short ruleno; action *p; count = 0;