diff options
author | Friedemann Kleint <Friedemann.Kleint@nokia.com> | 2012-04-30 14:54:56 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-04-30 15:15:34 +0200 |
commit | 8879cbba5915a60ed8b655169cfc8068802499bb (patch) | |
tree | e51c42b8ca4e0eb30e4f48675819213b2e36de38 /src | |
parent | ff41368749e3534cddc534ab58a891b2c07ce02f (diff) | |
download | qtscript-8879cbba5915a60ed8b655169cfc8068802499bb.tar.gz |
Fix some deprecation warnings in QtScript.
Change-Id: I98d4826fcc2e3687d45edfccca956891ca0466cf
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/script/api/qscriptengine.cpp | 4 | ||||
-rw-r--r-- | src/script/api/qscriptengine_p.h | 10 | ||||
-rw-r--r-- | src/script/parser/qscriptparser_p.h | 8 | ||||
-rw-r--r-- | src/script/parser/qscriptsyntaxchecker.cpp | 4 | ||||
-rw-r--r-- | src/script/parser/qscriptsyntaxchecker_p.h | 4 | ||||
-rw-r--r-- | src/scripttools/debugging/qscriptdebugger.cpp | 8 |
6 files changed, 24 insertions, 14 deletions
diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp index f3c63ba..c14f3ce 100644 --- a/src/script/api/qscriptengine.cpp +++ b/src/script/api/qscriptengine.cpp @@ -78,6 +78,8 @@ #include "qscriptextensioninterface.h" #endif +#include <stdlib.h> + Q_DECLARE_METATYPE(QScriptValue) #ifndef QT_NO_QOBJECT Q_DECLARE_METATYPE(QObjectList) @@ -1035,7 +1037,7 @@ QScriptEnginePrivate::~QScriptEnginePrivate() while (freeScriptValues) { QScriptValuePrivate *p = freeScriptValues; freeScriptValues = p->next; - qFree(p); + free(p); } } diff --git a/src/script/api/qscriptengine_p.h b/src/script/api/qscriptengine_p.h index e41c5d5..526fb1d 100644 --- a/src/script/api/qscriptengine_p.h +++ b/src/script/api/qscriptengine_p.h @@ -67,6 +67,8 @@ #include "JSGlobalObject.h" #include "JSValue.h" +#include <stdlib.h> + namespace JSC { class EvalExecutable; @@ -595,7 +597,7 @@ inline QScriptValuePrivate *QScriptEnginePrivate::allocateScriptValuePrivate(siz --freeScriptValuesCount; return p; } - return reinterpret_cast<QScriptValuePrivate*>(qMalloc(size)); + return reinterpret_cast<QScriptValuePrivate*>(malloc(size)); } inline void QScriptEnginePrivate::freeScriptValuePrivate(QScriptValuePrivate *p) @@ -605,7 +607,7 @@ inline void QScriptEnginePrivate::freeScriptValuePrivate(QScriptValuePrivate *p) freeScriptValues = p; ++freeScriptValuesCount; } else { - qFree(p); + free(p); } } @@ -794,7 +796,7 @@ inline void* QScriptValuePrivate::operator new(size_t size, QScriptEnginePrivate { if (engine) return engine->allocateScriptValuePrivate(size); - return qMalloc(size); + return malloc(size); } inline void QScriptValuePrivate::operator delete(void *ptr) @@ -803,7 +805,7 @@ inline void QScriptValuePrivate::operator delete(void *ptr) if (d->engine) d->engine->freeScriptValuePrivate(d); else - qFree(d); + free(d); } inline void QScriptEnginePrivate::saveException(JSC::ExecState *exec, JSC::JSValue *val) diff --git a/src/script/parser/qscriptparser_p.h b/src/script/parser/qscriptparser_p.h index eaa944c..76ba812 100644 --- a/src/script/parser/qscriptparser_p.h +++ b/src/script/parser/qscriptparser_p.h @@ -47,6 +47,8 @@ #include "qscriptastfwd_p.h" +#include <stdlib.h> + QT_BEGIN_NAMESPACE class QString; @@ -131,9 +133,9 @@ inline void QScriptParser::reallocateStack() else stack_size <<= 1; - sym_stack = reinterpret_cast<Value*> (qRealloc(sym_stack, stack_size * sizeof(Value))); - state_stack = reinterpret_cast<int*> (qRealloc(state_stack, stack_size * sizeof(int))); - location_stack = reinterpret_cast<Location*> (qRealloc(location_stack, stack_size * sizeof(Location))); + sym_stack = reinterpret_cast<Value*> (realloc(sym_stack, stack_size * sizeof(Value))); + state_stack = reinterpret_cast<int*> (realloc(state_stack, stack_size * sizeof(int))); + location_stack = reinterpret_cast<Location*> (realloc(location_stack, stack_size * sizeof(Location))); } diff --git a/src/script/parser/qscriptsyntaxchecker.cpp b/src/script/parser/qscriptsyntaxchecker.cpp index 30ac952..03eccaf 100644 --- a/src/script/parser/qscriptsyntaxchecker.cpp +++ b/src/script/parser/qscriptsyntaxchecker.cpp @@ -26,6 +26,8 @@ #include "qscriptlexer_p.h" #include "qscriptparser_p.h" +#include <stdlib.h> + QT_BEGIN_NAMESPACE namespace QScript { @@ -41,7 +43,7 @@ SyntaxChecker::SyntaxChecker(): SyntaxChecker::~SyntaxChecker() { if (stack_size) { - qFree(state_stack); + free(state_stack); } } diff --git a/src/script/parser/qscriptsyntaxchecker_p.h b/src/script/parser/qscriptsyntaxchecker_p.h index 7057bec..a3dee6a 100644 --- a/src/script/parser/qscriptsyntaxchecker_p.h +++ b/src/script/parser/qscriptsyntaxchecker_p.h @@ -39,6 +39,8 @@ #include "qscriptgrammar_p.h" +#include <stdlib.h> + QT_BEGIN_NAMESPACE namespace QScript { @@ -86,7 +88,7 @@ inline void SyntaxChecker::reallocateStack() else stack_size <<= 1; - state_stack = reinterpret_cast<int*> (qRealloc(state_stack, stack_size * sizeof(int))); + state_stack = reinterpret_cast<int*> (realloc(state_stack, stack_size * sizeof(int))); } } // namespace QScript diff --git a/src/scripttools/debugging/qscriptdebugger.cpp b/src/scripttools/debugging/qscriptdebugger.cpp index 5031554..41f73f6 100644 --- a/src/scripttools/debugging/qscriptdebugger.cpp +++ b/src/scripttools/debugging/qscriptdebugger.cpp @@ -882,10 +882,10 @@ void QScriptDebuggerPrivate::_q_goToLine() if (!view) return; bool ok = false; - int lineNumber = QInputDialog::getInteger(0, QScriptDebugger::tr("Go to Line"), - QScriptDebugger::tr("Line:"), - view->cursorLineNumber(), - 1, INT_MAX, 1, &ok); + int lineNumber = QInputDialog::getInt(0, QScriptDebugger::tr("Go to Line"), + QScriptDebugger::tr("Line:"), + view->cursorLineNumber(), + 1, INT_MAX, 1, &ok); if (ok) view->gotoLine(lineNumber); } |