Make the instruction table be const
authorThiago Macieira <thiago.macieira@intel.com>
Sun, 26 Aug 2012 15:15:00 +0000 (17:15 +0200)
committerQt by Nokia <qt-info@nokia.com>
Thu, 13 Sep 2012 17:52:51 +0000 (19:52 +0200)
It's never going to be modified, so it should be const.

Change-Id: Ibc3bac0583f72ccbf7caa69aeab029bae03d3cdd
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
src/qml/qml/qqmlcompileddata.cpp
src/qml/qml/qqmlvme.cpp
src/qml/qml/qqmlvme_p.h

index 49f0094..c2ca079 100644 (file)
@@ -215,7 +215,7 @@ QQmlInstruction *QQmlCompiledData::instruction(int index)
 QQmlInstruction::Type QQmlCompiledData::instructionType(const QQmlInstruction *instr)
 {
 #ifdef QML_THREADED_VME_INTERPRETER
-    void **jumpTable = QQmlVME::instructionJumpTable();
+    void *const *jumpTable = QQmlVME::instructionJumpTable();
     void *code = instr->common.code;
 
 #  define QML_CHECK_INSTR_CODE(I, FMT) \
index 1f12af3..9b550c5 100644 (file)
@@ -316,14 +316,14 @@ static QVariant variantFromString(const QString &string)
 QObject *QQmlVME::run(QList<QQmlError> *errors,
                               const Interrupt &interrupt
 #ifdef QML_THREADED_VME_INTERPRETER
-                              , void ***storeJumpTable
+                              , void * const **storeJumpTable
 #endif
                               )
 {
 #ifdef QML_THREADED_VME_INTERPRETER
     if (storeJumpTable) {
 #define QML_INSTR_ADDR(I, FMT) &&op_##I,
-        static void *jumpTable[] = {
+        static void *const jumpTable[] = {
             FOR_EACH_QML_INSTR(QML_INSTR_ADDR)
         };
 #undef QML_INSTR_ADDR
@@ -1263,9 +1263,9 @@ v8::Persistent<v8::Object> QQmlVME::run(QQmlContextData *parentCtxt, QQmlScriptD
 }
 
 #ifdef QML_THREADED_VME_INTERPRETER
-void **QQmlVME::instructionJumpTable()
+void *const *QQmlVME::instructionJumpTable()
 {
-    static void **jumpTable = 0;
+    static void * const *jumpTable = 0;
     if (!jumpTable) {
         QQmlVME dummy;
         QQmlVME::Interrupt i;
index 4d49b79..ab9d1fa 100644 (file)
@@ -132,13 +132,13 @@ private:
 
     QObject *run(QList<QQmlError> *errors, const Interrupt &
 #ifdef QML_THREADED_VME_INTERPRETER
-                 , void ***storeJumpTable = 0
+                 , void *const**storeJumpTable = 0
 #endif
                 );
     v8::Persistent<v8::Object> run(QQmlContextData *, QQmlScriptData *);
 
 #ifdef QML_THREADED_VME_INTERPRETER
-    static void **instructionJumpTable();
+    static void *const*instructionJumpTable();
     friend class QQmlCompiledData;
 #endif