1
0
Fork 0

Fix narrowing warnings (errors on clang/freebsd) and an unhandled value in switch. (Part of patch #275 from strageqargo)

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4072
This commit is contained in:
Peter Veenstra 2018-01-31 10:21:41 +00:00
parent aa8bf6041e
commit f7ae7a1dbe
2 changed files with 6 additions and 4 deletions

View file

@ -75,7 +75,7 @@ public:
for (int d = 0;d < DOS_DRIVES;d++) {
if (!Drives[d]) continue;
char root[7] = {'A'+d,':','\\','*','.','*',0};
char root[7] = {static_cast<char>('A'+d),':','\\','*','.','*',0};
bool ret = DOS_FindFirst(root,DOS_ATTR_VOLUME);
if (ret) {
dta.GetResult(name,size,date,time,attr);

View file

@ -280,9 +280,9 @@ static void update_cga16_color(void) {
}
Bitu CGApal[4] = {
overscan,
2 + (color_sel||bw ? 1 : 0) + (background_i ? 8 : 0),
4 + (color_sel&&!bw? 1 : 0) + (background_i ? 8 : 0),
6 + (color_sel||bw ? 1 : 0) + (background_i ? 8 : 0)
static_cast<Bitu>(2 + (color_sel||bw ? 1 : 0) + (background_i ? 8 : 0)),
static_cast<Bitu>(4 + (color_sel&&!bw? 1 : 0) + (background_i ? 8 : 0)),
static_cast<Bitu>(6 + (color_sel||bw ? 1 : 0) + (background_i ? 8 : 0))
};
for (Bit8u x=0; x<4; x++) { // Position of pixel in question
bool even = (x & 1) == 0;
@ -381,6 +381,8 @@ static void write_cga_color_select(Bitu val) {
vga.tandy.border_color = val & 0xf;
vga.attr.overscan_color = 0;
break;
default: //Else unhandled values warning
break;
}
}