Skip to content

Commit

Permalink
Silence a GCC 8 warning in qxcbnativeinterface
Browse files Browse the repository at this point in the history
qtbase/src/plugins/platforms/xcb/qxcbnativeinterface.cpp:309:65: error: cast between incompatible function types from ‘void (*)(const char*)’ to ‘QPlatformNativeInterface::NativeResourceForIntegrationFunction’ {aka ‘void* (*)()’} [-Werror=cast-function-type]
         return NativeResourceForIntegrationFunction(setStartupId);

Change-Id: I83409b3a6cc67ccb4c9e91e592e6a01bb6ce45ea
Reviewed-by: Friedemann Kleint <[email protected]>
  • Loading branch information
villevoutilainen committed Feb 27, 2018
1 parent 7eac2e7 commit 1b72d3e
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/plugins/platforms/xcb/qxcbnativeinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -306,13 +306,13 @@ QPlatformNativeInterface::NativeResourceForIntegrationFunction QXcbNativeInterfa
return func;

if (lowerCaseResource == "setstartupid")
return NativeResourceForIntegrationFunction(setStartupId);
return NativeResourceForIntegrationFunction(reinterpret_cast<void *>(setStartupId));
if (lowerCaseResource == "generatepeekerid")
return NativeResourceForIntegrationFunction(generatePeekerId);
return NativeResourceForIntegrationFunction(reinterpret_cast<void *>(generatePeekerId));
if (lowerCaseResource == "removepeekerid")
return NativeResourceForIntegrationFunction(removePeekerId);
return NativeResourceForIntegrationFunction(reinterpret_cast<void *>(removePeekerId));
if (lowerCaseResource == "peekeventqueue")
return NativeResourceForIntegrationFunction(peekEventQueue);
return NativeResourceForIntegrationFunction(reinterpret_cast<void *>(peekEventQueue));

return 0;
}
Expand All @@ -334,9 +334,9 @@ QPlatformNativeInterface::NativeResourceForScreenFunction QXcbNativeInterface::n
return func;

if (lowerCaseResource == "setapptime")
return NativeResourceForScreenFunction(setAppTime);
return NativeResourceForScreenFunction(reinterpret_cast<void *>(setAppTime));
else if (lowerCaseResource == "setappusertime")
return NativeResourceForScreenFunction(setAppUserTime);
return NativeResourceForScreenFunction(reinterpret_cast<void *>(setAppUserTime));
return 0;
}

Expand Down Expand Up @@ -388,7 +388,7 @@ QFunctionPointer QXcbNativeInterface::platformFunction(const QByteArray &functio
}

if (function == QXcbScreenFunctions::virtualDesktopNumberIdentifier())
return QFunctionPointer(QXcbScreenFunctions::VirtualDesktopNumber(QXcbScreen::virtualDesktopNumberStatic));
return QFunctionPointer(QXcbScreenFunctions::VirtualDesktopNumber(reinterpret_cast<void *>(QXcbScreen::virtualDesktopNumberStatic)));

return nullptr;
}
Expand Down

0 comments on commit 1b72d3e

Please sign in to comment.