Skip to content

Commit

Permalink
Fix type usage to use inttypes everywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
promovicz committed Feb 7, 2019
1 parent 790602d commit 77771f0
Show file tree
Hide file tree
Showing 18 changed files with 195 additions and 197 deletions.
8 changes: 4 additions & 4 deletions src/AliM1543C.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,7 @@ void CAliM1543C::toy_write(u32 address, u8 data)
u8 CAliM1543C::pit_read(u32 address)
{

//printf("PIT Read: %02" LL "x \n",address);
//printf("PIT Read: %02" PRIx64 " \n",address);
u8 data;
data = 0;
return data;
Expand All @@ -786,7 +786,7 @@ u8 CAliM1543C::pit_read(u32 address)
void CAliM1543C::pit_write(u32 address, u8 data)
{

//printf("PIT Write: %02" LL "x, %02x \n",address,data);
//printf("PIT Write: %02" PRIx64 ", %02x \n",address,data);
if(address == 3)
{ // control
if(data != 0)
Expand Down Expand Up @@ -964,7 +964,7 @@ u8 CAliM1543C::pic_read(int index, u32 address)

#ifdef DEBUG_PIC
if(pic_messages)
printf("%%PIC-I-READ: read %02x from port %"LL "d on PIC %d\n", data,
printf("%%PIC-I-READ: read %02x from port %" PRId64 " on PIC %d\n", data,
address, index);
#endif
return data;
Expand Down Expand Up @@ -1029,7 +1029,7 @@ void CAliM1543C::pic_write(int index, u32 address, u8 data)
int op;
#ifdef DEBUG_PIC
if(pic_messages)
printf("%%PIC-I-WRITE: write %02x to port %"LL "d on PIC %d\n", data,
printf("%%PIC-I-WRITE: write %02x to port %" PRId64 " on PIC %d\n", data,
address, index);
#endif
switch(address)
Expand Down
4 changes: 2 additions & 2 deletions src/AliM1543C_ide.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1115,9 +1115,9 @@ void CAliM1543C_ide::ide_busmaster_write(int index, u32 address, u32 data,
CONTROLLER(index).busmaster[address] = data;
prd_address = endian_32(*(u32 *) (&CONTROLLER(index).busmaster[4]));
#ifdef DEBUG_IDE_BUSMASTER
printf("%%IDE-I-PRD: Virtual address: %"LL "x \n",
printf("%%IDE-I-PRD: Virtual address: %" PRIx64 " \n",
endian_32(*(u32 *) (&CONTROLLER(index).busmaster[4])));
printf("-IDE-I-PRD: Physical address: %"LL "x \n", prd_address);
printf("-IDE-I-PRD: Physical address: %" PRIx64 " \n", prd_address);
u32 base, control;
do
{
Expand Down
22 changes: 11 additions & 11 deletions src/AlphaCPU.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -556,10 +556,10 @@ void CAlphaCPU::check_state()
if(ce_new != ce)
{

// printf(" time %12" LL "d | prev %12" LL "d \n",time,prev_time);
// printf(" count lapse %12" LL "d | curr %12" LL "d | prev %12" LL "d \n",icount_lapse,icount,prev_icount);
// printf("cc %12" LL "d | aim %12" LL "d | diff %12" LL "d | prev %12" LL "d \n",cc,cc_aim,cc_diff,prev_cc);
// printf("ce %12" LL "d | aim %12" LL "d | diff %12" LL "d | new %12" LL "d \n",ce,ce_aim,ce_diff,ce_new);
// printf(" time %12" PRId64 " | prev %12" PRId64 " \n",time,prev_time);
// printf(" count lapse %12" PRId64 " | curr %12" PRId64 " | prev %12" PRId64 " \n",icount_lapse,icount,prev_icount);
// printf("cc %12" PRId64 " | aim %12" PRId64 " | diff %12" PRId64 " | prev %12" PRId64 " \n",cc,cc_aim,cc_diff,prev_cc);
// printf("ce %12" PRId64 " | aim %12" PRId64 " | diff %12" PRId64 " | new %12" PRId64 " \n",ce,ce_aim,ce_diff,ce_new);
// printf("========================================================================== \n");
cc_per_instruction = ce_new;
// printf("cpu %d speed factor: %d\n",get_cpuid(),ce_new);
Expand Down Expand Up @@ -1345,7 +1345,7 @@ void CAlphaCPU::listing(u64 from, u64 to)
**/
void CAlphaCPU::listing(u64 from, u64 to, u64 mark)
{
printf("%%CPU-I-LISTNG: Listing from %016"LL "x to %016"LL "x\n", from, to);
printf("%%CPU-I-LISTNG: Listing from %016" PRIx64 " to %016" PRIx64 "\n", from, to);

u64 iSavedPC;
bool bSavedDebug;
Expand Down Expand Up @@ -1562,7 +1562,7 @@ int CAlphaCPU::virt2phys(u64 virt, u64* phys, int flags, bool* asm_bit, u32 ins)
#if defined(IDB)
if(bTB_Debug)
#endif
printf("TB %"LL "x,%x: ", virt, flags);
printf("TB %" PRIx64 ",%x: ", virt, flags);
#endif

// try superpage first.
Expand Down Expand Up @@ -1867,7 +1867,7 @@ int CAlphaCPU::virt2phys(u64 virt, u64* phys, int flags, bool* asm_bit, u32 ins)
#if defined(IDB)
if(bTB_Debug)
#endif
printf("phys: %"LL "x - OK\n", *phys);
printf("phys: %" PRIx64 " - OK\n", *phys);
#endif
return 0;
}
Expand Down Expand Up @@ -1968,10 +1968,10 @@ void CAlphaCPU::add_tb(u64 virt, u64 pte_phys, u64 pte_flags, int flags)
#endif
{
printf("Add TB---------------------------------------\n");
printf("Map VIRT %016"LL "x\n", state.tb[i].virt);
printf("Matching %016"LL "x\n", state.tb[i].match_mask);
printf("And keeping %016"LL "x\n", state.tb[i].keep_mask);
printf("To PHYS %016"LL "x\n", state.tb[i].phys);
printf("Map VIRT %016" PRIx64 "\n", state.tb[i].virt);
printf("Matching %016" PRIx64 "\n", state.tb[i].match_mask);
printf("And keeping %016" PRIx64 "\n", state.tb[i].keep_mask);
printf("To PHYS %016" PRIx64 "\n", state.tb[i].phys);
printf("Read : %c%c%c%c %c\n", state.tb[i].access[0][0] ? 'K' : '-',
state.tb[i].access[0][1] ? 'E' : '-',
state.tb[i].access[0][2] ? 'S' : '-',
Expand Down
4 changes: 2 additions & 2 deletions src/AlphaCPU_vaxfloat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ u64 CAlphaCPU::vax_ldf(u32 op)
u64 res = (((u64) (op & F_SIGN)) ? FPR_SIGN : 0) | /* finite non-zero */
(((u64) exp) << FPR_V_EXP) | (((u64) SWAP_VAXF(op &~(F_SIGN | F_EXP))) << F_V_FRAC);

//printf("vax_ldf: %08x -> %016" LL "x.\n", op, res);
//printf("vax_ldf: %08x -> %016" PRIx64 ".\n", op, res);
return res;
}

Expand Down Expand Up @@ -145,7 +145,7 @@ u32 CAlphaCPU::vax_stf(u64 op)

u32 res = sign | exp | (SWAP_VAXF(frac) &~(F_SIGN | F_EXP));

//printf("vax_stf: %016" LL "x -> %08x.\n", op, res);
//printf("vax_stf: %016" PRIx64 " -> %08x.\n", op, res);
return res;
}

Expand Down
4 changes: 2 additions & 2 deletions src/AlphaSim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -391,14 +391,14 @@ int main (int argc, char*argv[])
}
fprintf
(
p_fp, "p_max = %10"LL "d; %10"LL "d profiled instructions.\n\n", p_max,
p_fp, "p_max = %10" PRId64 "; %10" PRId64 " profiled instructions.\n\n", p_max,
profiled_insts
);
for(p_i = PROFILE_FROM; p_i < PROFILE_TO; p_i += (4 * PROFILE_BUCKSIZE))
{
if(PROFILE_BUCKET(p_i))
{
fprintf(p_fp, "%016"LL "x: %10"LL "d ", p_i, PROFILE_BUCKET(p_i));
fprintf(p_fp, "%016" PRIx64 ": %10" PRId64 " ", p_i, PROFILE_BUCKET(p_i));
for(p_j = 0; p_j < (((float) PROFILE_BUCKET(p_i) / (float) p_max) * 100);
p_j++)
fprintf(p_fp, "*");
Expand Down
16 changes: 8 additions & 8 deletions src/Cirrus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ u32 CCirrus::mem_read(u32 address, int dsize)
{
u32 data = 0;

//printf("cirrus: mem read: %" LL "x, %d, %" LL "x \n", address, dsize, data);
//printf("cirrus: mem read: %" PRIx64 ", %d, %" PRIx64 " \n", address, dsize, data);
return data;
}

Expand All @@ -628,7 +628,7 @@ u32 CCirrus::mem_read(u32 address, int dsize)
void CCirrus::mem_write(u32 address, int dsize, u32 data)
{

//printf("cirrus: mem write: %" LL "x, %d, %" LL "x \n", address, dsize, data);
//printf("cirrus: mem write: %" PRIx64 ", %d, %" PRIx64 " \n", address, dsize, data);
switch(dsize)
{
case 8:
Expand Down Expand Up @@ -659,7 +659,7 @@ u32 CCirrus::legacy_read(u32 address, int dsize)
data |= (u64) vga_mem_read((u32) address + 0xA0000);
}

// //printf("cirrus: legacy read: %" LL "x, %d, %" LL "x \n", address, dsize, data);
// //printf("cirrus: legacy read: %" PRIx64 ", %d, %" PRIx64 " \n", address, dsize, data);
return data;
}

Expand All @@ -671,7 +671,7 @@ u32 CCirrus::legacy_read(u32 address, int dsize)
void CCirrus::legacy_write(u32 address, int dsize, u32 data)
{

// //printf("cirrus: legacy write: %" LL "x, %d, %" LL "x \n", address, dsize, data);
// //printf("cirrus: legacy write: %" PRIx64 ", %d, %" PRIx64 " \n", address, dsize, data);
switch(dsize)
{
case 32:
Expand Down Expand Up @@ -703,11 +703,11 @@ u32 CCirrus::rom_read(u32 address, int dsize)
case 32: data = (u32) endian_32((*((u32*) x)) & 0xffffffff); break;
}

//printf("cirrus: rom read: %" LL "x, %d, %" LL "x\n", address, dsize,data);
//printf("cirrus: rom read: %" PRIx64 ", %d, %" PRIx64 "\n", address, dsize,data);
}
else
{
printf("cirrus: (BAD) rom read: %"LL "x, %d, %"LL "x\n", address, dsize,
printf("cirrus: (BAD) rom read: %" PRIx64 ", %d, %" PRIx64 "\n", address, dsize,
data);
}

Expand Down Expand Up @@ -784,7 +784,7 @@ u32 CCirrus::io_read(u32 address, int dsize)
FAILURE_1(NotImplemented, "Unhandled port %x read", address);
}

//printf("cirrus: io read: %" LL "x, %d, %" LL "x \n", address+VGA_BASE, dsize, data);
//printf("cirrus: io read: %" PRIx64 ", %d, %" PRIx64 " \n", address+VGA_BASE, dsize, data);
return data;
}

Expand All @@ -796,7 +796,7 @@ u32 CCirrus::io_read(u32 address, int dsize)
void CCirrus::io_write(u32 address, int dsize, u32 data)
{

// printf("cirrus: io write: %" LL "x, %d, %" LL "x \n", address+VGA_BASE, dsize, data);
// printf("cirrus: io write: %" PRIx64 ", %d, %" PRIx64 " \n", address+VGA_BASE, dsize, data);
switch(dsize)
{
case 8:
Expand Down
4 changes: 2 additions & 2 deletions src/DMA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ u64 CDMA::ReadMem(int index, u64 address, int dsize)
u64 ret;
u8 data;
int num;
//printf("dma: Readmem %s, %" LL "x, %x\n",DMA_INDEX(index),address, dsize);
//printf("dma: Readmem %s, %" PRIx64 ", %x\n",DMA_INDEX(index),address, dsize);
switch(dsize)
{
case 32:
Expand Down Expand Up @@ -463,7 +463,7 @@ void CDMA::send_data(int channel, void *data)
u64 addr = (state.channel[channel].pagebase << 16) + state.channel[channel].base;
int count = get_count(channel);

printf("DMA send_data: %x @ %16" LL "x\n ", count, addr);
printf("DMA send_data: %x @ %16" PRIx64 "\n ", count, addr);
for(int i = 0; i < count; i++)
{
printf("%02x ", *((char *)data+i) & 0xff);
Expand Down
4 changes: 2 additions & 2 deletions src/DiskDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ CDiskDevice::CDiskDevice(CConfigurator* cfg, CSystem* sys, CDiskController* c

model_number = myCfg->get_text_value("model_number", filename);

printf("%s: Mounted device %s, %"LL "d %d-byte blocks, %"LL "d/%d/%d.\n",
printf("%s: Mounted device %s, %" PRId64 " %d-byte blocks, %" PRId64 "/%d/%d.\n",
devid_string, filename, byte_size / state.block_size, state.block_size,
cylinders, heads, sectors);
}
Expand Down Expand Up @@ -177,7 +177,7 @@ bool CDiskDevice::seek_byte(off_t_large byte)
size_t CDiskDevice::read_bytes(void* dest, size_t bytes)
{

// printf("%s: read %d bytes @ %" LL "d.\n",devid_string,bytes,state.byte_pos);
// printf("%s: read %d bytes @ %" PRId64 ".\n",devid_string,bytes,state.byte_pos);
#if defined(_WIN32)
off_t_large byte_from = (state.byte_pos / dev_block_size) * dev_block_size;
off_t_large byte_to =
Expand Down
2 changes: 1 addition & 1 deletion src/DiskFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ CDiskFile::CDiskFile(CConfigurator* cfg, CSystem* sys, CDiskController* c,
p++;
}

printf("%s: Mounted file %s, %"LL "d %d-byte blocks, %"LL "d/%d/%d.\n",
printf("%s: Mounted file %s, %" PRId64 " %d-byte blocks, %" PRId64 "/%d/%d.\n",
devid_string, filename, byte_size / state.block_size, state.block_size,
cylinders, heads, sectors);
}
Expand Down
2 changes: 1 addition & 1 deletion src/DiskRam.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ CDiskRam::CDiskRam(CConfigurator* cfg, CSystem* sys, CDiskController* c,

model_number = myCfg->get_text_value("model_number", "ES40RAMDISK");

printf("%s: Mounted RAMDISK, %"LL "d %d-byte blocks, %"LL "d/%d/%d.\n",
printf("%s: Mounted RAMDISK, %" PRId64 " %d-byte blocks, %" PRId64 "/%d/%d.\n",
devid_string, byte_size / state.block_size, state.block_size,
cylinders, heads, sectors);
}
Expand Down
8 changes: 4 additions & 4 deletions src/PCIDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ void CPCIDevice::register_bar(int func, int bar, u32 data, u32 mask)
t = U64(0x00000801fc000000) + (U64(0x0000000200000000) * myPCIBus) +
(data &~0x3), length);
#if defined(DEBUG_PCI)
printf("%s(%s).%d PCI BAR %d set to IO % "LL "x, len %x.\n",
printf("%s(%s).%d PCI BAR %d set to IO % " PRIx64 ", len %x.\n",
myCfg->get_myName(), myCfg->get_myValue(), func, bar, t, length);
#endif
}
Expand All @@ -262,7 +262,7 @@ void CPCIDevice::register_bar(int func, int bar, u32 data, u32 mask)
t = U64(0x0000080000000000) + (U64(0x0000000200000000) * myPCIBus) +
(data &~0xf), length);
#if defined(DEBUG_PCI)
printf("%s(%s).%d PCI BAR %d set to MEM % "LL "x, len %x.\n",
printf("%s(%s).%d PCI BAR %d set to MEM % " PRIx64 ", len %x.\n",
myCfg->get_myName(), myCfg->get_myValue(), func, bar, t, length);
#endif
}
Expand Down Expand Up @@ -314,7 +314,7 @@ u64 CPCIDevice::ReadMem(int index, u64 address, int dsize)
if(dsize != 8 && dsize != 16 && dsize != 32)
{
FAILURE_5(InvalidArgument,
"ReadMem: %s(%s) Unsupported dsize %d. (%d, %"LL "x)\n",
"ReadMem: %s(%s) Unsupported dsize %d. (%d, %" PRIx64 ")\n",
myCfg->get_myName(), myCfg->get_myValue(), dsize, index, address);
}

Expand Down Expand Up @@ -380,7 +380,7 @@ void CPCIDevice::WriteMem(int index, u64 address, int dsize, u64 data)
if(dsize != 8 && dsize != 16 && dsize != 32)
{
FAILURE_6(InvalidArgument,
"WriteMem: %s(%s) Unsupported dsize %d. (%d,%"LL "x,%"LL "x)\n",
"WriteMem: %s(%s) Unsupported dsize %d. (%d,%" PRIx64 ",%" PRIx64 ")\n",
myCfg->get_myName(), myCfg->get_myValue(), dsize, index, address,
data);
}
Expand Down
16 changes: 8 additions & 8 deletions src/S3Trio64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@ u32 CS3Trio64::mem_read(u32 address, int dsize)
{
u32 data = 0;

//printf("S3 mem read: %" LL "x, %d, %" LL "x \n", address, dsize, data);
//printf("S3 mem read: %" PRIx64 ", %d, %" PRIx64 " \n", address, dsize, data);
return data;
}

Expand All @@ -619,7 +619,7 @@ u32 CS3Trio64::mem_read(u32 address, int dsize)
void CS3Trio64::mem_write(u32 address, int dsize, u32 data)
{

//printf("S3 mem write: %" LL "x, %d, %" LL "x \n", address, dsize, data);
//printf("S3 mem write: %" PRIx64 ", %d, %" PRIx64 " \n", address, dsize, data);
switch(dsize)
{
case 8:
Expand Down Expand Up @@ -650,7 +650,7 @@ u32 CS3Trio64::legacy_read(u32 address, int dsize)
data |= (u64) vga_mem_read((u32) address + 0xA0000);
}

// //printf("S3 legacy read: %" LL "x, %d, %" LL "x \n", address, dsize, data);
// //printf("S3 legacy read: %" PRIx64 ", %d, %" PRIx64 " \n", address, dsize, data);
return data;
}

Expand All @@ -662,7 +662,7 @@ u32 CS3Trio64::legacy_read(u32 address, int dsize)
void CS3Trio64::legacy_write(u32 address, int dsize, u32 data)
{

// //printf("S3 legacy write: %" LL "x, %d, %" LL "x \n", address, dsize, data);
// //printf("S3 legacy write: %" PRIx64 ", %d, %" PRIx64 " \n", address, dsize, data);
switch(dsize)
{
case 32:
Expand Down Expand Up @@ -694,12 +694,12 @@ u32 CS3Trio64::rom_read(u32 address, int dsize)
case 32: data = (u32) endian_32((*((u32*) x)) & 0xffffffff); break;
}

//printf("S3 rom read: %" LL "x, %d, %" LL "x\n", address, dsize,data);
//printf("S3 rom read: %" PRIx64 ", %d, %" PRIx64 "\n", address, dsize,data);
}
else
{

//printf("S3 (BAD) rom read: %" LL "x, %d, %" LL "x\n", address, dsize,data);
//printf("S3 (BAD) rom read: %" PRIx64 ", %d, %" PRIx64 "\n", address, dsize,data);
}

return data;
Expand Down Expand Up @@ -775,7 +775,7 @@ u32 CS3Trio64::io_read(u32 address, int dsize)
FAILURE_1(NotImplemented, "Unhandled port %x read", address);
}

//printf("S3 io read: %" LL "x, %d, %" LL "x \n", address, dsize, data);
//printf("S3 io read: %" PRIx64 ", %d, %" PRIx64 " \n", address, dsize, data);
return data;
}

Expand All @@ -787,7 +787,7 @@ u32 CS3Trio64::io_read(u32 address, int dsize)
void CS3Trio64::io_write(u32 address, int dsize, u32 data)
{

// printf("S3 io write: %" LL "x, %d, %" LL "x \n", address+VGA_BASE, dsize, data);
// printf("S3 io write: %" PRIx64 ", %d, %" PRIx64 " \n", address+VGA_BASE, dsize, data);
switch(dsize)
{
case 8:
Expand Down
Loading

0 comments on commit 77771f0

Please sign in to comment.