From 31fd67376ecc3b20b60d6c60eea0e01c1a9992e5 Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Thu, 1 Aug 2019 03:46:09 +0200 Subject: Sometimes static checks are enough. Change-Id: I61e7a28c5beab8f0c619767545009cefae6ddcd9 Reviewed-on: https://gerrit.libreoffice.org/76772 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- sal/osl/w32/file_url.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'sal/osl/w32') 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 ); -- cgit