From 7139da9f0d5def09d0ea2e6207d397e717610ef4 Mon Sep 17 00:00:00 2001 From: Sjoerd van der Berg Date: Sun, 9 Nov 2003 08:20:23 +0000 Subject: [PATCH] Fix some vstudio.net warnings/errors Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@1421 --- src/hardware/dma.cpp | 8 ++++---- src/hardware/gus.cpp | 15 +++++++-------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/hardware/dma.cpp b/src/hardware/dma.cpp index af3efba3..f93ac9fa 100644 --- a/src/hardware/dma.cpp +++ b/src/hardware/dma.cpp @@ -208,10 +208,10 @@ Bit16u DmaChannel::portRead(Bit32u port, bool eightbit) { if(eightbit) { if(ff) { ff = !ff; - return (Bit8u)(currcnt-1 & 0xff); + return (Bit8u)(currcnt-1); } else { ff = !ff; - return (Bit8u)(currcnt-1 >> 8); + return (Bit8u)((currcnt-1) >> 8); } } else { return (Bit16u)currcnt; @@ -343,7 +343,7 @@ Bitu DMA_8_Read(Bitu dmachan,Bit8u * buffer,Bitu count) { if (!count) return 0; if (chan->addr_changed) chan->reset(); - if (chan->currcnt>count) { + if (chan->currcnt>(Bits)count) { MEM_BlockRead(chan->curraddr,buffer,count); chan->curraddr+=count; chan->current_addr+=count; @@ -382,7 +382,7 @@ Bitu DMA_8_Write(Bitu dmachan,Bit8u * buffer,Bitu count) { if (chan->masked) return 0; if (!count) return 0; - if (chan->currcnt>count) { + if (chan->currcnt>(Bits)count) { MEM_BlockWrite(chan->curraddr,buffer,count); chan->curraddr+=count; chan->currcnt-=count; diff --git a/src/hardware/gus.cpp b/src/hardware/gus.cpp index a33d4f94..64ad12a0 100644 --- a/src/hardware/gus.cpp +++ b/src/hardware/gus.cpp @@ -166,7 +166,7 @@ INLINE Bit16s GetSample(Bit32u Delta, Bit32u CurAddr, bool eightbit) { Bit16s w1 = b1 << 7; Bit16s w2 = b2 << 7; Bit16s diff = w2 - w1; - return (w1 + (((Bit32s)diff * (Bit32s)(CurAddr & 0x3fe)) >> 10)); + return (Bit16s)(w1 + (((Bit32s)diff * (Bit32s)(CurAddr & 0x3fe)) >> 10)); } } else { @@ -188,7 +188,7 @@ INLINE Bit16s GetSample(Bit32u Delta, Bit32u CurAddr, bool eightbit) { Bit16s w1 = (Bit16s)((Bit16u)GUSRam[useAddr] | ((Bit16u)GUSRam[useAddr+1] << 8)); Bit16s w2 = (Bit16s)((Bit16u)GUSRam[useAddr+2] | ((Bit16u)GUSRam[useAddr+3] << 8)); Bit16s diff = w2 - w1; - return (w1 + (((Bit32s)diff * (Bit32s)((CurAddr) & 0x3fe)) >> 10)) >> 2; + return (Bit16s)(w1 + (((Bit32s)diff * (Bit32s)((CurAddr) & 0x3fe)) >> 10)) >> 2; } } @@ -210,7 +210,7 @@ public: Bit32u CurAddr; Bit8u PanPot; Bit8u VolControl; - Bit16u channum; + Bit8u channum; bool moving; bool playing; @@ -224,7 +224,7 @@ public: Bit32s rightvol; Bit32s nextramp; - GUSChannels(Bit16u num) { + GUSChannels(Bit8u num) { channum = num; playing = true; ramping = false; @@ -349,7 +349,7 @@ public: notifyonce = false; - for(i=0;i> 4)); + a = pow(2.0f,(float)(i >> 4)); b = 1.0+((float)(i & 0xf))/(float)16; a *= b; a /= 16; @@ -1012,7 +1011,7 @@ void MakeTables(void) } for(i=0;i<4096;i++) { float a,b; - a = pow(2,(float)(i >> 8)); + a = pow(2.0f,(float)(i >> 8)); b = 1.0+((float)(i & 0xff))/(float)256; a *= b; a /= 16;