get_count() cleanup

Fix several warnings.  Accept ASCII RUBOUT (aka DELETE) in addition
to backspace.  [Should use erase_char (and add support for kill_char)
but that means pushing get_count() into the interface code.]  Guard
against user causing the count to wrap if someone ever adds a call to
get_count() which doesn't specifying a maximum value.
This commit is contained in:
PatR
2016-01-06 15:37:46 -08:00
parent 5d1281c9ac
commit c8cd550a5a
2 changed files with 29 additions and 26 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 extern.h $NHDT-Date: 1451955077 2016/01/05 00:51:17 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.530 $ */
/* NetHack 3.6 extern.h $NHDT-Date: 1452123455 2016/01/06 23:37:35 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.535 $ */
/* Copyright (c) Steve Creps, 1988. */
/* NetHack may be freely redistributed. See license for details. */
@@ -204,7 +204,7 @@ E int FDECL(isok, (int, int));
E int FDECL(get_adjacent_loc,
(const char *, const char *, XCHAR_P, XCHAR_P, coord *));
E const char *FDECL(click_to_cmd, (int, int, int));
E char FDECL(get_count, (char *, char, long, long *));
E char FDECL(get_count, (char *, CHAR_P, long, long *));
#ifdef HANGUPHANDLING
E void FDECL(hangup, (int));
E void NDECL(end_of_input);
@@ -1501,9 +1501,9 @@ E boolean FDECL(lined_up, (struct monst *));
E struct obj *FDECL(m_carrying, (struct monst *, int));
E void FDECL(m_useupall, (struct monst *, struct obj *));
E void FDECL(m_useup, (struct monst *, struct obj *));
E void FDECL(m_throw,
(struct monst *, int, int, int, int, int, struct obj *));
E void FDECL(hit_bars, (struct obj **, int, int, int, int, boolean, boolean));
E void FDECL(m_throw, (struct monst *, int, int, int, int, int, struct obj *));
E void FDECL(hit_bars, (struct obj **, int, int, int, int,
BOOLEAN_P, BOOLEAN_P));
E boolean FDECL(hits_bars, (struct obj **, int, int, int, int, int, int));
/* ### muse.c ### */