Fix clang warnings (#423)

* Fixed clang compiler warnings

* Removed unused code

* Reset compiler
This commit is contained in:
Uwe Seimet 2021-11-07 21:30:21 +01:00 committed by GitHub
parent 817c1cde31
commit f7ec0de834
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 27 additions and 40 deletions

View File

@ -88,14 +88,14 @@ public:
SCSIDEV(); SCSIDEV();
~SCSIDEV(); ~SCSIDEV();
void Reset(); // Device Reset void Reset() override;
// External API // External API
BUS::phase_t Process(); // Run BUS::phase_t Process() override;
// Other // Other
bool IsSASI() const { return false; } // SASI Check bool IsSASI() const override { return false; }
bool IsSCSI() const { return true; } // SCSI check bool IsSCSI() const override { return true; }
void Error(ERROR_CODES::sense_key sense_key = ERROR_CODES::sense_key::NO_SENSE, void Error(ERROR_CODES::sense_key sense_key = ERROR_CODES::sense_key::NO_SENSE,
ERROR_CODES::asc asc = ERROR_CODES::asc::NO_ADDITIONAL_SENSE_INFORMATION) override; // Common error handling ERROR_CODES::asc asc = ERROR_CODES::asc::NO_ADDITIONAL_SENSE_INFORMATION) override; // Common error handling
@ -103,20 +103,20 @@ public:
private: private:
// Phase // Phase
void BusFree(); // Bus free phase void BusFree() override; // Bus free phase
void Selection(); // Selection phase void Selection() override; // Selection phase
void Execute(); // Execution phase void Execute() override; // Execution phase
void MsgOut(); // Message out phase void MsgOut(); // Message out phase
// commands // commands
void CmdGetEventStatusNotification(); void CmdGetEventStatusNotification();
void CmdModeSelect10(); // MODE SELECT(10) command void CmdModeSelect10();
void CmdModeSense10(); // MODE SENSE(10) command void CmdModeSense10();
// Data transfer // Data transfer
void Send(); // Send data void Send() override;
void Receive(); // Receive data void Receive() override;
bool XferMsg(DWORD msg); // Data transfer message bool XferMsg(DWORD msg);
scsi_t scsi; // Internal data scsi_t scsi; // Internal data
}; };

View File

@ -82,18 +82,18 @@ public:
virtual void TestUnitReady(SASIDEV *) override; virtual void TestUnitReady(SASIDEV *) override;
void Inquiry(SASIDEV *) override; void Inquiry(SASIDEV *) override;
void RequestSense(SASIDEV *) override; void RequestSense(SASIDEV *) override;
void ModeSelect6(SASIDEV *); void ModeSelect6(SASIDEV *) override;
void ModeSelect10(SASIDEV *); void ModeSelect10(SASIDEV *) override;
void ModeSense6(SASIDEV *); void ModeSense6(SASIDEV *) override;
void ModeSense10(SASIDEV *); void ModeSense10(SASIDEV *) override;
void Rezero(SASIDEV *); void Rezero(SASIDEV *);
void FormatUnit(SASIDEV *) override; void FormatUnit(SASIDEV *) override;
void ReassignBlocks(SASIDEV *); void ReassignBlocks(SASIDEV *) override;
void StartStopUnit(SASIDEV *); void StartStopUnit(SASIDEV *) override;
void SendDiagnostic(SASIDEV *); void SendDiagnostic(SASIDEV *) override;
void PreventAllowMediumRemoval(SASIDEV *); void PreventAllowMediumRemoval(SASIDEV *);
void SynchronizeCache10(SASIDEV *); void SynchronizeCache10(SASIDEV *) override;
void SynchronizeCache16(SASIDEV *); void SynchronizeCache16(SASIDEV *) override;
void ReadDefectData10(SASIDEV *); void ReadDefectData10(SASIDEV *);
virtual void Read6(SASIDEV *); virtual void Read6(SASIDEV *);
void Read10(SASIDEV *) override; void Read10(SASIDEV *) override;

View File

@ -31,7 +31,7 @@ public:
~SASIHD() {}; ~SASIHD() {};
void Reset(); void Reset();
void Open(const Filepath& path); void Open(const Filepath& path) override;
// Commands // Commands
int RequestSense(const DWORD *cdb, BYTE *buf) override; int RequestSense(const DWORD *cdb, BYTE *buf) override;

View File

@ -83,7 +83,7 @@ public:
void SetMcastAddr(SASIDEV *); void SetMcastAddr(SASIDEV *);
void EnableInterface(SASIDEV *); void EnableInterface(SASIDEV *);
bool Dispatch(SCSIDEV *); bool Dispatch(SCSIDEV *) override;
const int DAYNAPORT_BUFFER_SIZE = 0x1000000; const int DAYNAPORT_BUFFER_SIZE = 0x1000000;

View File

