From a58ea94498abc5ed1321bd2542ac31b3607dc21e Mon Sep 17 00:00:00 2001 From: Chih-Hung Hsieh Date: Fri, 15 Dec 2017 10:23:13 -0800 Subject: [PATCH] Fix format string warnings MockCasPlugin.cpp: These are printing out `size_t`s, so we should be using %zu. ClearKeyFetcher.cpp: asset_.id() is an `unsigned long long`, so we can't use PRIu64 for it. Bug: None Test: mma. Warnings are gone. Merged-In: Ie34acb274696dea999f6309fb914b39ef00f4d77 (cherry picked from commit 843328ff13456dbdfca72e3825222bcc65f4fac3) Change-Id: I7be4fff7d3fd603b7ab64397a6a05c28f7a34ace --- drm/mediacas/plugins/clearkey/ClearKeyFetcher.cpp | 2 +- drm/mediacas/plugins/mock/MockCasPlugin.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drm/mediacas/plugins/clearkey/ClearKeyFetcher.cpp b/drm/mediacas/plugins/clearkey/ClearKeyFetcher.cpp index cb69f911ff..eaa3390d0b 100644 --- a/drm/mediacas/plugins/clearkey/ClearKeyFetcher.cpp +++ b/drm/mediacas/plugins/clearkey/ClearKeyFetcher.cpp @@ -89,7 +89,7 @@ status_t ClearKeyFetcher::ObtainKey(const sp& buffer, // asset_id change. If it sends an EcmContainer with 2 Ecms with different // asset_ids (old and new) then it might be best to prefetch the Emm. if ((asset_.id() != 0) && (*asset_id != asset_.id())) { - ALOGW("Asset_id change from %" PRIu64 " to %" PRIu64, asset_.id(), *asset_id); + ALOGW("Asset_id change from %llu to %" PRIu64, asset_.id(), *asset_id); asset_.Clear(); } diff --git a/drm/mediacas/plugins/mock/MockCasPlugin.cpp b/drm/mediacas/plugins/mock/MockCasPlugin.cpp index 18cd9a4cda..500208b708 100644 --- a/drm/mediacas/plugins/mock/MockCasPlugin.cpp +++ b/drm/mediacas/plugins/mock/MockCasPlugin.cpp @@ -146,7 +146,7 @@ status_t MockCasPlugin::processEcm( if (session == NULL) { return BAD_VALUE; } - ALOGV("ECM: size=%d", ecm.size()); + ALOGV("ECM: size=%zu", ecm.size()); ALOGV("ECM: data=%s", arrayToString(ecm).string()); return OK; @@ -156,7 +156,7 @@ status_t MockCasPlugin::processEmm(const CasEmm& emm) { ALOGV("processEmm"); Mutex::Autolock lock(mLock); - ALOGV("EMM: size=%d", emm.size()); + ALOGV("EMM: size=%zu", emm.size()); ALOGV("EMM: data=%s", arrayToString(emm).string()); return OK;