[Libreoffice-commits] .: mysqlc/source sdext/source

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


 mysqlc/source/mysqlc_databasemetadata.cxx        |    3 ++-
 sdext/source/pdfimport/xpdfwrapper/pnghelper.cxx |    3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 0d8c6e022fbb87ace5dfdfebdc18049d12483f78
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/mysqlc/source/mysqlc_databasemetadata.cxx b/mysqlc/source/mysqlc_databasemetadata.cxx
index 27d976c..498ed77 100644
--- a/mysqlc/source/mysqlc_databasemetadata.cxx
+++ b/mysqlc/source/mysqlc_databasemetadata.cxx
@@ -62,6 +62,7 @@ using mysqlc_sdbc_driver::getStringFromAny;
 #include <cppconn/statement.h>
 #include <cppconn/prepared_statement.h>
 #include <postextstl.h>
+#include <sal/macros.h>
 
 static ext_std::string wild("%");
 
@@ -2106,7 +2107,7 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTablePrivileges(
                 "ALTER", "DELETE", "DROP", "INDEX", "INSERT", "LOCK TABLES", "SELECT", "UPDATE"
             };
             Any userName; userName <<= getUserName();
-            for (size_t i = 0; i < sizeof( allPrivileges ) / sizeof( allPrivileges[0]); ++i) {
+            for (size_t i = 0; i < SAL_N_ELEMENTS( allPrivileges ); ++i) {
                 std::vector< Any > aRow;
                 aRow.push_back(makeAny( sal_Int32( i ) ));
                 aRow.push_back(catalog);                                                          // TABLE_CAT
diff --git a/sdext/source/pdfimport/xpdfwrapper/pnghelper.cxx b/sdext/source/pdfimport/xpdfwrapper/pnghelper.cxx
index ec1517e..8bf3952 100644
--- a/sdext/source/pdfimport/xpdfwrapper/pnghelper.cxx
+++ b/sdext/source/pdfimport/xpdfwrapper/pnghelper.cxx
@@ -30,6 +30,7 @@
  ************************************************************************/
 
 #include "pnghelper.hxx"
+#include <sal/macros.h>
 
 #ifdef SYSTEM_ZLIB
 #include "zlib.h"
@@ -132,7 +133,7 @@ void PngHelper::appendFileHeader( OutputBuffer& o_rOutputBuf )
 {
     static const Output_t aHeader[] = { 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a };
 
-    o_rOutputBuf.insert( o_rOutputBuf.end(), aHeader, aHeader + sizeof(aHeader)/sizeof(aHeader[0]) );
+    o_rOutputBuf.insert( o_rOutputBuf.end(), aHeader, aHeader + SAL_N_ELEMENTS(aHeader) );
 }
 
 size_t PngHelper::startChunk( const char* pChunkName, OutputBuffer& o_rOutputBuf )


More information about the Libreoffice-commits mailing list