1
0
mirror of https://github.com/simh/simh.git synced 2026-04-16 16:31:35 +00:00

SCP: Add descriptive messages for SCPE_NOPARAM return cases

This commit is contained in:
Mark Pizzolato
2022-05-12 13:13:15 -07:00
parent ac73e7b4c7
commit ad9249d4c1
3 changed files with 22 additions and 13 deletions

21
scp.c
View File

@@ -5978,11 +5978,14 @@ while (*cptr != 0) { /* do all mods */
if (r != SCPE_OK)
return r;
}
else if (!mptr->desc) /* value desc? */
break;
else if (cvptr) /* = value? */
return SCPE_ARG;
else *((int32 *) mptr->desc) = mptr->match;
else
if (!mptr->desc) /* value desc? */
break;
else
if (cvptr) /* = value? */
return SCPE_ARG;
else
*((int32 *) mptr->desc) = mptr->match;
} /* end if xtd */
else { /* old style */
if (cvptr) /* = value? */
@@ -6004,9 +6007,11 @@ while (*cptr != 0) { /* do all mods */
if (r != SCPE_OK)
return r;
}
else if (!dptr->modifiers) /* no modifiers? */
return SCPE_NOPARAM;
else return sim_messagef (SCPE_NXPAR, "%s device: Non-existent parameter - %s\n", dptr->name, gbuf);
else
if (!dptr->modifiers) /* no modifiers? */
return sim_messagef (SCPE_NOPARAM, "%s device has no parameters\n", dptr->name);
else
return sim_messagef (SCPE_NXPAR, "%s device: Non-existent parameter - %s\n", dptr->name, gbuf);
} /* end if no mat */
} /* end while */
return SCPE_OK; /* done all */

View File

@@ -417,7 +417,8 @@ while (*cptr != 0) { /* do all mods */
if (r != SCPE_OK)
return r;
}
else return SCPE_NOPARAM;
else
return sim_messagef (SCPE_NOPARAM, "Invalid console parameter: %s\n", gbuf);
}
return SCPE_OK;
}
@@ -440,7 +441,8 @@ while (*cptr != 0) {
cptr = get_glyph (cptr, gbuf, ','); /* get modifier */
if ((shptr = find_shtab (show_con_tab, gbuf)))
shptr->action (st, dptr, uptr, shptr->arg, NULL);
else return SCPE_NOPARAM;
else
return sim_messagef (SCPE_NOPARAM, "Invalid console parameter: %s\n", gbuf);
}
return SCPE_OK;
}
@@ -588,7 +590,8 @@ while (*cptr != 0) { /* do all mods */
if (r != SCPE_OK)
return r;
}
else return SCPE_NOPARAM;
else
return sim_messagef (SCPE_NOPARAM, "Invalid remote console parameter: %s\n", gbuf);
}
return SCPE_OK;
}
@@ -1919,7 +1922,7 @@ if (flag) {
sim_activate_after(rem_con_poll_unit, 1000000);/* check for connection in 1 second */
return r;
}
return SCPE_NOPARAM;
return sim_messagef (SCPE_NOPARAM, "Invalid remote telnet specification: %s\n", gbuf);
}
else {
if (sim_rem_con_tmxr.master) {

View File

@@ -1601,7 +1601,8 @@ while (*cptr != 0) { /* do all mods */
if (r != SCPE_OK)
return r;
}
else return SCPE_NOPARAM;
else
return sim_messagef (SCPE_NOPARAM, "Invalid timer parameter: %s\n", gbuf);
}
return SCPE_OK;
}