summaryrefslogtreecommitdiff
path: root/plugins/FlashAvatars
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/FlashAvatars')
-rw-r--r--plugins/FlashAvatars/TigerHash.cpp2
-rw-r--r--plugins/FlashAvatars/cflash.cpp37
-rw-r--r--plugins/FlashAvatars/stdafx.h5
3 files changed, 25 insertions, 19 deletions
diff --git a/plugins/FlashAvatars/TigerHash.cpp b/plugins/FlashAvatars/TigerHash.cpp
index 5c680e5d8f..406676f0a5 100644
--- a/plugins/FlashAvatars/TigerHash.cpp
+++ b/plugins/FlashAvatars/TigerHash.cpp
@@ -166,7 +166,7 @@ void TigerHash::update(const void* data, size_t length) {
pos += n;
length -= n;
- if((tmppos + n) == BLOCK_SIZE) {
+ if ((tmppos + n) == BLOCK_SIZE) {
#ifdef TIGER_BIG_ENDIAN
for(j=0; j<BLOCK_SIZE; j++)
buf[j^7]=((uint8_t*)tmp)[j];
diff --git a/plugins/FlashAvatars/cflash.cpp b/plugins/FlashAvatars/cflash.cpp
index 5ab6e1379a..78eaf7912c 100644
--- a/plugins/FlashAvatars/cflash.cpp
+++ b/plugins/FlashAvatars/cflash.cpp
@@ -127,7 +127,7 @@ LPAtlAxAttachControl MyAtlAxAttachControl;
}
static bool DownloadFlashFile(char *url, const TCHAR* save_file, int recurse_count /*=0*/) {
- if(!url || recurse_count > 5) {
+ if (!url || recurse_count > 5) {
return false;
}
@@ -204,7 +204,7 @@ static void __cdecl loadFlash_Thread(void *p) {
fgd.cbSize = sizeof(FOLDERSGETDATA);
fgd.nMaxPathSize = MAX_PATH;
fgd.szPathT = path;
- if(!hAvatarsFolder || CallService(MS_FOLDERS_GET_PATH, (WPARAM)hAvatarsFolder, (LPARAM)&fgd)) {
+ if (!hAvatarsFolder || CallService(MS_FOLDERS_GET_PATH, (WPARAM)hAvatarsFolder, (LPARAM)&fgd)) {
if(ServiceExists(MS_UTILS_REPLACEVARS)) {
TCHAR *tmpPath = Utils_ReplaceVarsT(_T("%miranda_avatarcache%"));
mir_sntprintf(path, MAX_PATH, _T("%s\\%s"), tmpPath, _T("Flash"));
@@ -305,7 +305,7 @@ static void prepareFlash(char* pProto, const char* pUrl, FLASHAVATAR& fa, IShock
//loadFlash(new FlashPair(make_pair(fa, flash)));
}
-static int destroyAvatar(WPARAM wParam, LPARAM)
+static INT_PTR destroyAvatar(WPARAM wParam, LPARAM)
{
flash_avatar_item key(((FLASHAVATAR*)wParam)->hContact, *(FLASHAVATAR*)wParam, NULL);
@@ -324,7 +324,7 @@ static int destroyAvatar(WPARAM wParam, LPARAM)
return 0;
}
-static int makeAvatar(WPARAM wParam, LPARAM)
+static INT_PTR makeAvatar(WPARAM wParam, LPARAM)
{
debug("Searching for flash avatar...\n");
FLASHAVATAR* hFA = (FLASHAVATAR*)wParam;
@@ -348,7 +348,7 @@ static int makeAvatar(WPARAM wParam, LPARAM)
}
}
- if(!avatarOK) return 0;
+ if (!avatarOK) return 0;
debug("Avatar found...\n");
char* url = NULL;
@@ -411,7 +411,7 @@ static int makeAvatar(WPARAM wParam, LPARAM)
return 0;
}
-static int resizeAvatar(WPARAM wParam, LPARAM lParam)
+static INT_PTR resizeAvatar(WPARAM wParam, LPARAM lParam)
{
FLASHAVATAR* hFA = (FLASHAVATAR*)wParam;
RECT rc = *((LPRECT)lParam);
@@ -425,7 +425,7 @@ static int resizeAvatar(WPARAM wParam, LPARAM lParam)
return 0;
}
-static int setPos(WPARAM wParam, LPARAM lParam)
+static INT_PTR setPos(WPARAM wParam, LPARAM lParam)
{
FLASHAVATAR* hFA = (FLASHAVATAR*)wParam;
RECT rc = *((LPRECT)lParam);
@@ -439,7 +439,7 @@ static int setPos(WPARAM wParam, LPARAM lParam)
return 0;
}
-static int getInfo(WPARAM wParam, LPARAM)
+static INT_PTR getInfo(WPARAM wParam, LPARAM)
{
FLASHAVATAR* hFA = (FLASHAVATAR*)wParam;
flash_avatar_item key(hFA->hContact, *hFA, NULL);
@@ -455,7 +455,7 @@ static int getInfo(WPARAM wParam, LPARAM)
return 0;
}
-static int setEmoFace(WPARAM wParam, LPARAM lParam)
+static INT_PTR setEmoFace(WPARAM wParam, LPARAM lParam)
{
FLASHAVATAR* hFA = (FLASHAVATAR*)wParam;
flash_avatar_item key(hFA->hContact, *hFA, NULL);
@@ -469,7 +469,7 @@ static int setEmoFace(WPARAM wParam, LPARAM lParam)
return 0;
}
-static int setBkColor(WPARAM wParam, LPARAM lParam)
+static INT_PTR setBkColor(WPARAM wParam, LPARAM lParam)
{
FLASHAVATAR* hFA = (FLASHAVATAR*)wParam;
COLORREF clr = (COLORREF)lParam;
@@ -543,7 +543,7 @@ static int eventAdded(WPARAM wParam, LPARAM lParam)
//size_t aLen = strlen((char *)dbei.pBlob)+1;
char* face = NULL;
- if( (strstr((char*)dbei.pBlob, (char*)":-)") != NULL) ||
+ if ( (strstr((char*)dbei.pBlob, (char*)":-)") != NULL) ||
(strstr((char*)dbei.pBlob, (char*)":)") != NULL) ||
(strstr((char*)dbei.pBlob, (char*)";)") != NULL) ||
(strstr((char*)dbei.pBlob, (char*)";-)") != NULL) ||
@@ -553,24 +553,24 @@ static int eventAdded(WPARAM wParam, LPARAM lParam)
(strstr((char*)dbei.pBlob, (char*)":-P") != NULL) ||
(strstr((char*)dbei.pBlob, (char*)"*Drink*") != NULL)) { face = AV_SMILE; }
else
- if( (strstr((char*)dbei.pBlob, (char*)":-(") != NULL) ||
+ if ( (strstr((char*)dbei.pBlob, (char*)":-(") != NULL) ||
(strstr((char*)dbei.pBlob, (char*)":-$") != NULL) ||
(strstr((char*)dbei.pBlob, (char*)":-!") != NULL) ||
(strstr((char*)dbei.pBlob, (char*)":-X") != NULL)) { face = AV_SAD; }
else
- if( (strstr((char*)dbei.pBlob, (char*)"*JOKINGLY*") != NULL) ||
+ if ( (strstr((char*)dbei.pBlob, (char*)"*JOKINGLY*") != NULL) ||
(strstr((char*)dbei.pBlob, (char*)":-D") != NULL)) { face = AV_LAUGH; }
else
- if( (strstr((char*)dbei.pBlob, (char*)":'(") != NULL) ||
+ if ( (strstr((char*)dbei.pBlob, (char*)":'(") != NULL) ||
(strstr((char*)dbei.pBlob, (char*)":'-(") != NULL)) { face = AV_CRY; }
else
- if( (strstr((char*)dbei.pBlob, (char*)">:o") != NULL) ||
+ if ( (strstr((char*)dbei.pBlob, (char*)">:o") != NULL) ||
(strstr((char*)dbei.pBlob, (char*)":-@") != NULL) ||
(strstr((char*)dbei.pBlob, (char*)"*STOP*") != NULL) ||
(strstr((char*)dbei.pBlob, (char*)"]:->") != NULL) ||
(strstr((char*)dbei.pBlob, (char*)"@=") != NULL)) { face = AV_MAD; }
else
- if( (strstr((char*)dbei.pBlob, (char*)":-*") != NULL) ||
+ if ( (strstr((char*)dbei.pBlob, (char*)":-*") != NULL) ||
(strstr((char*)dbei.pBlob, (char*)":-[") != NULL) ||
(strstr((char*)dbei.pBlob, (char*)"*KISSED*") != NULL) ||
(strstr((char*)dbei.pBlob, (char*)"*KISSING*") != NULL) ||
@@ -597,11 +597,14 @@ static int eventAdded(WPARAM wParam, LPARAM lParam)
return 0;
}
+typedef BOOL (__stdcall *pfnAtlAxWinInit)( void );
static int systemModulesLoaded(WPARAM /*wParam*/, LPARAM /*lParam*/)
{
HMODULE hAtl = LoadLibrary(_T("atl"));
- void* init = GetProcAddress(hAtl, "AtlAxWinInit"); _asm call init;
+ pfnAtlAxWinInit init = (pfnAtlAxWinInit)GetProcAddress(hAtl, "AtlAxWinInit");
+ if (init)
+ init();
MyAtlAxAttachControl = (LPAtlAxAttachControl)GetProcAddress(hAtl, "AtlAxAttachControl");
hServices[0] = CreateServiceFunction(MS_FAVATAR_DESTROY, destroyAvatar);
diff --git a/plugins/FlashAvatars/stdafx.h b/plugins/FlashAvatars/stdafx.h
index 693caae144..6113744e85 100644
--- a/plugins/FlashAvatars/stdafx.h
+++ b/plugins/FlashAvatars/stdafx.h
@@ -15,7 +15,10 @@
# define _STLP_DEBUG 1
#endif
-#define _USE_32BIT_TIME_T
+#ifndef _WIN64
+ #define _USE_32BIT_TIME_T
+#endif
+
#define _STLP_DONT_USE_SHORT_STRING_OPTIM 1 // Uses small string buffer, so it saves memory for a lot of strings
#define _STLP_USE_PTR_SPECIALIZATIONS 1 // Reduces some code bloat
#define _STLP_USE_TEMPLATE_EXPRESSION 1 // Speeds up string concatenation