From e8acb7f0d7c2bbfae9fbc60e57024acd3bd61352 Mon Sep 17 00:00:00 2001 From: kcgen <1557255+kcgen@users.noreply.github.com> Date: Fri, 1 May 2020 07:52:34 -0700 Subject: [PATCH] Use C++ pointer-type casting to be more explicit The prior C-style casts are ambiguous when it comes to describing what type of cast is being performed. In this case, we're changing the undering the pointer type (from an unsigned char * to a char *), which a simple static_cast<...> cannot do. --- src/dos/drive_iso.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/dos/drive_iso.cpp b/src/dos/drive_iso.cpp index 2e103630..89c0d50c 100644 --- a/src/dos/drive_iso.cpp +++ b/src/dos/drive_iso.cpp @@ -477,8 +477,10 @@ int isoDrive :: readDirEntry(isoDirEntry *de, Bit8u *data) { // modify file identifier for use with dosbox if ((de->length < 33 + de->fileIdentLength)) return -1; if (IS_DIR(FLAGS2)) { - if (de->fileIdentLength == 1 && de->ident[0] == 0) strcpy((char*)de->ident, "."); - else if (de->fileIdentLength == 1 && de->ident[0] == 1) strcpy((char*)de->ident, ".."); + if (de->fileIdentLength == 1 && de->ident[0] == 0) + strcpy(reinterpret_cast(de->ident), "."); + else if (de->fileIdentLength == 1 && de->ident[0] == 1) + strcpy(reinterpret_cast(de->ident), ".."); else { if (de->fileIdentLength > 200) return -1; de->ident[de->fileIdentLength] = 0; @@ -498,7 +500,7 @@ int isoDrive :: readDirEntry(isoDirEntry *de, Bit8u *data) { if (dotpos!=NULL) { if (strlen(dotpos)>4) dotpos[4]=0; if (dotpos-(char*)de->ident>8) { - strcpy((char*)(&de->ident[8]),dotpos); + strcpy(reinterpret_cast(&de->ident[8]), dotpos); } } else if (strlen((char*)de->ident)>8) de->ident[8]=0; return de->length;