[Libreoffice-commits] .: extensions/source

Michael Meeks mmeeks at kemper.freedesktop.org
Sat Oct 16 12:57:46 PDT 2010


 extensions/source/scanner/sane.cxx |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 0fd4fdfa8e6536fb27f43dcd09766dcf9c7dce78
Author: Kenneth Venken <kenneth.venken at gmail.com>
Date:   Sat Oct 16 20:56:57 2010 +0100

    some patches that replace sizeof(a)/sizeof(a[0]) with SAL_N_ELEMENTS(a)

diff --git a/extensions/source/scanner/sane.cxx b/extensions/source/scanner/sane.cxx
index 35c4ab8..717cf4c 100644
--- a/extensions/source/scanner/sane.cxx
+++ b/extensions/source/scanner/sane.cxx
@@ -39,6 +39,7 @@
 #include <sys/time.h>
 #include <sys/types.h>
 #include <sal/config.h>
+#include <sal/macros.h>
 
 #if (OSL_DEBUG_LEVEL > 1) || defined DBG_UTIL
 #include <stdarg.h>
@@ -989,7 +990,7 @@ String Sane::GetOptionUnitName( int n )
     String aText;
     SANE_Unit nUnit = mppOptions[n]->unit;
     size_t nUnitAsSize = (size_t)nUnit;
-    if( nUnitAsSize > sizeof( ppUnits )/sizeof( ppUnits[0] ) )
+    if( nUnitAsSize > SAL_N_ELEMENTS( ppUnits ) )
         aText = String::CreateFromAscii( "[unknown units]" );
     else
         aText = String( ppUnits[ nUnit ], gsl_getSystemTextEncoding() );


More information about the Libreoffice-commits mailing list