From 7e5b39b67273ea3a49be51d0af33369f7f1284e4 Mon Sep 17 00:00:00 2001 From: Alex Smith Date: Sat, 18 Aug 2012 10:27:52 +0100 Subject: [PATCH] Fix printf format warnings that were missed earlier (CIDs 715645-715657). --- .../kernel/drivers/input/usb_hid/HIDCollection.cpp | 6 +++--- .../kernel/drivers/input/usb_hid/HIDDevice.cpp | 3 ++- .../kernel/drivers/input/usb_hid/HIDReport.cpp | 8 ++++---- .../kernel/drivers/input/usb_hid/HIDReportItem.cpp | 12 ++++++------ .../input/usb_hid/KeyboardProtocolHandler.cpp | 2 +- 5 files changed, 16 insertions(+), 15 deletions(-) diff --git a/src/add-ons/kernel/drivers/input/usb_hid/HIDCollection.cpp b/src/add-ons/kernel/drivers/input/usb_hid/HIDCollection.cpp index 3935e244fd..bfa424de46 100644 --- a/src/add-ons/kernel/drivers/input/usb_hid/HIDCollection.cpp +++ b/src/add-ons/kernel/drivers/input/usb_hid/HIDCollection.cpp @@ -214,18 +214,18 @@ HIDCollection::PrintToStream(uint32 indentLevel) TRACE_ALWAYS("%sHIDCollection %p\n", indent, this); TRACE_ALWAYS("%s\ttype: %u %s\n", indent, fType, typeName); - TRACE_ALWAYS("%s\tusage: 0x%08lx\n", indent, fUsage); + TRACE_ALWAYS("%s\tusage: 0x%08" B_PRIx32 "\n", indent, fUsage); TRACE_ALWAYS("%s\tstring id: %u\n", indent, fStringID); TRACE_ALWAYS("%s\tphysical id: %u\n", indent, fPhysicalID); - TRACE_ALWAYS("%s\titem count: %lu\n", indent, fItemCount); + TRACE_ALWAYS("%s\titem count: %" B_PRIu32 "\n", indent, fItemCount); for (uint32 i = 0; i < fItemCount; i++) { HIDReportItem *item = fItems[i]; if (item != NULL) item->PrintToStream(indentLevel + 1); } - TRACE_ALWAYS("%s\tchild count: %lu\n", indent, fChildCount); + TRACE_ALWAYS("%s\tchild count: %" B_PRIu32 "\n", indent, fChildCount); for (uint32 i = 0; i < fChildCount; i++) { HIDCollection *child = fChildren[i]; if (child != NULL) diff --git a/src/add-ons/kernel/drivers/input/usb_hid/HIDDevice.cpp b/src/add-ons/kernel/drivers/input/usb_hid/HIDDevice.cpp index aeacd6e43f..c1e15e1e3b 100644 --- a/src/add-ons/kernel/drivers/input/usb_hid/HIDDevice.cpp +++ b/src/add-ons/kernel/drivers/input/usb_hid/HIDDevice.cpp @@ -273,7 +273,8 @@ HIDDevice::MaybeScheduleTransfer() status_t result = gUSBModule->queue_interrupt(fInterruptPipe, fTransferBuffer, fTransferBufferSize, _TransferCallback, this); if (result != B_OK) { - TRACE_ALWAYS("failed to schedule interrupt transfer 0x%08lx\n", result); + TRACE_ALWAYS("failed to schedule interrupt transfer 0x%08" B_PRIx32 "\n", + result); return result; } diff --git a/src/add-ons/kernel/drivers/input/usb_hid/HIDReport.cpp b/src/add-ons/kernel/drivers/input/usb_hid/HIDReport.cpp index e38ebd8dd4..fe735b7d88 100644 --- a/src/add-ons/kernel/drivers/input/usb_hid/HIDReport.cpp +++ b/src/add-ons/kernel/drivers/input/usb_hid/HIDReport.cpp @@ -157,7 +157,7 @@ HIDReport::SetReport(status_t status, uint8 *report, size_t length) fReportStatus = status; fCurrentReport = report; if (status == B_OK && length * 8 < fReportSize) { - TRACE_ALWAYS("report of %lu bits too small, expected %lu bits\n", + TRACE_ALWAYS("report of %lu bits too small, expected %" B_PRIu32 " bits\n", length * 8, fReportSize); fReportStatus = B_ERROR; } @@ -276,10 +276,10 @@ HIDReport::PrintToStream() TRACE_ALWAYS("\ttype: %u %s\n", fType, typeName); TRACE_ALWAYS("\treport id: %u\n", fReportID); - TRACE_ALWAYS("\treport size: %lu bits = %lu bytes\n", fReportSize, - (fReportSize + 7) / 8); + TRACE_ALWAYS("\treport size: %" B_PRIu32 " bits = %" B_PRIu32 " bytes\n", + fReportSize, (fReportSize + 7) / 8); - TRACE_ALWAYS("\titem count: %lu\n", fItemsUsed); + TRACE_ALWAYS("\titem count: %" B_PRIu32 "\n", fItemsUsed); for (uint32 i = 0; i < fItemsUsed; i++) { HIDReportItem *item = fItems[i]; if (item != NULL) diff --git a/src/add-ons/kernel/drivers/input/usb_hid/HIDReportItem.cpp b/src/add-ons/kernel/drivers/input/usb_hid/HIDReportItem.cpp index d83d267bde..76faca711d 100644 --- a/src/add-ons/kernel/drivers/input/usb_hid/HIDReportItem.cpp +++ b/src/add-ons/kernel/drivers/input/usb_hid/HIDReportItem.cpp @@ -180,14 +180,14 @@ HIDReportItem::PrintToStream(uint32 indentLevel) indent[indentLevel] = 0; TRACE_ALWAYS("%sHIDReportItem %p\n", indent, this); - TRACE_ALWAYS("%s\tbyte offset: %lu\n", indent, fByteOffset); + TRACE_ALWAYS("%s\tbyte offset: %" B_PRIu32 "\n", indent, fByteOffset); TRACE_ALWAYS("%s\tshift: %u\n", indent, fShift); - TRACE_ALWAYS("%s\tmask: 0x%08lx\n", indent, fMask); + TRACE_ALWAYS("%s\tmask: 0x%08" B_PRIx32 "\n", indent, fMask); TRACE_ALWAYS("%s\thas data: %s\n", indent, fHasData ? "yes" : "no"); TRACE_ALWAYS("%s\tarray: %s\n", indent, fArray ? "yes" : "no"); TRACE_ALWAYS("%s\trelative: %s\n", indent, fRelative ? "yes" : "no"); - TRACE_ALWAYS("%s\tminimum: %lu\n", indent, fMinimum); - TRACE_ALWAYS("%s\tmaximum: %lu\n", indent, fMaximum); - TRACE_ALWAYS("%s\tusage minimum: 0x%08lx\n", indent, fUsageMinimum); - TRACE_ALWAYS("%s\tusage maximum: 0x%08lx\n", indent, fUsageMaximum); + TRACE_ALWAYS("%s\tminimum: %" B_PRIu32 "\n", indent, fMinimum); + TRACE_ALWAYS("%s\tmaximum: %" B_PRIu32 "\n", indent, fMaximum); + TRACE_ALWAYS("%s\tusage minimum: 0x%08" B_PRIx32 "\n", indent, fUsageMinimum); + TRACE_ALWAYS("%s\tusage maximum: 0x%08" B_PRIx32 "\n", indent, fUsageMaximum); } diff --git a/src/add-ons/kernel/drivers/input/usb_hid/KeyboardProtocolHandler.cpp b/src/add-ons/kernel/drivers/input/usb_hid/KeyboardProtocolHandler.cpp index 824031ce3f..083c5fe431 100644 --- a/src/add-ons/kernel/drivers/input/usb_hid/KeyboardProtocolHandler.cpp +++ b/src/add-ons/kernel/drivers/input/usb_hid/KeyboardProtocolHandler.cpp @@ -425,7 +425,7 @@ KeyboardProtocolHandler::Control(uint32 *cookie, uint32 op, void *buffer, return B_OK; } - TRACE_ALWAYS("keyboard device unhandled control 0x%08lx\n", op); + TRACE_ALWAYS("keyboard device unhandled control 0x%08" B_PRIx32 "\n", op); return B_ERROR; }