mirror of
https://github.com/open-simh/simh.git
synced 2026-04-29 21:27:07 +00:00
ALL: Massive 'const' cleanup
These changes facilitate more robust parameter type checking and helps to identify unexpected coding errors. Most simulators can now also be compiled with a C++ compiler without warnings. Additionally, these changes have also been configured to facilitate easier backporting of simulator and device simulation modules to run under the simh v3.9+ SCP framework.
This commit is contained in:
@@ -320,12 +320,12 @@ t_stat cpu_reset (DEVICE *dptr);
|
||||
t_bool cpu_is_pc_a_subroutine_call (t_addr **ret_addrs);
|
||||
t_stat cpu_ex (t_value *vptr, t_addr exta, UNIT *uptr, int32 sw);
|
||||
t_stat cpu_dep (t_value val, t_addr exta, UNIT *uptr, int32 sw);
|
||||
t_stat cpu_set_size (UNIT *uptr, int32 val, char *cptr, void *desc);
|
||||
t_stat cpu_set_hist (UNIT *uptr, int32 val, char *cptr, void *desc);
|
||||
t_stat cpu_show_hist (FILE *st, UNIT *uptr, int32 val, void *desc);
|
||||
t_stat cpu_show_virt (FILE *st, UNIT *uptr, int32 val, void *desc);
|
||||
t_stat cpu_set_idle (UNIT *uptr, int32 val, char *cptr, void *desc);
|
||||
t_stat cpu_show_idle (FILE *st, UNIT *uptr, int32 val, void *desc);
|
||||
t_stat cpu_set_size (UNIT *uptr, int32 val, CONST char *cptr, void *desc);
|
||||
t_stat cpu_set_hist (UNIT *uptr, int32 val, CONST char *cptr, void *desc);
|
||||
t_stat cpu_show_hist (FILE *st, UNIT *uptr, int32 val, CONST void *desc);
|
||||
t_stat cpu_show_virt (FILE *st, UNIT *uptr, int32 val, CONST void *desc);
|
||||
t_stat cpu_set_idle (UNIT *uptr, int32 val, CONST char *cptr, void *desc);
|
||||
t_stat cpu_show_idle (FILE *st, UNIT *uptr, int32 val, CONST void *desc);
|
||||
const char *cpu_description (DEVICE *dptr);
|
||||
int32 cpu_get_vsw (int32 sw);
|
||||
static SIM_INLINE int32 get_istr (int32 lnt, int32 acc);
|
||||
@@ -460,7 +460,7 @@ DEVICE cpu_dev = {
|
||||
&cpu_description
|
||||
};
|
||||
|
||||
t_stat cpu_show_model (FILE *st, UNIT *uptr, int32 val, void *desc)
|
||||
t_stat cpu_show_model (FILE *st, UNIT *uptr, int32 val, CONST void *desc)
|
||||
{
|
||||
fprintf (st, "model=");
|
||||
return cpu_print_model (st);
|
||||
@@ -3319,7 +3319,7 @@ return SCPE_NXM;
|
||||
|
||||
/* Memory allocation */
|
||||
|
||||
t_stat cpu_set_size (UNIT *uptr, int32 val, char *cptr, void *desc)
|
||||
t_stat cpu_set_size (UNIT *uptr, int32 val, CONST char *cptr, void *desc)
|
||||
{
|
||||
int32 mc = 0;
|
||||
uint32 i, clim, uval = (uint32)val;
|
||||
@@ -3346,10 +3346,10 @@ return SCPE_OK;
|
||||
|
||||
/* Virtual address translation */
|
||||
|
||||
t_stat cpu_show_virt (FILE *of, UNIT *uptr, int32 val, void *desc)
|
||||
t_stat cpu_show_virt (FILE *of, UNIT *uptr, int32 val, CONST void *desc)
|
||||
{
|
||||
t_stat r;
|
||||
char *cptr = (char *) desc;
|
||||
const char *cptr = (const char *) desc;
|
||||
uint32 va, pa;
|
||||
int32 st;
|
||||
static const char *mm_str[] = {
|
||||
@@ -3398,7 +3398,7 @@ return ACC_MASK (md);
|
||||
|
||||
/* Set history */
|
||||
|
||||
t_stat cpu_set_hist (UNIT *uptr, int32 val, char *cptr, void *desc)
|
||||
t_stat cpu_set_hist (UNIT *uptr, int32 val, CONST char *cptr, void *desc)
|
||||
{
|
||||
int32 i, lnt;
|
||||
char gbuf[CBUFSIZE];
|
||||
@@ -3454,10 +3454,10 @@ return SCPE_OK;
|
||||
|
||||
/* Show history */
|
||||
|
||||
t_stat cpu_show_hist (FILE *st, UNIT *uptr, int32 val, void *desc)
|
||||
t_stat cpu_show_hist (FILE *st, UNIT *uptr, int32 val, CONST void *desc)
|
||||
{
|
||||
int32 di, lnt;
|
||||
char *cptr = (char *) desc;
|
||||
const char *cptr = (const char *) desc;
|
||||
t_stat r;
|
||||
|
||||
if (hst_lnt == 0) /* enabled? */
|
||||
@@ -3630,7 +3630,7 @@ static struct os_idle os_tab[] = {
|
||||
|
||||
/* Set and show idle */
|
||||
|
||||
t_stat cpu_set_idle (UNIT *uptr, int32 val, char *cptr, void *desc)
|
||||
t_stat cpu_set_idle (UNIT *uptr, int32 val, CONST char *cptr, void *desc)
|
||||
{
|
||||
uint32 i;
|
||||
char gbuf[CBUFSIZE];
|
||||
@@ -3649,7 +3649,7 @@ if (cptr != NULL) {
|
||||
return sim_set_idle (uptr, val, cptr, desc);
|
||||
}
|
||||
|
||||
t_stat cpu_show_idle (FILE *st, UNIT *uptr, int32 val, void *desc)
|
||||
t_stat cpu_show_idle (FILE *st, UNIT *uptr, int32 val, CONST void *desc)
|
||||
{
|
||||
if (sim_idle_enab && (cpu_idle_type != 0))
|
||||
fprintf (st, "idle=%s, ", os_tab[cpu_idle_type - 1].name);
|
||||
@@ -3683,7 +3683,6 @@ fprintf (st, "The ");cpu_print_model (st);fprintf (st, " CPU help\n\n");
|
||||
fprintf (st, "CPU options include the size of main memory.\n\n");
|
||||
if (dptr->modifiers) {
|
||||
MTAB *mptr;
|
||||
extern t_stat cpu_set_size (UNIT *uptr, int32 val, char *cptr, void *desc);
|
||||
|
||||
for (mptr = dptr->modifiers; mptr->mask != 0; mptr++)
|
||||
if (mptr->valid == &cpu_set_size)
|
||||
|
||||
Reference in New Issue
Block a user