Skip to content

Commit dfb6fdd

Browse files
author
rheno
committed
error: implicit conversion loses precision when running make (Apple clang version 13.0.0)
Signed-off-by: rheno <rhenobudiasa@yahoo.com>
1 parent adc4ea8 commit dfb6fdd

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/lib/pci_ahci.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,8 @@ static inline void lba_to_msf(uint8_t *buf, int lba)
214214
{
215215
lba += 150;
216216
buf[0] = (uint8_t) ((lba / 75) / 60);
217-
buf[1] = (lba / 75) % 60;
218-
buf[2] = lba % 75;
217+
buf[1] = (uint8_t) ((lba / 75) % 60);
218+
buf[2] = (uint8_t) (lba % 75);
219219
}
220220

221221
/*

src/lib/vmm/io/vatpit.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ pit_update_counter(struct vatpit *vatpit, struct channel *c, bool latch)
200200

201201
delta_ticks = (sbinuptime() - c->now_sbt) / vatpit->freq_sbt;
202202

203-
lval = c->initial - delta_ticks % c->initial;
203+
lval = (uint16_t) (c->initial - delta_ticks % c->initial);
204204

205205
if (latch) {
206206
c->olbyte = 2;

src/lib/vmm/vmm_instruction_emul.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1376,7 +1376,7 @@ emulate_bittest(void *vm, int vcpuid, uint64_t gpa, struct vie *vie,
13761376
* "Range of Bit Positions Specified by Bit Offset Operands"
13771377
*/
13781378
bitmask = vie->opsize * 8 - 1;
1379-
bitoff = vie->immediate & bitmask;
1379+
bitoff = (int) (vie->immediate & bitmask);
13801380

13811381
/* Copy the bit into the Carry flag in %rflags */
13821382
if (val & (1UL << bitoff))

0 commit comments

Comments
 (0)