Make dprintfs 64-bit clean

This commit is contained in:
Tau 2018-12-17 17:34:15 -05:00
parent 755be05603
commit ee011a74d4
9 changed files with 43 additions and 27 deletions

View File

@ -41,7 +41,7 @@ static HRESULT sg_req_validate(const void *ptr, size_t nbytes)
if (req->hdr.frame_len != nbytes) { if (req->hdr.frame_len != nbytes) {
dprintf("SG Cmd: Frame length mismatch: got %i exp %i\n", dprintf("SG Cmd: Frame length mismatch: got %i exp %i\n",
req->hdr.frame_len, req->hdr.frame_len,
nbytes); (int) nbytes);
return E_FAIL; return E_FAIL;
} }
@ -51,7 +51,7 @@ static HRESULT sg_req_validate(const void *ptr, size_t nbytes)
if (req->payload_len != payload_len) { if (req->payload_len != payload_len) {
dprintf("SG Cmd: Payload length mismatch: got %i exp %i\n", dprintf("SG Cmd: Payload length mismatch: got %i exp %i\n",
req->payload_len, req->payload_len,
payload_len); (int) payload_len);
return E_FAIL; return E_FAIL;
} }

View File

@ -145,7 +145,7 @@ static HRESULT com12_mifare_poll(void *ctx, uint32_t *uid)
r = fscanf(f, "%02x ", &byte); r = fscanf(f, "%02x ", &byte);
if (r != 1) { if (r != 1) {
dprintf("Aime reader: fscanf[%i] failed: %i\n", i, r); dprintf("Aime reader: fscanf[%i] failed: %i\n", (int) i, r);
goto end; goto end;
} }

View File

@ -159,10 +159,10 @@ static HRESULT ds_handle_ioctl(struct irp *irp)
return ds_ioctl_read_sector(irp); return ds_ioctl_read_sector(irp);
default: default:
dprintf("DS: Unknown ioctl %x, write %i read %i\n", dprintf("DS: Unknown ioctl %08x, write %i read %i\n",
irp->ioctl, irp->ioctl,
irp->write.nbytes, (int) irp->write.nbytes,
irp->read.nbytes); (int) irp->read.nbytes);
return HRESULT_FROM_WIN32(ERROR_INVALID_FUNCTION); return HRESULT_FROM_WIN32(ERROR_INVALID_FUNCTION);
} }

View File

@ -100,8 +100,8 @@ static HRESULT eeprom_handle_ioctl(struct irp *irp)
default: default:
dprintf("EEPROM: Unknown ioctl %x, write %i read %i\n", dprintf("EEPROM: Unknown ioctl %x, write %i read %i\n",
irp->ioctl, irp->ioctl,
irp->write.nbytes, (int) irp->write.nbytes,
irp->read.nbytes); (int) irp->read.nbytes);
return HRESULT_FROM_WIN32(ERROR_INVALID_FUNCTION); return HRESULT_FROM_WIN32(ERROR_INVALID_FUNCTION);
} }
@ -143,7 +143,7 @@ static HRESULT eeprom_handle_read(struct irp *irp)
dprintf("EEPROM: Read off %x len %x\n", dprintf("EEPROM: Read off %x len %x\n",
(int) irp->ovl->Offset, (int) irp->ovl->Offset,
irp->read.nbytes); (int) irp->read.nbytes);
return iohook_invoke_next(irp); return iohook_invoke_next(irp);
} }
@ -158,7 +158,7 @@ static HRESULT eeprom_handle_write(struct irp *irp)
dprintf("EEPROM: Write off %x len %x\n", dprintf("EEPROM: Write off %x len %x\n",
(int) irp->ovl->Offset, (int) irp->ovl->Offset,
irp->write.nbytes); (int) irp->write.nbytes);
return iohook_invoke_next(irp); return iohook_invoke_next(irp);
} }

View File

@ -131,10 +131,10 @@ static HRESULT gpio_handle_ioctl(struct irp *irp)
return gpio_ioctl_describe(irp); return gpio_ioctl_describe(irp);
default: default:
dprintf("GPIO: IOCTL %08x write %i read %i\n", dprintf("GPIO: Unknown ioctl %08x, write %i read %i\n",
irp->ioctl, irp->ioctl,
irp->write.nbytes, (int) irp->write.nbytes,
irp->read.nbytes); (int) irp->read.nbytes);
return HRESULT_FROM_WIN32(ERROR_INVALID_FUNCTION); return HRESULT_FROM_WIN32(ERROR_INVALID_FUNCTION);
} }

View File

