summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>2012-07-12 01:03:20 +0159
committerBernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>2012-10-10 14:52:57 +0200
commit01311505f62cc98a40162c4ba7b2e2ef7cf4775c (patch)
tree65ee336b24ced69b1a3a7a0d79629a3e3f6dea42
parent0114bd9f9bbc2458ca77bf3508e7c15992a432b1 (diff)
downloadsecurity-linaro_android_4.1.2.tar.gz
keystore: Fix build with gcc 4.7+ -Werrorlinaro_android_4.1.2
Fix code fragments that are errors in ISO C++11 mode, and cause warnings in gcc 4.7+ -Werror (narrowing conversions inside {}) Change-Id: I878687e1daf99efddc353040805947e26435e535 Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>
-rw-r--r--keystore/keystore.cpp6
-rw-r--r--keystore/keystore_client.cpp2
2 files changed, 4 insertions, 4 deletions
diff --git a/keystore/keystore.cpp b/keystore/keystore.cpp
index 6f506dd2..3e435fcf 100644
--- a/keystore/keystore.cpp
+++ b/keystore/keystore.cpp
@@ -1292,7 +1292,7 @@ static const State STATE_ANY = (State) 0;
static struct action {
ResponseCode (*run)(KeyStore* keyStore, int sock, uid_t uid, Value* param1, Value* param2,
Value* param3);
- int8_t code;
+ command_code_t code;
State state;
uint32_t perm;
int lengths[MAX_PARAM];
@@ -1324,11 +1324,11 @@ static struct user {
uid_t euid;
uint32_t perms;
} users[] = {
- {AID_SYSTEM, ~0, ~0},
+ {AID_SYSTEM, (uid_t)~0, (uint32_t)~0},
{AID_VPN, AID_SYSTEM, P_GET | P_SIGN | P_VERIFY },
{AID_WIFI, AID_SYSTEM, P_GET | P_SIGN | P_VERIFY },
{AID_ROOT, AID_SYSTEM, P_GET},
- {~0, ~0, P_TEST | P_GET | P_INSERT | P_DELETE | P_EXIST | P_SAW |
+ {(uid_t)~0, (uid_t)~0, P_TEST | P_GET | P_INSERT | P_DELETE | P_EXIST | P_SAW |
P_SIGN | P_VERIFY},
};
diff --git a/keystore/keystore_client.cpp b/keystore/keystore_client.cpp
index db9eb680..a3a51ec5 100644
--- a/keystore/keystore_client.cpp
+++ b/keystore/keystore_client.cpp
@@ -47,7 +47,7 @@ ResponseCode keystore_cmd(command_code_t cmd, Keystore_Reply* reply, int numArgs
return SYSTEM_ERROR;
}
- uint8_t bytes[2] = { argLen >> 8, argLen };
+ uint8_t bytes[2] = { (uint8_t)(argLen >> 8), (uint8_t)argLen };
if (TEMP_FAILURE_RETRY(send(sock, bytes, 2, MSG_NOSIGNAL)) != 2
|| TEMP_FAILURE_RETRY(send(sock, arg, argLen, MSG_NOSIGNAL))
!= static_cast<ssize_t>(argLen)) {