[vlc-commits] keystore: keychain: fix warnings

Alexandre Janniaux git at videolan.org
Wed Jul 22 15:28:07 CEST 2020


vlc | branch: master | Alexandre Janniaux <ajanni at videolabs.io> | Mon Jul 13 09:36:06 2020 +0200| [9659001c78fd2b9073a9a92d78865d5974eb7b80] | committer: Alexandre Janniaux

keystore: keychain: fix warnings

../../../modules/keystore/keychain.m:431:58: warning: values of type 'OSStatus' should not be used as format arguments; add an explicit
      cast to 'int' instead [-Wformat]
        msg_Err(p_keystore, "Storage failed (%i: '%s')", status, [ErrorForStatus(status) UTF8String]);
                                             ~~          ^~~~~~
                                             %i          (int)
../../../include/vlc_messages.h:102:38: note: expanded from macro 'msg_Err'
    msg_Generic(p_this, VLC_MSG_ERR, __VA_ARGS__)
                                     ^~~~~~~~~~~
../../../include/vlc_messages.h:98:30: note: expanded from macro 'msg_Generic'
                   __func__, __VA_ARGS__)
                             ^~~~~~~~~~~
../../../modules/keystore/keychain.m:459:58: warning: values of type 'OSStatus' should not be used as format arguments; add an explicit
      cast to 'int' instead [-Wformat]
        msg_Warn(p_keystore, "lookup failed (%i: '%s')", status, [ErrorForStatus(status) UTF8String]);
                                             ~~          ^~~~~~
                                             %i          (int)
../../../include/vlc_messages.h:104:39: note: expanded from macro 'msg_Warn'
    msg_Generic(p_this, VLC_MSG_WARN, __VA_ARGS__)
                                      ^~~~~~~~~~~
../../../include/vlc_messages.h:98:30: note: expanded from macro 'msg_Generic'
                   __func__, __VA_ARGS__)
                             ^~~~~~~~~~~
../../../modules/keystore/keychain.m:465:76: warning: values of type 'NSUInteger' should not be used as format arguments; add an
      explicit cast to 'unsigned long' instead [-Wformat]
    msg_Dbg(p_keystore, "found %lu result(s) for the provided attributes", count);
                               ~~~                                         ^~~~~
                               %lu                                         (unsigned long)
../../../include/vlc_messages.h:106:38: note: expanded from macro 'msg_Dbg'
    msg_Generic(p_this, VLC_MSG_DBG, __VA_ARGS__)
                                     ^~~~~~~~~~~
../../../include/vlc_messages.h:98:30: note: expanded from macro 'msg_Generic'
                   __func__, __VA_ARGS__)
                             ^~~~~~~~~~~
../../../modules/keystore/keychain.m:492:58: warning: values of type 'OSStatus' should not be used as format arguments; add an explicit
      cast to 'int' instead [-Wformat]
            msg_Err(p_keystore, "Lookup error: %i (%s)", status, [ErrorForStatus(status) UTF8String]);
                                               ~~        ^~~~~~
                                               %i        (int)
../../../include/vlc_messages.h:102:38: note: expanded from macro 'msg_Err'
    msg_Generic(p_this, VLC_MSG_ERR, __VA_ARGS__)
                                     ^~~~~~~~~~~
../../../include/vlc_messages.h:98:30: note: expanded from macro 'msg_Generic'
                   __func__, __VA_ARGS__)
                             ^~~~~~~~~~~
../../../modules/keystore/keychain.m:538:58: warning: values of type 'OSStatus' should not be used as format arguments; add an explicit
      cast to 'int' instead [-Wformat]
  CC       mux/dummy.lo
        msg_Warn(p_keystore, "lookup failed (%i: '%s')", status, [ErrorForStatus(status) UTF8String]);
                                             ~~          ^~~~~~
                                             %i          (int)
../../../include/vlc_messages.h:104:39: note: expanded from macro 'msg_Warn'
    msg_Generic(p_this, VLC_MSG_WARN, __VA_ARGS__)
                                      ^~~~~~~~~~~
