summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2017-07-07 17:11:57 +0200
committerStephan Bergmann <sbergman@redhat.com>2017-07-13 10:37:53 +0200
commit4e451cad214edec7caa1af1f25048bb7045ce905 (patch)
tree9a939286c5c537e5aeaf6c624c2964727b82ec1f /basic
parente3f3b3b75d7411827291e98c9c78c89cedc2836b (diff)
loplugin:oncevar for value-dependent constant expressions
(Where the change to basic/source/comp/codegen.cxx reveals that loplugin:loopvartoosmall also needs the Clang < 3.9 workaround from 33ee8e61292af05627f5f72ea2f93ad80e715e46 "Work around bug in Clang 3.8".) Change-Id: I9f23b9648bc11ca4136a0fbdd332570ba70ee77c Reviewed-on: https://gerrit.libreoffice.org/39667 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'basic')
-rw-r--r--basic/source/comp/codegen.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/basic/source/comp/codegen.cxx b/basic/source/comp/codegen.cxx
index 384344e2f9b1..64791af66671 100644
--- a/basic/source/comp/codegen.cxx
+++ b/basic/source/comp/codegen.cxx
@@ -22,6 +22,7 @@
#include "image.hxx"
#include "codegen.hxx"
#include "parser.hxx"
+#include <cstddef>
#include <limits>
#include <algorithm>
#include <osl/diagnose.h>
@@ -408,9 +409,8 @@ private:
const sal_uInt8* m_pCode;
static T readParam( sal_uInt8 const *& pCode )
{
- short nBytes = sizeof( T );
T nOp1=0;
- for ( int i=0; i<nBytes; ++i )
+ for ( std::size_t i=0; i<sizeof( T ); ++i )
nOp1 |= *pCode++ << ( i * 8);
return nOp1;
}