diff options
-rw-r--r-- | media/jni/Android.mk | 2 | ||||
-rw-r--r-- | media/jni/android_media_AmrInputStream.cpp | 10 | ||||
-rw-r--r-- | media/jni/android_media_ImageReader.cpp | 1 | ||||
-rw-r--r-- | media/jni/android_media_MediaCodecList.cpp | 14 | ||||
-rw-r--r-- | media/jni/android_media_MediaCrypto.cpp | 2 | ||||
-rw-r--r-- | media/jni/android_media_MediaDrm.cpp | 16 | ||||
-rw-r--r-- | media/jni/android_media_MediaMetadataRetriever.cpp | 1 | ||||
-rw-r--r-- | media/jni/android_media_MediaMuxer.cpp | 14 | ||||
-rw-r--r-- | media/jni/android_media_MediaProfiles.cpp | 39 | ||||
-rw-r--r-- | media/jni/android_media_MediaScanner.cpp | 1 | ||||
-rw-r--r-- | media/jni/android_media_ResampleInputStream.cpp | 2 | ||||
-rw-r--r-- | media/jni/android_media_Utils.cpp | 6 | ||||
-rw-r--r-- | media/jni/android_mtp_MtpDatabase.cpp | 15 | ||||
-rw-r--r-- | media/jni/android_mtp_MtpDevice.cpp | 8 | ||||
-rw-r--r-- | media/jni/audioeffect/Android.mk | 20 | ||||
-rw-r--r-- | media/jni/audioeffect/android_media_Visualizer.cpp | 8 | ||||
-rw-r--r-- | media/jni/soundpool/Android.mk | 16 | ||||
-rw-r--r-- | media/jni/soundpool/android_media_SoundPool_SoundPoolImpl.cpp | 2 |
18 files changed, 88 insertions, 89 deletions
diff --git a/media/jni/Android.mk b/media/jni/Android.mk index 90fe695..4ebbe26 100644 --- a/media/jni/Android.mk +++ b/media/jni/Android.mk @@ -64,7 +64,7 @@ LOCAL_C_INCLUDES += \ $(PV_INCLUDES) \ $(JNI_H_INCLUDE) -LOCAL_CFLAGS += +LOCAL_CFLAGS += -Wall -Werror -Wunused -Wunreachable-code LOCAL_MODULE:= libmedia_jni diff --git a/media/jni/android_media_AmrInputStream.cpp b/media/jni/android_media_AmrInputStream.cpp index 3df6530..afb5d5c 100644 --- a/media/jni/android_media_AmrInputStream.cpp +++ b/media/jni/android_media_AmrInputStream.cpp @@ -50,7 +50,7 @@ struct GsmAmrEncoderState { }; static jlong android_media_AmrInputStream_GsmAmrEncoderNew - (JNIEnv *env, jclass clazz) { + (JNIEnv *env, jclass /* clazz */) { GsmAmrEncoderState* gae = new GsmAmrEncoderState(); if (gae == NULL) { jniThrowRuntimeException(env, "Out of memory"); @@ -59,7 +59,7 @@ static jlong android_media_AmrInputStream_GsmAmrEncoderNew } static void android_media_AmrInputStream_GsmAmrEncoderInitialize - (JNIEnv *env, jclass clazz, jlong gae) { + (JNIEnv *env, jclass /* clazz */, jlong gae) { GsmAmrEncoderState *state = (GsmAmrEncoderState *) gae; int32_t nResult = AMREncodeInit(&state->mEncState, &state->mSidState, false); if (nResult != OK) { @@ -69,7 +69,7 @@ static void android_media_AmrInputStream_GsmAmrEncoderInitialize } static jint android_media_AmrInputStream_GsmAmrEncoderEncode - (JNIEnv *env, jclass clazz, + (JNIEnv *env, jclass /* clazz */, jlong gae, jbyteArray pcm, jint pcmOffset, jbyteArray amr, jint amrOffset) { jbyte inBuf[BYTES_PER_FRAME]; @@ -105,7 +105,7 @@ static jint android_media_AmrInputStream_GsmAmrEncoderEncode } static void android_media_AmrInputStream_GsmAmrEncoderCleanup - (JNIEnv *env, jclass clazz, jlong gae) { + (JNIEnv* /* env */, jclass /* clazz */, jlong gae) { GsmAmrEncoderState *state = (GsmAmrEncoderState *) gae; AMREncodeExit(&state->mEncState, &state->mSidState); state->mEncState = NULL; @@ -113,7 +113,7 @@ static void android_media_AmrInputStream_GsmAmrEncoderCleanup } static void android_media_AmrInputStream_GsmAmrEncoderDelete - (JNIEnv *env, jclass clazz, jlong gae) { + (JNIEnv* /* env */, jclass /* clazz */, jlong gae) { delete (GsmAmrEncoderState*)gae; } diff --git a/media/jni/android_media_ImageReader.cpp b/media/jni/android_media_ImageReader.cpp index 7830c80..0a6bf1e 100644 --- a/media/jni/android_media_ImageReader.cpp +++ b/media/jni/android_media_ImageReader.cpp @@ -502,7 +502,6 @@ static jint Image_imageGetPixelStride(JNIEnv* env, CpuConsumer::LockedBuffer* bu case HAL_PIXEL_FORMAT_Y8: // Single plane 8bpp data. ALOG_ASSERT(idx == 0, "Wrong index: %d", idx); - pixelStride; break; case HAL_PIXEL_FORMAT_YV12: pixelStride = 1; diff --git a/media/jni/android_media_MediaCodecList.cpp b/media/jni/android_media_MediaCodecList.cpp index 12eb7d2..f8c349b 100644 --- a/media/jni/android_media_MediaCodecList.cpp +++ b/media/jni/android_media_MediaCodecList.cpp @@ -42,7 +42,7 @@ static sp<IMediaCodecList> getCodecList(JNIEnv *env) { } static jint android_media_MediaCodecList_getCodecCount( - JNIEnv *env, jobject thiz) { + JNIEnv *env, jobject /* thiz */) { sp<IMediaCodecList> mcl = getCodecList(env); if (mcl == NULL) { // Runtime exception already pending. @@ -52,7 +52,7 @@ static jint android_media_MediaCodecList_getCodecCount( } static jstring android_media_MediaCodecList_getCodecName( - JNIEnv *env, jobject thiz, jint index) { + JNIEnv *env, jobject /* thiz */, jint index) { sp<IMediaCodecList> mcl = getCodecList(env); if (mcl == NULL) { // Runtime exception already pending. @@ -70,7 +70,7 @@ static jstring android_media_MediaCodecList_getCodecName( } static jint android_media_MediaCodecList_findCodecByName( - JNIEnv *env, jobject thiz, jstring name) { + JNIEnv *env, jobject /* thiz */, jstring name) { if (name == NULL) { jniThrowException(env, "java/lang/IllegalArgumentException", NULL); return -ENOENT; @@ -95,7 +95,7 @@ static jint android_media_MediaCodecList_findCodecByName( } static jboolean android_media_MediaCodecList_isEncoder( - JNIEnv *env, jobject thiz, jint index) { + JNIEnv *env, jobject /* thiz */, jint index) { sp<IMediaCodecList> mcl = getCodecList(env); if (mcl == NULL) { // Runtime exception already pending. @@ -112,7 +112,7 @@ static jboolean android_media_MediaCodecList_isEncoder( } static jarray android_media_MediaCodecList_getSupportedTypes( - JNIEnv *env, jobject thiz, jint index) { + JNIEnv *env, jobject /* thiz */, jint index) { sp<IMediaCodecList> mcl = getCodecList(env); if (mcl == NULL) { // Runtime exception already pending. @@ -144,7 +144,7 @@ static jarray android_media_MediaCodecList_getSupportedTypes( } static jobject android_media_MediaCodecList_getCodecCapabilities( - JNIEnv *env, jobject thiz, jint index, jstring type) { + JNIEnv *env, jobject /* thiz */, jint index, jstring type) { if (type == NULL) { jniThrowException(env, "java/lang/IllegalArgumentException", NULL); return NULL; @@ -262,7 +262,7 @@ static jobject android_media_MediaCodecList_getCodecCapabilities( return caps; } -static void android_media_MediaCodecList_native_init(JNIEnv *env) { +static void android_media_MediaCodecList_native_init(JNIEnv* /* env */) { } static JNINativeMethod gMethods[] = { diff --git a/media/jni/android_media_MediaCrypto.cpp b/media/jni/android_media_MediaCrypto.cpp index a6f8dcd..d2216fb 100644 --- a/media/jni/android_media_MediaCrypto.cpp +++ b/media/jni/android_media_MediaCrypto.cpp @@ -224,7 +224,7 @@ static void android_media_MediaCrypto_native_finalize( } static jboolean android_media_MediaCrypto_isCryptoSchemeSupportedNative( - JNIEnv *env, jobject thiz, jbyteArray uuidObj) { + JNIEnv *env, jobject /* thiz */, jbyteArray uuidObj) { jsize uuidLength = env->GetArrayLength(uuidObj); if (uuidLength != 16) { diff --git a/media/jni/android_media_MediaDrm.cpp b/media/jni/android_media_MediaDrm.cpp index 8e07ec0..d9de7a9 100644 --- a/media/jni/android_media_MediaDrm.cpp +++ b/media/jni/android_media_MediaDrm.cpp @@ -667,7 +667,7 @@ static void android_media_MediaDrm_native_finalize( } static jboolean android_media_MediaDrm_isCryptoSchemeSupportedNative( - JNIEnv *env, jobject thiz, jbyteArray uuidObj, jstring jmimeType) { + JNIEnv *env, jobject /* thiz */, jbyteArray uuidObj, jstring jmimeType) { if (uuidObj == NULL) { jniThrowException(env, "java/lang/IllegalArgumentException", NULL); @@ -1173,7 +1173,7 @@ static void android_media_MediaDrm_setPropertyByteArray( } static void android_media_MediaDrm_setCipherAlgorithmNative( - JNIEnv *env, jobject thiz, jobject jdrm, jbyteArray jsessionId, + JNIEnv *env, jobject /* thiz */, jobject jdrm, jbyteArray jsessionId, jstring jalgorithm) { sp<IDrm> drm = GetDrm(env, jdrm); @@ -1197,7 +1197,7 @@ static void android_media_MediaDrm_setCipherAlgorithmNative( } static void android_media_MediaDrm_setMacAlgorithmNative( - JNIEnv *env, jobject thiz, jobject jdrm, jbyteArray jsessionId, + JNIEnv *env, jobject /* thiz */, jobject jdrm, jbyteArray jsessionId, jstring jalgorithm) { sp<IDrm> drm = GetDrm(env, jdrm); @@ -1222,7 +1222,7 @@ static void android_media_MediaDrm_setMacAlgorithmNative( static jbyteArray android_media_MediaDrm_encryptNative( - JNIEnv *env, jobject thiz, jobject jdrm, jbyteArray jsessionId, + JNIEnv *env, jobject /* thiz */, jobject jdrm, jbyteArray jsessionId, jbyteArray jkeyId, jbyteArray jinput, jbyteArray jiv) { sp<IDrm> drm = GetDrm(env, jdrm); @@ -1253,7 +1253,7 @@ static jbyteArray android_media_MediaDrm_encryptNative( } static jbyteArray android_media_MediaDrm_decryptNative( - JNIEnv *env, jobject thiz, jobject jdrm, jbyteArray jsessionId, + JNIEnv *env, jobject /* thiz */, jobject jdrm, jbyteArray jsessionId, jbyteArray jkeyId, jbyteArray jinput, jbyteArray jiv) { sp<IDrm> drm = GetDrm(env, jdrm); @@ -1283,7 +1283,7 @@ static jbyteArray android_media_MediaDrm_decryptNative( } static jbyteArray android_media_MediaDrm_signNative( - JNIEnv *env, jobject thiz, jobject jdrm, jbyteArray jsessionId, + JNIEnv *env, jobject /* thiz */, jobject jdrm, jbyteArray jsessionId, jbyteArray jkeyId, jbyteArray jmessage) { sp<IDrm> drm = GetDrm(env, jdrm); @@ -1313,7 +1313,7 @@ static jbyteArray android_media_MediaDrm_signNative( } static jboolean android_media_MediaDrm_verifyNative( - JNIEnv *env, jobject thiz, jobject jdrm, jbyteArray jsessionId, + JNIEnv *env, jobject /* thiz */, jobject jdrm, jbyteArray jsessionId, jbyteArray jkeyId, jbyteArray jmessage, jbyteArray jsignature) { sp<IDrm> drm = GetDrm(env, jdrm); @@ -1342,7 +1342,7 @@ static jboolean android_media_MediaDrm_verifyNative( static jbyteArray android_media_MediaDrm_signRSANative( - JNIEnv *env, jobject thiz, jobject jdrm, jbyteArray jsessionId, + JNIEnv *env, jobject /* thiz */, jobject jdrm, jbyteArray jsessionId, jstring jalgorithm, jbyteArray jwrappedKey, jbyteArray jmessage) { sp<IDrm> drm = GetDrm(env, jdrm); diff --git a/media/jni/android_media_MediaMetadataRetriever.cpp b/media/jni/android_media_MediaMetadataRetriever.cpp index ac8a929..c755bf0 100644 --- a/media/jni/android_media_MediaMetadataRetriever.cpp +++ b/media/jni/android_media_MediaMetadataRetriever.cpp @@ -78,7 +78,6 @@ static MediaMetadataRetriever* getRetriever(JNIEnv* env, jobject thiz) static void setRetriever(JNIEnv* env, jobject thiz, MediaMetadataRetriever* retriever) { // No lock is needed, since it is called internally by other methods that are protected - MediaMetadataRetriever *old = (MediaMetadataRetriever*) env->GetLongField(thiz, fields.context); env->SetLongField(thiz, fields.context, (jlong) retriever); } diff --git a/media/jni/android_media_MediaMuxer.cpp b/media/jni/android_media_MediaMuxer.cpp index 3fef446f..f234a1b 100644 --- a/media/jni/android_media_MediaMuxer.cpp +++ b/media/jni/android_media_MediaMuxer.cpp @@ -41,7 +41,7 @@ static fields_t gFields; using namespace android; static jint android_media_MediaMuxer_addTrack( - JNIEnv *env, jclass clazz, jlong nativeObject, jobjectArray keys, + JNIEnv *env, jclass /* clazz */, jlong nativeObject, jobjectArray keys, jobjectArray values) { sp<MediaMuxer> muxer(reinterpret_cast<MediaMuxer *>(nativeObject)); if (muxer == NULL) { @@ -71,7 +71,7 @@ static jint android_media_MediaMuxer_addTrack( } static void android_media_MediaMuxer_writeSampleData( - JNIEnv *env, jclass clazz, jlong nativeObject, jint trackIndex, + JNIEnv *env, jclass /* clazz */, jlong nativeObject, jint trackIndex, jobject byteBuf, jint offset, jint size, jlong timeUs, jint flags) { sp<MediaMuxer> muxer(reinterpret_cast<MediaMuxer *>(nativeObject)); if (muxer == NULL) { @@ -146,7 +146,7 @@ static jlong android_media_MediaMuxer_native_setup( } static void android_media_MediaMuxer_setOrientationHint( - JNIEnv *env, jclass clazz, jlong nativeObject, jint degrees) { + JNIEnv *env, jclass /* clazz */, jlong nativeObject, jint degrees) { sp<MediaMuxer> muxer(reinterpret_cast<MediaMuxer *>(nativeObject)); if (muxer == NULL) { jniThrowException(env, "java/lang/IllegalStateException", @@ -164,7 +164,7 @@ static void android_media_MediaMuxer_setOrientationHint( } static void android_media_MediaMuxer_setLocation( - JNIEnv *env, jclass clazz, jlong nativeObject, jint latitude, jint longitude) { + JNIEnv *env, jclass /* clazz */, jlong nativeObject, jint latitude, jint longitude) { MediaMuxer* muxer = reinterpret_cast<MediaMuxer *>(nativeObject); status_t res = muxer->setLocation(latitude, longitude); @@ -175,7 +175,7 @@ static void android_media_MediaMuxer_setLocation( } } -static void android_media_MediaMuxer_start(JNIEnv *env, jclass clazz, +static void android_media_MediaMuxer_start(JNIEnv *env, jclass /* clazz */, jlong nativeObject) { sp<MediaMuxer> muxer(reinterpret_cast<MediaMuxer *>(nativeObject)); if (muxer == NULL) { @@ -193,7 +193,7 @@ static void android_media_MediaMuxer_start(JNIEnv *env, jclass clazz, } -static void android_media_MediaMuxer_stop(JNIEnv *env, jclass clazz, +static void android_media_MediaMuxer_stop(JNIEnv *env, jclass /* clazz */, jlong nativeObject) { sp<MediaMuxer> muxer(reinterpret_cast<MediaMuxer *>(nativeObject)); if (muxer == NULL) { @@ -212,7 +212,7 @@ static void android_media_MediaMuxer_stop(JNIEnv *env, jclass clazz, } static void android_media_MediaMuxer_native_release( - JNIEnv *env, jclass clazz, jlong nativeObject) { + JNIEnv* /* env */, jclass clazz, jlong nativeObject) { sp<MediaMuxer> muxer(reinterpret_cast<MediaMuxer *>(nativeObject)); if (muxer != NULL) { muxer->decStrong(clazz); diff --git a/media/jni/android_media_MediaProfiles.cpp b/media/jni/android_media_MediaProfiles.cpp index 007fc14..ca9db91 100644 --- a/media/jni/android_media_MediaProfiles.cpp +++ b/media/jni/android_media_MediaProfiles.cpp @@ -34,7 +34,7 @@ MediaProfiles *sProfiles = NULL; // This function is called from a static block in MediaProfiles.java class, // which won't run until the first time an instance of this class is used. static void -android_media_MediaProfiles_native_init(JNIEnv *env) +android_media_MediaProfiles_native_init(JNIEnv* /* env */) { ALOGV("native_init"); Mutex::Autolock lock(sLock); @@ -45,14 +45,14 @@ android_media_MediaProfiles_native_init(JNIEnv *env) } static jint -android_media_MediaProfiles_native_get_num_file_formats(JNIEnv *env, jobject thiz) +android_media_MediaProfiles_native_get_num_file_formats(JNIEnv* /* env */, jobject /* thiz */) { ALOGV("native_get_num_file_formats"); return (jint) sProfiles->getOutputFileFormats().size(); } static jint -android_media_MediaProfiles_native_get_file_format(JNIEnv *env, jobject thiz, jint index) +android_media_MediaProfiles_native_get_file_format(JNIEnv *env, jobject /* thiz */, jint index) { ALOGV("native_get_file_format: %d", index); Vector<output_format> formats = sProfiles->getOutputFileFormats(); @@ -65,14 +65,15 @@ android_media_MediaProfiles_native_get_file_format(JNIEnv *env, jobject thiz, ji } static jint -android_media_MediaProfiles_native_get_num_video_encoders(JNIEnv *env, jobject thiz) +android_media_MediaProfiles_native_get_num_video_encoders(JNIEnv* /* env */, jobject /* thiz */) { ALOGV("native_get_num_video_encoders"); return sProfiles->getVideoEncoders().size(); } static jobject -android_media_MediaProfiles_native_get_video_encoder_cap(JNIEnv *env, jobject thiz, jint index) +android_media_MediaProfiles_native_get_video_encoder_cap(JNIEnv *env, jobject /* thiz */, + jint index) { ALOGV("native_get_video_encoder_cap: %d", index); Vector<video_encoder> encoders = sProfiles->getVideoEncoders(); @@ -116,14 +117,15 @@ android_media_MediaProfiles_native_get_video_encoder_cap(JNIEnv *env, jobject th } static jint -android_media_MediaProfiles_native_get_num_audio_encoders(JNIEnv *env, jobject thiz) +android_media_MediaProfiles_native_get_num_audio_encoders(JNIEnv* /* env */, jobject /* thiz */) { ALOGV("native_get_num_audio_encoders"); return (jint) sProfiles->getAudioEncoders().size(); } static jobject -android_media_MediaProfiles_native_get_audio_encoder_cap(JNIEnv *env, jobject thiz, jint index) +android_media_MediaProfiles_native_get_audio_encoder_cap(JNIEnv *env, jobject /* thiz */, + jint index) { ALOGV("native_get_audio_encoder_cap: %d", index); Vector<audio_encoder> encoders = sProfiles->getAudioEncoders(); @@ -172,7 +174,8 @@ static bool isCamcorderQualityKnown(int quality) } static jobject -android_media_MediaProfiles_native_get_camcorder_profile(JNIEnv *env, jobject thiz, jint id, jint quality) +android_media_MediaProfiles_native_get_camcorder_profile(JNIEnv *env, jobject /* thiz */, jint id, + jint quality) { ALOGV("native_get_camcorder_profile: %d %d", id, quality); if (!isCamcorderQualityKnown(quality)) { @@ -221,7 +224,8 @@ android_media_MediaProfiles_native_get_camcorder_profile(JNIEnv *env, jobject th } static jboolean -android_media_MediaProfiles_native_has_camcorder_profile(JNIEnv *env, jobject thiz, jint id, jint quality) +android_media_MediaProfiles_native_has_camcorder_profile(JNIEnv* /* env */, jobject /* thiz */, + jint id, jint quality) { ALOGV("native_has_camcorder_profile: %d %d", id, quality); if (!isCamcorderQualityKnown(quality)) { @@ -233,14 +237,15 @@ android_media_MediaProfiles_native_has_camcorder_profile(JNIEnv *env, jobject th } static jint -android_media_MediaProfiles_native_get_num_video_decoders(JNIEnv *env, jobject thiz) +android_media_MediaProfiles_native_get_num_video_decoders(JNIEnv* /* env */, jobject /* thiz */) { ALOGV("native_get_num_video_decoders"); return (jint) sProfiles->getVideoDecoders().size(); } static jint -android_media_MediaProfiles_native_get_video_decoder_type(JNIEnv *env, jobject thiz, jint index) +android_media_MediaProfiles_native_get_video_decoder_type(JNIEnv *env, jobject /* thiz */, + jint index) { ALOGV("native_get_video_decoder_type: %d", index); Vector<video_decoder> decoders = sProfiles->getVideoDecoders(); @@ -254,14 +259,15 @@ android_media_MediaProfiles_native_get_video_decoder_type(JNIEnv *env, jobject t } static jint -android_media_MediaProfiles_native_get_num_audio_decoders(JNIEnv *env, jobject thiz) +android_media_MediaProfiles_native_get_num_audio_decoders(JNIEnv* /* env */, jobject /* thiz */) { ALOGV("native_get_num_audio_decoders"); return (jint) sProfiles->getAudioDecoders().size(); } static jint -android_media_MediaProfiles_native_get_audio_decoder_type(JNIEnv *env, jobject thiz, jint index) +android_media_MediaProfiles_native_get_audio_decoder_type(JNIEnv *env, jobject /* thiz */, + jint index) { ALOGV("native_get_audio_decoder_type: %d", index); Vector<audio_decoder> decoders = sProfiles->getAudioDecoders(); @@ -275,14 +281,17 @@ android_media_MediaProfiles_native_get_audio_decoder_type(JNIEnv *env, jobject t } static jint -android_media_MediaProfiles_native_get_num_image_encoding_quality_levels(JNIEnv *env, jobject thiz, jint cameraId) +android_media_MediaProfiles_native_get_num_image_encoding_quality_levels(JNIEnv* /* env */, + jobject /* thiz */, + jint cameraId) { ALOGV("native_get_num_image_encoding_quality_levels"); return (jint) sProfiles->getImageEncodingQualityLevels(cameraId).size(); } static jint -android_media_MediaProfiles_native_get_image_encoding_quality_level(JNIEnv *env, jobject thiz, jint cameraId, jint index) +android_media_MediaProfiles_native_get_image_encoding_quality_level(JNIEnv *env, jobject /* thiz */, + jint cameraId, jint index) { ALOGV("native_get_image_encoding_quality_level"); Vector<int> levels = sProfiles->getImageEncodingQualityLevels(cameraId); diff --git a/media/jni/android_media_MediaScanner.cpp b/media/jni/android_media_MediaScanner.cpp index 321c2e3..1a9384e 100644 --- a/media/jni/android_media_MediaScanner.cpp +++ b/media/jni/android_media_MediaScanner.cpp @@ -360,7 +360,6 @@ android_media_MediaScanner_extractAlbumArt( env->SetByteArrayRegion(array, 0, mediaAlbumArt->size(), data); } -done: free(mediaAlbumArt); // if NewByteArray() returned NULL, an out-of-memory // exception will have been raised. I just want to diff --git a/media/jni/android_media_ResampleInputStream.cpp b/media/jni/android_media_ResampleInputStream.cpp index d5a4a17..1549a30 100644 --- a/media/jni/android_media_ResampleInputStream.cpp +++ b/media/jni/android_media_ResampleInputStream.cpp @@ -73,7 +73,7 @@ static const int nFir21 = sizeof(fir21) / sizeof(fir21[0]); static const int BUF_SIZE = 2048; -static void android_media_ResampleInputStream_fir21(JNIEnv *env, jclass clazz, +static void android_media_ResampleInputStream_fir21(JNIEnv *env, jclass /* clazz */, jbyteArray jIn, jint jInOffset, jbyteArray jOut, jint jOutOffset, jint jNpoints) { diff --git a/media/jni/android_media_Utils.cpp b/media/jni/android_media_Utils.cpp index 54c5e9b..ea33a2f 100644 --- a/media/jni/android_media_Utils.cpp +++ b/media/jni/android_media_Utils.cpp @@ -136,8 +136,7 @@ static void SetMapInt32( jstring keyObj = env->NewStringUTF(key); jobject valueObj = makeIntegerObject(env, value); - jobject res = env->CallObjectMethod( - hashMapObj, hashMapPutID, keyObj, valueObj); + env->CallObjectMethod(hashMapObj, hashMapPutID, keyObj, valueObj); env->DeleteLocalRef(valueObj); valueObj = NULL; env->DeleteLocalRef(keyObj); keyObj = NULL; @@ -266,8 +265,7 @@ status_t ConvertMessageToMap( if (valueObj != NULL) { jstring keyObj = env->NewStringUTF(key); - jobject res = env->CallObjectMethod( - hashMap, hashMapPutID, keyObj, valueObj); + env->CallObjectMethod(hashMap, hashMapPutID, keyObj, valueObj); env->DeleteLocalRef(keyObj); keyObj = NULL; env->DeleteLocalRef(valueObj); valueObj = NULL; diff --git a/media/jni/android_mtp_MtpDatabase.cpp b/media/jni/android_mtp_MtpDatabase.cpp index 62b4a36..9dda346 100644 --- a/media/jni/android_mtp_MtpDatabase.cpp +++ b/media/jni/android_mtp_MtpDatabase.cpp @@ -762,7 +762,7 @@ MtpResponseCode MyMtpDatabase::getObjectPropertyList(MtpObjectHandle handle, return result; } -static void foreachentry(ExifEntry *entry, void * /*user*/) { +static void foreachentry(ExifEntry *entry, void* /* user */) { char buf[1024]; ALOGI("entry %x, format %d, size %d: %s", entry->tag, entry->format, entry->size, exif_entry_get_value(entry, buf, sizeof(buf))); @@ -780,7 +780,6 @@ static long getLongFromExifEntry(ExifEntry *e) { MtpResponseCode MyMtpDatabase::getObjectInfo(MtpObjectHandle handle, MtpObjectInfo& info) { - char date[20]; MtpString path; int64_t length; MtpObjectFormat format; @@ -808,9 +807,11 @@ MtpResponseCode MyMtpDatabase::getObjectInfo(MtpObjectHandle handle, info.mDateModified = longValues[1]; env->ReleaseLongArrayElements(mLongBuffer, longValues, 0); -// info.mAssociationType = (format == MTP_FORMAT_ASSOCIATION ? -// MTP_ASSOCIATION_TYPE_GENERIC_FOLDER : -// MTP_ASSOCIATION_TYPE_UNDEFINED); + if ((false)) { + info.mAssociationType = (format == MTP_FORMAT_ASSOCIATION ? + MTP_ASSOCIATION_TYPE_GENERIC_FOLDER : + MTP_ASSOCIATION_TYPE_UNDEFINED); + } info.mAssociationType = MTP_ASSOCIATION_TYPE_UNDEFINED; jchar* str = env->GetCharArrayElements(mStringBuffer, 0); @@ -823,7 +824,9 @@ MtpResponseCode MyMtpDatabase::getObjectInfo(MtpObjectHandle handle, ExifData *exifdata = exif_data_new_from_file(path); if (exifdata) { - //exif_data_foreach_content(exifdata, foreachcontent, NULL); + if ((false)) { + exif_data_foreach_content(exifdata, foreachcontent, NULL); + } // XXX get this from exif, or parse jpeg header instead? ExifEntry *w = exif_content_get_entry( diff --git a/media/jni/android_mtp_MtpDevice.cpp b/media/jni/android_mtp_MtpDevice.cpp index 8e013a0..fb15770 100644 --- a/media/jni/android_mtp_MtpDevice.cpp +++ b/media/jni/android_mtp_MtpDevice.cpp @@ -91,14 +91,6 @@ MtpDevice* get_device_from_object(JNIEnv* env, jobject javaDevice) return (MtpDevice*)env->GetLongField(javaDevice, field_context); } -static void checkAndClearExceptionFromCallback(JNIEnv* env, const char* methodName) { - if (env->ExceptionCheck()) { - ALOGE("An exception was thrown by callback '%s'.", methodName); - LOGE_EX(env); - env->ExceptionClear(); - } -} - // ---------------------------------------------------------------------------- static jboolean diff --git a/media/jni/audioeffect/Android.mk b/media/jni/audioeffect/Android.mk index 3b1fb19..5c22c9b 100644 --- a/media/jni/audioeffect/Android.mk +++ b/media/jni/audioeffect/Android.mk @@ -2,20 +2,22 @@ LOCAL_PATH:= $(call my-dir) include $(CLEAR_VARS) LOCAL_SRC_FILES:= \ - android_media_AudioEffect.cpp \ - android_media_Visualizer.cpp + android_media_AudioEffect.cpp \ + android_media_Visualizer.cpp LOCAL_SHARED_LIBRARIES := \ - liblog \ - libcutils \ - libutils \ - libandroid_runtime \ - libnativehelper \ - libmedia + liblog \ + libcutils \ + libutils \ + libandroid_runtime \ + libnativehelper \ + libmedia LOCAL_C_INCLUDES := \ - $(call include-path-for, audio-effects) + $(call include-path-for, audio-effects) LOCAL_MODULE:= libaudioeffect_jni +LOCAL_CFLAGS += -Wall -Werror -Wunused -Wunreachable-code + include $(BUILD_SHARED_LIBRARY) diff --git a/media/jni/audioeffect/android_media_Visualizer.cpp b/media/jni/audioeffect/android_media_Visualizer.cpp index 8463d94..9183ad2 100644 --- a/media/jni/audioeffect/android_media_Visualizer.cpp +++ b/media/jni/audioeffect/android_media_Visualizer.cpp @@ -162,10 +162,6 @@ static void captureCallback(void* user, uint8_t *fft, uint32_t samplingrate) { - int arg1 = 0; - int arg2 = 0; - size_t size; - visualizer_callback_cookie *callbackInfo = (visualizer_callback_cookie *)user; JNIEnv *env = AndroidRuntime::getJNIEnv(); @@ -486,7 +482,7 @@ android_media_visualizer_native_getEnabled(JNIEnv *env, jobject thiz) } static jintArray -android_media_visualizer_native_getCaptureSizeRange(JNIEnv *env, jobject thiz) +android_media_visualizer_native_getCaptureSizeRange(JNIEnv *env, jobject /* thiz */) { jintArray jRange = env->NewIntArray(2); jint *nRange = env->GetIntArrayElements(jRange, NULL); @@ -498,7 +494,7 @@ android_media_visualizer_native_getCaptureSizeRange(JNIEnv *env, jobject thiz) } static jint -android_media_visualizer_native_getMaxCaptureRate(JNIEnv *env, jobject thiz) +android_media_visualizer_native_getMaxCaptureRate(JNIEnv* /* env */, jobject /* thiz */) { return (jint) Visualizer::getMaxCaptureRate(); } diff --git a/media/jni/soundpool/Android.mk b/media/jni/soundpool/Android.mk index ed8d7c1..3382512 100644 --- a/media/jni/soundpool/Android.mk +++ b/media/jni/soundpool/Android.mk @@ -2,16 +2,18 @@ LOCAL_PATH:= $(call my-dir) include $(CLEAR_VARS) LOCAL_SRC_FILES:= \ - android_media_SoundPool_SoundPoolImpl.cpp + android_media_SoundPool_SoundPoolImpl.cpp LOCAL_SHARED_LIBRARIES := \ - liblog \ - libcutils \ - libutils \ - libandroid_runtime \ - libnativehelper \ - libmedia + liblog \ + libcutils \ + libutils \ + libandroid_runtime \ + libnativehelper \ + libmedia LOCAL_MODULE:= libsoundpool +LOCAL_CFLAGS += -Wall -Werror -Wunused -Wunreachable-code + include $(BUILD_SHARED_LIBRARY) diff --git a/media/jni/soundpool/android_media_SoundPool_SoundPoolImpl.cpp b/media/jni/soundpool/android_media_SoundPool_SoundPoolImpl.cpp index 89b2893..ce20e52 100644 --- a/media/jni/soundpool/android_media_SoundPool_SoundPoolImpl.cpp +++ b/media/jni/soundpool/android_media_SoundPool_SoundPoolImpl.cpp @@ -312,7 +312,7 @@ static JNINativeMethod gMethods[] = { static const char* const kClassPathName = "android/media/SoundPool$SoundPoolImpl"; -jint JNI_OnLoad(JavaVM* vm, void* reserved) +jint JNI_OnLoad(JavaVM* vm, void* /* reserved */) { JNIEnv* env = NULL; jint result = -1; |