Skip to content

Commit e7535ea

Browse files
committed
More compile fixes
1 parent 7699075 commit e7535ea

2 files changed

Lines changed: 16 additions & 13 deletions

File tree

devices/common/ata/atapicdrom.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -358,11 +358,12 @@ uint16_t AtapiCdrom::get_data() {
358358
area_end += 4; // Header
359359
if (this->current_block_byte >= area_start && this->current_block_byte < area_end) {
360360
AddrMsf msf = lba_to_msf(this->current_block + 150);
361-
uint8_t header[4]{};
362-
header[0] = msf.min;
363-
header[1] = msf.sec;
364-
header[2] = msf.frm;
365-
header[3] = 0x01; // Mode 1
361+
uint8_t header[4]{
362+
(uint8_t)msf.min,
363+
(uint8_t)msf.sec,
364+
(uint8_t)msf.frm,
365+
0x01 // Mode 1
366+
};
366367
ret_data = BYTESWAP_16(*((uint16_t*)(&header[current_block_byte - area_start])));
367368
}
368369
}

devices/common/pci/pcibridge.cpp

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@ PCIBridge::PCIBridge(std::string name) : PCIBridgeBase(name, PCI_HEADER_TYPE_1,
3939

4040
this->pci_wr_memory_base = [this](uint16_t val) {
4141
this->memory_base = (val & this->memory_cfg) | (this->memory_cfg & 15);
42-
this->memory_base_32 = ((this->memory_base & 0xfff0) << 16);
42+
this->memory_base_32 = (((uint64_t)this->memory_base & 0xfff0) << 16);
4343
};
4444

4545
this->pci_wr_memory_limit = [this](uint16_t val) {
4646
this->memory_limit = (val & this->memory_cfg) | (this->memory_cfg & 15);
47-
this->memory_limit_32 = ((this->memory_limit & 0xfff0) << 16) + 0x100000;
47+
this->memory_limit_32 = (((uint64_t)this->memory_limit & 0xfff0) << 16) + 0x100000;
4848
};
4949

5050
this->pci_wr_io_base = [this](uint8_t val) {
@@ -61,12 +61,13 @@ PCIBridge::PCIBridge(std::string name) : PCIBridgeBase(name, PCI_HEADER_TYPE_1,
6161
this->pci_wr_pref_mem_base = [this](uint16_t val) {
6262
this->pref_mem_base = (val & this->pref_mem_cfg) | (this->pref_mem_cfg & 15);
6363
this->pref_mem_base_64 = ((uint64_t)this->pref_base_upper32 << 32) |
64-
((this->pref_mem_base & 0xfff0) << 16);
64+
(((uint64_t)this->pref_mem_base & 0xfff0) << 16);
6565
};
6666
this->pci_wr_pref_mem_limit = [this](uint16_t val) {
6767
this->pref_mem_limit = (val & this->pref_mem_cfg) | (this->pref_mem_cfg & 15);
68-
this->pref_mem_limit_64 = (((uint64_t)this->pref_limit_upper32 << 32) |
69-
((this->pref_mem_limit & 0xfff0) << 16)) + 0x100000;
68+
this->pref_mem_limit_64 = (((uint64_t)this->pref_limit_upper32 << 32) | \
69+
(((uint64_t)this->pref_mem_limit & 0xfff0) << 16)) + \
70+
0x100000;
7071
};
7172
this->pci_wr_io_base_upper16 = [this](uint16_t val) {
7273
if ((this->io_base & 15) == 1)
@@ -85,14 +86,15 @@ PCIBridge::PCIBridge(std::string name) : PCIBridgeBase(name, PCI_HEADER_TYPE_1,
8586
if ((this->pref_mem_cfg & 15) == 1)
8687
this->pref_base_upper32 = val;
8788
this->pref_mem_base_64 = ((uint64_t)this->pref_base_upper32 << 32) |
88-
((this->pref_mem_base & 0xfff0) << 16);
89+
(((uint64_t)this->pref_mem_base & 0xfff0) << 16);
8990
};
9091

9192
this->pci_wr_pref_limit_upper32 = [this](uint32_t val) {
9293
if ((this->pref_mem_cfg & 15) == 1)
9394
this->pref_limit_upper32 = val;
94-
this->pref_mem_limit_64 = (((uint64_t)this->pref_limit_upper32 << 32) |
95-
((this->pref_mem_limit & 0xfff0) << 16)) + 0x100000;
95+
this->pref_mem_limit_64 = (((uint64_t)this->pref_limit_upper32 << 32) | \
96+
(((uint64_t)this->pref_mem_limit & 0xfff0) << 16)) + \
97+
0x100000;
9698
};
9799
}
98100

0 commit comments

Comments
 (0)