From a6792a44adee7d5bff5beb2dc5511571e8538ff0 Mon Sep 17 00:00:00 2001 From: Patryk Obara Date: Mon, 6 Apr 2020 11:38:24 +0200 Subject: [PATCH] Fix effc++ warnings in ems.cpp --- src/ints/ems.cpp | 38 +++++++++++++++++++++++++------------- 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/src/ints/ems.cpp b/src/ints/ems.cpp index 8ec7fd2c..c346b408 100644 --- a/src/ints/ems.cpp +++ b/src/ints/ems.cpp @@ -99,11 +99,12 @@ static Bit16u GEMMIS_seg; class device_EMM : public DOS_Device { public: - device_EMM(bool is_emm386_avail) { - is_emm386=is_emm386_avail; + device_EMM(bool is_emm386_avail) : is_emm386(is_emm386_avail) + { SetName("EMMXXXX0"); - GEMMIS_seg=0; + GEMMIS_seg = 0; } + bool Read(Bit8u * /*data*/,Bit16u * /*size*/) { return false;} bool Write(Bit8u * /*data*/,Bit16u * /*size*/){ LOG(LOG_IOCTL,LOG_NORMAL)("EMS:Write to device"); @@ -1299,20 +1300,27 @@ Bitu GetEMSType(Section_prop * section) { return rtype; } - -class EMS: public Module_base { +class EMS : public Module_base { private: - DOS_Device * emm_device; + DOS_Device *emm_device = nullptr; + /* location in protected unfreeable memory where the ems name and callback are * stored 32 bytes.*/ static Bit16u ems_baseseg; - RealPt old67_pointer; - CALLBACK_HandlerObject call_vdma,call_vcpi,call_v86mon; - Bitu call_int67; + + RealPt old67_pointer = 0; + CALLBACK_HandlerObject call_vdma; + CALLBACK_HandlerObject call_vcpi; + CALLBACK_HandlerObject call_v86mon; + Bitu call_int67 = 0; public: - EMS(Section* configuration):Module_base(configuration) { - emm_device=NULL; + EMS(Section *configuration) + : Module_base(configuration), + call_vdma(), + call_vcpi(), + call_v86mon() + { ems_type=0; /* Virtual DMA interrupt callback */ @@ -1336,8 +1344,9 @@ public: if (!ems_baseseg) ems_baseseg=DOS_GetMemory(2); //We have 32 bytes /* Add a little hack so it appears that there is an actual ems device installed */ - char const* emsname="EMMXXXX0"; - MEM_BlockWrite(PhysMake(ems_baseseg,0xa),emsname,(Bitu)(strlen(emsname)+1)); + char const *emsname = "EMMXXXX0"; + MEM_BlockWrite(PhysMake(ems_baseseg, 0xa), emsname, + strlen(emsname) + 1); call_int67=CALLBACK_Allocate(); CALLBACK_Setup(call_int67,&INT67_Handler,CB_IRET,PhysMake(ems_baseseg,4),"Int 67 ems"); @@ -1416,6 +1425,9 @@ public: } } + EMS(const EMS &) = delete; // prevent copying + EMS &operator=(const EMS &) = delete; // prevent assignment + ~EMS() { if (ems_type<=0) return;