summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2012-06-23 13:53:03 +0000
committerKirill Volinsky <mataes2007@gmail.com>2012-06-23 13:53:03 +0000
commit4da03f6440d24fefcc129fc3317b9519a76f9216 (patch)
tree1badb0a0a2d7ced87ce2b38cab9578eae04f12a3
parentf3088d36fec8c063462d9dc16734ec0c11813668 (diff)
Import_SA:
plusified git-svn-id: http://svn.miranda-ng.org/main/trunk@554 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--plugins/Dbx_mmap_SA/Import_SA/import.h5
-rw-r--r--plugins/Dbx_mmap_SA/Import_SA/import_sa_10.vcxproj14
-rw-r--r--plugins/Dbx_mmap_SA/Import_SA/import_sa_10.vcxproj.filters14
-rw-r--r--plugins/Dbx_mmap_SA/Import_SA/main.cpp13
-rw-r--r--plugins/Dbx_mmap_SA/Import_SA/mirabilis.cpp4
-rw-r--r--plugins/Dbx_mmap_SA/Import_SA/miranda.cpp30
6 files changed, 37 insertions, 43 deletions
diff --git a/plugins/Dbx_mmap_SA/Import_SA/import.h b/plugins/Dbx_mmap_SA/Import_SA/import.h
index 2694959828..1c50146a15 100644
--- a/plugins/Dbx_mmap_SA/Import_SA/import.h
+++ b/plugins/Dbx_mmap_SA/Import_SA/import.h
@@ -99,11 +99,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;
-
-// Unsane: none
extern HINSTANCE hInst;
void AddMessage( const char* fmt, ... );
diff --git a/plugins/Dbx_mmap_SA/Import_SA/import_sa_10.vcxproj b/plugins/Dbx_mmap_SA/Import_SA/import_sa_10.vcxproj
index 9de942eb87..2f0918857d 100644
--- a/plugins/Dbx_mmap_SA/Import_SA/import_sa_10.vcxproj
+++ b/plugins/Dbx_mmap_SA/Import_SA/import_sa_10.vcxproj
@@ -205,15 +205,15 @@
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
- <ClCompile Include="encryption.c" />
- <ClCompile Include="ICQserver.c" />
- <ClCompile Include="main.c">
+ <ClCompile Include="encryption.cpp" />
+ <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/Dbx_mmap_SA/Import_SA/import_sa_10.vcxproj.filters b/plugins/Dbx_mmap_SA/Import_SA/import_sa_10.vcxproj.filters
index af9d0a9c31..f1fec2b705 100644
--- a/plugins/Dbx_mmap_SA/Import_SA/import_sa_10.vcxproj.filters
+++ b/plugins/Dbx_mmap_SA/Import_SA/import_sa_10.vcxproj.filters
@@ -18,25 +18,25 @@
</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>
- <ClCompile Include="encryption.c">
+ <ClCompile Include="encryption.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
diff --git a/plugins/Dbx_mmap_SA/Import_SA/main.cpp b/plugins/Dbx_mmap_SA/Import_SA/main.cpp
index f6fd4bc67a..331984958a 100644
--- a/plugins/Dbx_mmap_SA/Import_SA/main.cpp
+++ b/plugins/Dbx_mmap_SA/Import_SA/main.cpp
@@ -28,7 +28,6 @@ void WriteVariant( HANDLE hContact, const char* module, const char* var, DBVARIA
BOOL IsDuplicateEvent(HANDLE hContact, DBEVENTINFO dbei);
-
int nImportOption;
int nCustomOptions;
int hLangpack;
@@ -47,6 +46,8 @@ INT_PTR CALLBACK WizardDlgProc(HWND hdlg,UINT message,WPARAM wParam,LPARAM lPara
HINSTANCE hInst;
PLUGINLINK *pluginLink;
static HWND hwndWizard = NULL;
+struct MM_INTERFACE mmi;
+struct UTF8_INTERFACE utfi;
PLUGININFOEX pluginInfo = {
sizeof(PLUGININFOEX),
@@ -82,7 +83,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;
}
@@ -92,7 +93,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;
}
@@ -127,7 +128,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 );
@@ -160,7 +161,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);
@@ -347,7 +348,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/Dbx_mmap_SA/Import_SA/mirabilis.cpp b/plugins/Dbx_mmap_SA/Import_SA/mirabilis.cpp
index 130843205e..15b58f4e0a 100644
--- a/plugins/Dbx_mmap_SA/Import_SA/mirabilis.cpp
+++ b/plugins/Dbx_mmap_SA/Import_SA/mirabilis.cpp
@@ -1034,7 +1034,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;
@@ -1042,7 +1042,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/Dbx_mmap_SA/Import_SA/miranda.cpp b/plugins/Dbx_mmap_SA/Import_SA/miranda.cpp
index 69b348d192..21ece87022 100644
--- a/plugins/Dbx_mmap_SA/Import_SA/miranda.cpp
+++ b/plugins/Dbx_mmap_SA/Import_SA/miranda.cpp
@@ -482,7 +482,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
@@ -550,7 +550,9 @@ int CheckFileFormat(HANDLE hDbFile)
return DB_INVALID;
}
break;
-} }
+ }
+ return 1;
+}
// High level Miranda DB access functions
// Returns true if pValue points to the requested value
@@ -706,7 +708,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 );
@@ -772,7 +774,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;
@@ -821,26 +823,23 @@ int GetSettingValue(char* pBlob, DBVARIANT* dbv)
return TRUE;
case DBVT_WORD:
- // Unsane: encrypt WORDs
if (bEncrypted)
- DecodeMemory(pBlob, sizeof(pBlob));
+ DecodeMemory((BYTE *)pBlob, sizeof(pBlob));
dbv->wVal = *(WORD*)pBlob;
return TRUE;
case DBVT_DWORD:
- // Unsane: encrypt DWORDs
if (bEncrypted)
- DecodeMemory(pBlob, sizeof(pBlob));
+ DecodeMemory((BYTE *)pBlob, sizeof(pBlob));
dbv->dVal = *(DWORD*)pBlob;
return TRUE;
case DBVT_ASCIIZ:
case DBVT_UTF8:
- // Unsane: encrypt STRINGs
dbv->cchVal = *(WORD*)pBlob;
- dbv->pszVal = calloc( dbv->cchVal+1, sizeof( char ));
+ dbv->pszVal = (char *)calloc( dbv->cchVal+1, sizeof( char ));
if (bEncrypted)
- DecodeCopyMemory(dbv->pszVal, pBlob+2, dbv->cchVal);
+ DecodeCopyMemory((BYTE *)dbv->pszVal, pBlob+2, dbv->cchVal);
else
memcpy( dbv->pszVal, pBlob+2, dbv->cchVal );
dbv->pszVal[ dbv->cchVal ] = 0;
@@ -850,10 +849,9 @@ int GetSettingValue(char* pBlob, DBVARIANT* dbv)
case DBVTF_VARIABLELENGTH:
case DBVT_BLOB:
dbv->cpbVal = *(WORD*)pBlob;
- dbv->pbVal = calloc( dbv->cpbVal+1, sizeof( char ));
- // Unsane: encrypt other
+ dbv->pbVal = (BYTE *)calloc( dbv->cpbVal+1, sizeof( char ));
if (bEncrypted)
- DecodeCopyMemory(dbv->pszVal, pBlob+2, dbv->cchVal);
+ DecodeCopyMemory((BYTE *)dbv->pszVal, pBlob+2, dbv->cchVal);
else
memcpy( dbv->pbVal, pBlob+2, dbv->cpbVal );
dbv->pbVal[ dbv->cpbVal ] = 0;
@@ -932,7 +930,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
@@ -1037,7 +1035,7 @@ int ImportGroups(HANDLE hDbFile, struct DBHeader* pdbHeader)
if ( pDbSettings = GetSettingsGroupByModuleName( hDbFile, &DbContact, "CListGroups" )) {
/*if (bEncrypted)
DecodeMemory(pDbSettings->blob, pDbSettings->cbBlob);*/
- pSetting = pDbSettings->blob;
+ pSetting = (char *)pDbSettings->blob;
while ( pSetting && *pSetting ) {
DBVARIANT dbv;
if ( GetSettingValue( pSetting, &dbv )) {