From 75d18d4db0515d75aa22b01f861337bd6b4bfcf9 Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Fri, 1 Feb 2019 16:07:12 -0800 Subject: [PATCH] SCP: Removed redundant SCPE_NOTATT which duplicates SCPE_UNATT --- BESM6/besm6_panel.c | 6 +++--- I650/i650_sys.c | 2 +- scp.c | 7 ++----- sim_defs.h | 11 +++++------ sim_disk.c | 6 ++++-- sim_tape.c | 5 +++-- 6 files changed, 18 insertions(+), 19 deletions(-) diff --git a/BESM6/besm6_panel.c b/BESM6/besm6_panel.c index 9a52c61e..f69e2b72 100644 --- a/BESM6/besm6_panel.c +++ b/BESM6/besm6_panel.c @@ -432,7 +432,7 @@ static void draw_brz_static (int left, int top) t_stat besm6_close_panel (UNIT *u, int32 val, CONST char *cptr, void *desc) { if (! screen) - return SCPE_NOTATT; + return SCPE_UNATT; if (font_big) TTF_CloseFont(font_big); if (font_small) TTF_CloseFont(font_small); TTF_Quit(); @@ -685,12 +685,12 @@ t_stat besm6_init_panel (UNIT *u, int32 val, CONST char *cptr, void *desc) t_stat besm6_close_panel (UNIT *u, int32 val, CONST char *cptr, void *desc) { - return SCPE_NOTATT; + return SCPE_UNATT; } t_stat besm6_show_panel (FILE *st, UNIT *up, int32 v, CONST void *dp) { - return SCPE_NOTATT; + return SCPE_UNATT; } void besm6_draw_panel (int force) diff --git a/I650/i650_sys.c b/I650/i650_sys.c index 4b9649ef..2e58b56e 100644 --- a/I650/i650_sys.c +++ b/I650/i650_sys.c @@ -832,7 +832,7 @@ static t_stat deck_split_cmd(CONST char *cptr) if (uptr == NULL) /* valid unit? */ return SCPE_NXUN; if ((uptr->flags & UNIT_ATT) == 0) /* attached? */ - return SCPE_NOTATT; + return SCPE_UNATT; // get the file name strcpy(fn0, uptr->filename); sim_card_detach(uptr); // detach file from cdp device to be splitted diff --git a/scp.c b/scp.c index 475f5f62..3d6fe6e2 100644 --- a/scp.c +++ b/scp.c @@ -737,7 +737,6 @@ const struct scp_error { {"STALL", "Console Telnet output stall"}, {"AFAIL", "Assertion failed"}, {"INVREM", "Invalid remote console command"}, - {"NOTATT", "Not attached"}, {"EXPECT", "Expect matched"}, {"AMBREG", "Ambiguous register name"}, {"REMOTE", "remote console command"}, @@ -1754,8 +1753,6 @@ static const char simh_help[] = " Assertion failed\n" "5 INVREM\n" " Invalid remote console command\n" - "5 NOTATT\n" - " Not attached \n" "5 AMBREG\n" " Ambiguous register\n" #define HLP_SHIFT "*Commands Executing_Command_Files SHIFT" @@ -1798,7 +1795,7 @@ static const char simh_help[] = "++NOPARAM, ALATT, TIMER, SIGERR, TTYERR, SUB, NOFNC, UDIS,\n" "++NORO, INVSW, MISVAL, 2FARG, 2MARG, NXDEV, NXUN, NXREG,\n" "++NXPAR, NEST, IERR, MTRLNT, LOST, TTMO, STALL, AFAIL,\n" - "++NOTATT, AMBREG\n\n" + "++AMBREG\n\n" " These values can be indicated by name or by their internal\n" " numeric value (not recommended).\n" /***************** 80 character line width template *************************/ @@ -7024,7 +7021,7 @@ if (!(uptr->flags & UNIT_ATT)) { /* not attached? */ if (sim_switches & SIM_SW_REST) /* restoring? */ return SCPE_OK; /* allow detach */ else - return SCPE_NOTATT; /* complain */ + return SCPE_UNATT; /* complain */ } if ((dptr = find_dev_from_unit (uptr)) == NULL) return SCPE_OK; diff --git a/sim_defs.h b/sim_defs.h index bbe4a705..81e6dbe3 100644 --- a/sim_defs.h +++ b/sim_defs.h @@ -411,13 +411,12 @@ typedef uint32 t_addr; #define SCPE_STALL (SCPE_BASE + 41) /* Telnet conn stall */ #define SCPE_AFAIL (SCPE_BASE + 42) /* assert failed */ #define SCPE_INVREM (SCPE_BASE + 43) /* invalid remote console command */ -#define SCPE_NOTATT (SCPE_BASE + 44) /* not attached */ -#define SCPE_EXPECT (SCPE_BASE + 45) /* expect matched */ -#define SCPE_AMBREG (SCPE_BASE + 46) /* ambiguous register */ -#define SCPE_REMOTE (SCPE_BASE + 47) /* remote console command */ -#define SCPE_INVEXPR (SCPE_BASE + 48) /* invalid expression */ +#define SCPE_EXPECT (SCPE_BASE + 44) /* expect matched */ +#define SCPE_AMBREG (SCPE_BASE + 45) /* ambiguous register */ +#define SCPE_REMOTE (SCPE_BASE + 46) /* remote console command */ +#define SCPE_INVEXPR (SCPE_BASE + 47) /* invalid expression */ -#define SCPE_MAX_ERR (SCPE_BASE + 48) /* Maximum SCPE Error Value */ +#define SCPE_MAX_ERR (SCPE_BASE + 47) /* Maximum SCPE Error Value */ #define SCPE_KFLAG 0x10000000 /* tti data flag */ #define SCPE_BREAK 0x20000000 /* tti break flag */ #define SCPE_NOMESSAGE 0x40000000 /* message display supression flag */ diff --git a/sim_disk.c b/sim_disk.c index f24085cd..3a225067 100644 --- a/sim_disk.c +++ b/sim_disk.c @@ -1809,8 +1809,10 @@ int (*close_function)(FILE *f); FILE *fileref; t_bool auto_format; -if ((uptr == NULL) || !(uptr->flags & UNIT_ATT)) - return SCPE_NOTATT; +if (uptr == NULL) + return SCPE_IERR; +if (!(uptr->flags & UNIT_ATT)) + return SCPE_UNATT; ctx = (struct disk_context *)uptr->disk_ctx; fileref = uptr->fileref; diff --git a/sim_tape.c b/sim_tape.c index 0cbfbe6d..0e94fc24 100644 --- a/sim_tape.c +++ b/sim_tape.c @@ -547,10 +547,11 @@ t_bool auto_format = FALSE; if (uptr == NULL) return SCPE_IERR; +if (!(uptr->flags & UNIT_ATT)) + return SCPE_UNATT; + ctx = (struct tape_context *)uptr->tape_ctx; f = MT_GET_FMT (uptr); -if ((ctx == NULL) || !(uptr->flags & UNIT_ATT)) - return SCPE_IERR; if (uptr->io_flush) uptr->io_flush (uptr); /* flush buffered data */