summaryrefslogtreecommitdiffstats
path: root/src/corelib/plugin
diff options
context:
space:
mode:
authorSamuel Rødal <samuel.rodal@nokia.com>2011-08-03 11:03:22 +0200
committerSamuel Rødal <samuel.rodal@nokia.com>2011-08-03 11:03:22 +0200
commit92c998afb66a2ec900d50cab57929c0a97ad46ac (patch)
tree1f6219dc64c236c85d7365f8e07ee1df1f27a610 /src/corelib/plugin
parent6c4dec7bff6f55b0c41729f4a4ab6962a037af15 (diff)
parent6f4212e5936b96a8be0eacddbfc4dd7ca5abd776 (diff)
Merge remote branch 'gerrit/master' into refactor
Conflicts: src/gui/kernel/qapplication_x11.cpp src/gui/widgets/qlinecontrol.cpp src/gui/widgets/qlinecontrol_p.h src/gui/widgets/qtabwidget.h Change-Id: I90ba893a5553b9ff5658ca0a3221ecf76be4c736
Diffstat (limited to 'src/corelib/plugin')
-rw-r--r--src/corelib/plugin/qlibrary.cpp10
-rw-r--r--src/corelib/plugin/qlibrary.h8
-rw-r--r--src/corelib/plugin/qlibrary_p.h4
-rw-r--r--src/corelib/plugin/qlibrary_unix.cpp14
-rw-r--r--src/corelib/plugin/qlibrary_win.cpp8
-rw-r--r--src/corelib/plugin/qsystemlibrary_p.h8
6 files changed, 26 insertions, 26 deletions
diff --git a/src/corelib/plugin/qlibrary.cpp b/src/corelib/plugin/qlibrary.cpp
index 314ccd7861..45515f32e1 100644
--- a/src/corelib/plugin/qlibrary.cpp
+++ b/src/corelib/plugin/qlibrary.cpp
@@ -447,7 +447,7 @@ QLibraryPrivate::~QLibraryPrivate()
}
}
-void *QLibraryPrivate::resolve(const char *symbol)
+QFunctionPointer QLibraryPrivate::resolve(const char *symbol)
{
if (!pHnd)
return 0;
@@ -1129,7 +1129,7 @@ void QLibrary::setFileNameAndVersion(const QString &fileName, const QString &ver
Note: In Symbian resolving with symbol names works only if the loaded
library was built as STDDLL. Otherwise, the ordinals must be used.
*/
-void *QLibrary::resolve(const char *symbol)
+QFunctionPointer QLibrary::resolve(const char *symbol)
{
if (!isLoaded() && !load())
return 0;
@@ -1152,7 +1152,7 @@ void *QLibrary::resolve(const char *symbol)
\sa resolve()
*/
-void *QLibrary::resolve(const QString &fileName, const char *symbol)
+QFunctionPointer QLibrary::resolve(const QString &fileName, const char *symbol)
{
QLibrary library(fileName);
return library.resolve(symbol);
@@ -1175,7 +1175,7 @@ void *QLibrary::resolve(const QString &fileName, const char *symbol)
\sa resolve()
*/
-void *QLibrary::resolve(const QString &fileName, int verNum, const char *symbol)
+QFunctionPointer QLibrary::resolve(const QString &fileName, int verNum, const char *symbol)
{
QLibrary library(fileName, verNum);
return library.resolve(symbol);
@@ -1199,7 +1199,7 @@ void *QLibrary::resolve(const QString &fileName, int verNum, const char *symbol)
\sa resolve()
*/
-void *QLibrary::resolve(const QString &fileName, const QString &version, const char *symbol)
+QFunctionPointer QLibrary::resolve(const QString &fileName, const QString &version, const char *symbol)
{
QLibrary library(fileName, version);
return library.resolve(symbol);
diff --git a/src/corelib/plugin/qlibrary.h b/src/corelib/plugin/qlibrary.h
index 0154e949b3..e3f557dd7d 100644
--- a/src/corelib/plugin/qlibrary.h
+++ b/src/corelib/plugin/qlibrary.h
@@ -79,10 +79,10 @@ public:
explicit QLibrary(const QString& fileName, const QString &version, QObject *parent = 0);
~QLibrary();
- void *resolve(const char *symbol);
- static void *resolve(const QString &fileName, const char *symbol);
- static void *resolve(const QString &fileName, int verNum, const char *symbol);
- static void *resolve(const QString &fileName, const QString &version, const char *symbol);
+ QFunctionPointer resolve(const char *symbol);
+ static QFunctionPointer resolve(const QString &fileName, const char *symbol);
+ static QFunctionPointer resolve(const QString &fileName, int verNum, const char *symbol);
+ static QFunctionPointer resolve(const QString &fileName, const QString &version, const char *symbol);
bool load();
bool unload();
diff --git a/src/corelib/plugin/qlibrary_p.h b/src/corelib/plugin/qlibrary_p.h
index 4f66bc26a0..c6804955d9 100644
--- a/src/corelib/plugin/qlibrary_p.h
+++ b/src/corelib/plugin/qlibrary_p.h
@@ -87,7 +87,7 @@ public:
bool loadPlugin(); // loads and resolves instance
bool unload();
void release();
- void *resolve(const char *);
+ QFunctionPointer resolve(const char *);
static QLibraryPrivate *findOrCreate(const QString &fileName, const QString &version = QString());
@@ -108,7 +108,7 @@ private:
bool load_sys();
bool unload_sys();
- void *resolve_sys(const char *);
+ QFunctionPointer resolve_sys(const char *);
QAtomicInt libraryRefCount;
QAtomicInt libraryUnloadCount;
diff --git a/src/corelib/plugin/qlibrary_unix.cpp b/src/corelib/plugin/qlibrary_unix.cpp
index 0a7e841519..d3b08e1acf 100644
--- a/src/corelib/plugin/qlibrary_unix.cpp
+++ b/src/corelib/plugin/qlibrary_unix.cpp
@@ -267,29 +267,29 @@ bool QLibraryPrivate::unload_sys()
}
#ifdef Q_OS_MAC
-Q_CORE_EXPORT void *qt_mac_resolve_sys(void *handle, const char *symbol)
+Q_CORE_EXPORT QFunctionPointer qt_mac_resolve_sys(void *handle, const char *symbol)
{
- return dlsym(handle, symbol);
+ return QFunctionPointer(dlsym(handle, symbol));
}
#endif
-void* QLibraryPrivate::resolve_sys(const char* symbol)
+QFunctionPointer QLibraryPrivate::resolve_sys(const char* symbol)
{
#if defined(QT_AOUT_UNDERSCORE)
// older a.out systems add an underscore in front of symbols
char* undrscr_symbol = new char[strlen(symbol)+2];
undrscr_symbol[0] = '_';
strcpy(undrscr_symbol+1, symbol);
- void* address = dlsym(pHnd, undrscr_symbol);
+ QFunctionPointer address = QFunctionPointer(dlsym(pHnd, undrscr_symbol));
delete [] undrscr_symbol;
#elif defined(QT_HPUX_LD)
- void* address = 0;
+ QFunctionPointer address = 0;
if (shl_findsym((shl_t*)&pHnd, symbol, TYPE_UNDEFINED, &address) < 0)
address = 0;
#elif defined (QT_NO_DYNAMIC_LIBRARY)
- void *address = 0;
+ QFunctionPointer address = 0;
#else
- void* address = dlsym(pHnd, symbol);
+ QFunctionPointer address = QFunctionPointer(dlsym(pHnd, symbol));
#endif
if (!address) {
errorString = QLibrary::tr("Cannot resolve symbol \"%1\" in %2: %3").arg(
diff --git a/src/corelib/plugin/qlibrary_win.cpp b/src/corelib/plugin/qlibrary_win.cpp
index 667d9cca45..4eeb2fc441 100644
--- a/src/corelib/plugin/qlibrary_win.cpp
+++ b/src/corelib/plugin/qlibrary_win.cpp
@@ -113,12 +113,12 @@ bool QLibraryPrivate::unload_sys()
return true;
}
-void* QLibraryPrivate::resolve_sys(const char* symbol)
+QFunctionPointer QLibraryPrivate::resolve_sys(const char* symbol)
{
#ifdef Q_OS_WINCE
- void* address = (void*)GetProcAddress(pHnd, (const wchar_t*)QString::fromLatin1(symbol).utf16());
+ FARPROC address = GetProcAddress(pHnd, (const wchar_t*)QString::fromLatin1(symbol).utf16());
#else
- void* address = (void*)GetProcAddress(pHnd, symbol);
+ FARPROC address = GetProcAddress(pHnd, symbol);
#endif
if (!address) {
errorString = QLibrary::tr("Cannot resolve symbol \"%1\" in %2: %3").arg(
@@ -126,6 +126,6 @@ void* QLibraryPrivate::resolve_sys(const char* symbol)
} else {
errorString.clear();
}
- return address;
+ return QFunctionPointer(address);
}
QT_END_NAMESPACE
diff --git a/src/corelib/plugin/qsystemlibrary_p.h b/src/corelib/plugin/qsystemlibrary_p.h
index f20d0b6b9d..3298f05b8f 100644
--- a/src/corelib/plugin/qsystemlibrary_p.h
+++ b/src/corelib/plugin/qsystemlibrary_p.h
@@ -78,20 +78,20 @@ public:
return (m_handle != 0);
}
- void *resolve(const char *symbol)
+ QFunctionPointer resolve(const char *symbol)
{
if (!m_didLoad)
load();
if (!m_handle)
return 0;
#ifdef Q_OS_WINCE
- return (void*)GetProcAddress(m_handle, (const wchar_t*)QString::fromLatin1(symbol).utf16());
+ return QFunctionPointer(GetProcAddress(m_handle, (const wchar_t*)QString::fromLatin1(symbol).utf16()));
#else
- return (void*)GetProcAddress(m_handle, symbol);
+ return QFunctionPointer(GetProcAddress(m_handle, symbol));
#endif
}
- static void *resolve(const QString &libraryName, const char *symbol)
+ static QFunctionPointer resolve(const QString &libraryName, const char *symbol)
{
return QSystemLibrary(libraryName).resolve(symbol);
}