bin/diskimage: Fix format strings through B_PRI macros

This commit is contained in:
Alexander von Gluck IV
2015-07-19 09:19:11 -05:00
parent deb9fbcb85
commit f783542c1b
+15 -12
View File
@@ -57,7 +57,7 @@ list_file_disk_devices()
continue; continue;
// ID // ID
printf("%6ld ", device.ID()); printf("%6" B_PRId32 " ", device.ID());
// file path // file path
BPath path; BPath path;
@@ -104,11 +104,11 @@ register_file_disk_device(const char* fileName)
BPath path; BPath path;
if (roster.GetDeviceWithID(id, &device) == B_OK if (roster.GetDeviceWithID(id, &device) == B_OK
&& device.GetPath(&path) == B_OK) { && device.GetPath(&path) == B_OK) {
printf("Registered file as disk device \"%s\" with ID %ld.\n", printf("Registered file as disk device \"%s\" with ID %" B_PRId32 ".\n",
path.Path(), id); path.Path(), id);
} else { } else {
printf("Registered file as disk device with ID %ld, but failed to " printf("Registered file as disk device with ID %" B_PRId32 ", "
"get the device path.\n", id); "but failed to get the device path.\n", id);
} }
return B_OK; return B_OK;
@@ -128,15 +128,16 @@ unregister_file_disk_device(const char* fileNameOrID)
status_t error = roster.UnregisterFileDevice(id); status_t error = roster.UnregisterFileDevice(id);
if (error != B_OK) { if (error != B_OK) {
fprintf(stderr, "Error: Failed to unregister file disk device " fprintf(stderr, "Error: Failed to unregister file disk device "
"with ID %ld: %s\n", id, strerror(error)); "with ID %" B_PRId32 ": %s\n", id, strerror(error));
return error; return error;
} }
printf("Unregistered file disk device with ID %ld.\n", id); printf("Unregistered file disk device with ID %" B_PRId32 ".\n",
id);
return B_OK; return B_OK;
} else { } else {
fprintf(stderr, "No file disk device with ID %ld, trying file " fprintf(stderr, "No file disk device with ID %" B_PRId32 ","
"\"%s\"\n", id, fileNameOrID); "trying file \"%s\"\n", id, fileNameOrID);
} }
} }
@@ -172,13 +173,15 @@ unregister_file_disk_device(const char* fileNameOrID)
status_t error = roster.UnregisterFileDevice(device.ID()); status_t error = roster.UnregisterFileDevice(device.ID());
if (error != B_OK) { if (error != B_OK) {
fprintf(stderr, "Error: Failed to unregister file disk device" fprintf(stderr, "Error: Failed to unregister file disk device"
"%s \"%s\" (ID: %ld): %s\n", isFilePath ? " for file" : "", "%s \"%s\" (ID: %" B_PRId32 "): %s\n",
fileNameOrID, device.ID(), strerror(error)); isFilePath ? " for file" : "", fileNameOrID, device.ID(),
strerror(error));
return error; return error;
} }
printf("Unregistered file disk device%s \"%s\" (ID: %ld)\n", printf("Unregistered file disk device%s \"%s\" "
isFilePath ? " for file" : "", fileNameOrID, device.ID()); "(ID: %" B_PRId32 ")\n", isFilePath ? " for file" : "",
fileNameOrID, device.ID());
return B_OK; return B_OK;
} }