diff options
Diffstat (limited to 'plugins/AVS/src')
-rw-r--r-- | plugins/AVS/src/cache.cpp | 6 | ||||
-rw-r--r-- | plugins/AVS/src/image_utils.cpp | 16 | ||||
-rw-r--r-- | plugins/AVS/src/image_utils.h | 2 | ||||
-rw-r--r-- | plugins/AVS/src/main.cpp | 6 | ||||
-rw-r--r-- | plugins/AVS/src/poll.h | 2 | ||||
-rw-r--r-- | plugins/AVS/src/services.cpp | 4 | ||||
-rw-r--r-- | plugins/AVS/src/stdafx.h | 6 | ||||
-rw-r--r-- | plugins/AVS/src/utils.cpp | 4 |
8 files changed, 23 insertions, 23 deletions
diff --git a/plugins/AVS/src/cache.cpp b/plugins/AVS/src/cache.cpp index b54baa4d5c..fd64deb704 100644 --- a/plugins/AVS/src/cache.cpp +++ b/plugins/AVS/src/cache.cpp @@ -200,7 +200,7 @@ void DeleteAvatarFromCache(MCONTACT hContact, bool bForever) /////////////////////////////////////////////////////////////////////////////////////////
-int SetAvatarAttribute(MCONTACT hContact, DWORD attrib, int mode)
+int SetAvatarAttribute(MCONTACT hContact, uint32_t attrib, int mode)
{
if (g_shutDown)
return 0;
@@ -208,7 +208,7 @@ int SetAvatarAttribute(MCONTACT hContact, DWORD attrib, int mode) mir_cslock lck(cachecs);
CacheNode *cc = arCache.find((CacheNode*)&hContact);
if (cc != nullptr) {
- DWORD dwFlags = cc->dwFlags;
+ uint32_t dwFlags = cc->dwFlags;
cc->dwFlags = mode ? (cc->dwFlags | attrib) : (cc->dwFlags & ~attrib);
if (cc->dwFlags != dwFlags)
NotifyMetaAware(hContact, cc);
@@ -224,7 +224,7 @@ void PicLoader(LPVOID) {
Thread_SetName("AVS: PicLoader");
- DWORD dwDelay = g_plugin.getDword("picloader_sleeptime", 80);
+ uint32_t dwDelay = g_plugin.getDword("picloader_sleeptime", 80);
if (dwDelay < 30)
dwDelay = 30;
diff --git a/plugins/AVS/src/image_utils.cpp b/plugins/AVS/src/image_utils.cpp index a43177ad9b..3408e5296a 100644 --- a/plugins/AVS/src/image_utils.cpp +++ b/plugins/AVS/src/image_utils.cpp @@ -11,7 +11,7 @@ void MakeBmpTransparent(HBITMAP hBitmap) if (bmp.bmBitsPixel != 32)
return;
- DWORD dwLen = bmp.bmWidth * bmp.bmHeight * (bmp.bmBitsPixel / 8);
+ uint32_t dwLen = bmp.bmWidth * bmp.bmHeight * (bmp.bmBitsPixel / 8);
uint8_t *p = (uint8_t *)malloc(dwLen);
if (p == nullptr)
return;
@@ -29,7 +29,7 @@ HBITMAP CopyBitmapTo32(HBITMAP hBitmap) BITMAP bmp;
GetObject(hBitmap, sizeof(bmp), &bmp);
- DWORD dwLen = bmp.bmWidth * bmp.bmHeight * 4;
+ uint32_t dwLen = bmp.bmWidth * bmp.bmHeight * 4;
uint8_t *p = (uint8_t *)malloc(dwLen);
if (p == nullptr)
return nullptr;
@@ -97,7 +97,7 @@ void SetTranspBkgColor(HBITMAP hBitmap, COLORREF color) if (bmp.bmBitsPixel != 32)
return;
- DWORD dwLen = bmp.bmWidth * bmp.bmHeight * (bmp.bmBitsPixel / 8);
+ uint32_t dwLen = bmp.bmWidth * bmp.bmHeight * (bmp.bmBitsPixel / 8);
uint8_t *p = (uint8_t *)malloc(dwLen);
if (p == nullptr)
return;
@@ -264,12 +264,12 @@ BOOL GetColorForPoint(int colorDiff, uint8_t *p, int width, }
-DWORD GetImgHash(HBITMAP hBitmap)
+uint32_t GetImgHash(HBITMAP hBitmap)
{
BITMAP bmp;
GetObject(hBitmap, sizeof(bmp), &bmp);
- DWORD dwLen = bmp.bmWidth * bmp.bmHeight * (bmp.bmBitsPixel / 8);
+ uint32_t dwLen = bmp.bmWidth * bmp.bmHeight * (bmp.bmBitsPixel / 8);
uint16_t *p = (uint16_t *)malloc(dwLen);
if (p == nullptr)
return 0;
@@ -277,8 +277,8 @@ DWORD GetImgHash(HBITMAP hBitmap) GetBitmapBits(hBitmap, dwLen, p);
- DWORD ret = 0;
- for (DWORD i = 0; i < dwLen / 2; i++)
+ uint32_t ret = 0;
+ for (uint32_t i = 0; i < dwLen / 2; i++)
ret += p[i];
free(p);
@@ -325,7 +325,7 @@ BOOL MakeTransparentBkg(MCONTACT hContact, HBITMAP *hBitmap) if (width <= 4 || height <= 4)
return FALSE;
- DWORD dwLen = width * height * 4;
+ uint32_t dwLen = width * height * 4;
uint8_t *p = (uint8_t *)malloc(dwLen);
if (p == nullptr)
return FALSE;
diff --git a/plugins/AVS/src/image_utils.h b/plugins/AVS/src/image_utils.h index d47995e1b6..5070ce8854 100644 --- a/plugins/AVS/src/image_utils.h +++ b/plugins/AVS/src/image_utils.h @@ -8,7 +8,7 @@ HBITMAP CopyBitmapTo32(HBITMAP hBitmap); BOOL MakeTransparentBkg(MCONTACT hContact, HBITMAP *hBitmap);
HBITMAP MakeGrayscale(HBITMAP hBitmap);
-DWORD GetImgHash(HBITMAP hBitmap);
+uint32_t GetImgHash(HBITMAP hBitmap);
int SaveAvatar(const char* protocol, const wchar_t* tszFileName);
diff --git a/plugins/AVS/src/main.cpp b/plugins/AVS/src/main.cpp index ec3852171b..4e73e39b2e 100644 --- a/plugins/AVS/src/main.cpp +++ b/plugins/AVS/src/main.cpp @@ -213,7 +213,7 @@ static int ShutdownProc(WPARAM, LPARAM) return 0;
}
-void InternalDrawAvatar(AVATARDRAWREQUEST *r, HBITMAP hbm, LONG bmWidth, LONG bmHeight, DWORD dwFlags)
+void InternalDrawAvatar(AVATARDRAWREQUEST *r, HBITMAP hbm, LONG bmWidth, LONG bmHeight, uint32_t dwFlags)
{
int targetWidth = r->rcDraw.right - r->rcDraw.left;
int targetHeight = r->rcDraw.bottom - r->rcDraw.top;
@@ -239,8 +239,8 @@ void InternalDrawAvatar(AVATARDRAWREQUEST *r, HBITMAP hbm, LONG bmWidth, LONG bm newHeight = (int)(bmHeight * dScale);
}
- DWORD topoffset = targetHeight > newHeight ? (targetHeight - newHeight) / 2 : 0;
- DWORD leftoffset = targetWidth > newWidth ? (targetWidth - newWidth) / 2 : 0;
+ uint32_t topoffset = targetHeight > newHeight ? (targetHeight - newHeight) / 2 : 0;
+ uint32_t leftoffset = targetWidth > newWidth ? (targetWidth - newWidth) / 2 : 0;
// create the region for the avatar border - use the same region for clipping, if needed.
HRGN oldRgn = CreateRectRgn(0, 0, 1, 1);
diff --git a/plugins/AVS/src/poll.h b/plugins/AVS/src/poll.h index 0066c8e160..2d65509012 100644 --- a/plugins/AVS/src/poll.h +++ b/plugins/AVS/src/poll.h @@ -27,7 +27,7 @@ Boston, MA 02111-1307, USA. struct QueueItem
{
MCONTACT hContact;
- DWORD check_time;
+ uint32_t check_time;
};
void InitPolls();
diff --git a/plugins/AVS/src/services.cpp b/plugins/AVS/src/services.cpp index 6e192c1998..ef62183444 100644 --- a/plugins/AVS/src/services.cpp +++ b/plugins/AVS/src/services.cpp @@ -319,7 +319,7 @@ static UINT_PTR CALLBACK SetMyAvatarHookProc(HWND hwnd, UINT msg, WPARAM, LPARAM struct SaveProtocolData
{
- DWORD max_size;
+ uint32_t max_size;
wchar_t image_file_name[MAX_PATH];
BOOL saved;
BOOL need_smaller_size;
@@ -380,7 +380,7 @@ static int SetProtoMyAvatar(char *protocol, HBITMAP hBmp, wchar_t *originalFilen // Get protocol info
SaveProtocolData d = { 0 };
- d.max_size = (DWORD)Proto_GetAvatarMaxFileSize(protocol);
+ d.max_size = (uint32_t)Proto_GetAvatarMaxFileSize(protocol);
Proto_GetAvatarMaxSize(protocol, &d.width, &d.height);
int orig_width = d.width;
diff --git a/plugins/AVS/src/stdafx.h b/plugins/AVS/src/stdafx.h index 6372bd24ae..98c433815d 100644 --- a/plugins/AVS/src/stdafx.h +++ b/plugins/AVS/src/stdafx.h @@ -136,7 +136,7 @@ extern HANDLE hLoaderEvent, hShutdownEvent; extern HANDLE hEventChanged, hEventContactAvatarChanged, hMyAvatarChanged;
int GetFileHash(wchar_t* filename);
-DWORD GetFileSize(wchar_t *szFilename);
+uint32_t GetFileSize(wchar_t *szFilename);
void MakePathRelative(MCONTACT hContact);
void MakePathRelative(MCONTACT hContact, wchar_t *dest);
void MyPathToAbsolute(const wchar_t *ptszPath, wchar_t *ptszDest);
@@ -147,14 +147,14 @@ void DeleteAvatarFromCache(MCONTACT hContact, bool bForever); void PicLoader(LPVOID param);
void NotifyMetaAware(MCONTACT hContact, CacheNode *node = nullptr, AVATARCACHEENTRY *ace = (AVATARCACHEENTRY*)-1);
-void InternalDrawAvatar(AVATARDRAWREQUEST *r, HBITMAP hbm, LONG bmWidth, LONG bmHeight, DWORD dwFlags);
+void InternalDrawAvatar(AVATARDRAWREQUEST *r, HBITMAP hbm, LONG bmWidth, LONG bmHeight, uint32_t dwFlags);
int ChangeAvatar(MCONTACT hContact, bool fLoad, bool fNotifyHist = false, int pa_format = 0);
void DeleteGlobalUserAvatar();
int FetchAvatarFor(MCONTACT hContact, char *szProto = nullptr);
CacheNode* FindAvatarInCache(MCONTACT hContact, bool add, bool findAny = false);
void PushAvatarRequest(CacheNode *cc);
-int SetAvatarAttribute(MCONTACT hContact, DWORD attrib, int mode);
+int SetAvatarAttribute(MCONTACT hContact, uint32_t attrib, int mode);
void SetIgnoreNotify(char *protocol, BOOL ignore);
INT_PTR DrawAvatarPicture(WPARAM wParam, LPARAM lParam);
diff --git a/plugins/AVS/src/utils.cpp b/plugins/AVS/src/utils.cpp index 121fe9ea3d..bab40ac398 100644 --- a/plugins/AVS/src/utils.cpp +++ b/plugins/AVS/src/utils.cpp @@ -170,7 +170,7 @@ int CreateAvatarInCache(MCONTACT hContact, AVATARCACHEENTRY *ace, const char *sz // Calc image hash
if (hContact != 0 && hContact != INVALID_CONTACT_ID) {
// Have to reset settings? -> do it if image changed
- DWORD imgHash = GetImgHash(ace->hbmPic);
+ uint32_t imgHash = GetImgHash(ace->hbmPic);
if (imgHash != db_get_dw(hContact, "ContactPhoto", "ImageHash", 0)) {
db_unset(hContact, "ContactPhoto", "MakeTransparentBkg");
db_unset(hContact, "ContactPhoto", "TranspBkgNumPoints");
@@ -458,7 +458,7 @@ void SetIgnoreNotify(char *protocol, BOOL ignore) ///////////////////////////////////////////////////////////////////////////////////////////////////////
-DWORD GetFileSize(wchar_t *szFilename)
+uint32_t GetFileSize(wchar_t *szFilename)
{
struct _stat info;
return (_wstat(szFilename, &info) == -1) ? 0 : info.st_size;
|