diff options
Diffstat (limited to 'plugins/Import')
-rw-r--r-- | plugins/Import/import.h | 4 | ||||
-rw-r--r-- | plugins/Import/import_10.vcxproj | 12 | ||||
-rw-r--r-- | plugins/Import/import_10.vcxproj.filters | 12 | ||||
-rw-r--r-- | plugins/Import/main.cpp | 12 | ||||
-rw-r--r-- | plugins/Import/mirabilis.cpp | 4 | ||||
-rw-r--r-- | plugins/Import/miranda.cpp | 14 |
6 files changed, 28 insertions, 30 deletions
diff --git a/plugins/Import/import.h b/plugins/Import/import.h index 78e2715fe0..cbb6111a35 100644 --- a/plugins/Import/import.h +++ b/plugins/Import/import.h @@ -96,10 +96,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define IOPT_CONTACTS 4096
#define IOPT_GROUPS 8192
-
-struct MM_INTERFACE mmi;
-struct UTF8_INTERFACE utfi;
-
void AddMessage( const char* fmt, ... );
int CreateGroup(BYTE type, const char* name, HANDLE hContact);
diff --git a/plugins/Import/import_10.vcxproj b/plugins/Import/import_10.vcxproj index 839b97aa80..5766915232 100644 --- a/plugins/Import/import_10.vcxproj +++ b/plugins/Import/import_10.vcxproj @@ -208,14 +208,14 @@ </PreBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
- <ClCompile Include="ICQserver.c" />
- <ClCompile Include="main.c">
+ <ClCompile Include="ICQserver.cpp" />
+ <ClCompile Include="main.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
- <ClCompile Include="mirabilis.c" />
- <ClCompile Include="miranda.c" />
- <ClCompile Include="progress.c" />
- <ClCompile Include="wizard.c" />
+ <ClCompile Include="mirabilis.cpp" />
+ <ClCompile Include="miranda.cpp" />
+ <ClCompile Include="progress.cpp" />
+ <ClCompile Include="wizard.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="ICQserver.h" />
diff --git a/plugins/Import/import_10.vcxproj.filters b/plugins/Import/import_10.vcxproj.filters index 511f6e6481..48118ce444 100644 --- a/plugins/Import/import_10.vcxproj.filters +++ b/plugins/Import/import_10.vcxproj.filters @@ -18,22 +18,22 @@ </Filter>
</ItemGroup>
<ItemGroup>
- <ClCompile Include="ICQserver.c">
+ <ClCompile Include="ICQserver.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="main.c">
+ <ClCompile Include="main.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="mirabilis.c">
+ <ClCompile Include="mirabilis.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="miranda.c">
+ <ClCompile Include="miranda.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="progress.c">
+ <ClCompile Include="progress.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="wizard.c">
+ <ClCompile Include="wizard.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
diff --git a/plugins/Import/main.cpp b/plugins/Import/main.cpp index 36589b486e..a80ae522bd 100644 --- a/plugins/Import/main.cpp +++ b/plugins/Import/main.cpp @@ -49,6 +49,8 @@ HINSTANCE hInst; PLUGINLINK *pluginLink;
static HWND hwndWizard = NULL;
int hLangpack;
+struct MM_INTERFACE mmi;
+struct UTF8_INTERFACE utfi;
PLUGININFOEX pluginInfo = {
sizeof(PLUGININFOEX),
@@ -84,7 +86,7 @@ static INT_PTR ImportCommand(WPARAM wParam,LPARAM lParam) /////////////////////////////////////////////////////////////////////////////////////////
// MirandaPluginInfoEx - returns an information about a plugin
-__declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
+extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
{
return &pluginInfo;
}
@@ -94,7 +96,7 @@ __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion) static const MUUID interfaces[] = {MIID_IMPORT, MIID_LAST};
-__declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
+extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
{
return interfaces;
}
@@ -129,7 +131,7 @@ static int OnExit(WPARAM wParam, LPARAM lParam) return 0;
}
-int __declspec(dllexport) Load(PLUGINLINK *link)
+extern "C" __declspec(dllexport) int Load(PLUGINLINK *link)
{
pluginLink = link;
mir_getMMI( &mmi );
@@ -162,7 +164,7 @@ int __declspec(dllexport) Load(PLUGINLINK *link) /////////////////////////////////////////////////////////////////////////////////////////
// Unload a plugin
-int __declspec(dllexport) Unload(void)
+extern "C" __declspec(dllexport) int Unload(void)
{
if (hHookModulesLoaded)
UnhookEvent(hHookModulesLoaded);
@@ -349,7 +351,7 @@ int CreateGroup(BYTE type, const char* name, HANDLE hContact) return 0;
cbName = _tcslen(tmp);
- tszGrpName = _alloca(( cbName+2 )*sizeof( TCHAR ));
+ tszGrpName = (TCHAR*)_alloca(( cbName+2 )*sizeof( TCHAR ));
tszGrpName[0] = 1 | GROUPF_EXPANDED;
_tcscpy( tszGrpName+1, tmp );
mir_free( tmp );
diff --git a/plugins/Import/mirabilis.cpp b/plugins/Import/mirabilis.cpp index 8d4577acd6..1f032827af 100644 --- a/plugins/Import/mirabilis.cpp +++ b/plugins/Import/mirabilis.cpp @@ -1035,7 +1035,7 @@ BOOL ImportExtendedMessage(DWORD dwOffset) AddMessage( LPGEN("Ignoring msg with no text from %d ofs %d."), msg->uin, dwOffset );
return FALSE;
}
- pszText = _strdup(pDat + dwRichTextOffset + wRichTextLength + 2);
+ pszText = _strdup((char*)pDat + dwRichTextOffset + wRichTextLength + 2);
bFreeMe = TRUE;
mir_utf8decode(pszText, NULL);
wLength = (DWORD)strlen(pszText)+1;
@@ -1043,7 +1043,7 @@ BOOL ImportExtendedMessage(DWORD dwOffset) else {
// Use the ANSI text segment
wLength = msg->textLen;
- pszText = pDat + dwOffset + 0x2A;
+ pszText = (char*)(pDat + dwOffset + 0x2A);
}
// Convert the event to a Miranda dbevent
diff --git a/plugins/Import/miranda.cpp b/plugins/Import/miranda.cpp index 166fe65734..e83eaae869 100644 --- a/plugins/Import/miranda.cpp +++ b/plugins/Import/miranda.cpp @@ -478,7 +478,7 @@ struct DBHeader* GetHeader(HANDLE hDbFile) struct DBHeader* pdbHeader;
DWORD dwBytesRead;
- if (( pdbHeader = calloc(1, sizeof(struct DBHeader))) == NULL )
+ if (( pdbHeader = (DBHeader*)calloc(1, sizeof(struct DBHeader))) == NULL )
return NULL;
// Goto start of file
@@ -675,7 +675,7 @@ BOOL GetSettingsGroup(HANDLE hDbFile, DWORD dwOffset, struct DBContactSettings** // ** Read the struct and the following blob
dwBlobSize = pSettings.cbBlob;
- if (!(*pDbSettings = calloc(1, sizeof(struct DBContactSettings) + dwBlobSize)))
+ if (!(*pDbSettings = (DBContactSettings *)calloc(1, sizeof(struct DBContactSettings) + dwBlobSize)))
return FALSE;
memcpy(*pDbSettings, &pSettings, dwHead );
@@ -741,7 +741,7 @@ int GetSettingByName(struct DBContactSettings* pDbSettings, char* pszSettingName {
char pszName[256];
// We need at least one setting to start with
- char* pDbSetting = pDbSettings->blob;
+ char* pDbSetting = (char*)pDbSettings->blob;
if ( !pDbSetting )
return FALSE;
@@ -800,7 +800,7 @@ int GetSettingValue(char* pBlob, DBVARIANT* dbv) case DBVT_ASCIIZ:
case DBVT_UTF8:
dbv->cchVal = *(WORD*)pBlob;
- dbv->pszVal = calloc( dbv->cchVal+1, sizeof( char ));
+ dbv->pszVal = (char *)calloc( dbv->cchVal+1, sizeof( char ));
memcpy( dbv->pszVal, pBlob+2, dbv->cchVal );
dbv->pszVal[ dbv->cchVal ] = 0;
return TRUE;
@@ -808,7 +808,7 @@ int GetSettingValue(char* pBlob, DBVARIANT* dbv) case DBVTF_VARIABLELENGTH:
case DBVT_BLOB:
dbv->cpbVal = *(WORD*)pBlob;
- dbv->pbVal = calloc( dbv->cpbVal+1, sizeof( char ));
+ dbv->pbVal = (BYTE *)calloc( dbv->cpbVal+1, sizeof( char ));
memcpy( dbv->pbVal, pBlob+2, dbv->cpbVal );
dbv->pbVal[ dbv->cpbVal ] = 0;
return TRUE;
@@ -886,7 +886,7 @@ BOOL GetEvent(HANDLE hDbFile, DWORD dwOffset, DBEVENTINFO* pDBEI) pDBEI->eventType = pEvent.eventType;
pDBEI->cbSize = sizeof(DBEVENTINFO);
pDBEI->cbBlob = pEvent.cbBlob;
- pDBEI->pBlob = pBlob;
+ pDBEI->pBlob = (PBYTE)pBlob;
pDBEI->flags = (pEvent.flags & ~(DBEF_SENT+DBEF_READ)) +
((pEvent.flags & DBEF_SENT) ? DBEF_SENT : DBEF_READ ); // Imported events are always marked READ
@@ -985,7 +985,7 @@ int ImportGroups(HANDLE hDbFile, struct DBHeader* pdbHeader) // Find the module with the groups, and import them all
if ( pDbSettings = GetSettingsGroupByModuleName( hDbFile, &DbContact, "CListGroups" )) {
- pSetting = pDbSettings->blob;
+ pSetting = (char *)pDbSettings->blob;
while ( pSetting && *pSetting ) {
DBVARIANT dbv;
if ( GetSettingValue( pSetting, &dbv )) {
|