diff options
author | George Burgess IV <gbiv@google.com> | 2017-09-06 00:39:42 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-09-06 00:39:42 +0000 |
commit | 2704929e0021651e0a54c629b36ca4ae6cc0e381 (patch) | |
tree | d1e42d241977f5ffc731ab153c752cc97c2b2449 | |
parent | 99e8b227cd00678ce863c04ebde0b8d9a6f7df5c (diff) | |
parent | dabf66d32d1b1492e668f595a84b5221ac67e687 (diff) | |
download | akm-2704929e0021651e0a54c629b36ca4ae6cc0e381.tar.gz |
Merge "Fix printf warnings"
am: dabf66d32d
Change-Id: I59bd180e643e13d08a27e808228446f68cd44c83
-rw-r--r-- | AK8975_FS/akmdfs/AKFS_Measure.c | 6 | ||||
-rw-r--r-- | AK8975_FS/libsensors/AkmSensor.cpp | 9 |
2 files changed, 10 insertions, 5 deletions
diff --git a/AK8975_FS/akmdfs/AKFS_Measure.c b/AK8975_FS/akmdfs/AKFS_Measure.c index 849c921..efb73f4 100644 --- a/AK8975_FS/akmdfs/AKFS_Measure.c +++ b/AK8975_FS/akmdfs/AKFS_Measure.c @@ -16,6 +16,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + +#include <inttypes.h> + #ifdef WIN32 #include "AK8975_LinuxDriver.h" #else @@ -207,7 +210,8 @@ int16 AKFS_GetInterval( AKMERROR; return AKM_FAIL; } - AKMDATA(AKMDATA_GETINTERVAL,"delay[A,M,O]=%lld,%lld,%lld\n", + AKMDATA(AKMDATA_GETINTERVAL, + "delay[A,M,O]=%" PRIi64 ",%" PRIi64 ",%" PRIi64 "\n", delay[0], delay[1], delay[2]); /* update */ diff --git a/AK8975_FS/libsensors/AkmSensor.cpp b/AK8975_FS/libsensors/AkmSensor.cpp index bcbd445..3351fbf 100644 --- a/AK8975_FS/libsensors/AkmSensor.cpp +++ b/AK8975_FS/libsensors/AkmSensor.cpp @@ -14,6 +14,7 @@ * limitations under the License. */ +#include <inttypes.h> #include <fcntl.h> #include <errno.h> #include <math.h> @@ -139,9 +140,9 @@ int AkmSensor::setDelay(int32_t handle, int64_t ns) char buffer[32]; int bytes; - if (ns < -1 || 2147483647 < ns) { - ALOGE("AkmSensor: invalid delay (%lld)", ns); - return -EINVAL; + if (ns < -1 || 2147483647 < ns) { + ALOGE("AkmSensor: invalid delay (%" PRIi64 ")", ns); + return -EINVAL; } switch (id) { @@ -160,7 +161,7 @@ int AkmSensor::setDelay(int32_t handle, int64_t ns) } if (ns != mDelay[id]) { - bytes = sprintf(buffer, "%lld", ns); + bytes = sprintf(buffer, "%" PRIi64, ns); err = write_sys_attribute(input_sysfs_path, buffer, bytes); if (err == 0) { mDelay[id] = ns; |