diff --git a/src/dos/cdrom_image.cpp b/src/dos/cdrom_image.cpp index ce2a2689..3b5983d7 100644 --- a/src/dos/cdrom_image.cpp +++ b/src/dos/cdrom_image.cpp @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: cdrom_image.cpp,v 1.22 2008-09-29 17:50:18 c2woody Exp $ */ +/* $Id: cdrom_image.cpp,v 1.23 2008-10-05 14:44:52 qbix79 Exp $ */ #include #include @@ -131,7 +131,7 @@ int CDROM_Interface_Image::AudioFile::getLength() int CDROM_Interface_Image::refCount = 0; CDROM_Interface_Image* CDROM_Interface_Image::images[26]; CDROM_Interface_Image::imagePlayer CDROM_Interface_Image::player = { - NULL, NULL, NULL, 0, 0, 0, 0, 0, false, false }; + NULL, NULL, NULL, {0}, 0, 0, 0, false, false }; CDROM_Interface_Image::CDROM_Interface_Image(Bit8u subUnit) diff --git a/src/dos/dev_con.h b/src/dos/dev_con.h index 3b55ac67..89cd8795 100644 --- a/src/dos/dev_con.h +++ b/src/dos/dev_con.h @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: dev_con.h,v 1.33 2007-09-20 16:42:43 c2woody Exp $ */ +/* $Id: dev_con.h,v 1.34 2008-10-05 14:44:52 qbix79 Exp $ */ #include "dos_inc.h" #include "../ints/int10.h" @@ -392,7 +392,7 @@ Bit16u device_CON::GetInformation(void) { if (head>=end) head=start; mem_writew(BIOS_KEYBOARD_BUFFER_HEAD,head); return 0x80D3; /* No Key Available */ -}; +} device_CON::device_CON() { SetName("CON"); diff --git a/src/dos/dos_execute.cpp b/src/dos/dos_execute.cpp index 62f5f455..021aceec 100644 --- a/src/dos/dos_execute.cpp +++ b/src/dos/dos_execute.cpp @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: dos_execute.cpp,v 1.64 2008-09-07 10:55:14 c2woody Exp $ */ +/* $Id: dos_execute.cpp,v 1.65 2008-10-05 14:44:52 qbix79 Exp $ */ #include #include @@ -215,7 +215,7 @@ bool DOS_NewPSP(Bit16u segment, Bit16u size) { // copy command line as well (Kings Quest AGI -cga switch) psp.SetCommandTail(RealMake(parent_psp_seg,0x80)); return true; -}; +} bool DOS_ChildPSP(Bit16u segment, Bit16u size) { DOS_PSP psp(segment); @@ -225,7 +225,7 @@ bool DOS_ChildPSP(Bit16u segment, Bit16u size) { psp.SetEnvironment(psp_parent.GetEnvironment()); psp.SetSize(size); return true; -}; +} static void SetupPSP(Bit16u pspseg,Bit16u memsize,Bit16u envseg) { /* Fix the PSP for psp and environment MCB's */ diff --git a/src/dos/dos_files.cpp b/src/dos/dos_files.cpp index b3518f39..f8e52a32 100644 --- a/src/dos/dos_files.cpp +++ b/src/dos/dos_files.cpp @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: dos_files.cpp,v 1.101 2008-09-21 19:42:47 c2woody Exp $ */ +/* $Id: dos_files.cpp,v 1.102 2008-10-05 14:44:52 qbix79 Exp $ */ #include #include @@ -329,7 +329,7 @@ bool DOS_ReadFile(Bit16u entry,Bit8u * data,Bit16u * amount) { bool ret=Files[handle]->Read(data,&toread); *amount=toread; return ret; -}; +} bool DOS_WriteFile(Bit16u entry,Bit8u * data,Bit16u * amount) { Bit32u handle=RealHandle(entry); @@ -352,7 +352,7 @@ bool DOS_WriteFile(Bit16u entry,Bit8u * data,Bit16u * amount) { bool ret=Files[handle]->Write(data,&towrite); *amount=towrite; return ret; -}; +} bool DOS_SeekFile(Bit16u entry,Bit32u * pos,Bit32u type) { Bit32u handle=RealHandle(entry); @@ -365,7 +365,7 @@ bool DOS_SeekFile(Bit16u entry,Bit32u * pos,Bit32u type) { return false; }; return Files[handle]->Seek(pos,type); -}; +} bool DOS_CloseFile(Bit16u entry) { Bit32u handle=RealHandle(entry); @@ -388,6 +388,7 @@ bool DOS_CloseFile(Bit16u entry) { } return true; } + bool DOS_FlushFile(Bit16u entry) { Bit32u handle=RealHandle(entry); if (handle>=DOS_FILES) { @@ -660,7 +661,7 @@ bool DOS_DuplicateEntry(Bit16u entry,Bit16u * newentry) { Files[handle]->AddRef(); psp.SetFileHandle(*newentry,handle); return true; -}; +} bool DOS_ForceDuplicateEntry(Bit16u entry,Bit16u newentry) { if(entry == newentry) { @@ -684,7 +685,7 @@ bool DOS_ForceDuplicateEntry(Bit16u entry,Bit16u newentry) { Files[orig]->AddRef(); psp.SetFileHandle(newentry,orig); return true; -}; +} @@ -1116,7 +1117,7 @@ bool DOS_SetDrive(Bit8u drive) { } else { return false; } -}; +} bool DOS_GetFileDate(Bit16u entry, Bit16u* otime, Bit16u* odate) { Bit32u handle=RealHandle(entry); @@ -1135,7 +1136,7 @@ bool DOS_GetFileDate(Bit16u entry, Bit16u* otime, Bit16u* odate) { *otime = Files[handle]->time; *odate = Files[handle]->date; return true; -}; +} void DOS_SetupFiles (void) { /* Setup the File Handles */ diff --git a/src/dos/dos_memory.cpp b/src/dos/dos_memory.cpp index 9785e879..3f337dba 100644 --- a/src/dos/dos_memory.cpp +++ b/src/dos/dos_memory.cpp @@ -386,7 +386,7 @@ bool DOS_LinkUMBsToMemChain(Bit16u linkstate) { static Bitu DOS_default_handler(void) { LOG(LOG_CPU,LOG_ERROR)("DOS rerouted Interrupt Called %X",lastint); return CBRET_NONE; -}; +} static CALLBACK_HandlerObject callbackhandler; void DOS_SetupMemory(void) { diff --git a/src/dos/dos_misc.cpp b/src/dos/dos_misc.cpp index f203c720..6d4079b7 100644 --- a/src/dos/dos_misc.cpp +++ b/src/dos/dos_misc.cpp @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: dos_misc.cpp,v 1.20 2008-09-07 10:55:14 c2woody Exp $ */ +/* $Id: dos_misc.cpp,v 1.21 2008-10-05 14:44:52 qbix79 Exp $ */ #include "dosbox.h" #include "callback.h" @@ -50,13 +50,12 @@ static Bitu INT2F_Handler(void) { LOG(LOG_DOSMISC,LOG_ERROR)("DOS:Multiplex Unhandled call %4X",reg_ax); return CBRET_NONE; -}; +} static Bitu INT2A_Handler(void) { - return CBRET_NONE; -}; +} static bool DOS_MultiplexFunctions(void) { switch (reg_ax) { @@ -214,4 +213,4 @@ void DOS_SetupMisc(void) { call_int2a=CALLBACK_Allocate(); CALLBACK_Setup(call_int2a,&INT2A_Handler,CB_IRET,"DOS Int 2a"); RealSetVec(0x2A,CALLBACK_RealPointer(call_int2a)); -}; +} diff --git a/src/dos/drive_local.cpp b/src/dos/drive_local.cpp index 74eae3a7..91bd08b5 100644 --- a/src/dos/drive_local.cpp +++ b/src/dos/drive_local.cpp @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: drive_local.cpp,v 1.77 2008-09-07 10:55:14 c2woody Exp $ */ +/* $Id: drive_local.cpp,v 1.78 2008-10-05 14:44:52 qbix79 Exp $ */ #include #include @@ -76,7 +76,7 @@ bool localDrive::FileCreate(DOS_File * * file,char * name,Bit16u attributes) { *file=new localFile(name,hand); return true; -}; +} bool localDrive::FileOpen(DOS_File * * file,char * name,Bit32u flags) { const char* type; @@ -113,7 +113,7 @@ bool localDrive::FileOpen(DOS_File * * file,char * name,Bit32u flags) { (*file)->flags=flags; //for the inheritance flag and maybe check for others. // (*file)->SetFileName(newname); return true; -}; +} FILE * localDrive::GetSystemFilePtr(char const * const name, char const * const type) { @@ -304,7 +304,7 @@ bool localDrive::GetFileAttr(char * name,Bit16u * attr) { } *attr=0; return false; -}; +} bool localDrive::MakeDir(char * dir) { char newdir[CROSS_LEN]; @@ -364,7 +364,7 @@ bool localDrive::Rename(char * oldname,char * newname) { if (temp==0) dirCache.CacheOut(newnew); return (temp==0); -}; +} bool localDrive::AllocationInfo(Bit16u * _bytes_sector,Bit8u * _sectors_cluster,Bit16u * _total_clusters,Bit16u * _free_clusters) { /* Always report 100 mb free should be enough */ @@ -374,7 +374,7 @@ bool localDrive::AllocationInfo(Bit16u * _bytes_sector,Bit8u * _sectors_cluster, *_total_clusters=allocation.total_clusters; *_free_clusters=allocation.free_clusters; return true; -}; +} bool localDrive::FileExists(const char* name) { char newname[CROSS_LEN]; @@ -450,7 +450,7 @@ bool localFile::Read(Bit8u * data,Bit16u * size) { Bit8u mask = IO_Read(0x21); if(mask & 0x4 ) IO_Write(0x21,mask&0xfb); return true; -}; +} bool localFile::Write(Bit8u * data,Bit16u * size) { if (last_action==READ) fseek(fhandle,ftell(fhandle),SEEK_SET); @@ -464,6 +464,7 @@ bool localFile::Write(Bit8u * data,Bit16u * size) { return true; } } + bool localFile::Seek(Bit32u * pos,Bit32u type) { int seektype; switch (type) { @@ -556,8 +557,7 @@ bool MSCDEX_GetVolumeName(Bit8u subUnit, char* name); cdromDrive::cdromDrive(const char driveLetter, const char * startdir,Bit16u _bytes_sector,Bit8u _sectors_cluster,Bit16u _total_clusters,Bit16u _free_clusters,Bit8u _mediaid, int& error) - :localDrive(startdir,_bytes_sector,_sectors_cluster,_total_clusters,_free_clusters,_mediaid) -{ + :localDrive(startdir,_bytes_sector,_sectors_cluster,_total_clusters,_free_clusters,_mediaid) { // Init mscdex error = MSCDEX_AddDrive(driveLetter,startdir,subUnit); strcpy(info, "CDRom "); @@ -566,10 +566,9 @@ cdromDrive::cdromDrive(const char driveLetter, const char * startdir,Bit16u _byt // Get Volume Label char name[32]; if (MSCDEX_GetVolumeName(subUnit,name)) dirCache.SetLabel(name,true,true); -}; +} -bool cdromDrive::FileOpen(DOS_File * * file,char * name,Bit32u flags) -{ +bool cdromDrive::FileOpen(DOS_File * * file,char * name,Bit32u flags) { if ((flags&3)==OPEN_READWRITE) { flags &= ~OPEN_READWRITE; } else if ((flags&3)==OPEN_WRITE) { @@ -579,47 +578,40 @@ bool cdromDrive::FileOpen(DOS_File * * file,char * name,Bit32u flags) bool retcode = localDrive::FileOpen(file,name,flags); if(retcode) (dynamic_cast(*file))->FlagReadOnlyMedium(); return retcode; -}; +} -bool cdromDrive::FileCreate(DOS_File * * file,char * name,Bit16u attributes) -{ +bool cdromDrive::FileCreate(DOS_File * * file,char * name,Bit16u attributes) { DOS_SetError(DOSERR_ACCESS_DENIED); return false; -}; +} -bool cdromDrive::FileUnlink(char * name) -{ +bool cdromDrive::FileUnlink(char * name) { DOS_SetError(DOSERR_ACCESS_DENIED); return false; -}; +} -bool cdromDrive::RemoveDir(char * dir) -{ +bool cdromDrive::RemoveDir(char * dir) { DOS_SetError(DOSERR_ACCESS_DENIED); return false; -}; +} -bool cdromDrive::MakeDir(char * dir) -{ +bool cdromDrive::MakeDir(char * dir) { DOS_SetError(DOSERR_ACCESS_DENIED); return false; -}; +} -bool cdromDrive::Rename(char * oldname,char * newname) -{ +bool cdromDrive::Rename(char * oldname,char * newname) { DOS_SetError(DOSERR_ACCESS_DENIED); return false; -}; +} -bool cdromDrive::GetFileAttr(char * name,Bit16u * attr) -{ +bool cdromDrive::GetFileAttr(char * name,Bit16u * attr) { bool result = localDrive::GetFileAttr(name,attr); if (result) *attr |= DOS_ATTR_READ_ONLY; return result; -}; +} -bool cdromDrive::FindFirst(char * _dir,DOS_DTA & dta,bool fcb_findfirst) -{ +bool cdromDrive::FindFirst(char * _dir,DOS_DTA & dta,bool fcb_findfirst) { // If media has changed, reInit drivecache. if (MSCDEX_HasMediaChanged(subUnit)) { dirCache.EmptyCache(); @@ -628,10 +620,9 @@ bool cdromDrive::FindFirst(char * _dir,DOS_DTA & dta,bool fcb_findfirst) if (MSCDEX_GetVolumeName(subUnit,name)) dirCache.SetLabel(name,true,true); } return localDrive::FindFirst(_dir,dta); -}; +} -void cdromDrive::SetDir(const char* path) -{ +void cdromDrive::SetDir(const char* path) { // If media has changed, reInit drivecache. if (MSCDEX_HasMediaChanged(subUnit)) { dirCache.EmptyCache(); @@ -640,7 +631,7 @@ void cdromDrive::SetDir(const char* path) if (MSCDEX_GetVolumeName(subUnit,name)) dirCache.SetLabel(name,true,true); } localDrive::SetDir(path); -}; +} bool cdromDrive::isRemote(void) { return true; diff --git a/src/dos/drive_virtual.cpp b/src/dos/drive_virtual.cpp index 628201d1..17ee00a9 100644 --- a/src/dos/drive_virtual.cpp +++ b/src/dos/drive_virtual.cpp @@ -98,12 +98,12 @@ bool Virtual_File::Read(Bit8u * data,Bit16u * size) { } file_pos+=*size; return true; -}; +} bool Virtual_File::Write(Bit8u * data,Bit16u * size){ /* Not really writeable */ return false; -}; +} bool Virtual_File::Seek(Bit32u * new_pos,Bit32u type){ switch (type) { @@ -122,11 +122,11 @@ bool Virtual_File::Seek(Bit32u * new_pos,Bit32u type){ } *new_pos=file_pos; return true; -}; +} bool Virtual_File::Close(){ return true; -}; +} Bit16u Virtual_File::GetInformation(void) { diff --git a/src/hardware/joystick.cpp b/src/hardware/joystick.cpp index f8fc6341..550ecca4 100644 --- a/src/hardware/joystick.cpp +++ b/src/hardware/joystick.cpp @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: joystick.cpp,v 1.19 2007-08-12 10:23:36 c2woody Exp $ */ +/* $Id: joystick.cpp,v 1.20 2008-10-05 14:44:52 qbix79 Exp $ */ #include #include "dosbox.h" @@ -164,29 +164,25 @@ void JOYSTICK_Move_Y(Bitu which,float y) { } } -bool JOYSTICK_IsEnabled(Bitu which) -{ +bool JOYSTICK_IsEnabled(Bitu which) { if (which<2) return stick[which].enabled; return false; -}; +} -bool JOYSTICK_GetButton(Bitu which, Bitu num) -{ +bool JOYSTICK_GetButton(Bitu which, Bitu num) { if ((which<2) && (num<2)) return stick[which].button[num]; return false; } -float JOYSTICK_GetMove_X(Bitu which) -{ +float JOYSTICK_GetMove_X(Bitu which) { if (which<2) return stick[which].xpos; return 0.0f; } -float JOYSTICK_GetMove_Y(Bitu which) -{ +float JOYSTICK_GetMove_Y(Bitu which) { if (which<2) return stick[which].ypos; return 0.0f; -}; +} class JOYSTICK:public Module_base{ private: diff --git a/src/hardware/mixer.cpp b/src/hardware/mixer.cpp index 7991c1bb..ce42db4c 100644 --- a/src/hardware/mixer.cpp +++ b/src/hardware/mixer.cpp @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: mixer.cpp,v 1.47 2007-08-12 19:16:01 c2woody Exp $ */ +/* $Id: mixer.cpp,v 1.48 2008-10-05 14:44:52 qbix79 Exp $ */ /* Remove the sdl code from here and have it handeld in the sdlmain. @@ -265,7 +265,7 @@ void MixerChannel::AddStretched(Bitu len,Bit16s * data) { mixer.work[mixpos][1]+=sample*volmul[1]; mixpos++; } -}; +} void MixerChannel::AddSamples_m8(Bitu len,Bit8u * data) { AddSamples(len,data); diff --git a/src/hardware/vga_attr.cpp b/src/hardware/vga_attr.cpp index 622d39a5..fd7df3c2 100644 --- a/src/hardware/vga_attr.cpp +++ b/src/hardware/vga_attr.cpp @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: vga_attr.cpp,v 1.28 2008-01-09 20:34:51 c2woody Exp $ */ +/* $Id: vga_attr.cpp,v 1.29 2008-10-05 14:44:52 qbix79 Exp $ */ #include "dosbox.h" #include "inout.h" @@ -212,7 +212,7 @@ Bitu read_p3c1(Bitu port,Bitu iolen) { LOG(LOG_VGAMISC,LOG_NORMAL)("VGA:ATTR:Read from unkown Index %2X",attr(index)); } return 0; -}; +} void VGA_SetupAttr(void) { diff --git a/src/ints/ems.cpp b/src/ints/ems.cpp index 440eaf77..7a54ffb2 100644 --- a/src/ints/ems.cpp +++ b/src/ints/ems.cpp @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: ems.cpp,v 1.58 2008-09-07 10:55:15 c2woody Exp $ */ +/* $Id: ems.cpp,v 1.59 2008-10-05 14:44:52 qbix79 Exp $ */ #include #include @@ -527,9 +527,9 @@ static Bit8u MemoryRegion(void) { } LoadMoveRegion(SegPhys(ds)+reg_si,region); /* Parse the region for information */ - PhysPt src_mem,dest_mem; - MemHandle src_handle,dest_handle; - Bitu src_off,dest_off;Bitu src_remain,dest_remain; + PhysPt src_mem = 0,dest_mem = 0; + MemHandle src_handle = 0,dest_handle = 0; + Bitu src_off = 0,dest_off = 0 ;Bitu src_remain = 0,dest_remain = 0; if (!region.src_type) { src_mem=region.src_page_seg*16+region.src_offset; } else { @@ -1009,7 +1009,7 @@ static Bitu V86_Monitor() { Bitu rm_val=mem_readb((v86_cs<<4)+v86_ip+2); Bitu which=(rm_val >> 3) & 7; if ((rm_val<0xc0) || (rm_val>=0xe8)) - E_Exit("Invalid opcode 0x0f 0x20 %x caused a protection fault!",rm_val); + E_Exit("Invalid opcode 0x0f 0x20 %x caused a protection fault!",static_cast(rm_val)); Bit32u crx=CPU_GET_CRX(which); switch (rm_val&7) { case 0: reg_eax=crx; break; @@ -1028,7 +1028,7 @@ static Bitu V86_Monitor() { Bitu rm_val=mem_readb((v86_cs<<4)+v86_ip+2); Bitu which=(rm_val >> 3) & 7; if ((rm_val<0xc0) || (rm_val>=0xe8)) - E_Exit("Invalid opcode 0x0f 0x22 %x caused a protection fault!",rm_val); + E_Exit("Invalid opcode 0x0f 0x22 %x caused a protection fault!",static_cast(rm_val)); Bit32u crx=0; switch (rm_val&7) { case 0: crx=reg_eax; break; diff --git a/src/ints/int10.cpp b/src/ints/int10.cpp index 1e6895ce..9a5cbff0 100644 --- a/src/ints/int10.cpp +++ b/src/ints/int10.cpp @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: int10.cpp,v 1.52 2008-05-10 17:33:28 c2woody Exp $ */ +/* $Id: int10.cpp,v 1.53 2008-10-05 14:44:52 qbix79 Exp $ */ #include "dosbox.h" #include "mem.h" @@ -684,7 +684,7 @@ static void INT10_InitVGA(void) { /* More than 64k */ IO_Write(0x3c4,0x04); IO_Write(0x3c5,0x02); -}; +} static void SetupTandyBios(void) { static Bit8u TandyConfig[130]= { @@ -720,4 +720,4 @@ void INT10_Init(Section* sec) { INT10_SetupVESA(); INT10_SetupRomMemoryChecksum();//SetupVesa modifies the rom as well. INT10_SetVideoMode(machine==MCH_HERC ? 0x7 : 0x3); -}; +} diff --git a/src/ints/int10_vptable.cpp b/src/ints/int10_vptable.cpp index 8b6d9ab0..acd383d6 100644 --- a/src/ints/int10_vptable.cpp +++ b/src/ints/int10_vptable.cpp @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: int10_vptable.cpp,v 1.2 2008-08-06 18:32:35 c2woody Exp $ */ +/* $Id: int10_vptable.cpp,v 1.3 2008-10-05 14:44:52 qbix79 Exp $ */ #include "dosbox.h" #include "mem.h" @@ -461,6 +461,7 @@ Bitu INT10_SetupVideoParameterTable(PhysPt basepos) { } } +#if 0 void INT10_GenerateVideoParameterTable(void) { if (!IS_VGA_ARCH) E_Exit("Be sure that all graphics registers are readable!"); Bitu i; @@ -701,3 +702,4 @@ void INT10_GenerateVideoParameterTable(void) { INT10_SetVideoMode(3); E_Exit("done!"); } +#endif diff --git a/src/ints/xms.cpp b/src/ints/xms.cpp index e19b6d33..e6d91b86 100644 --- a/src/ints/xms.cpp +++ b/src/ints/xms.cpp @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: xms.cpp,v 1.52 2008-03-29 16:47:09 c2woody Exp $ */ +/* $Id: xms.cpp,v 1.53 2008-10-05 14:44:52 qbix79 Exp $ */ #include #include @@ -103,18 +103,16 @@ struct XMS_MemMove{ #endif -Bitu XMS_EnableA20(bool enable) -{ +Bitu XMS_EnableA20(bool enable) { Bit8u val = IO_Read (0x92); if (enable) IO_Write(0x92,val | 2); else IO_Write(0x92,val & ~2); return 0; -}; +} -Bitu XMS_GetEnabledA20(void) -{ +Bitu XMS_GetEnabledA20(void) { return (IO_Read(0x92)&2)>0; -}; +} static RealPt xms_callback; static bool umb_available; @@ -131,7 +129,7 @@ Bitu XMS_QueryFreeMemory(Bit16u& largestFree, Bit16u& totalFree) { largestFree=(Bit16u)(MEM_FreeLargest()*4); if (!totalFree) return XMS_OUT_OF_SPACE; return 0; -}; +} Bitu XMS_AllocateMemory(Bitu size, Bit16u& handle) { // size = kb /* Find free handle */ @@ -154,7 +152,7 @@ Bitu XMS_AllocateMemory(Bitu size, Bit16u& handle) { // size = kb xms_handles[index].size=size; handle=index; return 0; -}; +} Bitu XMS_FreeMemory(Bitu handle) { if (InvalidHandle(handle)) return XMS_INVALID_HANDLE; @@ -163,7 +161,7 @@ Bitu XMS_FreeMemory(Bitu handle) { xms_handles[handle].size=0; xms_handles[handle].free=true; return 0; -}; +} Bitu XMS_MoveMemory(PhysPt bpt) { /* Read the block with mem_read's */ @@ -215,7 +213,7 @@ Bitu XMS_LockMemory(Bitu handle, Bit32u& address) { if (xms_handles[handle].locked<255) xms_handles[handle].locked++; address = xms_handles[handle].mem*4096; return 0; -}; +} Bitu XMS_UnlockMemory(Bitu handle) { if (InvalidHandle(handle)) return XMS_INVALID_HANDLE; @@ -224,7 +222,7 @@ Bitu XMS_UnlockMemory(Bitu handle) { return 0; } return XMS_BLOCK_NOT_LOCKED; -}; +} Bitu XMS_GetHandleInformation(Bitu handle, Bit8u& lockCount, Bit8u& numFree, Bit16u& size) { if (InvalidHandle(handle)) return XMS_INVALID_HANDLE; @@ -236,7 +234,7 @@ Bitu XMS_GetHandleInformation(Bitu handle, Bit8u& lockCount, Bit8u& numFree, Bit } size=(Bit16u)(xms_handles[handle].size); return 0; -}; +} Bitu XMS_ResizeMemory(Bitu handle, Bitu newSize) { if (InvalidHandle(handle)) return XMS_INVALID_HANDLE; @@ -261,7 +259,8 @@ static bool multiplex_xms(void) { } return false; -}; +} + INLINE void SET_RESULT(Bitu res,bool touch_bl_on_succes=true) { if(touch_bl_on_succes || res) reg_bl = (Bit8u)res; reg_ax = (res==0); @@ -412,6 +411,7 @@ Bitu XMS_Handler(void) { // LOG(LOG_MISC,LOG_ERROR)("XMS: CALL Result: %02X",reg_bl); return CBRET_NONE; } + class XMS: public Module_base { private: CALLBACK_HandlerObject callbackhandler; diff --git a/src/misc/programs.cpp b/src/misc/programs.cpp index 59d08d88..0395406e 100644 --- a/src/misc/programs.cpp +++ b/src/misc/programs.cpp @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: programs.cpp,v 1.33 2008-09-07 10:55:15 c2woody Exp $ */ +/* $Id: programs.cpp,v 1.34 2008-10-05 14:44:52 qbix79 Exp $ */ #include #include @@ -58,7 +58,7 @@ void PROGRAMS_MakeFile(char const * const name,PROGRAMS_Main * main) { comdata[CB_POS+1]=(Bit8u)((call_program>>8)&0xff); /* Copy save the pointer in the vector and save it's index */ - if (internal_progs.size()>255) E_Exit("PROGRAMS_MakeFile program size too large (%d)",internal_progs.size()); + if (internal_progs.size()>255) E_Exit("PROGRAMS_MakeFile program size too large (%d)",static_cast(internal_progs.size())); Bit8u index = (Bit8u)internal_progs.size(); internal_progs.push_back(main); @@ -158,7 +158,7 @@ bool Program::GetEnvStr(const char * entry,std::string & result) { return true; } while (1); return false; -}; +} bool Program::GetEnvNum(Bitu num,std::string & result) { char env_string[1024+1];