am 4c23a0ec
: Merge "Adjust format strings to work on both 32-bit and 64-bit builds"
* commit '4c23a0ec161891a1248b7aea67fbfd1d00bbd199': Adjust format strings to work on both 32-bit and 64-bit builds
This commit is contained in:
@ -146,13 +146,13 @@ namespace {
|
|||||||
}
|
}
|
||||||
char *buf = new char[uncompLen];
|
char *buf = new char[uncompLen];
|
||||||
if (NULL == buf) {
|
if (NULL == buf) {
|
||||||
ALOGW("%s: failed to allocate %d byte\n", __FUNCTION__, uncompLen);
|
ALOGW("%s: failed to allocate %zd byte\n", __FUNCTION__, uncompLen);
|
||||||
dataMap->release();
|
dataMap->release();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
StreamingZipInflater inflater(dataMap, uncompLen);
|
StreamingZipInflater inflater(dataMap, uncompLen);
|
||||||
if (inflater.read(buf, uncompLen) < 0) {
|
if (inflater.read(buf, uncompLen) < 0) {
|
||||||
ALOGW("%s: failed to inflate %d byte\n", __FUNCTION__, uncompLen);
|
ALOGW("%s: failed to inflate %zd byte\n", __FUNCTION__, uncompLen);
|
||||||
delete[] buf;
|
delete[] buf;
|
||||||
dataMap->release();
|
dataMap->release();
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -182,7 +182,7 @@ int NativeInputEventReceiver::handleEvent(int receiveFd, int events, void* data)
|
|||||||
|
|
||||||
if (status == WOULD_BLOCK) {
|
if (status == WOULD_BLOCK) {
|
||||||
if (kDebugDispatchCycle) {
|
if (kDebugDispatchCycle) {
|
||||||
ALOGD("channel '%s' ~ Sent %u queued finish events; %u left.",
|
ALOGD("channel '%s' ~ Sent %zu queued finish events; %zu left.",
|
||||||
getInputChannelName(), i, mFinishQueue.size());
|
getInputChannelName(), i, mFinishQueue.size());
|
||||||
}
|
}
|
||||||
return 1; // keep the callback, try again later
|
return 1; // keep the callback, try again later
|
||||||
@ -201,7 +201,7 @@ int NativeInputEventReceiver::handleEvent(int receiveFd, int events, void* data)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (kDebugDispatchCycle) {
|
if (kDebugDispatchCycle) {
|
||||||
ALOGD("channel '%s' ~ Sent %u queued finish events; none left.",
|
ALOGD("channel '%s' ~ Sent %zu queued finish events; none left.",
|
||||||
getInputChannelName(), mFinishQueue.size());
|
getInputChannelName(), mFinishQueue.size());
|
||||||
}
|
}
|
||||||
mFinishQueue.clear();
|
mFinishQueue.clear();
|
||||||
@ -218,7 +218,7 @@ status_t NativeInputEventReceiver::consumeEvents(JNIEnv* env,
|
|||||||
bool consumeBatches, nsecs_t frameTime, bool* outConsumedBatch) {
|
bool consumeBatches, nsecs_t frameTime, bool* outConsumedBatch) {
|
||||||
if (kDebugDispatchCycle) {
|
if (kDebugDispatchCycle) {
|
||||||
ALOGD("channel '%s' ~ Consuming input events, consumeBatches=%s, frameTime=%lld.",
|
ALOGD("channel '%s' ~ Consuming input events, consumeBatches=%s, frameTime=%lld.",
|
||||||
getInputChannelName(), consumeBatches ? "true" : "false", frameTime);
|
getInputChannelName(), consumeBatches ? "true" : "false", (long long)frameTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (consumeBatches) {
|
if (consumeBatches) {
|
||||||
|
@ -204,7 +204,7 @@ status_t NativeInputEventSender::receiveFinishedSignals(JNIEnv* env) {
|
|||||||
|
|
||||||
if (kDebugDispatchCycle) {
|
if (kDebugDispatchCycle) {
|
||||||
ALOGD("channel '%s' ~ Received finished signal, seq=%u, handled=%s, "
|
ALOGD("channel '%s' ~ Received finished signal, seq=%u, handled=%s, "
|
||||||
"pendingEvents=%u.",
|
"pendingEvents=%zu.",
|
||||||
getInputChannelName(), seq, handled ? "true" : "false",
|
getInputChannelName(), seq, handled ? "true" : "false",
|
||||||
mPublishedSeqMap.size());
|
mPublishedSeqMap.size());
|
||||||
}
|
}
|
||||||
|
@ -93,7 +93,7 @@ class JavaDataSourceBridge : public DataSource {
|
|||||||
env->GetByteArrayRegion(byteArrayObj, 0, size, (jbyte*) buffer);
|
env->GetByteArrayRegion(byteArrayObj, 0, size, (jbyte*) buffer);
|
||||||
env->DeleteLocalRef(byteArrayObj);
|
env->DeleteLocalRef(byteArrayObj);
|
||||||
if (env->ExceptionCheck()) {
|
if (env->ExceptionCheck()) {
|
||||||
ALOGW("Exception occurred while reading %zu at %lld", size, offset);
|
ALOGW("Exception occurred while reading %zu at %lld", size, (long long)offset);
|
||||||
LOGW_EX(env);
|
LOGW_EX(env);
|
||||||
env->ExceptionClear();
|
env->ExceptionClear();
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -228,7 +228,7 @@ static void rotate(T *dst, const T *src, size_t width, size_t height, int angle)
|
|||||||
|
|
||||||
static jobject android_media_MediaMetadataRetriever_getFrameAtTime(JNIEnv *env, jobject thiz, jlong timeUs, jint option)
|
static jobject android_media_MediaMetadataRetriever_getFrameAtTime(JNIEnv *env, jobject thiz, jlong timeUs, jint option)
|
||||||
{
|
{
|
||||||
ALOGV("getFrameAtTime: %lld us option: %d", timeUs, option);
|
ALOGV("getFrameAtTime: %lld us option: %d", (long long)timeUs, option);
|
||||||
MediaMetadataRetriever* retriever = getRetriever(env, thiz);
|
MediaMetadataRetriever* retriever = getRetriever(env, thiz);
|
||||||
if (retriever == 0) {
|
if (retriever == 0) {
|
||||||
jniThrowException(env, "java/lang/IllegalStateException", "No retriever available");
|
jniThrowException(env, "java/lang/IllegalStateException", "No retriever available");
|
||||||
|
@ -107,7 +107,7 @@ static void android_media_MediaMuxer_writeSampleData(
|
|||||||
|
|
||||||
if (dstSize < (offset + size)) {
|
if (dstSize < (offset + size)) {
|
||||||
ALOGE("writeSampleData saw wrong dstSize %lld, size %d, offset %d",
|
ALOGE("writeSampleData saw wrong dstSize %lld, size %d, offset %d",
|
||||||
dstSize, size, offset);
|
(long long)dstSize, size, offset);
|
||||||
if (byteArray != NULL) {
|
if (byteArray != NULL) {
|
||||||
env->ReleaseByteArrayElements(byteArray, (jbyte *)dst, 0);
|
env->ReleaseByteArrayElements(byteArray, (jbyte *)dst, 0);
|
||||||
}
|
}
|
||||||
|
@ -305,7 +305,7 @@ static void
|
|||||||
android_media_MediaRecorder_setMaxFileSize(
|
android_media_MediaRecorder_setMaxFileSize(
|
||||||
JNIEnv *env, jobject thiz, jlong max_filesize_bytes)
|
JNIEnv *env, jobject thiz, jlong max_filesize_bytes)
|
||||||
{
|
{
|
||||||
ALOGV("setMaxFileSize(%lld)", max_filesize_bytes);
|
ALOGV("setMaxFileSize(%lld)", (long long)max_filesize_bytes);
|
||||||
sp<MediaRecorder> mr = getMediaRecorder(env, thiz);
|
sp<MediaRecorder> mr = getMediaRecorder(env, thiz);
|
||||||
|
|
||||||
char params[64];
|
char params[64];
|
||||||
|
@ -315,7 +315,7 @@ GLuint ShaderProgram::CompileShader(GLenum shader_type, const char* source) {
|
|||||||
size_t next_pos = 0;
|
size_t next_pos = 0;
|
||||||
size_t line_number = 1;
|
size_t line_number = 1;
|
||||||
while ( (next_pos = src.find_first_of('\n', cur_pos)) != std::string::npos) {
|
while ( (next_pos = src.find_first_of('\n', cur_pos)) != std::string::npos) {
|
||||||
ALOGE("%03d : %s", line_number, src.substr(cur_pos, next_pos-cur_pos).c_str());
|
ALOGE("%03zd : %s", line_number, src.substr(cur_pos, next_pos-cur_pos).c_str());
|
||||||
cur_pos = next_pos + 1;
|
cur_pos = next_pos + 1;
|
||||||
line_number++;
|
line_number++;
|
||||||
}
|
}
|
||||||
@ -435,7 +435,7 @@ bool ShaderProgram::BindInputTextures(const std::vector<GLuint>& textures,
|
|||||||
if (tex_var >= 0) {
|
if (tex_var >= 0) {
|
||||||
glUniform1i(tex_var, i);
|
glUniform1i(tex_var, i);
|
||||||
} else {
|
} else {
|
||||||
ALOGE("ShaderProgram: Shader does not seem to support %d number of "
|
ALOGE("ShaderProgram: Shader does not seem to support %zd number of "
|
||||||
"inputs! Missing uniform 'tex_sampler_%d'!", textures.size(), i);
|
"inputs! Missing uniform 'tex_sampler_%d'!", textures.size(), i);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -290,7 +290,7 @@ static jlong init_timerfd()
|
|||||||
|
|
||||||
epollfd = epoll_create(N_ANDROID_TIMERFDS);
|
epollfd = epoll_create(N_ANDROID_TIMERFDS);
|
||||||
if (epollfd < 0) {
|
if (epollfd < 0) {
|
||||||
ALOGV("epoll_create(%u) failed: %s", N_ANDROID_TIMERFDS,
|
ALOGV("epoll_create(%zu) failed: %s", N_ANDROID_TIMERFDS,
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -214,7 +214,7 @@ static void agps_status_callback(AGpsStatus* agps_status)
|
|||||||
|
|
||||||
size_t status_size = agps_status->size;
|
size_t status_size = agps_status->size;
|
||||||
if (status_size == sizeof(AGpsStatus_v3)) {
|
if (status_size == sizeof(AGpsStatus_v3)) {
|
||||||
ALOGV("AGpsStatus is V3: %d", status_size);
|
ALOGV("AGpsStatus is V3: %zd", status_size);
|
||||||
switch (agps_status->addr.ss_family)
|
switch (agps_status->addr.ss_family)
|
||||||
{
|
{
|
||||||
case AF_INET:
|
case AF_INET:
|
||||||
@ -256,7 +256,7 @@ static void agps_status_callback(AGpsStatus* agps_status)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else if (status_size >= sizeof(AGpsStatus_v2)) {
|
} else if (status_size >= sizeof(AGpsStatus_v2)) {
|
||||||
ALOGV("AGpsStatus is V2+: %d", status_size);
|
ALOGV("AGpsStatus is V2+: %zd", status_size);
|
||||||
// for back-compatibility reasons we check in v2 that the data structure size is greater or
|
// for back-compatibility reasons we check in v2 that the data structure size is greater or
|
||||||
// equal to the declared size in gps.h
|
// equal to the declared size in gps.h
|
||||||
uint32_t ipaddr = agps_status->ipaddr;
|
uint32_t ipaddr = agps_status->ipaddr;
|
||||||
@ -266,12 +266,12 @@ static void agps_status_callback(AGpsStatus* agps_status)
|
|||||||
isSupported = true;
|
isSupported = true;
|
||||||
}
|
}
|
||||||
} else if (status_size >= sizeof(AGpsStatus_v1)) {
|
} else if (status_size >= sizeof(AGpsStatus_v1)) {
|
||||||
ALOGV("AGpsStatus is V1+: %d", status_size);
|
ALOGV("AGpsStatus is V1+: %zd", status_size);
|
||||||
// because we have to check for >= with regards to v2, we also need to relax the check here
|
// because we have to check for >= with regards to v2, we also need to relax the check here
|
||||||
// and only make sure that the size is at least what we expect
|
// and only make sure that the size is at least what we expect
|
||||||
isSupported = true;
|
isSupported = true;
|
||||||
} else {
|
} else {
|
||||||
ALOGE("Invalid size of AGpsStatus found: %d.", status_size);
|
ALOGE("Invalid size of AGpsStatus found: %zd.", status_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isSupported) {
|
if (isSupported) {
|
||||||
@ -758,7 +758,7 @@ static void android_location_GpsLocationProvider_agps_data_conn_open(
|
|||||||
} else if (interface_size == sizeof(AGpsInterface_v1)) {
|
} else if (interface_size == sizeof(AGpsInterface_v1)) {
|
||||||
sAGpsInterface->data_conn_open(apnStr);
|
sAGpsInterface->data_conn_open(apnStr);
|
||||||
} else {
|
} else {
|
||||||
ALOGE("Invalid size of AGpsInterface found: %d.", interface_size);
|
ALOGE("Invalid size of AGpsInterface found: %zd.", interface_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
env->ReleaseStringUTFChars(apn, apnStr);
|
env->ReleaseStringUTFChars(apn, apnStr);
|
||||||
@ -1260,7 +1260,7 @@ static void measurement_callback(GpsData* data) {
|
|||||||
env->DeleteLocalRef(gpsMeasurementsEventClass);
|
env->DeleteLocalRef(gpsMeasurementsEventClass);
|
||||||
env->DeleteLocalRef(gpsMeasurementsEvent);
|
env->DeleteLocalRef(gpsMeasurementsEvent);
|
||||||
} else {
|
} else {
|
||||||
ALOGE("Invalid GpsData size found in gps_measurement_callback, size=%d", data->size);
|
ALOGE("Invalid GpsData size found in gps_measurement_callback, size=%zd", data->size);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1311,7 +1311,7 @@ static jobject translate_gps_navigation_message(JNIEnv* env, GpsNavigationMessag
|
|||||||
size_t dataLength = message->data_length;
|
size_t dataLength = message->data_length;
|
||||||
uint8_t* data = message->data;
|
uint8_t* data = message->data;
|
||||||
if (dataLength == 0 || data == NULL) {
|
if (dataLength == 0 || data == NULL) {
|
||||||
ALOGE("Invalid Navigation Message found: data=%p, length=%d", data, dataLength);
|
ALOGE("Invalid Navigation Message found: data=%p, length=%zd", data, dataLength);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1370,7 +1370,7 @@ static void navigation_message_callback(GpsNavigationMessage* message) {
|
|||||||
env->DeleteLocalRef(navigationMessageEventClass);
|
env->DeleteLocalRef(navigationMessageEventClass);
|
||||||
env->DeleteLocalRef(navigationMessageEvent);
|
env->DeleteLocalRef(navigationMessageEvent);
|
||||||
} else {
|
} else {
|
||||||
ALOGE("Invalid GpsNavigationMessage size found: %d", message->size);
|
ALOGE("Invalid GpsNavigationMessage size found: %zd", message->size);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user