WinRT: Fix compile warnings

Change-Id: If223dd73b9558a0f5144be38f19a61316f8c807b
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
This commit is contained in:
Maurice Kalinowski 2014-05-26 09:24:18 +02:00 committed by The Qt Project
parent b214c177ea
commit 262d2cba12
9 changed files with 19 additions and 3 deletions

View File

@ -148,6 +148,7 @@ bool QSharedMemoryPrivate::create(int size)
// Create the file mapping.
#if defined(Q_OS_WINPHONE)
Q_UNIMPLEMENTED();
Q_UNUSED(size)
hand = 0;
#elif defined(Q_OS_WINRT)
hand = CreateFileMappingFromApp(INVALID_HANDLE_VALUE, 0, PAGE_READWRITE, size, (PCWSTR)nativeKey.utf16());
@ -169,6 +170,7 @@ bool QSharedMemoryPrivate::attach(QSharedMemory::AccessMode mode)
int permissions = (mode == QSharedMemory::ReadOnly ? FILE_MAP_READ : FILE_MAP_ALL_ACCESS);
#if defined(Q_OS_WINPHONE)
Q_UNIMPLEMENTED();
Q_UNUSED(mode)
memory = 0;
#elif defined(Q_OS_WINRT)
memory = (void *)MapViewOfFileFromApp(handle(), permissions, 0, 0);

View File

@ -155,6 +155,7 @@ QCollatorSortKey QCollator::sortKey(const QString &string) const
#elif defined(Q_OS_WINPHONE)
int size = 0;
Q_UNIMPLEMENTED();
Q_UNUSED(string)
#else // Q_OS_WINPHONE
int size = LCMapStringEx(LOCALE_NAME_USER_DEFAULT, LCMAP_SORTKEY | d->collator,
reinterpret_cast<LPCWSTR>(string.constData()), string.size(),

View File

@ -453,6 +453,8 @@ QHostAddress::QHostAddress(const struct sockaddr *sockaddr)
setAddress(htonl(((sockaddr_in *)sockaddr)->sin_addr.s_addr));
else if (sockaddr->sa_family == AF_INET6)
setAddress(((qt_sockaddr_in6 *)sockaddr)->sin6_addr.qt_s6_addr);
#else
Q_UNUSED(sockaddr)
#endif
}
@ -612,6 +614,8 @@ void QHostAddress::setAddress(const struct sockaddr *sockaddr)
setAddress(htonl(((sockaddr_in *)sockaddr)->sin_addr.s_addr));
else if (sockaddr->sa_family == AF_INET6)
setAddress(((qt_sockaddr_in6 *)sockaddr)->sin6_addr.qt_s6_addr);
#else
Q_UNUSED(sockaddr)
#endif
}

View File

@ -84,7 +84,7 @@ QHostInfo QHostInfoAgent::fromName(const QString &hostName)
HStringReference classId(RuntimeClass_Windows_Networking_HostName);
if (FAILED(GetActivationFactory(classId.Get(), &hostnameFactory)))
Q_ASSERT(false, "Could not obtain hostname factory.");
Q_ASSERT_X(false, "QHostInfoAgent", "Could not obtain hostname factory.");
IHostName *host;
HStringReference hostNameRef((const wchar_t*)hostName.utf16());

View File

@ -1159,7 +1159,7 @@ HRESULT QNativeSocketEnginePrivate::handleBindCompleted(IAsyncAction *, AsyncSta
HRESULT QNativeSocketEnginePrivate::handleClientConnection(IStreamSocketListener *listener, IStreamSocketListenerConnectionReceivedEventArgs *args)
{
Q_Q(QNativeSocketEngine);
Q_ASSERT(tcpListener.Get() == listener);
Q_UNUSED(listener)
IStreamSocket *socket;
args->get_Socket(&socket);
pendingConnections.append(socket);
@ -1253,7 +1253,7 @@ HRESULT QNativeSocketEnginePrivate::handleWriteCompleted(IAsyncOperationWithProg
HRESULT QNativeSocketEnginePrivate::handleNewDatagram(IDatagramSocket *socket, IDatagramSocketMessageReceivedEventArgs *args)
{
Q_Q(QNativeSocketEngine);
Q_ASSERT(udp == socket);
Q_UNUSED(socket)
pendingDatagrams.append(args);
emit q->readReady();

View File

@ -135,6 +135,8 @@ void QWinRTCursor::changeCursor(QCursor *windowCursor, QWindow *)
ICoreCursor *cursor;
if (SUCCEEDED(m_cursorFactory->CreateCursor(type, 0, &cursor)))
m_window->put_PointerCursor(cursor);
#else // Q_OS_WINPHONE
Q_UNUSED(windowCursor)
#endif // Q_OS_WINPHONE
}
#endif // QT_NO_CURSOR

View File

@ -53,6 +53,8 @@ bool QWinRTPlatformTheme::usePlatformNativeDialog(QPlatformTheme::DialogType typ
#if !(defined(Q_OS_WINPHONE) && _MSC_VER<=1700)
if (type == QPlatformTheme::MessageDialog)
return true;
#else
Q_UNUSED(type)
#endif // !(Q_OS_WINPHONE && _MSC_VER<=1700)
return false;
}

View File

@ -960,6 +960,8 @@ HRESULT QWinRTScreen::onAutomationProviderRequested(ICoreWindow *, IAutomationPr
{
#ifndef Q_OS_WINPHONE
args->put_AutomationProvider(m_inputContext);
#else
Q_UNUSED(args)
#endif
return S_OK;
}

View File

@ -168,6 +168,9 @@ static void showYellowThing_win(QWidget *widget, const QRegion &region, int msec
void QWidgetBackingStore::showYellowThing(QWidget *widget, const QRegion &toBePainted, int msec, bool unclipped)
{
#ifdef Q_OS_WINRT
Q_UNUSED(msec)
#endif
QRegion paintRegion = toBePainted;
QRect widgetRect = widget->rect();