SCP: Reject undefined device with TESTLIB command
Also remove some otherwise unused variables (assignments but never used).
This commit is contained in:
parent
3a8472be2b
commit
df63d4ff9f
2 changed files with 4 additions and 7 deletions
10
scp.c
10
scp.c
|
@ -4359,7 +4359,6 @@ char *ip = instr, *op, *oend, *istart, *tmpbuf;
|
||||||
const char *ap;
|
const char *ap;
|
||||||
char rbuf[CBUFSIZE];
|
char rbuf[CBUFSIZE];
|
||||||
int i;
|
int i;
|
||||||
size_t instr_off = 0;
|
|
||||||
size_t outstr_off = 0;
|
size_t outstr_off = 0;
|
||||||
|
|
||||||
sim_exp_argv = do_arg;
|
sim_exp_argv = do_arg;
|
||||||
|
@ -6721,7 +6720,6 @@ static void sim_type_entry (const char *directory,
|
||||||
const struct stat *filestat,
|
const struct stat *filestat,
|
||||||
void *context)
|
void *context)
|
||||||
{
|
{
|
||||||
TYPE_CTX *ctx = (TYPE_CTX *)context;
|
|
||||||
char FullPath[PATH_MAX + 1];
|
char FullPath[PATH_MAX + 1];
|
||||||
FILE *file;
|
FILE *file;
|
||||||
char lbuf[4*CBUFSIZE];
|
char lbuf[4*CBUFSIZE];
|
||||||
|
@ -7169,8 +7167,6 @@ t_stat show_runlimit (FILE *st, DEVICE *dptr, UNIT *uptr, int32 flag, CONST char
|
||||||
{
|
{
|
||||||
if (sim_runlimit_enabled) {
|
if (sim_runlimit_enabled) {
|
||||||
if (sim_runlimit_switches & SWMASK ('T')) {
|
if (sim_runlimit_switches & SWMASK ('T')) {
|
||||||
double inst_per_sec = sim_timer_inst_per_sec ();
|
|
||||||
|
|
||||||
if (sim_runlimit_d_initial != sim_runlimit_d) {
|
if (sim_runlimit_d_initial != sim_runlimit_d) {
|
||||||
fprintf (st, "%s initially, ", sim_fmt_secs (sim_runlimit_d_initial / 1000000.0));
|
fprintf (st, "%s initially, ", sim_fmt_secs (sim_runlimit_d_initial / 1000000.0));
|
||||||
if (sim_is_active (&sim_runlimit_unit))
|
if (sim_is_active (&sim_runlimit_unit))
|
||||||
|
@ -14946,7 +14942,6 @@ return cptr;
|
||||||
*/
|
*/
|
||||||
static const char *sim_into_postfix (Stack *stack1, const char *cptr, t_stat *stat, t_bool parens_required)
|
static const char *sim_into_postfix (Stack *stack1, const char *cptr, t_stat *stat, t_bool parens_required)
|
||||||
{
|
{
|
||||||
const char *start = cptr;
|
|
||||||
const char *last_cptr;
|
const char *last_cptr;
|
||||||
int parens = 0;
|
int parens = 0;
|
||||||
Operator *op = NULL, *last_op;
|
Operator *op = NULL, *last_op;
|
||||||
|
@ -15403,7 +15398,6 @@ return stat;
|
||||||
t_stat test_lib_cmd (int32 flag, CONST char *cptr)
|
t_stat test_lib_cmd (int32 flag, CONST char *cptr)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
int bad_regs = 0;
|
|
||||||
DEVICE *dptr;
|
DEVICE *dptr;
|
||||||
int32 saved_switches = sim_switches & ~SWMASK ('T');
|
int32 saved_switches = sim_switches & ~SWMASK ('T');
|
||||||
t_stat stat = SCPE_OK;
|
t_stat stat = SCPE_OK;
|
||||||
|
@ -15412,6 +15406,10 @@ char gbuf[CBUFSIZE];
|
||||||
cptr = get_glyph (cptr, gbuf, 0);
|
cptr = get_glyph (cptr, gbuf, 0);
|
||||||
if (gbuf[0] == '\0')
|
if (gbuf[0] == '\0')
|
||||||
strcpy (gbuf, "ALL");
|
strcpy (gbuf, "ALL");
|
||||||
|
else {
|
||||||
|
if (!find_dev (gbuf))
|
||||||
|
return sim_messagef (SCPE_ARG, "No such device: %s\n", gbuf);
|
||||||
|
}
|
||||||
if (sim_switches & SWMASK ('D')) {
|
if (sim_switches & SWMASK ('D')) {
|
||||||
sim_switches &= ~(SWMASK ('D') | SWMASK ('R') | SWMASK ('F') | SWMASK ('T'));
|
sim_switches &= ~(SWMASK ('D') | SWMASK ('R') | SWMASK ('F') | SWMASK ('T'));
|
||||||
sim_set_debon (0, "STDOUT");
|
sim_set_debon (0, "STDOUT");
|
||||||
|
|
|
@ -876,7 +876,6 @@ static void _sim_rem_log_out (TMLN *lp)
|
||||||
{
|
{
|
||||||
char cbuf[4*CBUFSIZE];
|
char cbuf[4*CBUFSIZE];
|
||||||
REMOTE *rem = &sim_rem_consoles[(int)(lp - sim_rem_con_tmxr.ldsc)];
|
REMOTE *rem = &sim_rem_consoles[(int)(lp - sim_rem_con_tmxr.ldsc)];
|
||||||
int line = rem->line;
|
|
||||||
|
|
||||||
if ((!sim_oline) && (sim_log)) {
|
if ((!sim_oline) && (sim_log)) {
|
||||||
fflush (sim_log);
|
fflush (sim_log);
|
||||||
|
|
Loading…
Add table
Reference in a new issue