diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2012-06-23 17:31:32 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2012-06-23 17:31:32 +0000 |
commit | d11afafa9a4ffcf5c33f64d55d1ce22e452d6120 (patch) | |
tree | d409c487fd54476c45f55f3d385d32745e9f9f7d /plugins | |
parent | 1204c8ca267a83f1df6b8087bbfc5335ffb5090d (diff) |
Db3x_mmap:
plusified
git-svn-id: http://svn.miranda-ng.org/main/trunk@576 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/Db3x_mmap/commonheaders.cpp | 1 | ||||
-rw-r--r-- | plugins/Db3x_mmap/commonheaders.h | 5 | ||||
-rw-r--r-- | plugins/Db3x_mmap/db3x_mmap_10.vcxproj | 19 | ||||
-rw-r--r-- | plugins/Db3x_mmap/db3x_mmap_10.vcxproj.filters | 20 | ||||
-rw-r--r-- | plugins/Db3x_mmap/dbcache.cpp | 6 | ||||
-rw-r--r-- | plugins/Db3x_mmap/dbmodulechain.cpp | 10 | ||||
-rw-r--r-- | plugins/Db3x_mmap/dbsettings.cpp | 32 | ||||
-rw-r--r-- | plugins/Db3x_mmap/init.cpp | 14 |
8 files changed, 53 insertions, 54 deletions
diff --git a/plugins/Db3x_mmap/commonheaders.cpp b/plugins/Db3x_mmap/commonheaders.cpp deleted file mode 100644 index 14f99f7d71..0000000000 --- a/plugins/Db3x_mmap/commonheaders.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "commonheaders.h"
diff --git a/plugins/Db3x_mmap/commonheaders.h b/plugins/Db3x_mmap/commonheaders.h index 726e69bf1f..bc74ee267a 100644 --- a/plugins/Db3x_mmap/commonheaders.h +++ b/plugins/Db3x_mmap/commonheaders.h @@ -40,8 +40,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifndef __GNUC__
#include <crtdbg.h>
#endif
-#include "resource.h"
-#include "version.h"
+
#include <newpluginapi.h>
#include <win2k.h>
#include <m_plugins.h>
@@ -51,6 +50,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include <m_utils.h>
#include "database.h"
+#include "resource.h"
+#include "version.h"
extern PLUGINLINK *pluginLink;
diff --git a/plugins/Db3x_mmap/db3x_mmap_10.vcxproj b/plugins/Db3x_mmap/db3x_mmap_10.vcxproj index 329774f2d2..4e5cd03d40 100644 --- a/plugins/Db3x_mmap/db3x_mmap_10.vcxproj +++ b/plugins/Db3x_mmap/db3x_mmap_10.vcxproj @@ -201,18 +201,17 @@ </PreBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
- <ClCompile Include="commonheaders.c">
+ <ClCompile Include="database.cpp" />
+ <ClCompile Include="dbcache.cpp" />
+ <ClCompile Include="dbcontacts.cpp" />
+ <ClCompile Include="dbevents.cpp" />
+ <ClCompile Include="dbheaders.cpp" />
+ <ClCompile Include="dbmodulechain.cpp" />
+ <ClCompile Include="dbsettings.cpp" />
+ <ClCompile Include="encrypt.cpp" />
+ <ClCompile Include="init.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
- <ClCompile Include="database.c" />
- <ClCompile Include="dbcache.c" />
- <ClCompile Include="dbcontacts.c" />
- <ClCompile Include="dbevents.c" />
- <ClCompile Include="dbheaders.c" />
- <ClCompile Include="dbmodulechain.c" />
- <ClCompile Include="dbsettings.c" />
- <ClCompile Include="encrypt.c" />
- <ClCompile Include="init.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="commonheaders.h" />
diff --git a/plugins/Db3x_mmap/db3x_mmap_10.vcxproj.filters b/plugins/Db3x_mmap/db3x_mmap_10.vcxproj.filters index 448b7073e8..667339ebe6 100644 --- a/plugins/Db3x_mmap/db3x_mmap_10.vcxproj.filters +++ b/plugins/Db3x_mmap/db3x_mmap_10.vcxproj.filters @@ -15,34 +15,34 @@ </Filter>
</ItemGroup>
<ItemGroup>
- <ClCompile Include="commonheaders.c">
+ <ClCompile Include="commonheaders.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="database.c">
+ <ClCompile Include="database.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="dbcache.c">
+ <ClCompile Include="dbcache.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="dbcontacts.c">
+ <ClCompile Include="dbcontacts.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="dbevents.c">
+ <ClCompile Include="dbevents.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="dbheaders.c">
+ <ClCompile Include="dbheaders.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="dbmodulechain.c">
+ <ClCompile Include="dbmodulechain.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="dbsettings.c">
+ <ClCompile Include="dbsettings.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="encrypt.c">
+ <ClCompile Include="encrypt.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="init.c">
+ <ClCompile Include="init.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
diff --git a/plugins/Db3x_mmap/dbcache.cpp b/plugins/Db3x_mmap/dbcache.cpp index 625d8aa775..f5b953f615 100644 --- a/plugins/Db3x_mmap/dbcache.cpp +++ b/plugins/Db3x_mmap/dbcache.cpp @@ -40,7 +40,7 @@ void Map() if (hMap)
{
- pDbCache = MapViewOfFile(hMap, FILE_MAP_ALL_ACCESS/*FILE_MAP_WRITE*/, 0, 0 ,0);
+ pDbCache = (PBYTE)MapViewOfFile(hMap, FILE_MAP_ALL_ACCESS/*FILE_MAP_WRITE*/, 0, 0 ,0);
if (!pDbCache)
DatabaseCorruption( _T("%s (MapViewOfFile failed. Code: %d)"));
}
@@ -189,9 +189,9 @@ int InitCache(void) Map();
// zero region for reads outside the file
- pNull = calloc(ChunkSize,1);
+ pNull = (PBYTE)calloc(ChunkSize, 1);
- CreateServiceFunction(MS_DB_SETSAFETYMODE,CacheSetSafetyMode);
+ CreateServiceFunction(MS_DB_SETSAFETYMODE, CacheSetSafetyMode);
return 0;
}
diff --git a/plugins/Db3x_mmap/dbmodulechain.cpp b/plugins/Db3x_mmap/dbmodulechain.cpp index 1af4226419..671a239d48 100644 --- a/plugins/Db3x_mmap/dbmodulechain.cpp +++ b/plugins/Db3x_mmap/dbmodulechain.cpp @@ -69,11 +69,11 @@ int InitModuleNames(void) int nameLen;
char *mod;
- hModHeap=HeapCreate(0,0,0);
- lMods.sortFunc=ModCompare;
- lMods.increment=50;
- lOfs.sortFunc=OfsCompare;
- lOfs.increment=50;
+ hModHeap = HeapCreate(0, 0, 0);
+ lMods.sortFunc = (FSortFunc)ModCompare;
+ lMods.increment = 50;
+ lOfs.sortFunc = (FSortFunc)OfsCompare;
+ lOfs.increment = 50;
ofsThis=dbHeader.ofsFirstModuleName;
dbmn=(struct DBModuleName*)DBRead(ofsThis,sizeof(struct DBModuleName),NULL);
diff --git a/plugins/Db3x_mmap/dbsettings.cpp b/plugins/Db3x_mmap/dbsettings.cpp index 451ea95501..90dfecd727 100644 --- a/plugins/Db3x_mmap/dbsettings.cpp +++ b/plugins/Db3x_mmap/dbsettings.cpp @@ -179,7 +179,7 @@ static DBVARIANT* GetCachedValuePtr( HANDLE hContact, char* szSetting, int bAllo if ( bAllocate != 1 )
return NULL;
- V = HeapAlloc(hCacheHeap,HEAP_ZERO_MEMORY,sizeof(DBCachedContactValue));
+ V = (DBCachedContactValue *)HeapAlloc(hCacheHeap, HEAP_ZERO_MEMORY, sizeof(DBCachedContactValue));
if (VL->last)
VL->last->next = V;
else
@@ -341,7 +341,7 @@ static __inline int GetContactSettingWorker(HANDLE hContact,DBCONTACTGETSETTING CopyMemory(dbcgs->pValue->pbVal,pBlob+3,dbcgs->pValue->cpbVal);
}
else {
- dbcgs->pValue->pbVal=(char*)mir_alloc(*(PWORD)(pBlob+1));
+ dbcgs->pValue->pbVal=(BYTE *)mir_alloc(*(PWORD)(pBlob+1));
CopyMemory(dbcgs->pValue->pbVal,pBlob+3,*(PWORD)(pBlob+1));
}
dbcgs->pValue->cpbVal=*(PWORD)(pBlob+1);
@@ -402,7 +402,7 @@ static INT_PTR GetContactSetting(WPARAM wParam,LPARAM lParam) }
else {
dgs->pValue->type = DBVT_ASCIIZ;
- dgs->pValue->pszVal = mir_alloc( result );
+ dgs->pValue->pszVal = (char *)mir_alloc(result);
WideCharToMultiByte( mirCp, WC_NO_BEST_FIT_CHARS, tmp, -1, dgs->pValue->pszVal, result, NULL, NULL );
mir_free( tmp );
}
@@ -515,7 +515,7 @@ static INT_PTR SetSettingResident(WPARAM wParam,LPARAM lParam) if ( !li.List_GetIndex( &lSettings, szTemp, &idx ))
szSetting = InsertCachedSetting( szTemp, cbSettingNameLen, idx );
else
- szSetting = lSettings.items[ idx ];
+ szSetting = (char *)lSettings.items[idx];
*szSetting = (char)wParam;
@@ -955,7 +955,7 @@ static INT_PTR EnumResidentSettings(WPARAM wParam,LPARAM lParam) int i;
int ret;
for(i = 0; i < lResidentSettings.realCount; i++) {
- ret=((DBMODULEENUMPROC)lParam)(lResidentSettings.items[i],0,wParam);
+ ret=((DBMODULEENUMPROC)lParam)((char *)lResidentSettings.items[i], 0, wParam);
if(ret) return ret;
}
return 0;
@@ -989,17 +989,17 @@ int InitSettings(void) hSettingChangeEvent=CreateHookableEvent(ME_DB_CONTACT_SETTINGCHANGED);
- hCacheHeap=HeapCreate(0,0,0);
- lSettings.sortFunc=stringCompare;
- lSettings.increment=100;
- lContacts.sortFunc=HandleKeySort;
- lContacts.increment=50;
- lGlobalSettings.sortFunc=HandleKeySort;
- lGlobalSettings.increment=50;
- lResidentSettings.sortFunc=stringCompare2;
- lResidentSettings.increment=50;
-
- mirCp = CallService( MS_LANGPACK_GETCODEPAGE, 0, 0 );
+ hCacheHeap = HeapCreate(0, 0, 0);
+ lSettings.sortFunc = (FSortFunc)stringCompare;
+ lSettings.increment = 100;
+ lContacts.sortFunc = HandleKeySort;
+ lContacts.increment = 50;
+ lGlobalSettings.sortFunc = HandleKeySort;
+ lGlobalSettings.increment = 50;
+ lResidentSettings.sortFunc = (FSortFunc)stringCompare2;
+ lResidentSettings.increment = 50;
+
+ mirCp = CallService(MS_LANGPACK_GETCODEPAGE, 0, 0);
return 0;
}
diff --git a/plugins/Db3x_mmap/init.cpp b/plugins/Db3x_mmap/init.cpp index 30f8e9b60e..d62cf5afe2 100644 --- a/plugins/Db3x_mmap/init.cpp +++ b/plugins/Db3x_mmap/init.cpp @@ -120,7 +120,7 @@ static int grokHeader( char * profile, int * error ) // returns 0 if all the APIs are injected otherwise, 1
static int LoadDatabase( char * profile, void * plink )
{
- PLUGINLINK *link = plink;
+ PLUGINLINK *link = (PLUGINLINK *)plink;
#ifdef _DEBUG
_CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
#endif
@@ -169,28 +169,28 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD dwReason, LPVOID reserved) return TRUE;
}
-__declspec(dllexport) DATABASELINK* DatabasePluginInfo(void * reserved)
+extern "C" __declspec(dllexport) DATABASELINK* DatabasePluginInfo(void * reserved)
{
return &dblink;
}
-__declspec(dllexport) PLUGININFOEX * MirandaPluginInfoEx(DWORD mirandaVersion)
+extern "C" __declspec(dllexport) PLUGININFOEX * MirandaPluginInfoEx(DWORD mirandaVersion)
{
return &pluginInfo;
}
static const MUUID interfaces[] = {MIID_DATABASE, MIID_LAST};
-__declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
+extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
{
return interfaces;
}
-int __declspec(dllexport) Load(PLUGINLINK * link)
+extern "C" __declspec(dllexport) int Load(PLUGINLINK * link)
{
return 1;
}
-int __declspec(dllexport) Unload(void)
+extern "C" __declspec(dllexport) int Unload(void)
{
return 0;
-}
+}
\ No newline at end of file |