diff options
author | Arnaud Versini <arnaud.versini@libreoffice.org> | 2020-12-26 13:46:52 +0100 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-12-27 07:52:20 +0100 |
commit | 4be5308c05d8078b20fc9b14d961c53b0ede193a (patch) | |
tree | 92c4e72cd9150e10d49024b165b6d30a1671c8e3 /basic | |
parent | b329ff293f137770c94c882b959ed362e0cb7d95 (diff) |
BASIC : SbiRuntime static data should be const
Change-Id: If8c221a2bfb249a6625df4b466fe5247b7a8ae72
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108355
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'basic')
-rw-r--r-- | basic/source/inc/runtime.hxx | 6 | ||||
-rw-r--r-- | basic/source/runtime/runtime.cxx | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/basic/source/inc/runtime.hxx b/basic/source/inc/runtime.hxx index 3262dec7ce0d..1169820e753b 100644 --- a/basic/source/inc/runtime.hxx +++ b/basic/source/inc/runtime.hxx @@ -208,9 +208,9 @@ class SbiRuntime typedef void( SbiRuntime::*pStep0 )(); typedef void( SbiRuntime::*pStep1 )( sal_uInt32 nOp1 ); typedef void( SbiRuntime::*pStep2 )( sal_uInt32 nOp1, sal_uInt32 nOp2 ); - static pStep0 aStep0[]; // opcode-table group 0 - static pStep1 aStep1[]; - static pStep2 aStep2[]; + static const pStep0 aStep0[]; // opcode-table group 0 + static const pStep1 aStep1[]; + static const pStep2 aStep2[]; StarBASIC& rBasic; // StarBASIC instance SbiInstance* pInst; // current thread diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx index 3ceaf38cafc7..aecf2f7f9a3d 100644 --- a/basic/source/runtime/runtime.cxx +++ b/basic/source/runtime/runtime.cxx @@ -157,7 +157,7 @@ struct SbiGosub { // GOSUB-Stack: nStartForLvl(nStartForLvl_) {} }; -SbiRuntime::pStep0 SbiRuntime::aStep0[] = { // all opcodes without operands +const SbiRuntime::pStep0 SbiRuntime::aStep0[] = { // all opcodes without operands &SbiRuntime::StepNOP, &SbiRuntime::StepEXP, &SbiRuntime::StepMUL, @@ -226,7 +226,7 @@ SbiRuntime::pStep0 SbiRuntime::aStep0[] = { // all opcodes without operands &SbiRuntime::StepBYVAL, // access TOS as array }; -SbiRuntime::pStep1 SbiRuntime::aStep1[] = { // all opcodes with one operand +const SbiRuntime::pStep1 SbiRuntime::aStep1[] = { // all opcodes with one operand &SbiRuntime::StepLOADNC, // loading a numeric constant (+ID) &SbiRuntime::StepLOADSC, // loading a string constant (+ID) &SbiRuntime::StepLOADI, // Immediate Load (+value) @@ -255,7 +255,7 @@ SbiRuntime::pStep1 SbiRuntime::aStep1[] = { // all opcodes with one operand &SbiRuntime::StepVBASETCLASS,// vba-like set statement }; -SbiRuntime::pStep2 SbiRuntime::aStep2[] = {// all opcodes with two operands +const SbiRuntime::pStep2 SbiRuntime::aStep2[] = {// all opcodes with two operands &SbiRuntime::StepRTL, // load from RTL (+StringID+Typ) &SbiRuntime::StepFIND, // load (+StringID+Typ) &SbiRuntime::StepELEM, // load element (+StringID+Typ) |