Skip to content

Commit c1a6bb3

Browse files
Merge pull request #6420 from cimarronm/int10-warnings-cleanup
Clean up compiler warnings in INT10 code
2 parents aeea5c4 + f5cb91a commit c1a6bb3

3 files changed

Lines changed: 16 additions & 22 deletions

File tree

src/ints/int10.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1155,7 +1155,7 @@ CX 640x480 800x600 1024x768/1280x1024
11551155
LOG(LOG_INT10,LOG_NORMAL)("AX CRT BIOS 82xxh is called.");
11561156
switch (reg_al) {
11571157
case 0x00:
1158-
if (reg_bl == -1) {//Read scroll mode
1158+
if (reg_bl == 0xff) {//Read scroll mode
11591159
reg_al = real_readb(BIOSMEM_AX_SEG, BIOSMEM_AX_JPNSTATUS) & 0x01;
11601160
}
11611161
else {//Set scroll mode

src/ints/int10_char.cpp

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -727,7 +727,6 @@ void WriteCharDOSVSbcs24(uint8_t col, uint8_t row, uint8_t chr, uint8_t attr)
727727
uint8_t *font;
728728
Bitu off;
729729
Bitu width = (real_readw(BIOSMEM_SEG, BIOSMEM_NB_COLS) == 85) ? 128 : 160;
730-
volatile uint8_t dummy;
731730

732731
font = GetSbcs24Font(chr);
733732

@@ -754,12 +753,12 @@ void WriteCharDOSVSbcs24(uint8_t col, uint8_t row, uint8_t chr, uint8_t attr)
754753
for(uint8_t x = 0 ; x < 2 ; x++) {
755754
IO_Write(0x3ce, 8); IO_Write(0x3cf, data[x]);
756755
IO_Write(0x3ce, 0); IO_Write(0x3cf, attr);
757-
dummy = real_readb(0xa000, off);
756+
(void)real_readb(0xa000, off);
758757
real_writeb(0xa000, off, 0xff);
759758

760759
IO_Write(0x3ce, 8); IO_Write(0x3cf, data[x] ^ mask_data[col & 1][x]);
761760
IO_Write(0x3ce, 0); IO_Write(0x3cf, back);
762-
dummy = real_readb(0xa000, off);
761+
(void)real_readb(0xa000, off);
763762
real_writeb(0xa000, off, 0xff);
764763

765764
off++;
@@ -779,7 +778,6 @@ void WriteCharDOSVDbcs24(uint16_t col, uint16_t row, uint16_t chr, uint8_t attr)
779778
uint8_t *font;
780779
Bitu off;
781780
Bitu width = (real_readw(BIOSMEM_SEG, BIOSMEM_NB_COLS) == 85) ? 128 : 160;
782-
volatile uint8_t dummy;
783781

784782
font = GetDbcs24Font(chr);
785783

@@ -810,12 +808,12 @@ void WriteCharDOSVDbcs24(uint16_t col, uint16_t row, uint16_t chr, uint8_t attr)
810808
if(mask_data[col & 1][x] != 0) {
811809
IO_Write(0x3ce, 8); IO_Write(0x3cf, data[x]);
812810
IO_Write(0x3ce, 0); IO_Write(0x3cf, attr);
813-
dummy = real_readb(0xa000, off);
811+
(void)real_readb(0xa000, off);
814812
real_writeb(0xa000, off, 0xff);
815813

816814
IO_Write(0x3ce, 8); IO_Write(0x3cf, data[x] ^ mask_data[col & 1][x]);
817815
IO_Write(0x3ce, 0); IO_Write(0x3cf, back);
818-
dummy = real_readb(0xa000, off);
816+
(void)real_readb(0xa000, off);
819817
real_writeb(0xa000, off, 0xff);
820818
}
821819
off++;
@@ -846,14 +844,13 @@ void WriteCharDOSVSbcs(uint16_t col, uint16_t row, uint8_t chr, uint8_t attr) {
846844
IO_Write(0x3ce, 0x00); IO_Write(0x3cf, attr & 0x0f);
847845
IO_Write(0x3ce, 0x03); IO_Write(0x3cf, 0x18);
848846

849-
volatile uint8_t dummy;
850847
Bitu width = real_readw(BIOSMEM_SEG, BIOSMEM_NB_COLS);
851848
uint8_t height = real_readb(BIOSMEM_SEG, BIOSMEM_CHAR_HEIGHT);
852849
font = height == 16 ? GetSbcsFont(chr) : GetSbcs19Font(chr);
853850
off = row * width * height + col;
854851
select = StartBankSelect(off);
855852
for(uint8_t h = 0 ; h < height ; h++) {
856-
dummy = real_readb(0xa000, off);
853+
(void)real_readb(0xa000, off);
857854
data = *font++;
858855
real_writeb(0xa000, off, data);
859856
off += width;
@@ -864,7 +861,6 @@ void WriteCharDOSVSbcs(uint16_t col, uint16_t row, uint8_t chr, uint8_t attr) {
864861
}
865862
attr &= 0x0f;
866863
}
867-
volatile uint8_t dummy;
868864
Bitu width = real_readw(BIOSMEM_SEG, BIOSMEM_NB_COLS);
869865
uint8_t height = real_readb(BIOSMEM_SEG, BIOSMEM_CHAR_HEIGHT);
870866
font = height == 16 ? GetSbcsFont(chr) : GetSbcs19Font(chr);
@@ -874,7 +870,7 @@ void WriteCharDOSVSbcs(uint16_t col, uint16_t row, uint8_t chr, uint8_t attr) {
874870
IO_Write(0x3ce, 0x08); IO_Write(0x3cf, 0xff);
875871
IO_Write(0x3ce, 0x05); IO_Write(0x3cf, 0x03);
876872
IO_Write(0x3ce, 0x00); IO_Write(0x3cf, attr >> 4);
877-
real_writeb(0xa000, off, 0xff); dummy = real_readb(0xa000, off);
873+
real_writeb(0xa000, off, 0xff); (void)real_readb(0xa000, off);
878874
IO_Write(0x3ce, 0x00); IO_Write(0x3cf, attr & 0x0f);
879875
for(uint8_t h = 0 ; h < height ; h++) {
880876
data = *font++;
@@ -886,7 +882,6 @@ void WriteCharDOSVSbcs(uint16_t col, uint16_t row, uint8_t chr, uint8_t attr) {
886882

887883
static void DrawCharDOSVDbcsHalf(Bitu off, uint8_t *font, uint8_t attr, Bitu width, uint8_t height, uint8_t select, bool xor_flag)
888884
{
889-
volatile uint8_t dummy;
890885
uint8_t data;
891886
IO_Write(0x3ce, 0x08); IO_Write(0x3cf, 0xff);
892887
if(xor_flag) {
@@ -896,12 +891,12 @@ static void DrawCharDOSVDbcsHalf(Bitu off, uint8_t *font, uint8_t attr, Bitu wid
896891
} else {
897892
IO_Write(0x3ce, 0x05); IO_Write(0x3cf, 0x03);
898893
IO_Write(0x3ce, 0x00); IO_Write(0x3cf, attr >> 4);
899-
real_writeb(0xa000, off, 0xff); dummy = real_readb(0xa000, off);
894+
real_writeb(0xa000, off, 0xff); (void)real_readb(0xa000, off);
900895
IO_Write(0x3ce, 0x00); IO_Write(0x3cf, attr & 0x0f);
901896
}
902897
for(uint8_t h = 0 ; h < height ; h++) {
903898
if(xor_flag) {
904-
dummy = real_readb(0xa000, off);
899+
(void)real_readb(0xa000, off);
905900
}
906901
if(height == 19 && (h == 0 || h > 16)) {
907902
data = 0;
@@ -920,13 +915,12 @@ static void DrawCharDOSVDbcsHalf(Bitu off, uint8_t *font, uint8_t attr, Bitu wid
920915

921916
static inline void DrawCharDOSVDbcs(Bitu off, uint16_t *font, uint8_t attr, Bitu width, uint8_t height, uint8_t select)
922917
{
923-
volatile uint16_t dummy;
924918
uint16_t data;
925919

926920
IO_Write(0x3ce, 0x08); IO_Write(0x3cf, 0xff);
927921
IO_Write(0x3ce, 0x05); IO_Write(0x3cf, 0x03);
928922
IO_Write(0x3ce, 0x00); IO_Write(0x3cf, attr >> 4);
929-
real_writew(0xa000, off, 0xffff); dummy = real_readw(0xa000, off);
923+
real_writew(0xa000, off, 0xffff); (void)real_readw(0xa000, off);
930924
IO_Write(0x3ce, 0x00); IO_Write(0x3cf, attr & 0x0f);
931925

932926
for(uint8_t h = 0 ; h < height ; h++) {
@@ -1900,7 +1894,6 @@ void INT10_TeletypeOutput(uint8_t chr,uint8_t attr) {
19001894
static void DrawExtendAttribute(uint16_t col, uint16_t row, uint8_t attr, uint8_t ex_attr)
19011895
{
19021896
Bitu off, off_start;
1903-
volatile uint8_t dummy;
19041897
Bitu width = real_readw(BIOSMEM_SEG, BIOSMEM_NB_COLS);
19051898
uint8_t height = real_readb(BIOSMEM_SEG, BIOSMEM_CHAR_HEIGHT);
19061899
uint8_t no, select;
@@ -1919,12 +1912,12 @@ static void DrawExtendAttribute(uint16_t col, uint16_t row, uint8_t attr, uint8_
19191912
select = StartBankSelect(off);
19201913
if(height == 24) {
19211914
IO_Write(0x3ce, 0x08); IO_Write(0x3cf, mask_data[col & 1][0]);
1922-
dummy = real_readb(0xa000, off);
1915+
(void)real_readb(0xa000, off);
19231916
real_writeb(0xa000, off, 0x07);
19241917
off++;
19251918
select = CheckBankSelect(select, off);
19261919
IO_Write(0x3ce, 0x08); IO_Write(0x3cf, mask_data[col & 1][1]);
1927-
dummy = real_readb(0xa000, off);
1920+
(void)real_readb(0xa000, off);
19281921
real_writeb(0xa000, off, 0x07);
19291922
} else {
19301923
IO_Write(0x3ce, 0x08); IO_Write(0x3cf, 0xff);
@@ -1941,7 +1934,7 @@ static void DrawExtendAttribute(uint16_t col, uint16_t row, uint8_t attr, uint8_
19411934
IO_Write(0x3cf, 0x08);
19421935
}
19431936
for(no = 0 ; no < height ; no++) {
1944-
dummy = real_readb(0xa000, off);
1937+
(void)real_readb(0xa000, off);
19451938
real_writeb(0xa000, off, 0x07);
19461939
off += width;
19471940
select = CheckBankSelect(select, off);
@@ -1952,12 +1945,12 @@ static void DrawExtendAttribute(uint16_t col, uint16_t row, uint8_t attr, uint8_
19521945
select = StartBankSelect(off);
19531946
if(height == 24) {
19541947
IO_Write(0x3ce, 0x08); IO_Write(0x3cf, mask_data[col & 1][0]);
1955-
dummy = real_readb(0xa000, off);
1948+
(void)real_readb(0xa000, off);
19561949
real_writeb(0xa000, off, attr & 0x0f);
19571950
off++;
19581951
select = CheckBankSelect(select, off);
19591952
IO_Write(0x3ce, 0x08); IO_Write(0x3cf, mask_data[col & 1][1]);
1960-
dummy = real_readb(0xa000, off);
1953+
(void)real_readb(0xa000, off);
19611954
real_writeb(0xa000, off, attr & 0x0f);
19621955
} else {
19631956
IO_Write(0x3ce, 0x08); IO_Write(0x3cf, 0xff);

src/ints/int10_modes.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2717,6 +2717,7 @@ void AdjustIMEFontSize()
27172717
#elif defined(WIN32) && !defined(HX_DOS) && defined(C_SDL2)
27182718
IME_SetFontSize(cheight);
27192719
#endif
2720+
(void)cheight;
27202721
}
27212722

27222723
bool INT10_SetDOSVModeVtext(uint16_t mode, enum DOSV_VTEXT_MODE vtext_mode)

0 commit comments

Comments
 (0)