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:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user