diff options
author | Vadim Dashevskiy <watcherhd@gmail.com> | 2012-06-15 14:13:45 +0000 |
---|---|---|
committer | Vadim Dashevskiy <watcherhd@gmail.com> | 2012-06-15 14:13:45 +0000 |
commit | 4aa6229698b946e52ce19018aaf13f8b92fb168e (patch) | |
tree | 29334e8c5ee492a80f11a97fedab2373b8fbb392 /src/modules/protocols | |
parent | 5e8e561a80d1ac9ca1c2f1c3d388105733ed4e4e (diff) |
another portion of "#ifsef Unicode" removal
git-svn-id: http://svn.miranda-ng.org/main/trunk@426 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules/protocols')
-rw-r--r-- | src/modules/protocols/protoaccs.cpp | 6 | ||||
-rw-r--r-- | src/modules/protocols/protocols.cpp | 38 | ||||
-rw-r--r-- | src/modules/protocols/protoint.cpp | 31 |
3 files changed, 27 insertions, 48 deletions
diff --git a/src/modules/protocols/protoaccs.cpp b/src/modules/protocols/protoaccs.cpp index f2706ddb08..ccb88a3269 100644 --- a/src/modules/protocols/protoaccs.cpp +++ b/src/modules/protocols/protoaccs.cpp @@ -367,7 +367,6 @@ static INT_PTR stub42( PROTO_INTERFACE* ppi, WPARAM wParam, LPARAM lParam ) { return ppi->m_iStatus;
}
-#ifdef _UNICODE
static INT_PTR stub43( PROTO_INTERFACE* ppi, WPARAM wParam, LPARAM lParam )
{
@@ -409,7 +408,6 @@ static INT_PTR stub45( PROTO_INTERFACE* ppi, WPARAM wParam, LPARAM lParam ) return CallProtoService( ppi->m_szModuleName, PS_SETMYAVATARW, wParam, ( LPARAM )( LPCTSTR )StrConvT(( char* )lParam ));
}
-#endif
static HANDLE CreateProtoServiceEx( const char* szModule, const char* szService, MIRANDASERVICEOBJ pFunc, void* param )
{
@@ -454,7 +452,7 @@ BOOL ActivateAccount( PROTOACCOUNT* pa ) CreateProtoServiceEx( pa->szModuleName, PS_GETNAME, (MIRANDASERVICEOBJ)stub41, pa->ppro );
CreateProtoServiceEx( pa->szModuleName, PS_GETSTATUS, (MIRANDASERVICEOBJ)stub42, pa->ppro );
-#ifdef _UNICODE
+
char szServiceName[ 200 ];
mir_snprintf( szServiceName, SIZEOF(szServiceName), "%s%s", pa->szModuleName, PS_GETAVATARINFO );
if ( !ServiceExists( szServiceName )) {
@@ -476,7 +474,7 @@ BOOL ActivateAccount( PROTOACCOUNT* pa ) if ( ServiceExists( szServiceName ))
CreateProtoServiceEx( pa->szModuleName, PS_SETMYAVATAR, (MIRANDASERVICEOBJ)stub45, pa->ppro );
}
- #endif
+
return TRUE;
}
diff --git a/src/modules/protocols/protocols.cpp b/src/modules/protocols/protocols.cpp index 80eefddc7c..7b8b3d647a 100644 --- a/src/modules/protocols/protocols.cpp +++ b/src/modules/protocols/protocols.cpp @@ -52,7 +52,7 @@ static LIST<PROTOCOLDESCRIPTOR> protos( 10, CompareProtos ); static INT_PTR Proto_BroadcastAck(WPARAM wParam, LPARAM lParam)
{
-#ifdef _UNICODE
+
ACKDATA *ack = (ACKDATA*)lParam;
if (ack && ack->type == ACKTYPE_AVATAR && ack->hProcess) {
PROTO_AVATAR_INFORMATION* ai = (PROTO_AVATAR_INFORMATION*)ack->hProcess;
@@ -63,7 +63,7 @@ static INT_PTR Proto_BroadcastAck(WPARAM wParam, LPARAM lParam) ack->hProcess = &aiw;
}
}
-#endif
+
return NotifyEventHooks(hAckEvent, wParam, lParam);
}
@@ -320,7 +320,7 @@ void Proto_SetStatus(const char* szProto, unsigned status) CallProtoService(szProto, PS_SETSTATUS, status, 0);
}
-#ifdef _UNICODE
+
char** __fastcall Proto_FilesMatrixA( wchar_t **files )
{
if ( files == NULL ) return NULL;
@@ -348,7 +348,7 @@ static wchar_t** __fastcall Proto_FilesMatrixU( char **files ) return filesU;
}
-#endif
+
/////////////////////////////////////////////////////////////////////////////////////////
// 0.8.0+ - accounts
@@ -410,7 +410,7 @@ INT_PTR CallProtoServiceInt( HANDLE hContact, const char *szModule, const char * if ( item ) {
switch( item->id ) {
case 1:
-#ifdef _UNICODE
+
if ( ppi->m_iVersion > 1 || !((( PROTOSEARCHRESULT* )lParam)->flags & PSR_UNICODE))
return ( INT_PTR )ppi->AddToList( wParam, (PROTOSEARCHRESULT*)lParam );
else {
@@ -432,9 +432,7 @@ INT_PTR CallProtoServiceInt( HANDLE hContact, const char *szModule, const char * return res;
}
-#else
- return ( INT_PTR )ppi->AddToList( wParam, (PROTOSEARCHRESULT*)lParam );
-#endif
+
case 2: return ( INT_PTR )ppi->AddToListByEvent( LOWORD(wParam), HIWORD(wParam), (HANDLE)lParam );
case 3: return ( INT_PTR )ppi->Authorize(( HANDLE )wParam );
case 4:
@@ -462,7 +460,7 @@ INT_PTR CallProtoServiceInt( HANDLE hContact, const char *szModule, const char * return ( INT_PTR )ppi->FileDeny( hContact, ( HANDLE )wParam, ( PROTOCHAR* )lParam );
case 11: {
PROTOFILERESUME* pfr = ( PROTOFILERESUME* )lParam;
-#ifdef _UNICODE
+
if ( ppi->m_iVersion > 1 ) {
PROTOCHAR* szFname = mir_a2t(( char* )pfr->szFilename );
INT_PTR res = ( INT_PTR )ppi->FileResume(( HANDLE )wParam, &pfr->action,
@@ -471,7 +469,7 @@ INT_PTR CallProtoServiceInt( HANDLE hContact, const char *szModule, const char * pfr->szFilename = ( PROTOCHAR* )mir_t2a( szFname ); mir_free( szFname );
}
else
-#endif
+
return ( INT_PTR )ppi->FileResume(( HANDLE )wParam, &pfr->action,
( const PROTOCHAR** )&pfr->szFilename );
}
@@ -505,7 +503,7 @@ INT_PTR CallProtoServiceInt( HANDLE hContact, const char *szModule, const char * case 24: return ( INT_PTR )ppi->SendContacts( hContact, LOWORD( wParam ), HIWORD( wParam ),
( HANDLE* )lParam );
case 25:
-#ifdef _UNICODE
+
if ( ppi->m_iVersion > 1 ) {
TCHAR** files = Proto_FilesMatrixU(( char** )lParam );
INT_PTR res = ( INT_PTR )ppi->SendFile( hContact, StrConvT(( char* )wParam ), ( TCHAR** )files );
@@ -513,7 +511,7 @@ INT_PTR CallProtoServiceInt( HANDLE hContact, const char *szModule, const char * return res;
}
else
-#endif
+
return ( INT_PTR )ppi->SendFile( hContact, ( TCHAR* )wParam, ( TCHAR** )lParam );
case 26: return ( INT_PTR )ppi->SendMsg( hContact, wParam, ( const char* )lParam );
case 27: return ( INT_PTR )ppi->SendUrl( hContact, wParam, ( const char* )lParam );
@@ -531,7 +529,7 @@ INT_PTR CallProtoServiceInt( HANDLE hContact, const char *szModule, const char * case 35: lstrcpynA(( char* )lParam, ppi->m_szModuleName, wParam ); return 0;
case 36: return ppi->m_iStatus;
-#ifdef _UNICODE
+
case 100:
if ( ppi->m_iVersion > 1 )
return ( INT_PTR )ppi->SetAwayMsg( wParam, ( TCHAR* )lParam );
@@ -595,10 +593,10 @@ INT_PTR CallProtoServiceInt( HANDLE hContact, const char *szModule, const char * return ( INT_PTR )ppi->SearchByEmail(( const TCHAR* )lParam );
else
return ( INT_PTR )ppi->SearchByEmail(StrConvA(( const TCHAR* )lParam ));
-#endif
+
} } } }
-#ifdef _UNICODE
+
if ( !strcmp( szService, PS_ADDTOLIST )) {
PROTOSEARCHRESULT *psr = ( PROTOSEARCHRESULT* )lParam;
if ( !( psr->flags & PSR_UNICODE )) {
@@ -619,11 +617,11 @@ INT_PTR CallProtoServiceInt( HANDLE hContact, const char *szModule, const char * return res;
}
}
-#endif
+
INT_PTR res = MyCallProtoService( szModule, szService, wParam, lParam );
-#ifdef _UNICODE
+
if ( res == CALLSERVICE_NOTFOUND && pa && pa->bOldProto && pa->ppro && strchr( szService, 'W' )) {
TServiceListItem *item = serviceItems.find(( TServiceListItem* )&szService );
if ( !item ) return res;
@@ -662,7 +660,7 @@ INT_PTR CallProtoServiceInt( HANDLE hContact, const char *szModule, const char * case 110:
return ( INT_PTR )pa->ppro->SearchByEmail(( const TCHAR* )lParam );
} }
-#endif
+
return res;
}
@@ -763,7 +761,7 @@ int LoadProtocolsModule(void) InsertServiceListItem( 35, PS_GETNAME );
InsertServiceListItem( 36, PS_GETSTATUS );
-#ifdef _UNICODE
+
InsertServiceListItem( 100, PS_SETAWAYMSGW );
InsertServiceListItem( 102, PSS_FILEW );
InsertServiceListItem( 103, PSS_FILEALLOWW );
@@ -774,7 +772,7 @@ int LoadProtocolsModule(void) InsertServiceListItem( 108, PS_BASICSEARCHW );
InsertServiceListItem( 109, PS_SEARCHBYNAMEW );
InsertServiceListItem( 110, PS_SEARCHBYEMAILW );
-#endif
+
hAckEvent = CreateHookableEvent(ME_PROTO_ACK);
hTypeEvent = CreateHookableEvent(ME_PROTO_CONTACTISTYPING);
diff --git a/src/modules/protocols/protoint.cpp b/src/modules/protocols/protoint.cpp index ccad4701d6..fa2ec3b729 100644 --- a/src/modules/protocols/protoint.cpp +++ b/src/modules/protocols/protoint.cpp @@ -70,14 +70,11 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE HANDLE __cdecl FileAllow( HANDLE hContact, HANDLE hTransfer, const PROTOCHAR* szPath )
{ CCSDATA ccs = { hContact, PSS_FILEALLOW, (WPARAM)hTransfer, (LPARAM)szPath };
-#ifdef _UNICODE
+
ccs.lParam = ( LPARAM )mir_t2a( szPath );
HANDLE res = ( HANDLE )MyCallProtoService( m_szModuleName, PSS_FILEALLOW, 0, (LPARAM)&ccs );
mir_free(( char* )ccs.lParam );
return res;
-#else
- return ( HANDLE )MyCallProtoService( m_szModuleName, PSS_FILEALLOW, 0, (LPARAM)&ccs );
-#endif
}
int __cdecl FileCancel( HANDLE hContact, HANDLE hTransfer )
@@ -87,27 +84,21 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE int __cdecl FileDeny( HANDLE hContact, HANDLE hTransfer, const PROTOCHAR* szReason )
{ CCSDATA ccs = { hContact, PSS_FILEDENY, (WPARAM)hTransfer, (LPARAM)szReason };
-#ifdef _UNICODE
+
ccs.lParam = ( LPARAM )mir_t2a( szReason );
int res = ( int )MyCallProtoService( m_szModuleName, PSS_FILEDENY, 0, (LPARAM)&ccs );
mir_free(( char* )ccs.lParam );
return res;
-#else
- return ( int )MyCallProtoService( m_szModuleName, PSS_FILEDENY, 0, (LPARAM)&ccs );
-#endif
}
int __cdecl FileResume( HANDLE hTransfer, int* action, const PROTOCHAR** szFilename )
{ PROTOFILERESUME pfr = { *action, *szFilename };
-#ifdef _UNICODE
+
pfr.szFilename = ( PROTOCHAR* )mir_t2a( pfr.szFilename );
int res = ( int )MyCallProtoService( m_szModuleName, PS_FILERESUME, ( WPARAM )hTransfer, ( LPARAM )&pfr);
mir_free(( PROTOCHAR* )*szFilename );
*action = pfr.action; *szFilename = (PROTOCHAR*)pfr.szFilename;
-#else
- int res = ( int )MyCallProtoService( m_szModuleName, PS_FILERESUME, ( WPARAM )hTransfer, ( LPARAM )&pfr );
- *action = pfr.action; *szFilename = (PROTOCHAR*)pfr.szFilename;
-#endif
+
return res;
}
@@ -134,7 +125,7 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE HANDLE __cdecl SearchByName( const PROTOCHAR* nick, const PROTOCHAR* firstName, const PROTOCHAR* lastName )
{ PROTOSEARCHBYNAME psn;
-#ifdef _UNICODE
+
psn.pszNick = ( PROTOCHAR* )mir_t2a( nick );
psn.pszFirstName = ( PROTOCHAR* )mir_t2a( firstName );
psn.pszLastName = ( PROTOCHAR* )mir_t2a( lastName );
@@ -143,12 +134,7 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE mir_free( psn.pszFirstName );
mir_free( psn.pszLastName );
return res;
-#else
- psn.pszNick = ( char* )nick;
- psn.pszFirstName = ( char* )firstName;
- psn.pszLastName = ( char* )lastName;
- return ( HANDLE )MyCallProtoService( m_szModuleName, PS_SEARCHBYNAME, 0, ( LPARAM )&psn );
-#endif
+
}
HWND __cdecl SearchAdvanced( HWND owner )
@@ -186,16 +172,13 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE HANDLE __cdecl SendFile( HANDLE hContact, const PROTOCHAR* szDescription, PROTOCHAR** ppszFiles )
{ CCSDATA ccs = { hContact, PSS_FILE, (WPARAM)szDescription, (LPARAM)ppszFiles };
-#ifdef _UNICODE
+
ccs.wParam = ( WPARAM )mir_t2a( szDescription );
ccs.lParam = ( LPARAM )Proto_FilesMatrixA( ppszFiles );
HANDLE res = ( HANDLE )MyCallProtoService( m_szModuleName, PSS_FILE, 0, ( LPARAM )&ccs );
if ( res == 0 ) FreeFilesMatrix(( TCHAR*** )&ccs.lParam );
mir_free(( char* )ccs.wParam );
return res;
-#else
- return ( HANDLE )MyCallProtoService( m_szModuleName, PSS_FILE, 0, (LPARAM)&ccs );
-#endif
}
int __cdecl SendMsg( HANDLE hContact, int flags, const char* msg )
|