1
0
mirror of https://github.com/simh/simh.git synced 2026-01-25 11:46:37 +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

@@ -339,7 +339,7 @@ t_stat diskClose(DISK_INFO **myDisk)
*
* If the IMD file already exists, the user will be given the option of overwriting it.
*/
t_stat diskCreate(FILE *fileref, char *ctlr_comment)
t_stat diskCreate(FILE *fileref, const char *ctlr_comment)
{
DISK_INFO *myDisk = NULL;
char *comment;
@@ -361,7 +361,7 @@ t_stat diskCreate(FILE *fileref, char *ctlr_comment)
}
}
if((curptr = comment = calloc(1, MAX_COMMENT_LEN)) == 0) {
if((curptr = comment = (char *)calloc(1, MAX_COMMENT_LEN)) == 0) {
sim_printf("Memory allocation failure.\n");
return (SCPE_MEM);
}
@@ -735,7 +735,7 @@ t_stat trackWrite(DISK_INFO *myDisk,
* data with the fillbyte.
*/
dataLen = sectorLen + 1;
sectorData = malloc(dataLen);
sectorData = (uint8 *)malloc(dataLen);
memset(sectorData, fillbyte, dataLen);
sectorData[0] = SECT_RECORD_NORM;