@ -1066,10 +1066,8 @@ void SCSIBR::FS_GetCapacity(BYTE *buf)
ASSERT(fs); ASSERT(fs);
ASSERT(buf); ASSERT(buf);
int i = 0;
DWORD *dp = (DWORD*)buf; DWORD *dp = (DWORD*)buf;
DWORD nUnit = ntohl(*dp); DWORD nUnit = ntohl(*dp);
i += sizeof(DWORD);
Human68k::capacity_t cap; Human68k::capacity_t cap;
fsresult = fs->GetCapacity(nUnit, &cap); fsresult = fs->GetCapacity(nUnit, &cap);
@ -1099,7 +1097,6 @@ void SCSIBR::FS_CtrlDrive(BYTE *buf)
i += sizeof(DWORD); i += sizeof(DWORD);
Human68k::ctrldrive_t *pCtrlDrive = (Human68k::ctrldrive_t*)&buf[i]; Human68k::ctrldrive_t *pCtrlDrive = (Human68k::ctrldrive_t*)&buf[i];
i += sizeof(Human68k::ctrldrive_t);
fsresult = fs->CtrlDrive(nUnit, pCtrlDrive); fsresult = fs->CtrlDrive(nUnit, pCtrlDrive);
@ -1117,10 +1114,8 @@ void SCSIBR::FS_GetDPB(BYTE *buf)
ASSERT(fs); ASSERT(fs);
ASSERT(buf); ASSERT(buf);
int i = 0;
DWORD *dp = (DWORD*)buf; DWORD *dp = (DWORD*)buf;
DWORD nUnit = ntohl(*dp); DWORD nUnit = ntohl(*dp);
i += sizeof(DWORD);
Human68k::dpb_t dpb; Human68k::dpb_t dpb;
fsresult = fs->GetDPB(nUnit, &dpb); fsresult = fs->GetDPB(nUnit, &dpb);
@ -1173,10 +1168,8 @@ void SCSIBR::FS_DiskWrite(BYTE *buf)
ASSERT(fs); ASSERT(fs);
ASSERT(buf); ASSERT(buf);
int i = 0;
DWORD *dp = (DWORD*)buf; DWORD *dp = (DWORD*)buf;
DWORD nUnit = ntohl(*dp); DWORD nUnit = ntohl(*dp);
i += sizeof(DWORD);
fsresult = fs->DiskWrite(nUnit); fsresult = fs->DiskWrite(nUnit);
} }
@ -1238,10 +1231,8 @@ void SCSIBR::FS_Flush(BYTE *buf)
ASSERT(fs); ASSERT(fs);
ASSERT(buf); ASSERT(buf);
int i = 0;
DWORD *dp = (DWORD*)buf; DWORD *dp = (DWORD*)buf;
DWORD nUnit = ntohl(*dp); DWORD nUnit = ntohl(*dp);
i += sizeof(DWORD);
fsresult = fs->Flush(nUnit); fsresult = fs->Flush(nUnit);
} }
@ -1256,10 +1247,8 @@ void SCSIBR::FS_CheckMedia(BYTE *buf)
ASSERT(fs); ASSERT(fs);
ASSERT(buf); ASSERT(buf);
int i = 0;
DWORD *dp = (DWORD*)buf; DWORD *dp = (DWORD*)buf;
DWORD nUnit = ntohl(*dp); DWORD nUnit = ntohl(*dp);
i += sizeof(DWORD);
fsresult = fs->CheckMedia(nUnit); fsresult = fs->CheckMedia(nUnit);
} }
@ -1274,10 +1263,8 @@ void SCSIBR::FS_Lock(BYTE *buf)
ASSERT(fs); ASSERT(fs);
ASSERT(buf); ASSERT(buf);
int i = 0;
DWORD *dp = (DWORD*)buf; DWORD *dp = (DWORD*)buf;
DWORD nUnit = ntohl(*dp); DWORD nUnit = ntohl(*dp);
i += sizeof(DWORD);
fsresult = fs->Lock(nUnit); fsresult = fs->Lock(nUnit);
} }

View File

@ -108,8 +108,8 @@ private:
void OpenIso(const Filepath& path); // Open(ISO) void OpenIso(const Filepath& path); // Open(ISO)
void OpenPhysical(const Filepath& path); // Open(Physical) void OpenPhysical(const Filepath& path); // Open(Physical)
void ReadToc(SASIDEV *); void ReadToc(SASIDEV *) override;
void GetEventStatusNotification(SASIDEV *); void GetEventStatusNotification(SASIDEV *) override;
void LBAtoMSF(DWORD lba, BYTE *msf) const; // LBA→MSF conversion void LBAtoMSF(DWORD lba, BYTE *msf) const; // LBA→MSF conversion

View File

@ -28,7 +28,7 @@ public:
void FinalizeSetup(const Filepath&, off_t); void FinalizeSetup(const Filepath&, off_t);
void Reset(); void Reset();
virtual void Open(const Filepath&); virtual void Open(const Filepath&) override;
// Commands // Commands
virtual int Inquiry(const DWORD *cdb, BYTE *buf) override; virtual int Inquiry(const DWORD *cdb, BYTE *buf) override;

View File

@ -25,7 +25,7 @@ public:
SCSIMO(); SCSIMO();
~SCSIMO() {}; ~SCSIMO() {};
void Open(const Filepath& path); void Open(const Filepath& path) override;
// Commands // Commands
int Inquiry(const DWORD *cdb, BYTE *buf) override; int Inquiry(const DWORD *cdb, BYTE *buf) override;