../../../include/vlc_messages.h:98:30: note: expanded from macro 'msg_Generic'
                   __func__, __VA_ARGS__)
                             ^~~~~~~~~~~
../../../modules/keystore/keychain.m:544:76: warning: values of type 'NSUInteger' should not be used as format arguments; add an
      explicit cast to 'unsigned long' instead [-Wformat]
    msg_Dbg(p_keystore, "found %lu result(s) for the provided attributes", count);
                               ~~~                                         ^~~~~
                               %lu                                         (unsigned long)
../../../include/vlc_messages.h:106:38: note: expanded from macro 'msg_Dbg'
    msg_Generic(p_this, VLC_MSG_DBG, __VA_ARGS__)
                                     ^~~~~~~~~~~
../../../include/vlc_messages.h:98:30: note: expanded from macro 'msg_Generic'
                   __func__, __VA_ARGS__)
                             ^~~~~~~~~~~

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=9659001c78fd2b9073a9a92d78865d5974eb7b80
---

 modules/keystore/keychain.m | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/modules/keystore/keychain.m b/modules/keystore/keychain.m
index 353f152c93..f5ccf36b63 100644
--- a/modules/keystore/keychain.m
+++ b/modules/keystore/keychain.m
@@ -428,7 +428,7 @@ static int Store(vlc_keystore *p_keystore,
         status = SecItemAdd((__bridge CFDictionaryRef)query, NULL);
     }
     if (status != errSecSuccess) {
-        msg_Err(p_keystore, "Storage failed (%i: '%s')", status, [ErrorForStatus(status) UTF8String]);
+        msg_Err(p_keystore, "Storage failed (%i: '%s')", (int)status, [ErrorForStatus(status) UTF8String]);
         return VLC_EGENERIC;
     }
 
@@ -462,7 +462,7 @@ static unsigned int Find(vlc_keystore *p_keystore,
 
     NSArray *listOfResults = (__bridge_transfer NSArray *)result;
     NSUInteger count = listOfResults.count;
-    msg_Dbg(p_keystore, "found %lu result(s) for the provided attributes", count);
+    msg_Dbg(p_keystore, "found %lu result(s) for the provided attributes", (unsigned long)count);
 
     vlc_keystore_entry *p_entries = calloc(count,
                                            sizeof(vlc_keystore_entry));
@@ -489,7 +489,7 @@ static unsigned int Find(vlc_keystore *p_keystore,
         CFTypeRef secretResult = NULL;
         status = SecItemCopyMatching((__bridge CFDictionaryRef)passwordFetchQuery, &secretResult);
         if (status != noErr) {
-            msg_Err(p_keystore, "Lookup error: %i (%s)", status, [ErrorForStatus(status) UTF8String]);
+            msg_Err(p_keystore, "Lookup error: %i (%s)", (int)status, [ErrorForStatus(status) UTF8String]);
             vlc_keystore_release_entries(p_entries, (unsigned int)count);
             return 0;
         }
@@ -535,13 +535,14 @@ static unsigned int Remove(vlc_keystore *p_keystore,
     /* do a copy matching to see how many items we are going to delete */
     status = SecItemCopyMatching((__bridge CFDictionaryRef)query, &result);
     if (status != errSecSuccess) {
-        msg_Warn(p_keystore, "lookup failed (%i: '%s')", status, [ErrorForStatus(status) UTF8String]);
+        msg_Warn(p_keystore, "lookup failed (%i: '%s')", (int)status, [ErrorForStatus(status) UTF8String]);
         return 0;
     }
 
     NSArray *listOfResults = (__bridge_transfer NSArray *)result;
     NSUInteger count = listOfResults.count;
-    msg_Dbg(p_keystore, "found %lu result(s) for the provided attributes", count);
+    msg_Dbg(p_keystore, "found %lu result(s) for the provided attributes",
+            (unsigned long)count);
 
     /* delete everything!! */
     status = SecItemDelete((__bridge CFDictionaryRef)query);



More information about the vlc-commits mailing list