Dear Maintainer,
In case constructs:
Add several "/* FALLTHROUGH */ /* to avoid a warning */".
Add a "return 0;" after a returning function, to avoid a warning.
Add information to the output of a "sys_error(...)" function.
Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
---
menu.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/menu.c b/menu.c
index b91a974..0dfee2c 100644
--- a/menu.c
+++ b/menu.c
@@ -1295,6 +1295,7 @@ draw_menu:
case 1:
if ((ah->flag & A_ROOT_ART) == 0)
break;
+ /* FALLTHROUGH */ /* to avoid a warning */
/* XXX: bug? Another fall? */
case 2:
menu_length++;
@@ -1484,6 +1485,9 @@ new_state:
case AC_REENTER_GROUP:
menu_return(ME_REENTER_GROUP);
+ /* Previous command returns, but the compiler can't know that,
+so "return 0;" is used to tell that */
+ return 0; /* avoid a "fallthrough" warning */
}
/* XXX: bug? fall */
@@ -1622,6 +1626,7 @@ new_state:
case 3:
if (ah->attr == 0)
break;
+ /* FALLTHROUGH */ /* to avoid a warning */
/* XXX: check fall */
case 1:
if ((ah->attr & A_SELECT) == 0)
@@ -1860,6 +1865,7 @@ new_state:
goto empty_menu_hack;
}
+ /* FALLTHROUGH */ /* avoid a warning */
/* XXX: Fall ? */
case K_OPEN_SUBJECT:
if (numa < 0)
@@ -2251,6 +2257,7 @@ new_state:
case 1:
if ((articles[nexta]->flag & A_ROOT_ART) == 0)
break;
+ /* FALLTHROUGH */ /* to avoid a warning */
/* XXX: fall? */
case 2:
--menu_length;
@@ -2405,6 +2412,7 @@ do_auto_read:
firsta = nexta;
goto redraw;
}
+ goto defaut; /* Uncertain code, avoid a warning */
/* XXX: fall? */
case MC_NEXTGROUP:
menu_cmd = ME_NEXT;
@@ -2419,7 +2427,8 @@ do_auto_read:
break;
default:
- sys_error("show_articles returned improper value");
+ sys_error("File %s, line %d: show_articles returned improper value, %d",
+ __FILE__, __LINE__, show_artices());
}
menu_exit: