From patchwork Sun Sep 23 19:03:49 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [06/18] acpi: s3power: print format using inttypes Date: Sun, 23 Sep 2012 09:03:49 -0000 From: Colin King X-Patchwork-Id: 186257 Message-Id: <1348427041-4913-7-git-send-email-colin.king@canonical.com> To: fwts-devel@lists.ubuntu.com, colin.king@canonical.com From: Colin Ian King Signed-off-by: Colin Ian King Acked-by: Keng-Yu Lin Acked-by: Ivan Hu --- src/acpi/s3power/s3power.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/acpi/s3power/s3power.c b/src/acpi/s3power/s3power.c index e5c4ba0..a57bcba 100644 --- a/src/acpi/s3power/s3power.c +++ b/src/acpi/s3power/s3power.c @@ -28,6 +28,7 @@ #include #include #include +#include #define PM_SUSPEND "pm-suspend" @@ -122,7 +123,7 @@ static void s3power_difference(fwts_framework *fw, float hourly_loss; if (before != 0) { - fwts_log_info(fw, "Change in capacity: %d %s\n", (int)diff, units); + fwts_log_info(fw, "Change in capacity: %" PRId32 " %s\n", diff, units); hourly_loss = ((float)diff * 3600.0) / (float)s3power_sleep_delay; if (diff < 0) { fwts_log_error(fw, "Negative loss of power, are you sure the machine was not charging?"); @@ -130,7 +131,7 @@ static void s3power_difference(fwts_framework *fw, fwts_log_info(fw, "Loss of %7.4f %s per hour.", hourly_loss, units); if ((diff > 0) && (battery_capacity > 0)) { float duration = (float)battery_capacity / hourly_loss; - fwts_log_info(fw, "The %d %s battery will provide %5.2f hours of suspend time.", + fwts_log_info(fw, "The %" PRIu32 " %s battery will provide %5.2f hours of suspend time.", battery_capacity, units, duration); if (duration < 24.0) {