1
0
Fork 0

silence some warnings, add most of sf patch #1185267 by Moe

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@2883
This commit is contained in:
Sebastian Strohhäcker 2007-06-12 20:22:09 +00:00
parent 8c6d24bb61
commit 0c24e87fdc
49 changed files with 265 additions and 255 deletions

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: bios.cpp,v 1.67 2007-03-07 10:47:12 qbix79 Exp $ */
/* $Id: bios.cpp,v 1.68 2007-06-12 20:22:08 c2woody Exp $ */
#include "dosbox.h"
#include "mem.h"
@ -981,7 +981,7 @@ void BIOS_SetComPorts(Bit16u baseaddr[]) {
equipmentword &= (~0x0E00);
equipmentword |= (portcount << 9);
mem_writew(BIOS_CONFIGURATION,equipmentword);
CMOS_SetRegister(0x14,equipmentword); //Should be updated on changes
CMOS_SetRegister(0x14,(Bit8u)(equipmentword&0xff)); //Should be updated on changes
}

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: bios_disk.cpp,v 1.34 2007-05-02 18:56:15 c2woody Exp $ */
/* $Id: bios_disk.cpp,v 1.35 2007-06-12 20:22:08 c2woody Exp $ */
#include "dosbox.h"
#include "callback.h"
@ -40,7 +40,7 @@ diskGeo DiskGeometryList[] = {
{1200, 15, 2, 80, 2},
{1440, 18, 2, 80, 4},
{2880, 36, 2, 80, 6},
{0, 0, 0 , 0},
{0, 0, 0, 0, 0}
};
Bitu call_int13;
@ -65,8 +65,8 @@ void updateDPT(void) {
if(imageDiskList[2] != NULL) {
PhysPt dp0physaddr=CALLBACK_PhysPointer(diskparm0);
imageDiskList[2]->Get_Geometry(&tmpheads, &tmpcyl, &tmpsect, &tmpsize);
phys_writew(dp0physaddr,tmpcyl);
phys_writeb(dp0physaddr+0x2,tmpheads);
phys_writew(dp0physaddr,(Bit16u)tmpcyl);
phys_writeb(dp0physaddr+0x2,(Bit8u)tmpheads);
phys_writew(dp0physaddr+0x3,0);
phys_writew(dp0physaddr+0x5,(Bit16u)-1);
phys_writeb(dp0physaddr+0x7,0);
@ -74,15 +74,15 @@ void updateDPT(void) {
phys_writeb(dp0physaddr+0x9,0);
phys_writeb(dp0physaddr+0xa,0);
phys_writeb(dp0physaddr+0xb,0);
phys_writew(dp0physaddr+0xc,tmpcyl);
phys_writeb(dp0physaddr+0xe,tmpsect);
phys_writew(dp0physaddr+0xc,(Bit16u)tmpcyl);
phys_writeb(dp0physaddr+0xe,(Bit8u)tmpsect);
}
if(imageDiskList[3] != NULL) {
PhysPt dp1physaddr=CALLBACK_PhysPointer(diskparm1);
imageDiskList[3]->Get_Geometry(&tmpheads, &tmpcyl, &tmpsect, &tmpsize);
phys_writew(dp1physaddr,tmpcyl);
phys_writeb(dp1physaddr+0x2,tmpheads);
phys_writeb(dp1physaddr+0xe,tmpsect);
phys_writew(dp1physaddr,(Bit16u)tmpcyl);
phys_writeb(dp1physaddr+0x2,(Bit8u)tmpheads);
phys_writeb(dp1physaddr+0xe,(Bit8u)tmpsect);
}
}
@ -222,7 +222,7 @@ imageDisk::imageDisk(FILE *imgFile, Bit8u *imgName, Bit32u imgSizeK, bool isHard
equipment|=(numofdisks<<6);
} else equipment|=1;
mem_writew(BIOS_CONFIGURATION,equipment);
CMOS_SetRegister(0x14, equipment);
CMOS_SetRegister(0x14, (Bit8u)(equipment&0xff));
}
}
}
@ -244,7 +244,7 @@ void imageDisk::Get_Geometry(Bit32u * getHeads, Bit32u *getCyl, Bit32u *getSect,
Bit8u imageDisk::GetBiosType(void) {
if(!hardDrive) {
return DiskGeometryList[floppytype].biosval;
return (Bit8u)DiskGeometryList[floppytype].biosval;
} else return 0;
}
@ -298,11 +298,11 @@ static Bitu INT13_DiskHandler(void) {
Bit16u segat, bufptr;
Bit8u sectbuf[512];
Bitu drivenum;
int i,t;
Bitu i,t;
last_drive = reg_dl;
drivenum = GetDosDriveNumber(reg_dl);
bool any_images = false;
for(Bitu i = 0;i < MAX_DISK_IMAGES;i++) {
for(i = 0;i < MAX_DISK_IMAGES;i++) {
if(imageDiskList[i]) any_images=true;
}
@ -447,9 +447,9 @@ static Bitu INT13_DiskHandler(void) {
else tmpcyl--; // cylinder count -> max cylinder
if (tmpheads==0) LOG(LOG_BIOS,LOG_ERROR)("INT13 DrivParm: head count zero!");
else tmpheads--; // head count -> max head
reg_ch = tmpcyl & 0xff;
reg_cl = (((tmpcyl >> 2) & 0xc0) | (tmpsect & 0x3f));
reg_dh = tmpheads;
reg_ch = (Bit8u)(tmpcyl & 0xff);
reg_cl = (Bit8u)(((tmpcyl >> 2) & 0xc0) | (tmpsect & 0x3f));
reg_dh = (Bit8u)tmpheads;
last_status = 0x00;
if (reg_dl&0x80) { // harddisks
reg_dl = 0;

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: int10_char.cpp,v 1.49 2007-01-08 19:45:41 qbix79 Exp $ */
/* $Id: int10_char.cpp,v 1.50 2007-06-12 20:22:08 c2woody Exp $ */
/* Character displaying moving functions */
@ -534,7 +534,7 @@ void INT10_WriteChar(Bit8u chr,Bit8u attr,Bit8u page,Bit16u count,bool showattr)
Bit8u cur_row=CURSOR_POS_ROW(page);
Bit8u cur_col=CURSOR_POS_COL(page);
BIOS_NCOLS;BIOS_NROWS;
BIOS_NCOLS;
while (count>0) {
WriteChar(cur_col,cur_row,page,chr,attr,showattr);
count--;
@ -600,7 +600,6 @@ void INT10_TeletypeOutput(Bit8u chr,Bit8u attr) {
}
void INT10_WriteString(Bit8u row,Bit8u col,Bit8u flag,Bit8u attr,PhysPt string,Bit16u count,Bit8u page) {
BIOS_NCOLS;BIOS_NROWS;
Bit8u cur_row=CURSOR_POS_ROW(page);
Bit8u cur_col=CURSOR_POS_COL(page);

View file

@ -218,7 +218,7 @@ void INT10_EGA_RIL_ReadRegisterRange(Bit8u & bl, Bit8u ch, Bit8u cl, Bit16u dx,
LOG(LOG_INT10,LOG_ERROR)("EGA RIL range read with port %x called",port);
} else {
if(ch<regs) {
if (ch+cl>regs) cl=regs-ch;
if ((Bitu)ch+cl>regs) cl=(Bit8u)(regs-ch);
for (Bitu i=0; i<cl; i++) {
if(port == 0x3c0) IO_Read(real_readw(BIOSMEM_SEG,BIOSMEM_CRTC_ADDRESS) + 6);
IO_Write(port,ch+i);
@ -237,7 +237,7 @@ void INT10_EGA_RIL_WriteRegisterRange(Bit8u & bl, Bit8u ch, Bit8u cl, Bit16u dx,
LOG(LOG_INT10,LOG_ERROR)("EGA RIL range write called with port %x",port);
} else {
if(ch<regs) {
if (ch+cl>regs) cl=regs-ch;
if ((Bitu)ch+cl>regs) cl=(Bit8u)(regs-ch);
if(port == 0x3c0) {
IO_Read(real_readw(BIOSMEM_SEG,BIOSMEM_CRTC_ADDRESS) + 6);
for (Bitu i=0; i<cl; i++) {

View file

@ -340,6 +340,7 @@ bool INT10_SetVideoMode_OTHER(Bitu mode,bool clearmem) {
IO_WriteW(crtc_base,0x07 | (CurMode->vdispend+1) << 8);
//Maximum scanline
Bit8u scanline,crtpage;
scanline=8;
switch(CurMode->type) {
case M_TEXT:
if (machine==MCH_HERC) scanline=14;

View file

@ -210,7 +210,7 @@ void INT10_GetPelMask(Bit8u & mask) {
}
void INT10_SetBackgroundBorder(Bit8u val) {
Bitu temp=real_readb(BIOSMEM_SEG,BIOSMEM_CURRENT_PAL);
Bit8u temp=real_readb(BIOSMEM_SEG,BIOSMEM_CURRENT_PAL);
temp=(temp & 0xe0) | (val & 0x1f);
real_writeb(BIOSMEM_SEG,BIOSMEM_CURRENT_PAL,temp);
if (machine == MCH_CGA || IS_TANDY_ARCH)
@ -233,7 +233,7 @@ void INT10_SetBackgroundBorder(Bit8u val) {
}
void INT10_SetColorSelect(Bit8u val) {
Bitu temp=real_readb(BIOSMEM_SEG,BIOSMEM_CURRENT_PAL);
Bit8u temp=real_readb(BIOSMEM_SEG,BIOSMEM_CURRENT_PAL);
temp=(temp & 0xdf) | ((val & 1) ? 0x20 : 0x0);
real_writeb(BIOSMEM_SEG,BIOSMEM_CURRENT_PAL,temp);
if (machine == MCH_CGA || IS_TANDY_ARCH)

View file

@ -21,8 +21,8 @@
#include "inout.h"
#include "int10.h"
static Bit8u cga_masks[4]={~192U,~48U,~12U,~3U};
static Bit8u cga_masks2[8]={~128U,~64U,~32U,~16U,~8U,~4U,~2U,~1U};
static Bit8u cga_masks[4]={0x3f,0xcf,0xf3,0xfc};
static Bit8u cga_masks2[8]={0x7f,0xbf,0xdf,0xef,0xf7,0xfb,0xfd,0xfe};
void INT10_PutPixel(Bit16u x,Bit16u y,Bit8u page,Bit8u color) {
switch (CurMode->type) {

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: int10_vesa.cpp,v 1.26 2007-01-24 16:29:53 harekiet Exp $ */
/* $Id: int10_vesa.cpp,v 1.27 2007-06-12 20:22:09 c2woody Exp $ */
#include <string.h>
#include <stddef.h>
@ -228,7 +228,7 @@ Bit8u VESA_SetSVGAMode(Bit16u mode) {
};
Bit8u VESA_GetSVGAMode(Bit16u & mode) {
mode=CurMode->mode;
mode=(Bit16u)(CurMode->mode);
return 0x00;
}

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: mouse.cpp,v 1.68 2007-06-06 15:44:40 c2woody Exp $ */
/* $Id: mouse.cpp,v 1.69 2007-06-12 20:22:09 c2woody Exp $ */
#include <string.h>
#include <math.h>
@ -236,12 +236,12 @@ void DrawCursorText()
Bit16u result;
ReadCharAttr(mouse.backposx,mouse.backposy,0,&result);
mouse.backData[0] = result & 0xFF;
mouse.backData[1] = result>>8;
mouse.backData[0] = (Bit8u)(result & 0xFF);
mouse.backData[1] = (Bit8u)(result>>8);
mouse.background = true;
// Write Cursor
result = (result & mouse.textAndMask) ^ mouse.textXorMask;
WriteChar(mouse.backposx,mouse.backposy,0,result&0xFF,result>>8,true);
WriteChar(mouse.backposx,mouse.backposy,0,(Bit8u)(result&0xFF),(Bit8u)(result>>8),true);
};
// ***************************************************************************
@ -508,8 +508,8 @@ static void SetSensitivity(Bit16s px, Bit16s py){
if ((px!=0) && (py!=0)) {
px--; //Inspired by cutemouse
py--; //Although their cursor update routine is far more complex then ours
mouse.senv_x=(static_cast<float>(px)*px)/3600.0 +1.0/3.0;
mouse.senv_y=(static_cast<float>(py)*py)/3600.0 +1.0/3.0;
mouse.senv_x=(static_cast<float>(px)*px)/3600.0f +1.0f/3.0f;
mouse.senv_y=(static_cast<float>(py)*py)/3600.0f +1.0f/3.0f;
}
};

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: xms.cpp,v 1.46 2007-01-08 21:40:15 qbix79 Exp $ */
/* $Id: xms.cpp,v 1.47 2007-06-12 20:22:09 c2woody Exp $ */
#include <stdlib.h>
#include <string.h>
@ -229,7 +229,7 @@ Bitu XMS_GetHandleInformation(Bitu handle, Bit8u& lockCount, Bit8u& numFree, Bit
for (Bitu i=1;i<XMS_HANDLES;i++) {
if (xms_handles[i].free) numFree++;
}
size=xms_handles[handle].size;
size=(Bit16u)(xms_handles[handle].size);
return 0;
};
@ -259,7 +259,7 @@ static bool multiplex_xms(void) {
};
#define SET_RESULT(caller) { \
res = caller; \
if(res) reg_bl = res; \
if(res) reg_bl = (Bit8u)res; \
reg_ax = (res==0); \
}