path: root/src/dbus/qdbus_symbols.cpp
diff options
authorKim Motoyoshi Kalland <>2011-07-21 18:47:26 +0200
committerQt by Nokia <>2011-07-25 12:58:23 +0200
commitb949b17c3cb7b6752bc8daf2834415163792a76c (patch)
treef4d7d0eb7c3a1a71cb12e2d5a5c6c667449c6358 /src/dbus/qdbus_symbols.cpp
parent8d762c9caea4f8b9ff589b6c23564f4e37242745 (diff)
Changed QLibrary::resolve() to return a function pointer.
According to the C++ standard, there is no guarantee that you can cast between function pointers and void pointers without data loss (section 5.2.10-6). Change-Id: I27f4d835e4c8ca8ecca0d76cfea9ce34491956bd Reviewed-on: Reviewed-by: Qt Sanity Bot <> Reviewed-by: João Abecasis <>
Diffstat (limited to 'src/dbus/qdbus_symbols.cpp')
1 files changed, 4 insertions, 5 deletions
diff --git a/src/dbus/qdbus_symbols.cpp b/src/dbus/qdbus_symbols.cpp
index fed18350bb..8e74b8b922 100644
--- a/src/dbus/qdbus_symbols.cpp
+++ b/src/dbus/qdbus_symbols.cpp
@@ -48,7 +48,7 @@
-void *qdbus_resolve_me(const char *name);
+void (*qdbus_resolve_me(const char *name))();
#if !defined QT_LINKED_LIBDBUS
@@ -95,20 +95,19 @@ bool qdbus_loadLibDBus()
return false;
-void *qdbus_resolve_conditionally(const char *name)
+void (*qdbus_resolve_conditionally(const char *name))()
if (qdbus_loadLibDBus())
return qdbus_libdbus->resolve(name);
return 0;
-void *qdbus_resolve_me(const char *name)
+void (*qdbus_resolve_me(const char *name))()
- void *ptr = 0;
if (!qdbus_loadLibDBus())
qFatal("Cannot find libdbus-1 in your system to resolve symbol '%s'.", name);
- ptr = qdbus_libdbus->resolve(name);
+ QFunctionPointer ptr = qdbus_libdbus->resolve(name);
if (!ptr)
qFatal("Cannot resolve '%s' in your libdbus-1.", name);