1
0
Fork 0

Add compiler testing for always_inline attribute

Add compiler testing for fastcall attribute
Add the FASTCALL define to visual c
Remove some overkill inline routines
Make sure that all the inline routines in headers are static


Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3355
This commit is contained in:
Sjoerd van der Berg 2009-04-25 16:25:03 +00:00
parent 5f6236ee35
commit 88caf1dc71
20 changed files with 182 additions and 147 deletions

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: callback.h,v 1.22 2009-01-14 22:16:00 qbix79 Exp $ */
/* $Id: callback.h,v 1.23 2009-04-25 16:25:03 harekiet Exp $ */
#ifndef DOSBOX_CALLBACK_H
#define DOSBOX_CALLBACK_H
@ -43,14 +43,14 @@ enum {
extern Bit8u lastint;
INLINE RealPt CALLBACK_RealPointer(Bitu callback) {
static INLINE RealPt CALLBACK_RealPointer(Bitu callback) {
return RealMake(CB_SEG,(Bit16u)(callback*CB_SIZE));
}
INLINE PhysPt CALLBACK_PhysPointer(Bitu callback) {
static INLINE PhysPt CALLBACK_PhysPointer(Bitu callback) {
return PhysMake(CB_SEG,(Bit16u)(callback*CB_SIZE));
}
INLINE PhysPt CALLBACK_GetBase(void) {
static INLINE PhysPt CALLBACK_GetBase(void) {
return CB_SEG << 4;
}

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: cpu.h,v 1.55 2008-08-24 16:43:06 qbix79 Exp $ */
/* $Id: cpu.h,v 1.56 2009-04-25 16:25:03 harekiet Exp $ */
#ifndef DOSBOX_CPU_H
#define DOSBOX_CPU_H
@ -144,13 +144,13 @@ void CPU_ENTER(bool use32,Bitu bytes,Bitu level);
#define CPU_INT_NOIOPLCHECK 0x8
void CPU_Interrupt(Bitu num,Bitu type,Bitu oldeip);
INLINE void CPU_HW_Interrupt(Bitu num) {
static INLINE void CPU_HW_Interrupt(Bitu num) {
CPU_Interrupt(num,0,reg_eip);
}
INLINE void CPU_SW_Interrupt(Bitu num,Bitu oldeip) {
static INLINE void CPU_SW_Interrupt(Bitu num,Bitu oldeip) {
CPU_Interrupt(num,CPU_INT_SOFTWARE,oldeip);
}
INLINE void CPU_SW_Interrupt_NoIOPLCheck(Bitu num,Bitu oldeip) {
static INLINE void CPU_SW_Interrupt_NoIOPLCheck(Bitu num,Bitu oldeip) {
CPU_Interrupt(num,CPU_INT_SOFTWARE|CPU_INT_NOIOPLCHECK,oldeip);
}
@ -478,12 +478,12 @@ struct CPUBlock {
extern CPUBlock cpu;
INLINE void CPU_SetFlagsd(Bitu word) {
static INLINE void CPU_SetFlagsd(Bitu word) {
Bitu mask=cpu.cpl ? FMASK_NORMAL : FMASK_ALL;
CPU_SetFlags(word,mask);
}
INLINE void CPU_SetFlagsw(Bitu word) {
static INLINE void CPU_SetFlagsw(Bitu word) {
Bitu mask=(cpu.cpl ? FMASK_NORMAL : FMASK_ALL) & 0xffff;
CPU_SetFlags(word,mask);
}

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: dos_inc.h,v 1.76 2008-09-06 14:47:02 c2woody Exp $ */
/* $Id: dos_inc.h,v 1.77 2009-04-25 16:25:03 harekiet Exp $ */
#ifndef DOSBOX_DOS_INC_H
#define DOSBOX_DOS_INC_H
@ -208,18 +208,18 @@ enum {
};
INLINE Bit16u long2para(Bit32u size) {
static INLINE Bit16u long2para(Bit32u size) {
if (size>0xFFFF0) return 0xffff;
if (size&0xf) return (Bit16u)((size>>4)+1);
else return (Bit16u)(size>>4);
}
INLINE Bit16u DOS_PackTime(Bit16u hour,Bit16u min,Bit16u sec) {
static INLINE Bit16u DOS_PackTime(Bit16u hour,Bit16u min,Bit16u sec) {
return (hour&0x1f)<<11 | (min&0x3f) << 5 | ((sec/2)&0x1f);
}
INLINE Bit16u DOS_PackDate(Bit16u year,Bit16u mon,Bit16u day) {
static INLINE Bit16u DOS_PackDate(Bit16u year,Bit16u mon,Bit16u day) {
return ((year-1980)&0x7f)<<9 | (mon&0x3f) << 5 | (day&0x1f);
}
@ -254,7 +254,7 @@ INLINE Bit16u DOS_PackDate(Bit16u year,Bit16u mon,Bit16u day) {
class MemStruct {
public:
INLINE Bitu GetIt(Bitu size,PhysPt addr) {
Bitu GetIt(Bitu size,PhysPt addr) {
switch (size) {
case 1:return mem_readb(pt+addr);
case 2:return mem_readw(pt+addr);
@ -262,16 +262,16 @@ public:
}
return 0;
}
INLINE void SaveIt(Bitu size,PhysPt addr,Bitu val) {
void SaveIt(Bitu size,PhysPt addr,Bitu val) {
switch (size) {
case 1:mem_writeb(pt+addr,(Bit8u)val);break;
case 2:mem_writew(pt+addr,(Bit16u)val);break;
case 4:mem_writed(pt+addr,(Bit32u)val);break;
}
}
INLINE void SetPt(Bit16u seg) { pt=PhysMake(seg,0);}
INLINE void SetPt(Bit16u seg,Bit16u off) { pt=PhysMake(seg,off);}
INLINE void SetPt(RealPt addr) { pt=Real2Phys(addr);}
void SetPt(Bit16u seg) { pt=PhysMake(seg,0);}
void SetPt(Bit16u seg,Bit16u off) { pt=PhysMake(seg,off);}
void SetPt(RealPt addr) { pt=Real2Phys(addr);}
protected:
PhysPt pt;
};
@ -635,7 +635,7 @@ struct DOS_Block {
extern DOS_Block dos;
INLINE Bit8u RealHandle(Bit16u handle) {
static Bit8u RealHandle(Bit16u handle) {
DOS_PSP psp(dos.psp());
return psp.GetFileHandle(handle);
}

View file

@ -108,44 +108,44 @@ extern FPU_rec fpu;
Bit16u FPU_GetTag(void);
void FPU_FLDCW(PhysPt addr);
INLINE void FPU_SetTag(Bit16u tag){
static INLINE void FPU_SetTag(Bit16u tag){
for(Bitu i=0;i<8;i++)
fpu.tags[i] = static_cast<FPU_Tag>((tag >>(2*i))&3);
}
INLINE void FPU_SetCW(Bitu word){
static INLINE void FPU_SetCW(Bitu word){
fpu.cw = (Bit16u)word;
fpu.cw_mask_all = (Bit16u)(word | 0x3f);
fpu.round = (FPU_Round)((word >> 10) & 3);
}
INLINE Bitu FPU_GET_TOP(void) {
static INLINE Bitu FPU_GET_TOP(void) {
return (fpu.sw & 0x3800)>>11;
}
INLINE void FPU_SET_TOP(Bitu val){
static INLINE void FPU_SET_TOP(Bitu val){
fpu.sw &= ~0x3800;
fpu.sw |= (val&7)<<11;
}
INLINE void FPU_SET_C0(Bitu C){
static INLINE void FPU_SET_C0(Bitu C){
fpu.sw &= ~0x0100;
if(C) fpu.sw |= 0x0100;
}
INLINE void FPU_SET_C1(Bitu C){
static INLINE void FPU_SET_C1(Bitu C){
fpu.sw &= ~0x0200;
if(C) fpu.sw |= 0x0200;
}
INLINE void FPU_SET_C2(Bitu C){
static INLINE void FPU_SET_C2(Bitu C){
fpu.sw &= ~0x0400;
if(C) fpu.sw |= 0x0400;
}
INLINE void FPU_SET_C3(Bitu C){
static INLINE void FPU_SET_C3(Bitu C){
fpu.sw &= ~0x4000;
if(C) fpu.sw |= 0x4000;
}

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: inout.h,v 1.11 2007-06-12 20:22:07 c2woody Exp $ */
/* $Id: inout.h,v 1.12 2009-04-25 16:25:03 harekiet Exp $ */
#ifndef DOSBOX_INOUT_H
#define DOSBOX_INOUT_H
@ -68,10 +68,10 @@ public:
~IO_WriteHandleObject();
};
INLINE void IO_Write(Bitu port,Bit8u val) {
static INLINE void IO_Write(Bitu port,Bit8u val) {
IO_WriteB(port,val);
}
INLINE Bit8u IO_Read(Bitu port){
static INLINE Bit8u IO_Read(Bitu port){
return (Bit8u)IO_ReadB(port);
}

View file

@ -59,23 +59,23 @@ MemHandle MEM_NextHandleAt(MemHandle handle,Bitu where);
#if defined(WORDS_BIGENDIAN) || !defined(C_UNALIGNED_MEMORY)
INLINE Bit8u host_readb(HostPt off) {
static 4/25/2009INLINE Bit8u host_readb(HostPt off) {
return off[0];
}
INLINE Bit16u host_readw(HostPt off) {
static INLINE Bit16u host_readw(HostPt off) {
return off[0] | (off[1] << 8);
}
INLINE Bit32u host_readd(HostPt off) {
static INLINE Bit32u host_readd(HostPt off) {
return off[0] | (off[1] << 8) | (off[2] << 16) | (off[3] << 24);
}
INLINE void host_writeb(HostPt off,Bit8u val) {
static INLINE void host_writeb(HostPt off,Bit8u val) {
off[0]=val;
}
INLINE void host_writew(HostPt off,Bit16u val) {
static INLINE void host_writew(HostPt off,Bit16u val) {
off[0]=(Bit8u)(val);
off[1]=(Bit8u)(val >> 8);
}
INLINE void host_writed(HostPt off,Bit32u val) {
static INLINE void host_writed(HostPt off,Bit32u val) {
off[0]=(Bit8u)(val);
off[1]=(Bit8u)(val >> 8);
off[2]=(Bit8u)(val >> 16);
@ -84,37 +84,37 @@ INLINE void host_writed(HostPt off,Bit32u val) {
#else
INLINE Bit8u host_readb(HostPt off) {
static INLINE Bit8u host_readb(HostPt off) {
return *(Bit8u *)off;
}
INLINE Bit16u host_readw(HostPt off) {
static INLINE Bit16u host_readw(HostPt off) {
return *(Bit16u *)off;
}
INLINE Bit32u host_readd(HostPt off) {
static INLINE Bit32u host_readd(HostPt off) {
return *(Bit32u *)off;
}
INLINE void host_writeb(HostPt off,Bit8u val) {
static INLINE void host_writeb(HostPt off,Bit8u val) {
*(Bit8u *)(off)=val;
}
INLINE void host_writew(HostPt off,Bit16u val) {
static INLINE void host_writew(HostPt off,Bit16u val) {
*(Bit16u *)(off)=val;
}
INLINE void host_writed(HostPt off,Bit32u val) {
static INLINE void host_writed(HostPt off,Bit32u val) {
*(Bit32u *)(off)=val;
}
#endif
INLINE void var_write(Bit8u * var, Bit8u val) {
static INLINE void var_write(Bit8u * var, Bit8u val) {
host_writeb((HostPt)var, val);
}
INLINE void var_write(Bit16u * var, Bit16u val) {
static INLINE void var_write(Bit16u * var, Bit16u val) {
host_writew((HostPt)var, val);
}
INLINE void var_write(Bit32u * var, Bit32u val) {
static INLINE void var_write(Bit32u * var, Bit32u val) {
host_writed((HostPt)var, val);
}
@ -128,23 +128,23 @@ void mem_writeb(PhysPt pt,Bit8u val);
void mem_writew(PhysPt pt,Bit16u val);
void mem_writed(PhysPt pt,Bit32u val);
INLINE void phys_writeb(PhysPt addr,Bit8u val) {
static INLINE void phys_writeb(PhysPt addr,Bit8u val) {
host_writeb(MemBase+addr,val);
}
INLINE void phys_writew(PhysPt addr,Bit16u val){
static INLINE void phys_writew(PhysPt addr,Bit16u val){
host_writew(MemBase+addr,val);
}
INLINE void phys_writed(PhysPt addr,Bit32u val){
static INLINE void phys_writed(PhysPt addr,Bit32u val){
host_writed(MemBase+addr,val);
}
INLINE Bit8u phys_readb(PhysPt addr) {
static INLINE Bit8u phys_readb(PhysPt addr) {
return host_readb(MemBase+addr);
}
INLINE Bit16u phys_readw(PhysPt addr){
static INLINE Bit16u phys_readw(PhysPt addr){
return host_readw(MemBase+addr);
}
INLINE Bit32u phys_readd(PhysPt addr){
static INLINE Bit32u phys_readd(PhysPt addr){
return host_readd(MemBase+addr);
}
@ -161,57 +161,57 @@ void mem_strcpy(PhysPt dest,PhysPt src);
/* The folowing functions are all shortcuts to the above functions using physical addressing */
INLINE Bit8u real_readb(Bit16u seg,Bit16u off) {
static INLINE Bit8u real_readb(Bit16u seg,Bit16u off) {
return mem_readb((seg<<4)+off);
}
INLINE Bit16u real_readw(Bit16u seg,Bit16u off) {
static INLINE Bit16u real_readw(Bit16u seg,Bit16u off) {
return mem_readw((seg<<4)+off);
}
INLINE Bit32u real_readd(Bit16u seg,Bit16u off) {
static INLINE Bit32u real_readd(Bit16u seg,Bit16u off) {
return mem_readd((seg<<4)+off);
}
INLINE void real_writeb(Bit16u seg,Bit16u off,Bit8u val) {
static INLINE void real_writeb(Bit16u seg,Bit16u off,Bit8u val) {
mem_writeb(((seg<<4)+off),val);
}
INLINE void real_writew(Bit16u seg,Bit16u off,Bit16u val) {
static INLINE void real_writew(Bit16u seg,Bit16u off,Bit16u val) {
mem_writew(((seg<<4)+off),val);
}
INLINE void real_writed(Bit16u seg,Bit16u off,Bit32u val) {
static INLINE void real_writed(Bit16u seg,Bit16u off,Bit32u val) {
mem_writed(((seg<<4)+off),val);
}
INLINE Bit16u RealSeg(RealPt pt) {
static INLINE Bit16u RealSeg(RealPt pt) {
return (Bit16u)(pt>>16);
}
INLINE Bit16u RealOff(RealPt pt) {
static INLINE Bit16u RealOff(RealPt pt) {
return (Bit16u)(pt&0xffff);
}
INLINE PhysPt Real2Phys(RealPt pt) {
static INLINE PhysPt Real2Phys(RealPt pt) {
return (RealSeg(pt)<<4) +RealOff(pt);
}
INLINE PhysPt PhysMake(Bit16u seg,Bit16u off) {
static INLINE PhysPt PhysMake(Bit16u seg,Bit16u off) {
return (seg<<4)+off;
}
INLINE RealPt RealMake(Bit16u seg,Bit16u off) {
static INLINE RealPt RealMake(Bit16u seg,Bit16u off) {
return (seg<<16)+off;
}
INLINE void RealSetVec(Bit8u vec,RealPt pt) {
static INLINE void RealSetVec(Bit8u vec,RealPt pt) {
mem_writed(vec<<2,pt);
}
INLINE void RealSetVec(Bit8u vec,RealPt pt,RealPt &old) {
static INLINE void RealSetVec(Bit8u vec,RealPt pt,RealPt &old) {
old = mem_readd(vec<<2);
mem_writed(vec<<2,pt);
}
INLINE RealPt RealGetVec(Bit8u vec) {
static INLINE RealPt RealGetVec(Bit8u vec) {
return mem_readd(vec<<2);
}

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: mixer.h,v 1.17 2009-03-19 20:45:42 c2woody Exp $ */
/* $Id: mixer.h,v 1.18 2009-04-25 16:25:03 harekiet Exp $ */
#ifndef DOSBOX_MIXER_H
#define DOSBOX_MIXER_H
@ -52,8 +52,10 @@ public:
void SetFreq(Bitu _freq);
void Mix(Bitu _needed);
void AddSilence(void); //Fill up until needed
template<class Type,bool stereo,bool signeddata,bool nativeorder>
void AddSamples(Bitu len, const Type* data);
void AddSamples_m8(Bitu len, const Bit8u * data);
void AddSamples_s8(Bitu len, const Bit8u * data);
void AddSamples_m8s(Bitu len, const Bit8s * data);

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: paging.h,v 1.31 2008-01-05 21:04:43 c2woody Exp $ */
/* $Id: paging.h,v 1.32 2009-04-25 16:25:03 harekiet Exp $ */
#ifndef DOSBOX_PAGING_H
#define DOSBOX_PAGING_H
@ -197,25 +197,25 @@ bool mem_unalignedwrited_checked(PhysPt address,Bit32u val);
#if defined(USE_FULL_TLB)
INLINE HostPt get_tlb_read(PhysPt address) {
static INLINE HostPt get_tlb_read(PhysPt address) {
return paging.tlb.read[address>>12];
}
INLINE HostPt get_tlb_write(PhysPt address) {
static INLINE HostPt get_tlb_write(PhysPt address) {
return paging.tlb.write[address>>12];
}
INLINE PageHandler* get_tlb_readhandler(PhysPt address) {
static INLINE PageHandler* get_tlb_readhandler(PhysPt address) {
return paging.tlb.readhandler[address>>12];
}
INLINE PageHandler* get_tlb_writehandler(PhysPt address) {
static INLINE PageHandler* get_tlb_writehandler(PhysPt address) {
return paging.tlb.writehandler[address>>12];
}
/* Use these helper functions to access linear addresses in readX/writeX functions */
INLINE PhysPt PAGING_GetPhysicalPage(PhysPt linePage) {
static INLINE PhysPt PAGING_GetPhysicalPage(PhysPt linePage) {
return (paging.tlb.phys_page[linePage>>12]<<12);
}
INLINE PhysPt PAGING_GetPhysicalAddress(PhysPt linAddr) {
static INLINE PhysPt PAGING_GetPhysicalAddress(PhysPt linAddr) {
return (paging.tlb.phys_page[linAddr>>12]<<12)|(linAddr&0xfff);
}
@ -223,7 +223,7 @@ INLINE PhysPt PAGING_GetPhysicalAddress(PhysPt linAddr) {
void PAGING_InitTLBBank(tlb_entry **bank);
INLINE tlb_entry *get_tlb_entry(PhysPt address) {
static INLINE tlb_entry *get_tlb_entry(PhysPt address) {
Bitu index=(address>>12);
if (TLB_BANKS && (index > TLB_SIZE)) {
Bitu bank=(address>>BANK_SHIFT) - 1;
@ -234,26 +234,26 @@ INLINE tlb_entry *get_tlb_entry(PhysPt address) {
return &paging.tlbh[index];
}
INLINE HostPt get_tlb_read(PhysPt address) {
static INLINE HostPt get_tlb_read(PhysPt address) {
return get_tlb_entry(address)->read;
}
INLINE HostPt get_tlb_write(PhysPt address) {
static INLINE HostPt get_tlb_write(PhysPt address) {
return get_tlb_entry(address)->write;
}
INLINE PageHandler* get_tlb_readhandler(PhysPt address) {
static INLINE PageHandler* get_tlb_readhandler(PhysPt address) {
return get_tlb_entry(address)->readhandler;
}
INLINE PageHandler* get_tlb_writehandler(PhysPt address) {
static INLINE PageHandler* get_tlb_writehandler(PhysPt address) {
return get_tlb_entry(address)->writehandler;
}
/* Use these helper functions to access linear addresses in readX/writeX functions */
INLINE PhysPt PAGING_GetPhysicalPage(PhysPt linePage) {
static INLINE PhysPt PAGING_GetPhysicalPage(PhysPt linePage) {
tlb_entry *entry = get_tlb_entry(linePage);
return (entry->phys_page<<12);
}
INLINE PhysPt PAGING_GetPhysicalAddress(PhysPt linAddr) {
static INLINE PhysPt PAGING_GetPhysicalAddress(PhysPt linAddr) {
tlb_entry *entry = get_tlb_entry(linAddr);
return (entry->phys_page<<12)|(linAddr&0xfff);
}
@ -261,13 +261,13 @@ INLINE PhysPt PAGING_GetPhysicalAddress(PhysPt linAddr) {
/* Special inlined memory reading/writing */
INLINE Bit8u mem_readb_inline(PhysPt address) {
static INLINE Bit8u mem_readb_inline(PhysPt address) {
HostPt tlb_addr=get_tlb_read(address);
if (tlb_addr) return host_readb(tlb_addr+address);
else return (Bit8u)(get_tlb_readhandler(address))->readb(address);
}
INLINE Bit16u mem_readw_inline(PhysPt address) {
static INLINE Bit16u mem_readw_inline(PhysPt address) {
if ((address & 0xfff)<0xfff) {
HostPt tlb_addr=get_tlb_read(address);
if (tlb_addr) return host_readw(tlb_addr+address);
@ -275,7 +275,7 @@ INLINE Bit16u mem_readw_inline(PhysPt address) {
} else return mem_unalignedreadw(address);
}
INLINE Bit32u mem_readd_inline(PhysPt address) {
static INLINE Bit32u mem_readd_inline(PhysPt address) {
if ((address & 0xfff)<0xffd) {
HostPt tlb_addr=get_tlb_read(address);
if (tlb_addr) return host_readd(tlb_addr+address);
@ -283,13 +283,13 @@ INLINE Bit32u mem_readd_inline(PhysPt address) {
} else return mem_unalignedreadd(address);
}
INLINE void mem_writeb_inline(PhysPt address,Bit8u val) {
static INLINE void mem_writeb_inline(PhysPt address,Bit8u val) {
HostPt tlb_addr=get_tlb_write(address);
if (tlb_addr) host_writeb(tlb_addr+address,val);
else (get_tlb_writehandler(address))->writeb(address,val);
}
INLINE void mem_writew_inline(PhysPt address,Bit16u val) {
static INLINE void mem_writew_inline(PhysPt address,Bit16u val) {
if ((address & 0xfff)<0xfff) {
HostPt tlb_addr=get_tlb_write(address);
if (tlb_addr) host_writew(tlb_addr+address,val);
@ -297,7 +297,7 @@ INLINE void mem_writew_inline(PhysPt address,Bit16u val) {
} else mem_unalignedwritew(address,val);
}
INLINE void mem_writed_inline(PhysPt address,Bit32u val) {
static INLINE void mem_writed_inline(PhysPt address,Bit32u val) {
if ((address & 0xfff)<0xffd) {
HostPt tlb_addr=get_tlb_write(address);
if (tlb_addr) host_writed(tlb_addr+address,val);
@ -306,7 +306,7 @@ INLINE void mem_writed_inline(PhysPt address,Bit32u val) {
}
INLINE bool mem_readb_checked(PhysPt address, Bit8u * val) {
static INLINE bool mem_readb_checked(PhysPt address, Bit8u * val) {
HostPt tlb_addr=get_tlb_read(address);
if (tlb_addr) {
*val=host_readb(tlb_addr+address);
@ -314,7 +314,7 @@ INLINE bool mem_readb_checked(PhysPt address, Bit8u * val) {
} else return (get_tlb_readhandler(address))->readb_checked(address, val);
}
INLINE bool mem_readw_checked(PhysPt address, Bit16u * val) {
static INLINE bool mem_readw_checked(PhysPt address, Bit16u * val) {
if ((address & 0xfff)<0xfff) {
HostPt tlb_addr=get_tlb_read(address);
if (tlb_addr) {
@ -324,7 +324,7 @@ INLINE bool mem_readw_checked(PhysPt address, Bit16u * val) {
} else return mem_unalignedreadw_checked(address, val);
}
INLINE bool mem_readd_checked(PhysPt address, Bit32u * val) {
static INLINE bool mem_readd_checked(PhysPt address, Bit32u * val) {
if ((address & 0xfff)<0xffd) {
HostPt tlb_addr=get_tlb_read(address);
if (tlb_addr) {
@ -334,7 +334,7 @@ INLINE bool mem_readd_checked(PhysPt address, Bit32u * val) {
} else return mem_unalignedreadd_checked(address, val);
}
INLINE bool mem_writeb_checked(PhysPt address,Bit8u val) {
static INLINE bool mem_writeb_checked(PhysPt address,Bit8u val) {
HostPt tlb_addr=get_tlb_write(address);
if (tlb_addr) {
host_writeb(tlb_addr+address,val);
@ -342,7 +342,7 @@ INLINE bool mem_writeb_checked(PhysPt address,Bit8u val) {
} else return (get_tlb_writehandler(address))->writeb_checked(address,val);
}
INLINE bool mem_writew_checked(PhysPt address,Bit16u val) {
static INLINE bool mem_writew_checked(PhysPt address,Bit16u val) {
if ((address & 0xfff)<0xfff) {
HostPt tlb_addr=get_tlb_write(address);
if (tlb_addr) {
@ -352,7 +352,7 @@ INLINE bool mem_writew_checked(PhysPt address,Bit16u val) {
} else return mem_unalignedwritew_checked(address,val);
}
INLINE bool mem_writed_checked(PhysPt address,Bit32u val) {
static INLINE bool mem_writed_checked(PhysPt address,Bit32u val) {
if ((address & 0xfff)<0xffd) {
HostPt tlb_addr=get_tlb_write(address);
if (tlb_addr) {

View file

@ -36,19 +36,19 @@ extern Bitu PIC_IRQCheck;
extern Bitu PIC_IRQActive;
extern Bitu PIC_Ticks;
INLINE float PIC_TickIndex(void) {
static INLINE float PIC_TickIndex(void) {
return (CPU_CycleMax-CPU_CycleLeft-CPU_Cycles)/(float)CPU_CycleMax;
}
INLINE Bits PIC_TickIndexND(void) {
static INLINE Bits PIC_TickIndexND(void) {
return CPU_CycleMax-CPU_CycleLeft-CPU_Cycles;
}
INLINE Bits PIC_MakeCycles(double amount) {
static INLINE Bits PIC_MakeCycles(double amount) {
return (Bits)(CPU_CycleMax*amount);
}
INLINE double PIC_FullIndex(void) {
static INLINE double PIC_FullIndex(void) {
return PIC_Ticks+(double)PIC_TickIndex();
}

View file

@ -93,20 +93,20 @@ struct CPU_Regs {
extern Segments Segs;
extern CPU_Regs cpu_regs;
INLINE PhysPt SegPhys(SegNames index) {
static INLINE PhysPt SegPhys(SegNames index) {
return Segs.phys[index];
}
INLINE Bit16u SegValue(SegNames index) {
static INLINE Bit16u SegValue(SegNames index) {
return (Bit16u)Segs.val[index];
}
INLINE RealPt RealMakeSeg(SegNames index,Bit16u off) {
static INLINE RealPt RealMakeSeg(SegNames index,Bit16u off) {
return RealMake(SegValue(index),off);
}
INLINE void SegSet16(Bitu index,Bit16u val) {
static INLINE void SegSet16(Bitu index,Bit16u val) {
Segs.val[index]=val;
Segs.phys[index]=val << 4;
}

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: support.h,v 1.16 2008-01-13 11:28:41 qbix79 Exp $ */
/* $Id: support.h,v 1.17 2009-04-25 16:25:03 harekiet Exp $ */
#ifndef DOSBOX_SUPPORT_H
#define DOSBOX_SUPPORT_H
@ -43,6 +43,8 @@ void strreplace(char * str,char o,char n);
char *ltrim(char *str);
char *rtrim(char *str);
char *trim(char * str);
char * upcase(char * str);
char * lowcase(char * str);
bool ScanCMDBool(char * cmd,char const * const check);
char * ScanCMDRemain(char * cmd);
@ -52,16 +54,6 @@ bool IsHexWord(char * word);
Bits ConvDecWord(char * word);
Bits ConvHexWord(char * word);
INLINE char * upcase(char * str) {
for (char* idx = str; *idx ; idx++) *idx = toupper(*reinterpret_cast<unsigned char*>(idx));
return str;
}
INLINE char * lowcase(char * str) {
for(char* idx = str; *idx ; idx++) *idx = tolower(*reinterpret_cast<unsigned char*>(idx));
return str;
}
void upcase(std::string &str);
void lowcase(std::string &str);