summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-06-15 07:30:21 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-06-15 07:30:21 +0000
commitaea05a29c94830176499680956e48ecb2d42381b (patch)
tree6d804100688b149ae838c221b23052668af242de
parenta735b401218ad35318cf7e3d4e93581bb97d5d95 (diff)
MirandaPluginInterfaces is not needed anymore in the common case
git-svn-id: http://svn.miranda-ng.org/main/trunk@423 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--src/modules/plugins/newplugins.cpp22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/modules/plugins/newplugins.cpp b/src/modules/plugins/newplugins.cpp
index 022120379a..2f67ab297f 100644
--- a/src/modules/plugins/newplugins.cpp
+++ b/src/modules/plugins/newplugins.cpp
@@ -174,16 +174,20 @@ static int equalUUID(const MUUID& u1, const MUUID& u2)
static MUUID miid_last = MIID_LAST;
static MUUID miid_servicemode = MIID_SERVICEMODE;
-static int validInterfaceList(Miranda_Plugin_Interfaces ifaceProc)
+static bool validInterfaceList(Miranda_Plugin_Interfaces ifaceProc)
{
- MUUID *piface = ( ifaceProc ) ? ifaceProc() : NULL;
- int i = 0/*, j*/;
+ // we don't need'em anymore in the common case
+ if (ifaceProc == NULL)
+ return true;
- if (!piface)
- return 0;
- if (equalUUID(miid_last, piface[0]))
- return 0;
- return 1;
+ MUUID *piface = ifaceProc();
+ if (piface == NULL)
+ return false;
+
+ if ( equalUUID(miid_last, piface[0]))
+ return false;
+
+ return true;
}
static int isPluginBanned(MUUID u1, DWORD dwVersion)
@@ -282,7 +286,7 @@ static int checkAPI(TCHAR* plugin, BASIC_PLUGIN_INFO* bpi, DWORD mirandaVersion,
bpi->Interfaces = (Miranda_Plugin_Interfaces) GetProcAddress(h, "MirandaPluginInterfaces");
// if they were present
- if ( !bpi->Load || !bpi->Unload || !bpi->InfoEx || !bpi->Interfaces ) {
+ if ( !bpi->Load || !bpi->Unload || !bpi->InfoEx) {
LBL_Error:
FreeLibrary(h);
return 0;