1
0
Fork 0

- Fix url to forum.

- Fix Bit8u instead of char weirdness for imageDisk (dreamer_)
- Give device_t a virtual empty destructor so some warning program
  doesn't go crazy.
- Give the code that moves the Z drive its own function for readability.
- Give sizes arrays default values again for warning program.
- Rewrite IMGMOUNT in order to exit early for clarity and attempt
  to group things together.



Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4267
This commit is contained in:
Peter Veenstra 2019-10-03 20:03:43 +00:00
parent 7f979234f8
commit 60204619d0
6 changed files with 337 additions and 330 deletions

View file

@ -196,7 +196,7 @@ Bit8u imageDisk::Write_AbsoluteSector(Bit32u sectnum, void *data) {
}
imageDisk::imageDisk(FILE *imgFile, Bit8u *imgName, Bit32u imgSizeK, bool isHardDisk) {
imageDisk::imageDisk(FILE *imgFile, const char *imgName, Bit32u imgSizeK, bool isHardDisk) {
heads = 0;
cylinders = 0;
sectors = 0;
@ -205,14 +205,8 @@ imageDisk::imageDisk(FILE *imgFile, Bit8u *imgName, Bit32u imgSizeK, bool isHard
last_action = NONE;
diskimg = imgFile;
fseek(diskimg,0,SEEK_SET);
memset(diskname,0,512);
if(strlen((const char *)imgName) > 511) {
memcpy(diskname, imgName, 511);
} else {
strcpy((char *)diskname, (const char *)imgName);
}
safe_strncpy(diskname, imgName, sizeof(diskname));
active = false;
hardDrive = isHardDisk;
if(!isHardDisk) {