qdutils/qservice: fix compilation warnings
- fix incorrect type casting.
- remove unused variables.
Change-Id: I4d21fe895b048a9dcb7c43297d44b041ba42d735
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);