summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Burgess IV <gbiv@google.com>2017-07-12 16:22:46 -0700
committerGeorge Burgess IV <gbiv@google.com>2017-07-12 16:37:35 -0700
commitbf5a68552f489463afa636b1f2f521965a98ce19 (patch)
treed1e42d241977f5ffc731ab153c752cc97c2b2449
parent7889f98849ad3913586904e00d91b32cc0ceb75b (diff)
downloadakm-bf5a68552f489463afa636b1f2f521965a98ce19.tar.gz
Fix printf warnings
This fixes five warnings like: hardware/akm/AK8975_FS/libsensors/AkmSensor.cpp:143:44: warning: format specifies type 'long long' but the argument has type 'int64_t' (aka 'long') Also reformat a tiny bit of immediately surrounding code. Bug: None Test: mma. Warnings are gone. Change-Id: I1b48d1e93add7c98e731dcc303650fe0a2ef85e5
-rw-r--r--AK8975_FS/akmdfs/AKFS_Measure.c6
-rw-r--r--AK8975_FS/libsensors/AkmSensor.cpp9
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;