qdutils/qservice: fix compilation warnings
- fix incorrect type casting.
- remove unused variables.
Change-Id: I4d21fe895b048a9dcb7c43297d44b041ba42d735
diff --git a/libqdutils/display_config.cpp b/libqdutils/display_config.cpp
index 45b0211..60f1f68 100644
--- a/libqdutils/display_config.cpp
+++ b/libqdutils/display_config.cpp
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2013 The Linux Foundation. All rights reserved.
+* Copyright (c) 2013-2014 The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -37,7 +37,7 @@
int isExternalConnected(void) {
int ret;
- status_t err = FAILED_TRANSACTION;
+ status_t err = (status_t) FAILED_TRANSACTION;
sp<IQService> binder = getBinder();
Parcel inParcel, outParcel;
if(binder != NULL) {
@@ -54,7 +54,7 @@
}
int getDisplayAttributes(int dpy, DisplayAttributes_t& dpyattr) {
- status_t err = FAILED_TRANSACTION;
+ status_t err = (status_t) FAILED_TRANSACTION;
sp<IQService> binder = getBinder();
Parcel inParcel, outParcel;
inParcel.writeInt32(dpy);
@@ -76,7 +76,7 @@
}
int setHSIC(int dpy, const HSICData_t& hsic_data) {
- status_t err = FAILED_TRANSACTION;
+ status_t err = (status_t) FAILED_TRANSACTION;
sp<IQService> binder = getBinder();
Parcel inParcel, outParcel;
inParcel.writeInt32(dpy);
@@ -93,7 +93,7 @@
}
int getDisplayVisibleRegion(int dpy, hwc_rect_t &rect) {
- status_t err = FAILED_TRANSACTION;
+ status_t err = (status_t) FAILED_TRANSACTION;
sp<IQService> binder = getBinder();
Parcel inParcel, outParcel;
inParcel.writeInt32(dpy);
diff --git a/libqdutils/mdp_version.cpp b/libqdutils/mdp_version.cpp
index b743d7a..9e36980 100644
--- a/libqdutils/mdp_version.cpp
+++ b/libqdutils/mdp_version.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2014, The Linux Foundation. All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -99,7 +99,7 @@
char* tokenStr[], int *idx) {
char *tmp_token = NULL;
char *temp_ptr;
- int ret = 0, index = 0;
+ int index = 0;
if (!inputParams) {
return -1;
}
diff --git a/libqdutils/qdMetaData.cpp b/libqdutils/qdMetaData.cpp
index f39eef9..ecbf873 100644
--- a/libqdutils/qdMetaData.cpp
+++ b/libqdutils/qdMetaData.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2014, The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -31,6 +31,8 @@
#include <sys/mman.h>
#include <cutils/log.h>
#include <gralloc_priv.h>
+#define __STDC_FORMAT_MACROS 1
+#include <inttypes.h>
#include "qdMetaData.h"
int setMetaData(private_handle_t *handle, DispParamType paramType,
@@ -106,7 +108,7 @@
break;
}
if(munmap(base, size))
- ALOGE("%s: failed to unmap ptr 0x%x, err %d", __func__, (int)base,
+ ALOGE("%s: failed to unmap ptr 0x%"PRIdPTR", err %d", __func__, (intptr_t)base,
errno);
return 0;
}
diff --git a/libqservice/IQService.cpp b/libqservice/IQService.cpp
index d2180bb..096444f 100644
--- a/libqservice/IQService.cpp
+++ b/libqservice/IQService.cpp
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2010 The Android Open Source Project
- * Copyright (C) 2012-2013, The Linux Foundation. All rights reserved.
+ * Copyright (C) 2012-2014, The Linux Foundation. All rights reserved.
*
* Not a Contribution, Apache license notifications and license are
* retained for attribution purposes only.
@@ -55,7 +55,7 @@
virtual android::status_t dispatch(uint32_t command, const Parcel* inParcel,
Parcel* outParcel) {
ALOGD_IF(QSERVICE_DEBUG, "%s: dispatch in:%p", __FUNCTION__, inParcel);
- status_t err = android::FAILED_TRANSACTION;
+ status_t err = (status_t) android::FAILED_TRANSACTION;
Parcel data;
Parcel *reply = outParcel;
data.writeInterfaceToken(IQService::getInterfaceDescriptor());
@@ -80,7 +80,7 @@
IPCThreadState* ipc = IPCThreadState::self();
const int callerPid = ipc->getCallingPid();
const int callerUid = ipc->getCallingUid();
- const size_t MAX_BUF_SIZE = 1024;
+ const int MAX_BUF_SIZE = 1024;
char callingProcName[MAX_BUF_SIZE] = {0};
getProcName(callerPid, callingProcName, MAX_BUF_SIZE);
diff --git a/libqservice/QService.cpp b/libqservice/QService.cpp
index aac5788..e4af422 100644
--- a/libqservice/QService.cpp
+++ b/libqservice/QService.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2014, The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -54,7 +54,7 @@
status_t QService::dispatch(uint32_t command, const Parcel* inParcel,
Parcel* outParcel) {
- status_t err = FAILED_TRANSACTION;
+ status_t err = (status_t) FAILED_TRANSACTION;
if (mClient.get()) {
ALOGD_IF(QSERVICE_DEBUG, "Dispatching command: %d", command);
err = mClient->notifyCallback(command, inParcel, outParcel);
diff --git a/libqservice/QServiceUtils.h b/libqservice/QServiceUtils.h
index 2817429..a5f4f7f 100644
--- a/libqservice/QServiceUtils.h
+++ b/libqservice/QServiceUtils.h
@@ -49,7 +49,7 @@
}
inline android::status_t sendSingleParam(uint32_t command, uint32_t value) {
- android::status_t err = android::FAILED_TRANSACTION;
+ android::status_t err = (status_t) android::FAILED_TRANSACTION;
android::sp<qService::IQService> binder = getBinder();
android::Parcel inParcel, outParcel;
inParcel.writeInt32(value);