Fix build warnings in hardware/ril.
Bug: 29401612
Change-Id: I8473294655ad24ec001cedb84856004ab0ba22a7
diff --git a/libril/RilSapSocket.cpp b/libril/RilSapSocket.cpp
index 19457f4..ecb04ed 100644
--- a/libril/RilSapSocket.cpp
+++ b/libril/RilSapSocket.cpp
@@ -21,6 +21,7 @@
#include "RilSapSocket.h"
#include "pb_decode.h"
#include "pb_encode.h"
+#undef LOG_TAG
#define LOG_TAG "RIL_UIM_SOCKET"
#include <utils/Log.h>
#include <arpa/inet.h>
@@ -351,8 +352,8 @@
success = pb_encode(&ostream, MsgHeader_fields, hdr);
if (success) {
- RLOGD("Size: %d (0x%x) Size as written: 0x%x", encoded_size, encoded_size,
- written_size);
+ RLOGD("Size: %zu (0x%zx) Size as written: 0x%x", encoded_size,
+ encoded_size, written_size);
log_hex("onRequestComplete", &buffer[sizeof(written_size)], encoded_size);
RLOGI("[%d] < SAP RESPONSE type: %d. id: %d. error: %d",
hdr->token, hdr->type, hdr->id,hdr->error );
@@ -363,12 +364,12 @@
RLOGD("Write successful");
}
} else {
- RLOGE("Error while encoding response of type %d id %d buffer_size: %d: %s.",
- hdr->type, hdr->id, buffer_size, PB_GET_ERROR(&ostream));
+ RLOGE("Error while encoding response of type %d id %d buffer_size: %zu: %s.",
+ hdr->type, hdr->id, buffer_size, PB_GET_ERROR(&ostream));
}
} else {
- RLOGE("Not sending response type %d: encoded_size: %u. commandFd: %d. encoded size result: %d",
- hdr->type, encoded_size, commandFd, success);
+ RLOGE("Not sending response type %d: encoded_size: %zu. commandFd: %d. encoded size result:\
+ %d", hdr->type, encoded_size, commandFd, success);
}
pthread_mutex_unlock(&write_lock);
diff --git a/reference-ril/atchannel.c b/reference-ril/atchannel.c
index 6124d88..2ef3a4c 100644
--- a/reference-ril/atchannel.c
+++ b/reference-ril/atchannel.c
@@ -422,7 +422,7 @@
}
-static void *readerLoop(void *arg)
+static void *readerLoop(void *arg __unused)
{
for (;;) {
const char * line;
diff --git a/reference-ril/reference-ril.c b/reference-ril/reference-ril.c
index b9baef1..089100f 100644
--- a/reference-ril/reference-ril.c
+++ b/reference-ril/reference-ril.c
@@ -364,7 +364,7 @@
at_send_command("AT+CNMI=1,2,2,1,1", NULL);
}
-static void requestRadioPower(void *data, size_t datalen, RIL_Token t)
+static void requestRadioPower(void *data, size_t datalen __unused, RIL_Token t)
{
int onOff;
@@ -1932,6 +1932,7 @@
{ // ci[0]
1, // cellInfoType
1, // registered
+ RIL_TIMESTAMP_TYPE_MODEM,
curTime - 1000, // Fake some time in the past
{ // union CellInfo
{ // RIL_CellInfoGsm gsm
@@ -1940,7 +1941,6 @@
s_mnc, // mnc
s_lac, // lac
s_cid, // cid
- 0 // psc
},
{ // gsm.signalStrengthGsm
10, // signalStrength
@@ -1955,7 +1955,7 @@
}
-static void requestSetCellInfoListRate(void *data, size_t datalen, RIL_Token t)
+static void requestSetCellInfoListRate(void *data, size_t datalen __unused, RIL_Token t)
{
// For now we'll save the rate but no RIL_UNSOL_CELL_INFO_LIST messages
// will be sent.
@@ -3273,7 +3273,7 @@
RIL_onUnsolicitedResponse(RIL_UNSOL_HARDWARE_CONFIG_CHANGED, cfg, num*sizeof(*cfg));
}
-static void usage(char *s)
+static void usage(char *s __unused)
{
#ifdef RIL_SHLIB
fprintf(stderr, "reference-ril requires: -p <tcp port> or -d /dev/tty_device\n");
diff --git a/rild/rild.c b/rild/rild.c
index 0e0d056..ce1adba 100644
--- a/rild/rild.c
+++ b/rild/rild.c
@@ -147,8 +147,8 @@
char **rilArgv;
void *dlHandle;
const RIL_RadioFunctions *(*rilInit)(const struct RIL_Env *, int, char **);
- const RIL_RadioFunctions *(*rilUimInit)(const struct RIL_Env *, int, char **);
- char *err_str = NULL;
+ RIL_RadioFunctions *(*rilUimInit)(const struct RIL_Env *, int, char **);
+ const char *err_str = NULL;
const RIL_RadioFunctions *funcs;
char libPath[PROPERTY_VALUE_MAX];
@@ -223,7 +223,7 @@
goto OpenLib;
}
- if (st.st_size > sizeof(buffer) - 1) {
+ if ((unsigned long)st.st_size > sizeof(buffer) - 1) {
RLOGE("Size of /proc/cmdline exceeds buffer");
close(fd);
goto OpenLib;
@@ -339,7 +339,7 @@
dlerror(); // Clear any previous dlerror
rilUimInit =
- (const RIL_RadioFunctions *(*)(const struct RIL_Env *, int, char **))
+ (RIL_RadioFunctions *(*)(const struct RIL_Env *, int, char **))
dlsym(dlHandle, "RIL_SAP_Init");
err_str = dlerror();
if (err_str) {