From 741c4f5b5d6b46096aaefc6b77a8224aa66d4e7b Mon Sep 17 00:00:00 2001 From: axis Date: Fri, 21 Aug 2009 10:40:44 +0200 Subject: Fixed some comments and code style issues after review. RevBy: Trust me --- src/corelib/kernel/qcore_unix_p.h | 3 ++- src/corelib/kernel/qcoreapplication.cpp | 2 +- src/corelib/kernel/qeventdispatcher_symbian.cpp | 11 ++++------- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/corelib/kernel/qcore_unix_p.h b/src/corelib/kernel/qcore_unix_p.h index c83c24b..698b05b 100644 --- a/src/corelib/kernel/qcore_unix_p.h +++ b/src/corelib/kernel/qcore_unix_p.h @@ -274,7 +274,8 @@ static inline int qt_safe_close(int fd) #undef QT_CLOSE #define QT_CLOSE qt_safe_close -// Open C does not (yet?) implement these on Symbian OS and VxWorks doesn't have processes +// - Open C does not (yet?) implement these on Symbian OS +// - VxWorks doesn't have processes #if !defined(Q_OS_SYMBIAN) && !defined(Q_OS_VXWORKS) static inline int qt_safe_execve(const char *filename, char *const argv[], char *const envp[]) diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp index 875c3cc..81a1d68 100644 --- a/src/corelib/kernel/qcoreapplication.cpp +++ b/src/corelib/kernel/qcoreapplication.cpp @@ -490,7 +490,7 @@ QCoreApplication::QCoreApplication(int &argc, char **argv) { init(); QCoreApplicationPrivate::eventDispatcher->startingUp(); -#if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS) && defined(Q_OS_SYMBIAN) +#if defined(Q_OS_SYMBIAN) && !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS) // Refresh factoryloader, as text codecs are requested during lib path // resolving process and won't be therefore properly loaded. // Unknown if this is symbian specific issue. diff --git a/src/corelib/kernel/qeventdispatcher_symbian.cpp b/src/corelib/kernel/qeventdispatcher_symbian.cpp index d7b9d92..7bca408 100644 --- a/src/corelib/kernel/qeventdispatcher_symbian.cpp +++ b/src/corelib/kernel/qeventdispatcher_symbian.cpp @@ -225,6 +225,7 @@ void QTimerActiveObject::RunL() { int error; QT_TRYCATCH_ERROR(error, Run()); + // All Symbian error codes are negative. if (error < 0) { CActiveScheduler::Current()->Error(error); // stop and report here, as this timer will be deleted on scope exit } @@ -275,7 +276,7 @@ void QTimerActiveObject::Start() } SymbianTimerInfo::SymbianTimerInfo() -: timerAO(0) + : timerAO(0) { } @@ -369,10 +370,8 @@ void QSelectThread::run() int ret; int savedSelectErrno; - //do { - ret = qt_socket_select(maxfd, &readfds, &writefds, &exceptionfds, 0); - savedSelectErrno = errno; - //} while (ret == 0); + ret = qt_socket_select(maxfd, &readfds, &writefds, &exceptionfds, 0); + savedSelectErrno = errno; char buffer; @@ -405,7 +404,6 @@ void QSelectThread::run() FD_ZERO(&readfds); FD_ZERO(&writefds); FD_ZERO(&exceptionfds); - { for (QHash::const_iterator i = m_AOStatuses.begin(); i != m_AOStatuses.end(); ++i) { @@ -434,7 +432,6 @@ void QSelectThread::run() } } // end for - } // traversed all, so update updateActivatedNotifiers(QSocketNotifier::Read, &readfds); -- cgit v0.12 From 0179bc8e688714b33e4f14780578f630e8ddcd7b Mon Sep 17 00:00:00 2001 From: axis Date: Fri, 21 Aug 2009 10:41:51 +0200 Subject: Fixed documentation. Private directory is not always in C-drive. RevBy: Trust me --- src/corelib/kernel/qcoreapplication.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp index 81a1d68..88306bf 100644 --- a/src/corelib/kernel/qcoreapplication.cpp +++ b/src/corelib/kernel/qcoreapplication.cpp @@ -1768,9 +1768,8 @@ bool QCoreApplicationPrivate::isTranslatorInstalled(QTranslator *translator) function also assumes that the current directory has not been changed by the application. - In Symbian this function will return the application private directory - in C-drive, not the path to executable itself, as those are always in - /sys/bin. + In Symbian this function will return the application private directory, + not the path to executable itself, as those are always in \c {/sys/bin}. \sa applicationFilePath() */ -- cgit v0.12 From e909151283a561643a25a72ff85588a00d9f1e7d Mon Sep 17 00:00:00 2001 From: axis Date: Fri, 21 Aug 2009 10:43:24 +0200 Subject: Switched to logical comparison instead of bitwise. This was done because I initially thought that KRequestPending was a bit flag, but it turns out it's just an int value, so == is more correct. RevBy: Iain AutoTest: Passed --- src/corelib/kernel/qeventdispatcher_symbian.cpp | 10 +++++----- src/corelib/kernel/qeventdispatcher_symbian_p.h | 7 +------ 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/src/corelib/kernel/qeventdispatcher_symbian.cpp b/src/corelib/kernel/qeventdispatcher_symbian.cpp index 7bca408..881e546 100644 --- a/src/corelib/kernel/qeventdispatcher_symbian.cpp +++ b/src/corelib/kernel/qeventdispatcher_symbian.cpp @@ -184,7 +184,7 @@ QWakeUpActiveObject::~QWakeUpActiveObject() void QWakeUpActiveObject::DoCancel() { - if (iStatus.Int() & KRequestPending) { + if (iStatus.Int() == KRequestPending) { TRequestStatus *status = &iStatus; QEventDispatcherSymbian::RequestComplete(status, KErrNone); } @@ -214,7 +214,7 @@ void QTimerActiveObject::DoCancel() m_rTimer.Cancel(); m_rTimer.Close(); } else { - if (iStatus.Int() & KRequestPending) { + if (iStatus.Int() == KRequestPending) { TRequestStatus *status = &iStatus; QEventDispatcherSymbian::RequestComplete(status, KErrNone); } @@ -301,7 +301,7 @@ QCompleteDeferredAOs::~QCompleteDeferredAOs() void QCompleteDeferredAOs::complete() { - if (iStatus.Int() & KRequestPending) { + if (iStatus.Int() == KRequestPending) { TRequestStatus *status = &iStatus; QEventDispatcherSymbian::RequestComplete(status, KErrNone); } @@ -309,7 +309,7 @@ void QCompleteDeferredAOs::complete() void QCompleteDeferredAOs::DoCancel() { - if (iStatus.Int() & KRequestPending) { + if (iStatus.Int() == KRequestPending) { TRequestStatus *status = &iStatus; QEventDispatcherSymbian::RequestComplete(status, KErrNone); } @@ -578,7 +578,7 @@ QSocketActiveObject::~QSocketActiveObject() void QSocketActiveObject::DoCancel() { - if (iStatus.Int() & KRequestPending) { + if (iStatus.Int() == KRequestPending) { TRequestStatus *status = &iStatus; QEventDispatcherSymbian::RequestComplete(status, KErrNone); } diff --git a/src/corelib/kernel/qeventdispatcher_symbian_p.h b/src/corelib/kernel/qeventdispatcher_symbian_p.h index 69912d0..021de13 100644 --- a/src/corelib/kernel/qeventdispatcher_symbian_p.h +++ b/src/corelib/kernel/qeventdispatcher_symbian_p.h @@ -281,13 +281,9 @@ private: }; #ifdef QT_DEBUG -// EActive is defined to 1 and ERequestPending to 2, but they are both private. -// A little dangerous to rely on, but it is only for debugging. -# define REQUEST_STATUS_ACTIVE_AND_PENDING 3 # define VERIFY_PENDING_REQUEST_STATUS \ - Q_ASSERT(status->Int() & REQUEST_STATUS_ACTIVE_AND_PENDING == REQUEST_STATUS_ACTIVE_AND_PENDING); + Q_ASSERT(status->Int() == KRequestPending); #else -# define REQUEST_STATUS_ACTIVE_AND_PENDING # define VERIFY_PENDING_REQUEST_STATUS #endif @@ -304,7 +300,6 @@ inline void QEventDispatcherSymbian::RequestComplete(RThread &threadHandle, TReq threadHandle.RequestComplete(status, reason); } -#undef REQUEST_STATUS_ACTIVE_AND_PENDING #undef VERIFY_PENDING_REQUEST_STATUS QT_END_NAMESPACE -- cgit v0.12 From 0ef0311dad387642bd6aa43e2cef9d25e2b5c5b3 Mon Sep 17 00:00:00 2001 From: axis Date: Fri, 21 Aug 2009 12:09:06 +0200 Subject: Revert "Fixed KERN-EXEC 3 panic on ARMV5 builds caused by combining trinary operators and 64 bit values in QVariant. This is probably a compiler bug. Workaround is flagged with Q_CC_RVCT specific just in case, but should work for all compilers." This reverts commit 85a1f7888bd48d5857de2b7c6304a334350fd054. Conflicts: src/corelib/kernel/qvariant.cpp tests/auto/qvariant/qvariant.pro I cannot reproduce this anymore with the latest RVCT, not even in S60 3.1. RevBy: Miikka Heikkinen --- src/corelib/kernel/qvariant.cpp | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp index d5b2d16..196e1d7 100644 --- a/src/corelib/kernel/qvariant.cpp +++ b/src/corelib/kernel/qvariant.cpp @@ -156,16 +156,7 @@ static void construct(QVariant::Private *x, const void *copy) x->data.b = copy ? *static_cast(copy) : false; break; case QVariant::Double: -#if defined(Q_CC_RVCT) - // Using trinary operator with 64bit constants crashes when ran on Symbian device - if (copy){ - x->data.d = *static_cast(copy); - } else { - x->data.d = 0.0; - } -#else x->data.d = copy ? *static_cast(copy) : 0.0; -#endif break; case QMetaType::Float: x->data.f = copy ? *static_cast(copy) : 0.0f; @@ -174,28 +165,10 @@ static void construct(QVariant::Private *x, const void *copy) x->data.o = copy ? *static_cast(copy) : 0; break; case QVariant::LongLong: -#if defined(Q_CC_RVCT) - // Using trinary operator with 64bit constants crashes when ran on Symbian device - if (copy){ - x->data.ll = *static_cast(copy); - } else { - x->data.ll = Q_INT64_C(0); - } -#else x->data.ll = copy ? *static_cast(copy) : Q_INT64_C(0); -#endif break; case QVariant::ULongLong: -#if defined(Q_CC_RVCT) - // Using trinary operator with 64bit constants crashes when ran on Symbian device - if (copy){ - x->data.ull = *static_cast(copy); - } else { - x->data.ull = Q_UINT64_C(0); - } -#else x->data.ull = copy ? *static_cast(copy) : Q_UINT64_C(0); -#endif break; case QVariant::Invalid: case QVariant::UserType: -- cgit v0.12