1
0
mirror of https://github.com/simh/simh.git synced 2026-04-13 23:44:44 +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:
Mark Pizzolato
2016-05-15 15:25:33 -07:00
parent 60a8a2d43d
commit 5531ccb175
444 changed files with 4119 additions and 3798 deletions

View File

@@ -47,7 +47,7 @@ extern uint32 *M;
extern UNIT cpu_unit;
t_stat fprint_sym_m (FILE *of, uint32 inst);
t_stat parse_sym_m (char *cptr, t_value *val);
t_stat parse_sym_m (const char *cptr, t_value *val);
void fprint_ebcdic (FILE *of, uint32 c);
/* SCP data structures and interface routines
@@ -164,7 +164,7 @@ uint8 ebcdic_to_ascii[256] = {
/* Binary loader */
t_stat sim_load (FILE *fileref, char *cptr, char *fnam, int flag)
t_stat sim_load (FILE *fileref, CONST char *cptr, CONST char *fnam, int flag)
{
return SCPE_NOFNC;
}
@@ -376,7 +376,7 @@ if (sw & SWMASK ('C')) { /* char format? */
if (sw & SWMASK ('A')) { /* ASCII? */
sc = 24 - ((addr & 0x3) * 8); /* shift count */
c = (inst >> sc) & 0x7F;
fprintf (of, "%c", FMTASC (c));
fprintf (of, FMTASC (c));
return 0;
}
if (sw & SWMASK ('E')) { /* EBCDIC? */
@@ -465,7 +465,7 @@ return;
status = error status
*/
t_stat parse_sym (char *cptr, t_addr addr, UNIT *uptr, t_value *val, int32 sw)
t_stat parse_sym (CONST char *cptr, t_addr addr, UNIT *uptr, t_value *val, int32 sw)
{
t_value num;
uint32 i, sc, rdx, c;
@@ -540,7 +540,7 @@ if (r != SCPE_OK)
return 0;
}
t_stat parse_sym_m (char *cptr, t_value *val)
t_stat parse_sym_m (const char *cptr, t_value *val)
{
uint32 i, sgn;
t_stat r;
@@ -548,7 +548,7 @@ char *sep;
char gbuf[CBUFSIZE];
cptr = get_glyph (cptr, gbuf, 0); /* get opcode+reg*/
if (sep = strchr (gbuf, ',')) /* , in middle? */
if ((sep = strchr (gbuf, ','))) /* , in middle? */
*sep++ = 0; /* split strings */
for (i = 0; opcode[i] != NULL; i++) { /* loop thru ops */
if (strcmp (opcode[i], gbuf) == 0) { /* string match? */
@@ -584,7 +584,7 @@ for (i = 0; opcode[i] != NULL; i++) { /* loop thru ops */
sgn = 1;
else sgn = 0; /* else + */
cptr = get_glyph (cptr, gbuf, 0); /* get rest */
if (sep = strchr (gbuf, ',')) /* , in middle? */
if ((sep = strchr (gbuf, ','))) /* , in middle? */
*sep++ = 0; /* split strings */
ad = get_uint (gbuf, 16, mask, &r);
if (r != SCPE_OK)