[Libreoffice-commits] core.git: sal/osl

Mike Kaganski (via logerrit) logerrit at kemper.freedesktop.org
Thu Aug 1 02:37:08 UTC 2019


 sal/osl/w32/file_url.cxx |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 31fd67376ecc3b20b60d6c60eea0e01c1a9992e5
Author:     Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Thu Aug 1 03:46:09 2019 +0200
Commit:     Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Thu Aug 1 04:36:33 2019 +0200

    Sometimes static checks are enough.
    
    Change-Id: I61e7a28c5beab8f0c619767545009cefae6ddcd9
    Reviewed-on: https://gerrit.libreoffice.org/76772
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>

diff --git a/sal/osl/w32/file_url.cxx b/sal/osl/w32/file_url.cxx
index 9ff2f95568af..65bcd70552ed 100644
--- a/sal/osl/w32/file_url.cxx
+++ b/sal/osl/w32/file_url.cxx
@@ -818,7 +818,8 @@ oslFileError osl_getFileURLFromSystemPath( rtl_uString* strPath, rtl_uString** p
             {
                 case PATHTYPE_ABSOLUTE_UNC:
                     nIgnore = SAL_N_ELEMENTS( WSTR_LONG_PATH_PREFIX_UNC ) - 1;
-                    OSL_ENSURE( nIgnore == 8, "Unexpected long path UNC prefix!" );
+                    static_assert(SAL_N_ELEMENTS(WSTR_LONG_PATH_PREFIX_UNC) - 1 == 8,
+                                  "Unexpected long path UNC prefix!");
 
                     /* generate the normal UNC path */
                     nLength = rtl_uString_getLength( strPath );
@@ -831,7 +832,8 @@ oslFileError osl_getFileURLFromSystemPath( rtl_uString* strPath, rtl_uString** p
 
                 case PATHTYPE_ABSOLUTE_LOCAL:
                     nIgnore = SAL_N_ELEMENTS( WSTR_LONG_PATH_PREFIX ) - 1;
-                    OSL_ENSURE( nIgnore == 4, "Unexpected long path prefix!" );
+                    static_assert(SAL_N_ELEMENTS(WSTR_LONG_PATH_PREFIX) - 1 == 4,
+                                  "Unexpected long path prefix!");
 
                     /* generate the normal path */
                     nLength = rtl_uString_getLength( strPath );


More information about the Libreoffice-commits mailing list