From 425aa282df1d0e90c8337f49223c8bc7e9a970b3 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Thu, 1 Jun 2017 17:42:09 +0200 Subject: Win: Account for when "condition expression is constant" warning occurs There is already some case accounting for when this warning appears with warning level 4 and Visual C++ on Windows. However it was not catching all the places it was coming from, so this extends it to cover those places too. Change-Id: I69b21440716361fda1c1ae0be0d9c17ced7f0792 Reviewed-by: Thiago Macieira --- src/corelib/tools/qvector.h | 37 +++++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 14 deletions(-) (limited to 'src/corelib') diff --git a/src/corelib/tools/qvector.h b/src/corelib/tools/qvector.h index 57e80ae125..da15d401e3 100644 --- a/src/corelib/tools/qvector.h +++ b/src/corelib/tools/qvector.h @@ -310,6 +310,7 @@ private: // will be default-initialized # pragma warning ( push ) # pragma warning ( disable : 4345 ) +# pragma warning(disable : 4127) // conditional expression is constant #endif template @@ -324,10 +325,6 @@ void QVector::defaultConstruct(T *from, T *to) } } -#ifdef Q_CC_MSVC -# pragma warning ( pop ) -#endif - template void QVector::copyConstruct(const T *srcFrom, const T *srcTo, T *dstFrom) { @@ -339,11 +336,6 @@ void QVector::copyConstruct(const T *srcFrom, const T *srcTo, T *dstFrom) } } -#if defined(Q_CC_MSVC) -#pragma warning( push ) -#pragma warning( disable : 4127 ) // conditional expression is constant -#endif - template void QVector::destruct(T *from, T *to) { @@ -354,10 +346,6 @@ void QVector::destruct(T *from, T *to) } } -#if defined(Q_CC_MSVC) -#pragma warning( pop ) -#endif - template inline QVector::QVector(const QVector &v) { @@ -379,6 +367,10 @@ inline QVector::QVector(const QVector &v) } } +#if defined(Q_CC_MSVC) +#pragma warning( pop ) +#endif + template void QVector::detach() { @@ -506,6 +498,11 @@ QVector::QVector(int asize, const T &t) } #ifdef Q_COMPILER_INITIALIZER_LISTS +# if defined(Q_CC_MSVC) +QT_WARNING_PUSH +QT_WARNING_DISABLE_MSVC(4127) // conditional expression is constant +# endif // Q_CC_MSVC + template QVector::QVector(std::initializer_list args) { @@ -520,7 +517,10 @@ QVector::QVector(std::initializer_list args) d = Data::sharedNull(); } } -#endif +# if defined(Q_CC_MSVC) +QT_WARNING_POP +# endif // Q_CC_MSVC +#endif // Q_COMPILER_INITALIZER_LISTS template void QVector::freeData(Data *x) @@ -529,6 +529,11 @@ void QVector::freeData(Data *x) Data::deallocate(x); } +#if defined(Q_CC_MSVC) +QT_WARNING_PUSH +QT_WARNING_DISABLE_MSVC(4127) // conditional expression is constant +#endif + template void QVector::reallocData(const int asize, const int aalloc, QArrayData::AllocationOptions options) { @@ -620,6 +625,10 @@ void QVector::reallocData(const int asize, const int aalloc, QArrayData::Allo Q_ASSERT(d->size == asize); } +#if defined(Q_CC_MSVC) +QT_WARNING_POP +#endif + template Q_OUTOFLINE_TEMPLATE T QVector::value(int i) const { -- cgit v1.2.3 From f4e0ffb11c158908cfc33df1e06fcd032501ef1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tero=20Alam=C3=A4ki?= Date: Thu, 27 Jul 2017 11:43:38 +0300 Subject: Enable custom shared memory schemes on INTEGRITY Replaced dependency to libdl.a with libshm_client.a. Defined symbols 'shm_area_password' and 'shm_area_name' internally. The build for INTEGRITY is static only so libdl.a is not needed. Change-Id: I7e34528835132d79ea582a30cf9ff61cdda198da Reviewed-by: Oswald Buddenhagen Reviewed-by: Rolland Dudemaine Reviewed-by: Thiago Macieira --- src/corelib/global/qglobal.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/corelib') diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index 4223d2a3e1..12e908f09f 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -95,6 +95,19 @@ #include #endif +#if defined(Q_OS_INTEGRITY) +extern "C" { + // Function mmap resides in libshm_client.a. To be able to link with it one needs + // to define symbols 'shm_area_password' and 'shm_area_name', because the library + // is meant to allow the application that links to it to use POSIX shared memory + // without full system POSIX. +# pragma weak shm_area_password +# pragma weak shm_area_name + char *shm_area_password = "dummy"; + char *shm_area_name = "dummy"; +} +#endif + #include "archdetect.cpp" #ifdef qFatal -- cgit v1.2.3 From b7bcd03d194495f3e7230e0cd757b04641c633d9 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Sun, 13 Aug 2017 10:37:34 -0700 Subject: Doc: indicate the QSharedMemory::size() that the size may be bigger Task-number: QTBUG-62468 Change-Id: I6e9274c1e7444ad48c81fffd14da78718828c4a6 Reviewed-by: Martin Smith --- src/corelib/kernel/qsharedmemory.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/corelib') diff --git a/src/corelib/kernel/qsharedmemory.cpp b/src/corelib/kernel/qsharedmemory.cpp index 7f185ee9dc..c8ba13c90c 100644 --- a/src/corelib/kernel/qsharedmemory.cpp +++ b/src/corelib/kernel/qsharedmemory.cpp @@ -362,6 +362,9 @@ bool QSharedMemory::create(int size, AccessMode mode) Returns the size of the attached shared memory segment. If no shared memory segment is attached, 0 is returned. + \note The size of the segment may be larger than the requested size that was + passed to create(). + \sa create(), attach() */ int QSharedMemory::size() const -- cgit v1.2.3