1
0
mirror of https://github.com/alliedmodders/metamod-source.git synced 2025-02-26 19:54:14 +01:00

Fixed a warning in stub and sample :|

--HG--
extra : convert_revision : svn%3Ac2935e3e-5518-0410-8daf-afa5dab7d4e3/trunk%40188
This commit is contained in:
Scott Ehlert 2006-04-17 19:42:55 +00:00
parent e194c19011
commit 1e68eb3131
2 changed files with 10 additions and 10 deletions

View File

@ -23,10 +23,10 @@ PLUGIN_EXPOSE(SamplePlugin, g_SamplePlugin);
#define FIND_IFACE(func, assn_var, num_var, name, type) \ #define FIND_IFACE(func, assn_var, num_var, name, type) \
do { \ do { \
if ( (assn_var=(type)((ismm->func())(name, NULL))) != NULL ) { \ if ( (assn_var=(type)((ismm->func())(name, NULL))) != NULL ) { \
num = 0; \ num_var = 0; \
break; \ break; \
} \ } \
if (num >= 999) \ if (num_var >= 999) \
break; \ break; \
} while ( num_var=ismm->FormatIface(name, sizeof(name)-1) ); \ } while ( num_var=ismm->FormatIface(name, sizeof(name)-1) ); \
if (!assn_var) { \ if (!assn_var) { \
@ -124,14 +124,14 @@ bool SamplePlugin::Load(PluginId id, ISmmAPI *ismm, char *error, size_t maxlen,
PLUGIN_SAVEVARS(); PLUGIN_SAVEVARS();
char iface_buffer[255]; char iface_buffer[255];
int num; int num = 0;
strcpy(iface_buffer, INTERFACEVERSION_SERVERGAMEDLL); strcpy(iface_buffer, INTERFACEVERSION_SERVERGAMEDLL);
FIND_IFACE(serverFactory, m_ServerDll, num, iface_buffer, IServerGameDLL *) FIND_IFACE(serverFactory, m_ServerDll, num, iface_buffer, IServerGameDLL *);
strcpy(iface_buffer, INTERFACEVERSION_VENGINESERVER); strcpy(iface_buffer, INTERFACEVERSION_VENGINESERVER);
FIND_IFACE(engineFactory, m_Engine, num, iface_buffer, IVEngineServer *) FIND_IFACE(engineFactory, m_Engine, num, iface_buffer, IVEngineServer *);
strcpy(iface_buffer, INTERFACEVERSION_SERVERGAMECLIENTS); strcpy(iface_buffer, INTERFACEVERSION_SERVERGAMECLIENTS);
FIND_IFACE(serverFactory, m_ServerClients, num, iface_buffer, IServerGameClients *) FIND_IFACE(serverFactory, m_ServerClients, num, iface_buffer, IServerGameClients *);
strcpy(iface_buffer, INTERFACEVERSION_GAMEEVENTSMANAGER2); strcpy(iface_buffer, INTERFACEVERSION_GAMEEVENTSMANAGER2);
FIND_IFACE(engineFactory, m_GameEventManager, num, iface_buffer, IGameEventManager2 *); FIND_IFACE(engineFactory, m_GameEventManager, num, iface_buffer, IGameEventManager2 *);

View File

@ -21,10 +21,10 @@ PLUGIN_EXPOSE(SamplePlugin, g_StubPlugin);
#define FIND_IFACE(func, assn_var, num_var, name, type) \ #define FIND_IFACE(func, assn_var, num_var, name, type) \
do { \ do { \
if ( (assn_var=(type)((ismm->func())(name, NULL))) != NULL ) { \ if ( (assn_var=(type)((ismm->func())(name, NULL))) != NULL ) { \
num = 0; \ num_var = 0; \
break; \ break; \
} \ } \
if (num >= 999) \ if (num_var >= 999) \
break; \ break; \
} while ( num_var=ismm->FormatIface(name, sizeof(name)-1) ); \ } while ( num_var=ismm->FormatIface(name, sizeof(name)-1) ); \
if (!assn_var) { \ if (!assn_var) { \
@ -44,10 +44,10 @@ bool StubPlugin::Load(PluginId id, ISmmAPI *ismm, char *error, size_t maxlen, bo
PLUGIN_SAVEVARS(); PLUGIN_SAVEVARS();
char iface_buffer[255]; char iface_buffer[255];
int num; int num = 0;
strcpy(iface_buffer, INTERFACEVERSION_SERVERGAMEDLL); strcpy(iface_buffer, INTERFACEVERSION_SERVERGAMEDLL);
FIND_IFACE(serverFactory, m_ServerDll, num, iface_buffer, IServerGameDLL *) FIND_IFACE(serverFactory, m_ServerDll, num, iface_buffer, IServerGameDLL *);
SH_ADD_HOOK_STATICFUNC(IServerGameDLL, ServerActivate, m_ServerDll, ServerActivate_handler, true); SH_ADD_HOOK_STATICFUNC(IServerGameDLL, ServerActivate, m_ServerDll, ServerActivate_handler, true);