[vlc-devel] [PATCH 5/9] win32: dirs-uap: fix indentation

Steve Lhomme robux4 at ycbcr.xyz
Mon Apr 6 13:35:03 CEST 2020


---
 src/win32/dirs-uap.c | 69 +++++++++++++++++++++-----------------------
 1 file changed, 33 insertions(+), 36 deletions(-)

diff --git a/src/win32/dirs-uap.c b/src/win32/dirs-uap.c
index 20a722ef898..f35839a203a 100644
--- a/src/win32/dirs-uap.c
+++ b/src/win32/dirs-uap.c
@@ -76,49 +76,46 @@ static char *config_GetShellDir(vlc_userdir_t csidl)
     HRESULT hr;
     IStorageFolder *folder = NULL;
 
-    {
-        IKnownFoldersStatics *knownFoldersStatics = NULL;
-        static const WCHAR *className = L"Windows.Storage.KnownFolders";
-        const UINT32 clen = wcslen(className);
+    IKnownFoldersStatics *knownFoldersStatics = NULL;
+    static const WCHAR *className = L"Windows.Storage.KnownFolders";
+    const UINT32 clen = wcslen(className);
 
-        HSTRING hClassName = NULL;
-        HSTRING_HEADER header;
-        hr = WindowsCreateStringReference(className, clen, &header, &hClassName);
-        if (FAILED(hr))
-            goto end_other;
+    HSTRING hClassName = NULL;
+    HSTRING_HEADER header;
+    hr = WindowsCreateStringReference(className, clen, &header, &hClassName);
+    if (FAILED(hr))
+        goto end_other;
 
-        hr = RoGetActivationFactory(hClassName, &IID_IKnownFoldersStatics, (void**)&knownFoldersStatics);
+    hr = RoGetActivationFactory(hClassName, &IID_IKnownFoldersStatics, (void**)&knownFoldersStatics);
 
-        if (FAILED(hr))
-            goto end_other;
+    if (FAILED(hr))
+        goto end_other;
 
-        if (!knownFoldersStatics) {
-            hr = E_FAIL;
-            goto end_other;
-        }
+    if (!knownFoldersStatics) {
+        hr = E_FAIL;
+        goto end_other;
+    }
 
-        switch (csidl) {
-        case VLC_HOME_DIR:
-            hr = IKnownFoldersStatics_get_DocumentsLibrary(knownFoldersStatics, &folder);
-            break;
-        case VLC_MUSIC_DIR:
-            hr = IKnownFoldersStatics_get_MusicLibrary(knownFoldersStatics, &folder);
-            break;
-        case VLC_PICTURES_DIR:
-            hr = IKnownFoldersStatics_get_PicturesLibrary(knownFoldersStatics, &folder);
-            break;
-        case VLC_VIDEOS_DIR:
-            hr = IKnownFoldersStatics_get_VideosLibrary(knownFoldersStatics, &folder);
-            break;
-        default:
-            hr = E_NOTIMPL;
-        }
+    switch (csidl) {
+    case VLC_HOME_DIR:
+        hr = IKnownFoldersStatics_get_DocumentsLibrary(knownFoldersStatics, &folder);
+        break;
+    case VLC_MUSIC_DIR:
+        hr = IKnownFoldersStatics_get_MusicLibrary(knownFoldersStatics, &folder);
+        break;
+    case VLC_PICTURES_DIR:
+        hr = IKnownFoldersStatics_get_PicturesLibrary(knownFoldersStatics, &folder);
+        break;
+    case VLC_VIDEOS_DIR:
+        hr = IKnownFoldersStatics_get_VideosLibrary(knownFoldersStatics, &folder);
+        break;
+    default: vlc_assert_unreachable();
+    }
 
 end_other:
-        WindowsDeleteString(hClassName);
-        if (knownFoldersStatics)
-            IKnownFoldersStatics_Release(knownFoldersStatics);
-    }
+    WindowsDeleteString(hClassName);
+    if (knownFoldersStatics)
+        IKnownFoldersStatics_Release(knownFoldersStatics);
 
     if( FAILED(hr) || folder == NULL )
         return NULL;
-- 
2.17.1



More information about the vlc-devel mailing list