[Android] Code cosmetics and warnings

Jean-Baptiste Kempf git at videolan.org
Sun Apr 15 18:08:37 CEST 2012


android | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Sun Apr 15 17:55:50 2012 +0200| [7fa16911ffd72f92a604ba3990d53abf8ad47b92] | committer: Jean-Baptiste Kempf

Code cosmetics and warnings

> http://git.videolan.org/gitweb.cgi/android.git/?a=commit;h=7fa16911ffd72f92a604ba3990d53abf8ad47b92
---

 vlc-android/jni/libvlcjni.c   |    5 ++---
 vlc-android/jni/thumbnailer.c |    7 +++----
 2 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/vlc-android/jni/libvlcjni.c b/vlc-android/jni/libvlcjni.c
index d2c6af3..eb63b4c 100644
--- a/vlc-android/jni/libvlcjni.c
+++ b/vlc-android/jni/libvlcjni.c
@@ -392,7 +392,7 @@ jobjectArray Java_org_videolan_vlc_LibVLC_readMediaMeta(JNIEnv *env,
     if (!m)
     {
         LOGE("readMediaMeta: Couldn't create the media!");
-        return;
+        return array;
     }
 
     libvlc_media_parse(m);
@@ -406,8 +406,7 @@ jobjectArray Java_org_videolan_vlc_LibVLC_readMediaMeta(JNIEnv *env,
         libvlc_meta_Title,
         libvlc_meta_Genre,
     };
-    int i;
-    for (i=0; i < sizeof(str) / sizeof(*str); i++) {
+    for (int i=0; i < sizeof(str) / sizeof(*str); i++) {
         char *meta = libvlc_media_get_meta(m, meta_id[i]);
         if (!meta)
             meta = strdup("");
diff --git a/vlc-android/jni/thumbnailer.c b/vlc-android/jni/thumbnailer.c
index 515d5d8..a4aa194 100644
--- a/vlc-android/jni/thumbnailer.c
+++ b/vlc-android/jni/thumbnailer.c
@@ -92,8 +92,7 @@ static void thumbnailer_unlock(void *opaque, void *picture, void *const *pixels)
     const char *dataSrc = sys->frameData;
     char *dataDest = sys->thumbnail + sys->thumbnailOffset;
     /* Copy the thumbnail. */
-    unsigned i;
-    for (i = 0; i < sys->nbLines; ++i)
+    for (unsigned i = 0; i < sys->nbLines; ++i)
     {
         memcpy(dataDest, dataSrc, sys->picPitch);
         dataDest += sys->lineSize;
@@ -152,9 +151,9 @@ jbyteArray Java_org_videolan_vlc_LibVLC_getThumbnail(JNIEnv *env, jobject thiz,
     libvlc_media_parse(m);
     int nbTracks = libvlc_media_get_tracks_info(m, &tracks);
 
-    unsigned i, videoWidth, videoHeight;
+    unsigned videoWidth, videoHeight;
     bool hasVideoTrack = false;
-    for (i = 0; i < nbTracks; ++i)
+    for (unsigned i = 0; i < nbTracks; ++i)
         if (tracks[i].i_type == libvlc_track_video)
         {
             videoWidth = tracks[i].u.video.i_width;



More information about the Android mailing list