@ -70,10 +70,10 @@ static HRESULT hwmon_handle_ioctl(struct irp *irp)
return hwmon_ioctl_read_cpu_temp(irp); return hwmon_ioctl_read_cpu_temp(irp);
default: default:
dprintf("Hwmon: Unknown ioctl %08x write %i read %i\n", dprintf("Hwmon: Unknown ioctl %08x, write %i read %i\n",
irp->ioctl, irp->ioctl,
irp->write.nbytes, (int) irp->write.nbytes,
irp->read.nbytes); (int) irp->read.nbytes);
return HRESULT_FROM_WIN32(ERROR_INVALID_FUNCTION); return HRESULT_FROM_WIN32(ERROR_INVALID_FUNCTION);
} }

View File

@ -151,10 +151,10 @@ static HRESULT nusec_handle_ioctl(struct irp *irp)
return nusec_ioctl_put_trace_log_data(irp); return nusec_ioctl_put_trace_log_data(irp);
default: default:
dprintf("Security: Unhandled ioctl %#08x: read %i write %i\n", dprintf("Security: Unknown ioctl %#08x, write %i read %i\n",
irp->ioctl, irp->ioctl,
irp->read.nbytes, (int) irp->write.nbytes,
irp->write.nbytes); (int) irp->read.nbytes);
return HRESULT_FROM_WIN32(ERROR_INVALID_FUNCTION); return HRESULT_FROM_WIN32(ERROR_INVALID_FUNCTION);
} }
@ -241,9 +241,17 @@ static HRESULT nusec_ioctl_get_billing_ca_cert(struct irp *irp)
irp->op = IRP_OP_READ; irp->op = IRP_OP_READ;
irp->fd = fd; irp->fd = fd;
dprintf(">>> %p:%i/%i\n", irp->read.bytes, irp->read.pos, irp->read.nbytes); dprintf(">>> %p:%i/%i\n",
irp->read.bytes,
(int) irp->read.pos,
(int) irp->read.nbytes);
hr = iohook_invoke_next(irp); hr = iohook_invoke_next(irp);
dprintf("<<< %p:%i/%i\n", irp->read.bytes, irp->read.pos, irp->read.nbytes);
dprintf("<<< %p:%i/%i\n",
irp->read.bytes,
(int) irp->read.pos,
(int) irp->read.nbytes);
if (FAILED(hr)) { if (FAILED(hr)) {
dprintf("ReadFile transformation failed: %x\n", (int) hr); dprintf("ReadFile transformation failed: %x\n", (int) hr);
@ -280,9 +288,17 @@ static HRESULT nusec_ioctl_get_billing_pubkey(struct irp *irp)
irp->op = IRP_OP_READ; irp->op = IRP_OP_READ;
irp->fd = fd; irp->fd = fd;
dprintf(">>> %p:%i/%i\n", irp->read.bytes, irp->read.pos, irp->read.nbytes); dprintf(">>> %p:%i/%i\n",
irp->read.bytes,
(int) irp->read.pos,
(int) irp->read.nbytes);
hr = iohook_invoke_next(irp); hr = iohook_invoke_next(irp);
dprintf("<<< %p:%i/%i\n", irp->read.bytes, irp->read.pos, irp->read.nbytes);
dprintf("<<< %p:%i/%i\n",
irp->read.bytes,
(int) irp->read.pos,
(int) irp->read.nbytes);
if (FAILED(hr)) { if (FAILED(hr)) {
dprintf("ReadFile transformation failed: %x\n", (int) hr); dprintf("ReadFile transformation failed: %x\n", (int) hr);
@ -362,7 +378,7 @@ static HRESULT nusec_ioctl_get_trace_log_data(struct irp *irp)
return hr; return hr;
} }
dprintf(" Params: %i %i Buf: %i\n", pos, count, irp->read.nbytes); dprintf(" Params: %i %i Buf: %i\n", pos, count, (int) irp->read.nbytes);
avail = irp->read.nbytes - irp->read.pos; avail = irp->read.nbytes - irp->read.pos;

View File

@ -96,8 +96,8 @@ static HRESULT sram_handle_ioctl(struct irp *irp)
default: default:
dprintf("SRAM: Unknown ioctl %x, write %i read %i\n", dprintf("SRAM: Unknown ioctl %x, write %i read %i\n",
irp->ioctl, irp->ioctl,
irp->write.nbytes, (int) irp->write.nbytes,
irp->read.nbytes); (int) irp->read.nbytes);
return HRESULT_FROM_WIN32(ERROR_INVALID_FUNCTION); return HRESULT_FROM_WIN32(ERROR_INVALID_FUNCTION);
} }

View File

@ -24,7 +24,7 @@ void dump(const void *ptr, size_t nbytes)
bytes = ptr; bytes = ptr;
for (i = 0 ; i < nbytes ; i += 16) { for (i = 0 ; i < nbytes ; i += 16) {
dprintf(" %08x:", i); dprintf(" %08x:", (int) i);
for (j = 0 ; i + j < nbytes && j < 16 ; j++) { for (j = 0 ; i + j < nbytes && j < 16 ; j++) {
dprintf(" %02x", bytes[i + j]); dprintf(" %02x", bytes[i + j]);