diff options
Diffstat (limited to 'plugins')
400 files changed, 2303 insertions, 2302 deletions
diff --git a/plugins/AVS/src/acc.cpp b/plugins/AVS/src/acc.cpp index a8d1bfd5ca..bc65051d2d 100644 --- a/plugins/AVS/src/acc.cpp +++ b/plugins/AVS/src/acc.cpp @@ -150,7 +150,7 @@ void AnimatedGifMountFrame(ACCData* data, int page) data->ag.times[page] = 0;
if (FreeImage_GetMetadata(FIMD_ANIMATION, dib, "DisposalMethod", &tag))
- data->ag.frame.disposal_method = *(BYTE *)FreeImage_GetTagValue(tag);
+ data->ag.frame.disposal_method = *(uint8_t *)FreeImage_GetTagValue(tag);
else
data->ag.frame.disposal_method = 0;
@@ -163,7 +163,7 @@ void AnimatedGifMountFrame(ACCData* data, int page) int transparent_color = -1;
if (FreeImage_IsTransparent(dib)) {
int count = FreeImage_GetTransparencyCount(dib);
- BYTE *table = FreeImage_GetTransparencyTable(dib);
+ uint8_t *table = FreeImage_GetTransparencyTable(dib);
for (int i = 0; i < count; i++) {
if (table[i] == 0) {
have_transparent = true;
@@ -176,7 +176,7 @@ void AnimatedGifMountFrame(ACCData* data, int page) //copy page data into logical buffer, with full alpha opaqueness
for (int y = 0; y < data->ag.frame.height; y++) {
RGBQUAD *scanline = (RGBQUAD*)FreeImage_GetScanLine(data->ag.dib, data->ag.logicalHeight - (y + data->ag.frame.top) - 1) + data->ag.frame.left;
- BYTE *pageline = FreeImage_GetScanLine(dib, data->ag.frame.height - y - 1);
+ uint8_t *pageline = FreeImage_GetScanLine(dib, data->ag.frame.height - y - 1);
for (int x = 0; x < data->ag.frame.width; x++) {
if (!have_transparent || *pageline != transparent_color) {
*scanline = pal[*pageline];
diff --git a/plugins/AVS/src/image_utils.cpp b/plugins/AVS/src/image_utils.cpp index 9717e5ddb4..3783f2ab3a 100644 --- a/plugins/AVS/src/image_utils.cpp +++ b/plugins/AVS/src/image_utils.cpp @@ -12,7 +12,7 @@ void MakeBmpTransparent(HBITMAP hBitmap) return;
DWORD dwLen = bmp.bmWidth * bmp.bmHeight * (bmp.bmBitsPixel / 8);
- BYTE *p = (BYTE *)malloc(dwLen);
+ uint8_t *p = (uint8_t *)malloc(dwLen);
if (p == nullptr)
return;
@@ -30,7 +30,7 @@ HBITMAP CopyBitmapTo32(HBITMAP hBitmap) GetObject(hBitmap, sizeof(bmp), &bmp);
DWORD dwLen = bmp.bmWidth * bmp.bmHeight * 4;
- BYTE *p = (BYTE *)malloc(dwLen);
+ uint8_t *p = (uint8_t *)malloc(dwLen);
if (p == nullptr)
return nullptr;
@@ -43,7 +43,7 @@ HBITMAP CopyBitmapTo32(HBITMAP hBitmap) RGB32BitsBITMAPINFO.bmiHeader.biPlanes = 1;
RGB32BitsBITMAPINFO.bmiHeader.biBitCount = 32;
- BYTE *ptPixels;
+ uint8_t *ptPixels;
HBITMAP hDirectBitmap = CreateDIBSection(nullptr, (BITMAPINFO *)&RGB32BitsBITMAPINFO, DIB_RGB_COLORS, (void **)&ptPixels, nullptr, 0);
// Copy data
@@ -98,7 +98,7 @@ void SetTranspBkgColor(HBITMAP hBitmap, COLORREF color) return;
DWORD dwLen = bmp.bmWidth * bmp.bmHeight * (bmp.bmBitsPixel / 8);
- BYTE *p = (BYTE *)malloc(dwLen);
+ uint8_t *p = (uint8_t *)malloc(dwLen);
if (p == nullptr)
return;
memset(p, 0, dwLen);
@@ -107,7 +107,7 @@ void SetTranspBkgColor(HBITMAP hBitmap, COLORREF color) bool changed = false;
for (int y = 0; y < bmp.bmHeight; ++y) {
- BYTE *px = p + bmp.bmWidth * 4 * y;
+ uint8_t *px = p + bmp.bmWidth * 4 * y;
for (int x = 0; x < bmp.bmWidth; ++x) {
if (px[3] == 0) {
@@ -220,7 +220,7 @@ int BmpFilterSaveBitmap(HBITMAP hBmp, const wchar_t *ptszFile, int flags) // Other utilities ////////////////////////////////////////////////////////////////////////////////
-static BOOL ColorsAreTheSame(int colorDiff, BYTE *px1, BYTE *px2)
+static BOOL ColorsAreTheSame(int colorDiff, uint8_t *px1, uint8_t *px2)
{
return abs(px1[0] - px2[0]) <= colorDiff
&& abs(px1[1] - px2[1]) <= colorDiff
@@ -241,12 +241,12 @@ void AddToStack(int *stack, int *topPos, int x, int y) (*topPos)++;
}
-BOOL GetColorForPoint(int colorDiff, BYTE *p, int width,
- int x0, int y0, int x1, int y1, int x2, int y2, BOOL *foundBkg, BYTE colors[][3])
+BOOL GetColorForPoint(int colorDiff, uint8_t *p, int width,
+ int x0, int y0, int x1, int y1, int x2, int y2, BOOL *foundBkg, uint8_t colors[][3])
{
- BYTE *px1 = GET_PIXEL(p, x0, y0);
- BYTE *px2 = GET_PIXEL(p, x1, y1);
- BYTE *px3 = GET_PIXEL(p, x2, y2);
+ uint8_t *px1 = GET_PIXEL(p, x0, y0);
+ uint8_t *px2 = GET_PIXEL(p, x1, y1);
+ uint8_t *px3 = GET_PIXEL(p, x2, y2);
// If any of the corners have transparency, forget about it
// Not using != 255 because some MSN bmps have 254 in some positions
@@ -326,7 +326,7 @@ BOOL MakeTransparentBkg(MCONTACT hContact, HBITMAP *hBitmap) return FALSE;
DWORD dwLen = width * height * 4;
- BYTE *p = (BYTE *)malloc(dwLen);
+ uint8_t *p = (uint8_t *)malloc(dwLen);
if (p == nullptr)
return FALSE;
@@ -341,7 +341,7 @@ BOOL MakeTransparentBkg(MCONTACT hContact, HBITMAP *hBitmap) // **** Get corner colors
// Top left
- BYTE colors[8][3];
+ uint8_t colors[8][3];
BOOL foundBkg[8];
if (!GetColorForPoint(colorDiff, p, width, 0, 0, 0, 1, 1, 0, &foundBkg[0], &colors[0])) {
if (hBmpTmp != *hBitmap)
@@ -428,7 +428,7 @@ BOOL MakeTransparentBkg(MCONTACT hContact, HBITMAP *hBitmap) count = 0;
for (j = 0; j < 8; j++) {
- if (foundBkg[j] && ColorsAreTheSame(colorDiff, (BYTE *)&colors[i], (BYTE *)&colors[j]))
+ if (foundBkg[j] && ColorsAreTheSame(colorDiff, (uint8_t *)&colors[i], (uint8_t *)&colors[j]))
count++;
}
@@ -454,7 +454,7 @@ BOOL MakeTransparentBkg(MCONTACT hContact, HBITMAP *hBitmap) bkgColor[1] = 0;
bkgColor[2] = 0;
for (i = 0; i < 8; i++) {
- if (foundBkg[i] && ColorsAreTheSame(colorDiff, (BYTE *)&colors[i], (BYTE *)&colors[selectedColor])) {
+ if (foundBkg[i] && ColorsAreTheSame(colorDiff, (uint8_t *)&colors[i], (uint8_t *)&colors[selectedColor])) {
bkgColor[0] += colors[i][0];
bkgColor[1] += colors[i][1];
bkgColor[2] += colors[i][2];
@@ -506,13 +506,13 @@ BOOL MakeTransparentBkg(MCONTACT hContact, HBITMAP *hBitmap) int y = stack[curPos]; curPos++;
// Get pixel
- BYTE *px1 = GET_PIXEL(p, x, y);
+ uint8_t *px1 = GET_PIXEL(p, x, y);
// It won't change the transparency if one exists
// (This avoid an endless loop too)
// Not using == 255 because some MSN bmps have 254 in some positions
if (px1[3] >= 253) {
- if (ColorsAreTheSame(colorDiff, px1, (BYTE *)&colors[selectedColor])) {
+ if (ColorsAreTheSame(colorDiff, px1, (uint8_t *)&colors[selectedColor])) {
px1[3] = (transpProportional) ? min(252,
(abs(px1[0] - colors[selectedColor][0])
+ abs(px1[1] - colors[selectedColor][1])
diff --git a/plugins/AVS/src/options.cpp b/plugins/AVS/src/options.cpp index 4a22874456..f75005773b 100644 --- a/plugins/AVS/src/options.cpp +++ b/plugins/AVS/src/options.cpp @@ -659,7 +659,7 @@ INT_PTR CALLBACK DlgProcAvatarOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPA { wchar_t szFinalName[MAX_PATH]; DBVARIANT dbv = { 0 }; - BYTE is_locked = db_get_b(hContact, "ContactPhoto", "Locked", 0); + uint8_t is_locked = db_get_b(hContact, "ContactPhoto", "Locked", 0); szFinalName[0] = 0; diff --git a/plugins/AVS/src/services.cpp b/plugins/AVS/src/services.cpp index d7364e8872..6e192c1998 100644 --- a/plugins/AVS/src/services.cpp +++ b/plugins/AVS/src/services.cpp @@ -44,9 +44,9 @@ INT_PTR GetAvatarBitmap(WPARAM hContact, LPARAM) INT_PTR ProtectAvatar(WPARAM hContact, LPARAM lParam)
{
- BYTE was_locked = db_get_b(hContact, "ContactPhoto", "Locked", 0);
+ uint8_t was_locked = db_get_b(hContact, "ContactPhoto", "Locked", 0);
- if (was_locked == (BYTE)lParam) // no need for redundant lockings...
+ if (was_locked == (uint8_t)lParam) // no need for redundant lockings...
return 0;
if (hContact) {
@@ -68,8 +68,8 @@ INT_PTR ProtectAvatar(WPARAM hContact, LPARAM lParam) struct OpenFileSubclassData
{
- BYTE *locking_request;
- BYTE setView;
+ uint8_t *locking_request;
+ uint8_t setView;
};
UINT_PTR CALLBACK OpenFileSubclass(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
@@ -84,7 +84,7 @@ UINT_PTR CALLBACK OpenFileSubclass(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP data = (OpenFileSubclassData *)malloc(sizeof(OpenFileSubclassData));
SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)data);
- data->locking_request = (BYTE *)ofn->lCustData;
+ data->locking_request = (uint8_t *)ofn->lCustData;
data->setView = TRUE;
CheckDlgButton(hwnd, IDC_PROTECTAVATAR, *(data->locking_request) ? BST_CHECKED : BST_UNCHECKED);
}
@@ -119,7 +119,7 @@ INT_PTR SetAvatar(WPARAM hContact, LPARAM lParam) {
wchar_t FileName[MAX_PATH];
wchar_t *szFinalName;
- BYTE locking_request;
+ uint8_t locking_request;
if (hContact == NULL)
return 0;
diff --git a/plugins/Alarms/src/stdafx.h b/plugins/Alarms/src/stdafx.h index ef193d0b23..0e479358fa 100755 --- a/plugins/Alarms/src/stdafx.h +++ b/plugins/Alarms/src/stdafx.h @@ -37,7 +37,7 @@ typedef struct ALARM_tag { unsigned short action;
wchar_t *szCommand;
wchar_t *szCommandParams;
- BYTE sound_num;
+ uint8_t sound_num;
int flags, day_mask;
} ALARM;
diff --git a/plugins/AssocMgr/src/assoclist.cpp b/plugins/AssocMgr/src/assoclist.cpp index 779e9d3756..ecaa58231f 100644 --- a/plugins/AssocMgr/src/assoclist.cpp +++ b/plugins/AssocMgr/src/assoclist.cpp @@ -32,7 +32,7 @@ static BOOL IsAssocEnabled(const ASSOCDATA *assoc) {
char szSetting[MAXMODULELABELLENGTH];
mir_snprintf(szSetting, "enabled_%s", assoc->pszClassName);
- return g_plugin.getByte(szSetting, (BYTE)!(assoc->flags&FTDF_DEFAULTDISABLED)) != 0;
+ return g_plugin.getByte(szSetting, (uint8_t)!(assoc->flags&FTDF_DEFAULTDISABLED)) != 0;
}
static void SetAssocEnabled(const ASSOCDATA *assoc, BOOL fEnabled)
@@ -40,7 +40,7 @@ static void SetAssocEnabled(const ASSOCDATA *assoc, BOOL fEnabled) char szSetting[MAXMODULELABELLENGTH];
wchar_t szDLL[MAX_PATH], szBuf[MAX_PATH];
mir_snprintf(szSetting, "enabled_%s", assoc->pszClassName);
- g_plugin.setByte(szSetting, (BYTE)fEnabled);
+ g_plugin.setByte(szSetting, (uint8_t)fEnabled);
// dll name for uninstall
if (assoc->hInstance != nullptr && assoc->hInstance != g_plugin.getInst() && assoc->hInstance != GetModuleHandle(nullptr))
if (GetModuleFileName(assoc->hInstance, szBuf, _countof(szBuf)))
@@ -92,7 +92,7 @@ void CleanupAssocEnabledSettings(void) /************************* Mime Reg *******************************/
-static __inline void RememberMimeTypeAdded(const char *pszMimeType, const char *pszFileExt, BYTE fAdded)
+static __inline void RememberMimeTypeAdded(const char *pszMimeType, const char *pszFileExt, uint8_t fAdded)
{
char szSetting[MAXMODULELABELLENGTH];
mir_snprintf(szSetting, "mime_%s", pszMimeType);
@@ -888,7 +888,7 @@ void InitAssocList(void) void UninitAssocList(void)
{
// Assoc List
- BYTE fOnlyWhileRunning = g_plugin.getByte("OnlyWhileRunning", SETTING_ONLYWHILERUNNING_DEFAULT);
+ uint8_t fOnlyWhileRunning = g_plugin.getByte("OnlyWhileRunning", SETTING_ONLYWHILERUNNING_DEFAULT);
for (auto &it : arAssocList)
if (fOnlyWhileRunning)
UnregisterAssoc(it); // remove registry keys
diff --git a/plugins/AssocMgr/src/reg.cpp b/plugins/AssocMgr/src/reg.cpp index 6adb696026..4bd7f44bbf 100644 --- a/plugins/AssocMgr/src/reg.cpp +++ b/plugins/AssocMgr/src/reg.cpp @@ -277,7 +277,7 @@ static LONG SetRegSubKeyStrDefValue(HKEY hMainKey, const wchar_t *pszSubKey, con HKEY hSubKey;
LONG res = RegCreateKeyEx(hMainKey, pszSubKey, 0, nullptr, 0, KEY_SET_VALUE | KEY_QUERY_VALUE, nullptr, &hSubKey, nullptr);
if (!res) {
- res = RegSetValueEx(hSubKey, nullptr, 0, REG_SZ, (BYTE*)pszVal, (int)(mir_wstrlen(pszVal) + 1) * sizeof(wchar_t));
+ res = RegSetValueEx(hSubKey, nullptr, 0, REG_SZ, (uint8_t*)pszVal, (int)(mir_wstrlen(pszVal) + 1) * sizeof(wchar_t));
RegCloseKey(hSubKey);
}
return res;
@@ -289,7 +289,7 @@ static void SetRegStrPrefixValue(HKEY hKey, const wchar_t *pszValPrefix, const w size_t dwSize = (mir_wstrlen(pszVal) + mir_wstrlen(pszValPrefix) + 1) * sizeof(wchar_t);
wchar_t *pszStr = (wchar_t*)_alloca(dwSize);
mir_wstrcat(mir_wstrcpy(pszStr, pszValPrefix), pszVal); // buffer safe
- RegSetValueEx(hKey, nullptr, 0, REG_SZ, (BYTE*)pszStr, (int)dwSize);
+ RegSetValueEx(hKey, nullptr, 0, REG_SZ, (uint8_t*)pszStr, (int)dwSize);
}
// hKey must have been opened with KEY_QUERY_VALUE access right
@@ -302,7 +302,7 @@ static wchar_t* GetRegStrValue(HKEY hKey, const wchar_t *pszValName) wchar_t *pszVal = (wchar_t*)mir_alloc(dwSize + sizeof(wchar_t));
if (pszVal != nullptr) {
// get value
- if (!RegQueryValueEx(hKey, pszValName, nullptr, &dwType, (BYTE*)pszVal, &dwSize)) {
+ if (!RegQueryValueEx(hKey, pszValName, nullptr, &dwType, (uint8_t*)pszVal, &dwSize)) {
pszVal[dwSize / sizeof(wchar_t)] = 0;
if (dwType == REG_EXPAND_SZ) {
dwSize = MAX_PATH;
@@ -351,7 +351,7 @@ static BOOL IsRegStrValueA(HKEY hKey, const wchar_t *pszValName, const char *psz #define REGF_ANSI 0x80000000 // this bit is set in dwType for ANSI registry data
// pData must always be Unicode data, registry supports Unicode even on Win95
-static void WriteDbBackupData(const char *pszSetting, DWORD dwType, BYTE *pData, DWORD cbData)
+static void WriteDbBackupData(const char *pszSetting, DWORD dwType, uint8_t *pData, DWORD cbData)
{
size_t cbLen = cbData + sizeof(DWORD);
uint8_t *buf = (uint8_t*)mir_alloc(cbLen);
@@ -364,7 +364,7 @@ static void WriteDbBackupData(const char *pszSetting, DWORD dwType, BYTE *pData, }
// mir_free() the value returned in ppData
-static BOOL ReadDbBackupData(const char *pszSetting, DWORD *pdwType, BYTE **ppData, DWORD *pcbData)
+static BOOL ReadDbBackupData(const char *pszSetting, DWORD *pdwType, uint8_t **ppData, DWORD *pcbData)
{
DBVARIANT dbv;
if (!db_get(0, MODULENAME, pszSetting, &dbv)) {
@@ -410,7 +410,7 @@ static void BackupRegTree_Worker(HKEY hKey, const char *pszSubKey, struct Backup // enum values
pszName = (char*)mir_alloc(nMaxValNameLen + 1);
if (nMaxValSize == 0) nMaxValSize = 1;
- BYTE *pData = (BYTE*)mir_alloc(nMaxValSize);
+ uint8_t *pData = (uint8_t*)mir_alloc(nMaxValSize);
if (pszName != nullptr && pData != nullptr) {
DWORD index = 0;
while (!res) {
@@ -489,7 +489,7 @@ static LONG RestoreRegTree(HKEY hKey, const char *pszSubKey, const char *pszDbPr break;
char *pszValName = pslash;
// read data
- BYTE *pData;
+ uint8_t *pData;
DWORD dwType, cbData;
if (ReadDbBackupData(ppszSettings[i], &dwType, &pData, &cbData)) {
// set value
@@ -616,7 +616,7 @@ BOOL AddRegClass(const char *pszClassName, const wchar_t *pszTypeDescription, co if (fUrlProto) BackupRegTree(hRootKey, pszClassName, "bak_");
// type description
if (fUrlProto) SetRegStrPrefixValue(hClassKey, L"URL:", pszTypeDescription);
- else RegSetValueEx(hClassKey, nullptr, 0, REG_SZ, (BYTE*)pszTypeDescription, (int)(mir_wstrlen(pszTypeDescription) + 1) * sizeof(wchar_t));
+ else RegSetValueEx(hClassKey, nullptr, 0, REG_SZ, (uint8_t*)pszTypeDescription, (int)(mir_wstrlen(pszTypeDescription) + 1) * sizeof(wchar_t));
// default icon
if (pszIconLoc != nullptr) SetRegSubKeyStrDefValue(hClassKey, L"DefaultIcon", pszIconLoc);
// url protocol
@@ -627,11 +627,11 @@ BOOL AddRegClass(const char *pszClassName, const wchar_t *pszTypeDescription, co // edit flags
{
DWORD dwFlags = 0, dwSize = sizeof(dwFlags);
- RegQueryValueEx(hClassKey, L"EditFlags", nullptr, nullptr, (BYTE*)&dwFlags, &dwSize);
+ RegQueryValueEx(hClassKey, L"EditFlags", nullptr, nullptr, (uint8_t*)&dwFlags, &dwSize);
if (fBrowserAutoOpen) dwFlags = (dwFlags & ~FTA_AlwaysUnsafe) | FTA_OpenIsSafe;
if (!fUrlProto) dwFlags |= FTA_HasExtension;
else dwFlags = (dwFlags & ~FTA_HasExtension) | FTA_Show; // show classes without extension
- RegSetValueEx(hClassKey, L"EditFlags", 0, REG_DWORD, (BYTE*)&dwFlags, sizeof(dwFlags));
+ RegSetValueEx(hClassKey, L"EditFlags", 0, REG_DWORD, (uint8_t*)&dwFlags, sizeof(dwFlags));
}
if (fIsShortcut) {
RegSetValueExA(hClassKey, "IsShortcut", 0, REG_SZ, nullptr, 0);
@@ -640,21 +640,21 @@ BOOL AddRegClass(const char *pszClassName, const wchar_t *pszTypeDescription, co // shell
if ((res = RegCreateKeyEx(hClassKey, L"shell", 0, nullptr, 0, KEY_SET_VALUE | KEY_CREATE_SUB_KEY, nullptr, &hShellKey, nullptr)) == ERROR_SUCCESS) {
// default verb (when empty "open" is used)
- RegSetValueEx(hShellKey, nullptr, 0, REG_SZ, (BYTE*)L"open", 5 * sizeof(wchar_t));
+ RegSetValueEx(hShellKey, nullptr, 0, REG_SZ, (uint8_t*)L"open", 5 * sizeof(wchar_t));
// verb
if ((res = RegCreateKeyEx(hShellKey, L"open", 0, nullptr, 0, KEY_SET_VALUE | KEY_CREATE_SUB_KEY | DELETE, nullptr, &hVerbKey, nullptr)) == ERROR_SUCCESS) {
// verb description
if (pszVerbDesc == nullptr) RegDeleteValue(hVerbKey, nullptr);
- else RegSetValueEx(hVerbKey, nullptr, 0, REG_SZ, (BYTE*)pszVerbDesc, (int)(mir_wstrlen(pszVerbDesc) + 1) * sizeof(wchar_t));
+ else RegSetValueEx(hVerbKey, nullptr, 0, REG_SZ, (uint8_t*)pszVerbDesc, (int)(mir_wstrlen(pszVerbDesc) + 1) * sizeof(wchar_t));
// friendly appname (mui string)
- RegSetValueEx(hVerbKey, L"FriendlyAppName", 0, REG_SZ, (BYTE*)pszAppName, (int)(mir_wstrlen(pszAppName) + 1) * sizeof(wchar_t));
+ RegSetValueEx(hVerbKey, L"FriendlyAppName", 0, REG_SZ, (uint8_t*)pszAppName, (int)(mir_wstrlen(pszAppName) + 1) * sizeof(wchar_t));
// command
SetRegSubKeyStrDefValue(hVerbKey, L"command", pszRunCmd);
// ddeexec
if (pszDdeCmd != nullptr) {
if (!RegCreateKeyEx(hVerbKey, L"ddeexec", 0, nullptr, 0, KEY_SET_VALUE | KEY_CREATE_SUB_KEY | DELETE, nullptr, &hDdeKey, nullptr)) {
// command
- RegSetValueEx(hDdeKey, nullptr, 0, REG_SZ, (BYTE*)pszDdeCmd, (int)(mir_wstrlen(pszDdeCmd) + 1) * sizeof(wchar_t));
+ RegSetValueEx(hDdeKey, nullptr, 0, REG_SZ, (uint8_t*)pszDdeCmd, (int)(mir_wstrlen(pszDdeCmd) + 1) * sizeof(wchar_t));
// application
SetRegSubKeyStrDefValue(hDdeKey, L"application", pszDdeApp);
// topic
@@ -847,11 +847,11 @@ BOOL AddRegFileExt(const char *pszFileExt, const char *pszClassName, const char }
mir_free(pszPrevClass); // does NULL check
// class name
- fSuccess = !RegSetValueExA(hExtKey, nullptr, 0, REG_SZ, (BYTE*)pszClassName, (int)mir_strlen(pszClassName) + 1);
+ fSuccess = !RegSetValueExA(hExtKey, nullptr, 0, REG_SZ, (uint8_t*)pszClassName, (int)mir_strlen(pszClassName) + 1);
// mime type e.g. "application/x-icq"
- if (pszMimeType != nullptr) RegSetValueExA(hExtKey, "Content Type", 0, REG_SZ, (BYTE*)pszMimeType, (int)mir_strlen(pszMimeType) + 1);
+ if (pszMimeType != nullptr) RegSetValueExA(hExtKey, "Content Type", 0, REG_SZ, (uint8_t*)pszMimeType, (int)mir_strlen(pszMimeType) + 1);
// perceived type e.g. text (WinXP+)
- if (fIsText) RegSetValueEx(hExtKey, L"PerceivedType", 0, REG_SZ, (BYTE*)L"text", 5 * sizeof(wchar_t));
+ if (fIsText) RegSetValueEx(hExtKey, L"PerceivedType", 0, REG_SZ, (uint8_t*)L"text", 5 * sizeof(wchar_t));
RegCloseKey(hExtKey);
}
@@ -958,7 +958,7 @@ BOOL AddRegMimeType(const char *pszMimeType, const char *pszFileExt) if (!RegCreateKeyExA(hDbKey, pszMimeType, 0, nullptr, 0, KEY_QUERY_VALUE | KEY_SET_VALUE, nullptr, &hTypeKey, nullptr)) {
// file ext
if (RegQueryValueExA(hTypeKey, "Extension", nullptr, nullptr, nullptr, nullptr)) // only set if not present
- fSuccess = !RegSetValueExA(hTypeKey, "Extension", 0, REG_SZ, (BYTE*)pszFileExt, (int)mir_strlen(pszFileExt) + 1);
+ fSuccess = !RegSetValueExA(hTypeKey, "Extension", 0, REG_SZ, (uint8_t*)pszFileExt, (int)mir_strlen(pszFileExt) + 1);
RegCloseKey(hTypeKey);
}
RegCloseKey(hDbKey);
@@ -1014,7 +1014,7 @@ void AddRegOpenWith(const wchar_t *pszAppFileName, BOOL fAllowOpenWith, const wc // filename
if (!RegCreateKeyEx(hAppsKey, pszAppFileName, 0, nullptr, 0, KEY_SET_VALUE | KEY_CREATE_SUB_KEY, nullptr, &hExeKey, nullptr)) {
// appname
- RegSetValueEx(hExeKey, nullptr, 0, REG_SZ, (BYTE*)pszAppName, (int)(mir_wstrlen(pszAppName) + 1) * sizeof(wchar_t));
+ RegSetValueEx(hExeKey, nullptr, 0, REG_SZ, (uint8_t*)pszAppName, (int)(mir_wstrlen(pszAppName) + 1) * sizeof(wchar_t));
// no open-with flag
if (fAllowOpenWith) RegDeleteValue(hExeKey, L"NoOpenWith");
else RegSetValueEx(hExeKey, L"NoOpenWith", 0, REG_SZ, nullptr, 0);
@@ -1023,18 +1023,18 @@ void AddRegOpenWith(const wchar_t *pszAppFileName, BOOL fAllowOpenWith, const wc // shell
if (!RegCreateKeyEx(hExeKey, L"shell", 0, nullptr, 0, KEY_SET_VALUE | KEY_CREATE_SUB_KEY, nullptr, &hShellKey, nullptr)) {
// default verb (when empty "open" is used)
- RegSetValueEx(hShellKey, nullptr, 0, REG_SZ, (BYTE*)L"open", 5 * sizeof(wchar_t));
+ RegSetValueEx(hShellKey, nullptr, 0, REG_SZ, (uint8_t*)L"open", 5 * sizeof(wchar_t));
// verb
if (!RegCreateKeyEx(hShellKey, L"open", 0, nullptr, 0, KEY_SET_VALUE | KEY_CREATE_SUB_KEY, nullptr, &hVerbKey, nullptr)) {
// friendly appname (mui string)
- RegSetValueEx(hVerbKey, L"FriendlyAppName", 0, REG_SZ, (BYTE*)pszAppName, (int)(mir_wstrlen(pszAppName) + 1) * sizeof(wchar_t));
+ RegSetValueEx(hVerbKey, L"FriendlyAppName", 0, REG_SZ, (uint8_t*)pszAppName, (int)(mir_wstrlen(pszAppName) + 1) * sizeof(wchar_t));
// command
SetRegSubKeyStrDefValue(hVerbKey, L"command", pszRunCmd);
// ddeexec
if (pszDdeCmd != nullptr)
if (!RegCreateKeyEx(hVerbKey, L"ddeexec", 0, nullptr, 0, KEY_SET_VALUE | KEY_CREATE_SUB_KEY, nullptr, &hDdeKey, nullptr)) {
// command
- RegSetValueEx(hDdeKey, nullptr, 0, REG_SZ, (BYTE*)pszDdeCmd, (int)(mir_wstrlen(pszDdeCmd) + 1) * sizeof(wchar_t));
+ RegSetValueEx(hDdeKey, nullptr, 0, REG_SZ, (uint8_t*)pszDdeCmd, (int)(mir_wstrlen(pszDdeCmd) + 1) * sizeof(wchar_t));
// application
SetRegSubKeyStrDefValue(hDdeKey, L"application", pszDdeApp);
// topic
@@ -1119,7 +1119,7 @@ void AddRegOpenWithExtEntry(const wchar_t *pszAppFileName, const char *pszFileEx if (!RegCreateKeyEx(hExeKey, L"SupportedTypes", 0, nullptr, 0, KEY_SET_VALUE, nullptr, &hTypesKey, nullptr)) {
ptrW ptszFileExt(mir_a2u(pszFileExt));
if (ptszFileExt != nullptr)
- RegSetValueEx(hTypesKey, ptszFileExt, 0, REG_SZ, (BYTE*)ptszFileExt.get(), (int)(mir_wstrlen(pszFileDesc) + 1) * sizeof(wchar_t));
+ RegSetValueEx(hTypesKey, ptszFileExt, 0, REG_SZ, (uint8_t*)ptszFileExt.get(), (int)(mir_wstrlen(pszFileDesc) + 1) * sizeof(wchar_t));
mir_free(ptszFileExt); // does NULL check
RegCloseKey(hTypesKey);
}
@@ -1171,7 +1171,7 @@ BOOL AddRegRunEntry(const wchar_t *pszAppName, const wchar_t *pszRunCmd) HKEY hRunKey;
if (!RegCreateKeyEx(HKEY_CURRENT_USER, L"Software\\Microsoft\\Windows\\CurrentVersion\\Run", 0, nullptr, 0, KEY_SET_VALUE, nullptr, &hRunKey, nullptr)) {
// appname
- fSuccess = !RegSetValueEx(hRunKey, pszAppName, 0, REG_SZ, (BYTE*)pszRunCmd, (int)(mir_wstrlen(pszRunCmd) + 1) * sizeof(wchar_t));
+ fSuccess = !RegSetValueEx(hRunKey, pszAppName, 0, REG_SZ, (uint8_t*)pszRunCmd, (int)(mir_wstrlen(pszRunCmd) + 1) * sizeof(wchar_t));
RegCloseKey(hRunKey);
}
return fSuccess;
diff --git a/plugins/AssocMgr/src/utils.cpp b/plugins/AssocMgr/src/utils.cpp index 8e70d68af5..71091b0c87 100644 --- a/plugins/AssocMgr/src/utils.cpp +++ b/plugins/AssocMgr/src/utils.cpp @@ -107,7 +107,7 @@ static void MessageBoxIndirectFree(MSGBOXPARAMSA *mbp) mir_free(mbp);
}
-void ShowInfoMessage(BYTE flags, const char *pszTitle, const char *pszTextFmt, ...)
+void ShowInfoMessage(uint8_t flags, const char *pszTitle, const char *pszTextFmt, ...)
{
char szText[256]; /* max for systray */
diff --git a/plugins/AssocMgr/src/utils.h b/plugins/AssocMgr/src/utils.h index a9fe49cd35..2cb2b6826b 100644 --- a/plugins/AssocMgr/src/utils.h +++ b/plugins/AssocMgr/src/utils.h @@ -31,5 +31,5 @@ void* t2s(const wchar_t *pszStr, DWORD fUnicode, BOOL fMirCp); BOOL EnumDbPrefixSettings(const char *pszModule, const char *pszSettingPrefix, char ***pSettings, int *pnSettingsCount);
/* Error Output */
-void ShowInfoMessage(BYTE flags, const char *pszTitle, const char *pszTextFmt, ...);
+void ShowInfoMessage(uint8_t flags, const char *pszTitle, const char *pszTextFmt, ...);
char* GetWinErrorDescription(DWORD dwLastError);
diff --git a/plugins/AuthState/src/stdafx.h b/plugins/AuthState/src/stdafx.h index 1a0b4a781c..b8e4c199ea 100644 --- a/plugins/AuthState/src/stdafx.h +++ b/plugins/AuthState/src/stdafx.h @@ -42,7 +42,7 @@ struct CMPlugin : public PLUGIN<CMPlugin> {
CMPlugin();
- CMOption<BYTE> bUseAuthIcon, bUseGrantIcon, bIconsForRecentContacts;
+ CMOption<uint8_t> bUseAuthIcon, bUseGrantIcon, bIconsForRecentContacts;
int Load() override;
};
diff --git a/plugins/AutoRun/src/main.cpp b/plugins/AutoRun/src/main.cpp index f1badb4082..e4a8bcc99f 100644 --- a/plugins/AutoRun/src/main.cpp +++ b/plugins/AutoRun/src/main.cpp @@ -45,7 +45,7 @@ static void SetAutorun(BOOL autorun) if (RegCreateKeyEx(ROOT_KEY, SUB_KEY, 0, nullptr, 0, KEY_CREATE_SUB_KEY | KEY_SET_VALUE, nullptr, &hKey, &dw) == ERROR_SUCCESS) {
wchar_t result[MAX_PATH];
GetProfilePath(result, _countof(result));
- RegSetValueEx(hKey, L"MirandaNG", 0, REG_SZ, (BYTE*)result, sizeof(wchar_t)*(DWORD)mir_wstrlen(result));
+ RegSetValueEx(hKey, L"MirandaNG", 0, REG_SZ, (uint8_t*)result, sizeof(wchar_t)*(DWORD)mir_wstrlen(result));
RegCloseKey(hKey);
}
break;
diff --git a/plugins/AutoShutdown/src/cpuusage.cpp b/plugins/AutoShutdown/src/cpuusage.cpp index 1e5c3e6231..de331986d1 100644 --- a/plugins/AutoShutdown/src/cpuusage.cpp +++ b/plugins/AutoShutdown/src/cpuusage.cpp @@ -35,9 +35,9 @@ static BOOL WinNT_PerfStatsSwitch(wchar_t *pszServiceName, BOOL fDisable) if (!RegOpenKeyEx(hKeyServices, pszServiceName, 0, KEY_QUERY_VALUE | KEY_SET_VALUE, &hKeyService)) {
if (!RegOpenKeyEx(hKeyService, L"Performance", 0, KEY_QUERY_VALUE | KEY_SET_VALUE, &hKeyPerf)) {
dwDataSize = sizeof(DWORD);
- if (!RegQueryValueEx(hKeyPerf, L"Disable Performance Counters", nullptr, nullptr, (BYTE*)&dwData, &dwDataSize))
+ if (!RegQueryValueEx(hKeyPerf, L"Disable Performance Counters", nullptr, nullptr, (uint8_t*)&dwData, &dwDataSize))
if ((dwData != 0) != fDisable)
- fSwitched = !RegSetValueEx(hKeyPerf, L"Disable Performance Counters", 0, REG_DWORD, (BYTE*)&fDisable, dwDataSize);
+ fSwitched = !RegSetValueEx(hKeyPerf, L"Disable Performance Counters", 0, REG_DWORD, (uint8_t*)&fDisable, dwDataSize);
RegCloseKey(hKeyPerf);
}
RegCloseKey(hKeyService);
@@ -57,7 +57,7 @@ struct CpuUsageThreadParams DWORD *pidThread;
};
-static BOOL CallBackAndWait(struct CpuUsageThreadParams *param, BYTE nCpuUsage)
+static BOOL CallBackAndWait(struct CpuUsageThreadParams *param, uint8_t nCpuUsage)
{
if (param->hFirstEvent != nullptr) {
/* return value for PollCpuUsage() */
@@ -75,7 +75,7 @@ static BOOL CallBackAndWait(struct CpuUsageThreadParams *param, BYTE nCpuUsage) static void WinNT_PollThread(CpuUsageThreadParams *param)
{
DWORD dwBufferSize = 0, dwCount;
- BYTE *pBuffer = nullptr;
+ uint8_t *pBuffer = nullptr;
PERF_DATA_BLOCK *pPerfData = nullptr;
LONG res, lCount;
PERF_OBJECT_TYPE *pPerfObj;
@@ -84,7 +84,7 @@ static void WinNT_PollThread(CpuUsageThreadParams *param) PERF_COUNTER_BLOCK *pPerfCounterBlock;
DWORD dwObjectId, dwCounterId;
wchar_t wszValueName[11], *pwszInstanceName;
- BYTE nCpuUsage;
+ uint8_t nCpuUsage;
BOOL fSwitched, fFound, fIsFirst = FALSE;
LARGE_INTEGER liPrevCounterValue = { 0 }, liCurrentCounterValue = { 0 }, liPrevPerfTime100nSec = { 0 };
@@ -98,9 +98,9 @@ static void WinNT_PollThread(CpuUsageThreadParams *param) /* poll */
for (;;) {
/* retrieve data for given object */
- res = RegQueryValueExW(HKEY_PERFORMANCE_DATA, wszValueName, nullptr, nullptr, (BYTE*)pPerfData, &dwBufferSize);
+ res = RegQueryValueExW(HKEY_PERFORMANCE_DATA, wszValueName, nullptr, nullptr, (uint8_t*)pPerfData, &dwBufferSize);
while (!pBuffer || res == ERROR_MORE_DATA) {
- pBuffer = (BYTE*)mir_realloc(pPerfData, dwBufferSize += 256);
+ pBuffer = (uint8_t*)mir_realloc(pPerfData, dwBufferSize += 256);
if (!pBuffer) break;
pPerfData = (PERF_DATA_BLOCK*)pBuffer;
res = RegQueryValueExW(HKEY_PERFORMANCE_DATA, wszValueName, nullptr, nullptr, pBuffer, &dwBufferSize);
@@ -110,43 +110,43 @@ static void WinNT_PollThread(CpuUsageThreadParams *param) /* find object in data */
fFound = FALSE;
/* first object */
- pPerfObj = (PERF_OBJECT_TYPE*)((BYTE*)pPerfData + pPerfData->HeaderLength);
+ pPerfObj = (PERF_OBJECT_TYPE*)((uint8_t*)pPerfData + pPerfData->HeaderLength);
for (dwCount = 0; dwCount < pPerfData->NumObjectTypes; ++dwCount) {
if (pPerfObj->ObjectNameTitleIndex == dwObjectId) {
/* find counter in object data */
/* first counter */
- pPerfCounter = (PERF_COUNTER_DEFINITION*)((BYTE*)pPerfObj + pPerfObj->HeaderLength);
+ pPerfCounter = (PERF_COUNTER_DEFINITION*)((uint8_t*)pPerfObj + pPerfObj->HeaderLength);
for (dwCount = 0; dwCount < (pPerfObj->NumCounters); ++dwCount) {
if (pPerfCounter->CounterNameTitleIndex == dwCounterId) {
/* find instance in counter data */
if (pPerfObj->NumInstances == PERF_NO_INSTANCES) {
- pPerfCounterBlock = (PERF_COUNTER_BLOCK*)((BYTE*)pPerfObj + pPerfObj->DefinitionLength);
- liCurrentCounterValue = *(LARGE_INTEGER*)((BYTE*)pPerfCounterBlock + pPerfCounter->CounterOffset);
+ pPerfCounterBlock = (PERF_COUNTER_BLOCK*)((uint8_t*)pPerfObj + pPerfObj->DefinitionLength);
+ liCurrentCounterValue = *(LARGE_INTEGER*)((uint8_t*)pPerfCounterBlock + pPerfCounter->CounterOffset);
fFound = TRUE;
}
else {
/* first instance */
- pPerfInstance = (PERF_INSTANCE_DEFINITION*)((BYTE*)pPerfObj + pPerfObj->DefinitionLength);
+ pPerfInstance = (PERF_INSTANCE_DEFINITION*)((uint8_t*)pPerfObj + pPerfObj->DefinitionLength);
for (lCount = 0; lCount < (pPerfObj->NumInstances); ++lCount) {
- pPerfCounterBlock = (PERF_COUNTER_BLOCK*)((BYTE*)pPerfInstance + pPerfInstance->ByteLength);
- if (!mir_wstrcmpi(pwszInstanceName, (wchar_t*)((BYTE*)pPerfInstance + pPerfInstance->NameOffset))) {
- liCurrentCounterValue = *(LARGE_INTEGER*)((BYTE*)pPerfCounterBlock + pPerfCounter->CounterOffset);
+ pPerfCounterBlock = (PERF_COUNTER_BLOCK*)((uint8_t*)pPerfInstance + pPerfInstance->ByteLength);
+ if (!mir_wstrcmpi(pwszInstanceName, (wchar_t*)((uint8_t*)pPerfInstance + pPerfInstance->NameOffset))) {
+ liCurrentCounterValue = *(LARGE_INTEGER*)((uint8_t*)pPerfCounterBlock + pPerfCounter->CounterOffset);
fFound = TRUE;
break;
}
/* next instance */
- pPerfInstance = (PPERF_INSTANCE_DEFINITION)((BYTE*)pPerfCounterBlock + pPerfCounterBlock->ByteLength);
+ pPerfInstance = (PPERF_INSTANCE_DEFINITION)((uint8_t*)pPerfCounterBlock + pPerfCounterBlock->ByteLength);
}
}
break;
}
/* next counter */
- pPerfCounter = (PERF_COUNTER_DEFINITION*)((BYTE*)pPerfCounter + pPerfCounter->ByteLength);
+ pPerfCounter = (PERF_COUNTER_DEFINITION*)((uint8_t*)pPerfCounter + pPerfCounter->ByteLength);
}
break;
}
/* next object */
- pPerfObj = (PERF_OBJECT_TYPE*)((BYTE*)pPerfObj + pPerfObj->TotalByteLength);
+ pPerfObj = (PERF_OBJECT_TYPE*)((uint8_t*)pPerfObj + pPerfObj->TotalByteLength);
}
if (!fFound)
break;
@@ -155,7 +155,7 @@ static void WinNT_PollThread(CpuUsageThreadParams *param) * counter type: PERF_100NSEC_TIMER_INV
* calc: time base=100Ns, value=100*(1-(data_diff)/(100NsTime_diff)) */
if (!fIsFirst) {
- nCpuUsage = (BYTE)((1.0 - (Li2Double(liCurrentCounterValue) - Li2Double(liPrevCounterValue)) / (Li2Double(pPerfData->PerfTime100nSec) - Li2Double(liPrevPerfTime100nSec)))*100.0 + 0.5);
+ nCpuUsage = (uint8_t)((1.0 - (Li2Double(liCurrentCounterValue) - Li2Double(liPrevCounterValue)) / (Li2Double(pPerfData->PerfTime100nSec) - Li2Double(liPrevPerfTime100nSec)))*100.0 + 0.5);
if (!CallBackAndWait(param, nCpuUsage))
break;
}
diff --git a/plugins/AutoShutdown/src/cpuusage.h b/plugins/AutoShutdown/src/cpuusage.h index f10ead7d9e..391832e059 100644 --- a/plugins/AutoShutdown/src/cpuusage.h +++ b/plugins/AutoShutdown/src/cpuusage.h @@ -22,5 +22,5 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #pragma once
/* Start Thread */
-typedef BOOL (CALLBACK* CPUUSAGEAVAILPROC)(BYTE nCpuUsage,LPARAM lParam);
+typedef BOOL (CALLBACK* CPUUSAGEAVAILPROC)(uint8_t nCpuUsage,LPARAM lParam);
DWORD PollCpuUsage(CPUUSAGEAVAILPROC pfnDataAvailProc,LPARAM lParam,DWORD dwDelayMillis);
diff --git a/plugins/AutoShutdown/src/frame.cpp b/plugins/AutoShutdown/src/frame.cpp index ccae0afbd2..6ff377a99a 100644 --- a/plugins/AutoShutdown/src/frame.cpp +++ b/plugins/AutoShutdown/src/frame.cpp @@ -33,7 +33,7 @@ static HANDLE hHookModulesLoaded; #define FRAMEELEMENT_BKGRND 2
#define FRAMEELEMENT_TEXT 3
-static COLORREF GetDefaultColor(BYTE id)
+static COLORREF GetDefaultColor(uint8_t id)
{
switch (id) {
case FRAMEELEMENT_BAR:
@@ -84,7 +84,7 @@ struct CountdownFrameWndData COLORREF clrBackground, clrText;
HFONT hFont;
WORD fTimeFlags;
- BYTE flags;
+ uint8_t flags;
};
/* Flags */
diff --git a/plugins/AutoShutdown/src/options.cpp b/plugins/AutoShutdown/src/options.cpp index 3c79c94384..06756a5407 100644 --- a/plugins/AutoShutdown/src/options.cpp +++ b/plugins/AutoShutdown/src/options.cpp @@ -85,12 +85,12 @@ static INT_PTR CALLBACK ShutdownOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam case WM_NOTIFY:
switch (((NMHDR*)lParam)->code) {
case PSN_APPLY:
- g_plugin.setByte("ShowConfirmDlg", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CHECK_SHOWCONFIRMDLG) != 0));
+ g_plugin.setByte("ShowConfirmDlg", (uint8_t)(IsDlgButtonChecked(hwndDlg, IDC_CHECK_SHOWCONFIRMDLG) != 0));
g_plugin.setWord("ConfirmDlgCountdown", (WORD)GetDlgItemInt(hwndDlg, IDC_EDIT_CONFIRMDLGCOUNTDOWN, nullptr, FALSE));
- g_plugin.setByte("RememberOnRestart", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CHECK_REMEMBERONRESTART) != 0));
- g_plugin.setByte("SmartOfflineCheck", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CHECK_SMARTOFFLINECHECK) != 0));
+ g_plugin.setByte("RememberOnRestart", (uint8_t)(IsDlgButtonChecked(hwndDlg, IDC_CHECK_REMEMBERONRESTART) != 0));
+ g_plugin.setByte("SmartOfflineCheck", (uint8_t)(IsDlgButtonChecked(hwndDlg, IDC_CHECK_SMARTOFFLINECHECK) != 0));
if (IsWindowEnabled(GetDlgItem(hwndDlg, IDC_CHECK_WEATHER)))
- g_plugin.setByte("WeatherShutdown", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CHECK_WEATHER) != 0));
+ g_plugin.setByte("WeatherShutdown", (uint8_t)(IsDlgButtonChecked(hwndDlg, IDC_CHECK_WEATHER) != 0));
return TRUE;
}
break;
diff --git a/plugins/AutoShutdown/src/settingsdlg.cpp b/plugins/AutoShutdown/src/settingsdlg.cpp index 999eeb0d98..8e1e9642ef 100644 --- a/plugins/AutoShutdown/src/settingsdlg.cpp +++ b/plugins/AutoShutdown/src/settingsdlg.cpp @@ -36,7 +36,7 @@ static void EnableDlgItem(HWND hwndDlg, int idCtrl, BOOL fEnable) EnableWindow(hwndDlg, fEnable);
}
-static BOOL CALLBACK DisplayCpuUsageProc(BYTE nCpuUsage, LPARAM lParam)
+static BOOL CALLBACK DisplayCpuUsageProc(uint8_t nCpuUsage, LPARAM lParam)
{
/* dialog closed? */
if (!IsWindow((HWND)lParam))
@@ -129,7 +129,7 @@ static INT_PTR CALLBACK SettingsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L }
/* cpuusage threshold */
{
- BYTE setting = DBGetContactSettingRangedByte(0, MODULENAME, "CpuUsageThreshold", SETTING_CPUUSAGETHRESHOLD_DEFAULT, 1, 100);
+ uint8_t setting = DBGetContactSettingRangedByte(0, MODULENAME, "CpuUsageThreshold", SETTING_CPUUSAGETHRESHOLD_DEFAULT, 1, 100);
SendDlgItemMessage(hwndDlg, IDC_SPIN_CPUUSAGE, UDM_SETRANGE, 0, MAKELPARAM(100, 1));
SendDlgItemMessage(hwndDlg, IDC_EDIT_CPUUSAGE, EM_SETLIMITTEXT, (WPARAM)3, 0);
SendDlgItemMessage(hwndDlg, IDC_SPIN_CPUUSAGE, UDM_SETPOS, 0, MAKELPARAM(setting, 0));
@@ -138,11 +138,11 @@ static INT_PTR CALLBACK SettingsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L /* shutdown types */
{
HWND hwndCombo = GetDlgItem(hwndDlg, IDC_COMBO_SHUTDOWNTYPE);
- BYTE lastShutdownType = g_plugin.getByte("ShutdownType", SETTING_SHUTDOWNTYPE_DEFAULT);
+ uint8_t lastShutdownType = g_plugin.getByte("ShutdownType", SETTING_SHUTDOWNTYPE_DEFAULT);
SendMessage(hwndCombo, CB_SETLOCALE, (WPARAM)locale, 0); /* sort order */
SendMessage(hwndCombo, CB_SETEXTENDEDUI, TRUE, 0);
SendMessage(hwndCombo, CB_INITSTORAGE, SDSDT_MAX, SDSDT_MAX * 32);
- for (BYTE shutdownType = 1; shutdownType <= SDSDT_MAX; ++shutdownType)
+ for (uint8_t shutdownType = 1; shutdownType <= SDSDT_MAX; ++shutdownType)
if (ServiceIsTypeEnabled(shutdownType, 0)) {
wchar_t *pszText = (wchar_t*)ServiceGetTypeDescription(shutdownType, GSTDF_TCHAR); /* never fails */
int index = SendMessage(hwndCombo, CB_ADDSTRING, 0, (LPARAM)pszText);
@@ -232,7 +232,7 @@ static INT_PTR CALLBACK SettingsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L case M_UPDATE_SHUTDOWNDESC: /* lParam=(LPARAM)(HWND)hwndCombo */
{
- BYTE shutdownType = (BYTE)SendMessage((HWND)lParam, CB_GETITEMDATA, SendMessage((HWND)lParam, CB_GETCURSEL, 0, 0), 0);
+ uint8_t shutdownType = (uint8_t)SendMessage((HWND)lParam, CB_GETITEMDATA, SendMessage((HWND)lParam, CB_GETCURSEL, 0, 0), 0);
SetDlgItemText(hwndDlg, IDC_TEXT_SHUTDOWNTYPE, (wchar_t*)ServiceGetTypeDescription(shutdownType, GSTDF_LONGDESC | GSTDF_TCHAR));
}
return TRUE;
@@ -357,12 +357,12 @@ static INT_PTR CALLBACK SettingsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L {
int index = SendDlgItemMessage(hwndDlg, IDC_COMBO_SHUTDOWNTYPE, CB_GETCURSEL, 0, 0);
if (index != LB_ERR)
- g_plugin.setByte("ShutdownType", (BYTE)SendDlgItemMessage(hwndDlg, IDC_COMBO_SHUTDOWNTYPE, CB_GETITEMDATA, (WPARAM)index, 0));
+ g_plugin.setByte("ShutdownType", (uint8_t)SendDlgItemMessage(hwndDlg, IDC_COMBO_SHUTDOWNTYPE, CB_GETITEMDATA, (WPARAM)index, 0));
index = SendDlgItemMessage(hwndDlg, IDC_COMBO_COUNTDOWNUNIT, CB_GETCURSEL, 0, 0);
if (index != LB_ERR)
g_plugin.setDword("CountdownUnit", (DWORD)SendDlgItemMessage(hwndDlg, IDC_COMBO_COUNTDOWNUNIT, CB_GETITEMDATA, (WPARAM)index, 0));
g_plugin.setDword("Countdown", (DWORD)GetDlgItemInt(hwndDlg, IDC_EDIT_COUNTDOWN, nullptr, FALSE));
- g_plugin.setByte("CpuUsageThreshold", (BYTE)GetDlgItemInt(hwndDlg, IDC_EDIT_CPUUSAGE, nullptr, FALSE));
+ g_plugin.setByte("CpuUsageThreshold", (uint8_t)GetDlgItemInt(hwndDlg, IDC_EDIT_CPUUSAGE, nullptr, FALSE));
}
/* watcher type */
{
diff --git a/plugins/AutoShutdown/src/shutdownsvc.cpp b/plugins/AutoShutdown/src/shutdownsvc.cpp index c225d63e17..064c1fd843 100644 --- a/plugins/AutoShutdown/src/shutdownsvc.cpp +++ b/plugins/AutoShutdown/src/shutdownsvc.cpp @@ -67,7 +67,7 @@ static void BroadcastEndSession(DWORD dwRecipients, LPARAM lParam) }
/************************* Workers ************************************/
-static BOOL IsShutdownTypeEnabled(BYTE shutdownType)
+static BOOL IsShutdownTypeEnabled(uint8_t shutdownType)
{
BOOL bReturn = FALSE;
switch (shutdownType) {
@@ -128,7 +128,7 @@ static BOOL IsShutdownTypeEnabled(BYTE shutdownType) return bReturn;
}
-static DWORD ShutdownNow(BYTE shutdownType)
+static DWORD ShutdownNow(uint8_t shutdownType)
{
DWORD dwErrCode = ERROR_SUCCESS;
switch (shutdownType) {
@@ -297,7 +297,7 @@ static DWORD ShutdownNow(BYTE shutdownType) #define M_UPDATE_COUNTDOWN (WM_APP+112)
static INT_PTR CALLBACK ShutdownDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- BYTE shutdownType = (BYTE)GetWindowLongPtr(hwndDlg, DWLP_USER);
+ uint8_t shutdownType = (uint8_t)GetWindowLongPtr(hwndDlg, DWLP_USER);
WORD countdown = (WORD)GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_TEXT_HEADER), GWLP_USERDATA);
switch (msg) {
@@ -417,7 +417,7 @@ INT_PTR ServiceShutdown(WPARAM wParam, LPARAM lParam) {
/* passing 0 as wParam is only to be used internally, undocumented */
if (!wParam) wParam = g_plugin.getByte("ShutdownType", SETTING_SHUTDOWNTYPE_DEFAULT);
- if (!IsShutdownTypeEnabled((BYTE)wParam)) return 1; /* does shutdownType range check */
+ if (!IsShutdownTypeEnabled((uint8_t)wParam)) return 1; /* does shutdownType range check */
if ((BOOL)lParam && hwndShutdownDlg != nullptr) return 2;
/* ask others if allowed */
@@ -429,11 +429,11 @@ INT_PTR ServiceShutdown(WPARAM wParam, LPARAM lParam) NotifyEventHooks(hEventShutdown, wParam, lParam);
/* show dialog */
if (lParam && g_plugin.getByte("ShowConfirmDlg", SETTING_SHOWCONFIRMDLG_DEFAULT))
- if (CreateDialogParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_SHUTDOWNNOW), nullptr, ShutdownDlgProc, (BYTE)wParam) != nullptr)
+ if (CreateDialogParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_SHUTDOWNNOW), nullptr, ShutdownDlgProc, (uint8_t)wParam) != nullptr)
return 0;
/* show error */
- DWORD dwErrCode = ShutdownNow((BYTE)wParam);
+ DWORD dwErrCode = ShutdownNow((uint8_t)wParam);
if (dwErrCode != ERROR_SUCCESS) {
char *pszErr = GetWinErrorDescription(dwErrCode);
ShowInfoMessage(NIIF_ERROR, Translate("Automatic shutdown error"), Translate("Initiating the shutdown process failed!\nReason: %s"), (pszErr != nullptr) ? pszErr : Translate("Unknown"));
@@ -447,7 +447,7 @@ INT_PTR ServiceShutdown(WPARAM wParam, LPARAM lParam) INT_PTR ServiceIsTypeEnabled(WPARAM wParam, LPARAM)
{
- return IsShutdownTypeEnabled((BYTE)wParam); /* does shutdownType range check */
+ return IsShutdownTypeEnabled((uint8_t)wParam); /* does shutdownType range check */
}
const wchar_t *apszShort[] = {
@@ -473,7 +473,7 @@ const wchar_t *apszLong[] = { INT_PTR ServiceGetTypeDescription(WPARAM wParam, LPARAM lParam)
{
/* shutdownType range check */
- if (!wParam || (BYTE)wParam > SDSDT_MAX) return 0;
+ if (!wParam || (uint8_t)wParam > SDSDT_MAX) return 0;
/* select description */
wchar_t *pszDesc = (wchar_t*)((lParam & GSTDF_LONGDESC) ? apszLong : apszShort)[wParam - 1];
if (!(lParam & GSTDF_UNTRANSLATED))
diff --git a/plugins/AutoShutdown/src/utils.cpp b/plugins/AutoShutdown/src/utils.cpp index 35e1bb0755..cd2b247703 100644 --- a/plugins/AutoShutdown/src/utils.cpp +++ b/plugins/AutoShutdown/src/utils.cpp @@ -31,7 +31,7 @@ static void MessageBoxIndirectFree(MSGBOXPARAMSA *mbp) mir_free(mbp);
}
-void ShowInfoMessage(BYTE flags, const char *pszTitle, const char *pszTextFmt, ...)
+void ShowInfoMessage(uint8_t flags, const char *pszTitle, const char *pszTextFmt, ...)
{
char szText[256]; /* max for systray */
diff --git a/plugins/AutoShutdown/src/utils.h b/plugins/AutoShutdown/src/utils.h index e64dc87086..e3c05f51f9 100644 --- a/plugins/AutoShutdown/src/utils.h +++ b/plugins/AutoShutdown/src/utils.h @@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #pragma once
/* Error Output */
-void ShowInfoMessage(BYTE flags,const char *pszTitle,const char *pszTextFmt,...);
+void ShowInfoMessage(uint8_t flags,const char *pszTitle,const char *pszTextFmt,...);
char* GetWinErrorDescription(DWORD dwLastError);
/* Time */
diff --git a/plugins/AutoShutdown/src/watcher.cpp b/plugins/AutoShutdown/src/watcher.cpp index f3a3f76578..0d53d9deed 100644 --- a/plugins/AutoShutdown/src/watcher.cpp +++ b/plugins/AutoShutdown/src/watcher.cpp @@ -182,16 +182,16 @@ static int StatusSettingChanged(WPARAM wParam, LPARAM lParam) static DWORD idCpuUsageThread;
-static BOOL CALLBACK CpuUsageWatcherProc(BYTE nCpuUsage, LPARAM lParam)
+static BOOL CALLBACK CpuUsageWatcherProc(uint8_t nCpuUsage, LPARAM lParam)
{
- static BYTE nTimesBelow = 0; /* only one watcher thread */
+ static uint8_t nTimesBelow = 0; /* only one watcher thread */
/* terminated? */
if (idCpuUsageThread != GetCurrentThreadId()) {
nTimesBelow = 0;
return FALSE; /* stop poll thread */
}
/* ignore random peaks */
- if (nCpuUsage < (BYTE)lParam) ++nTimesBelow;
+ if (nCpuUsage < (uint8_t)lParam) ++nTimesBelow;
else nTimesBelow = 0;
if (nTimesBelow == 3) {
nTimesBelow = 0;
diff --git a/plugins/AvatarHistory/src/AvatarDlg.cpp b/plugins/AvatarHistory/src/AvatarDlg.cpp index a03378ec28..8a76311ffa 100644 --- a/plugins/AvatarHistory/src/AvatarDlg.cpp +++ b/plugins/AvatarHistory/src/AvatarDlg.cpp @@ -287,9 +287,9 @@ static INT_PTR CALLBACK AvatarDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARA case IDOK:
if (HIWORD(wParam) == BN_CLICKED) {
MCONTACT hContact = (MCONTACT)GetWindowLongPtr(hwnd, GWLP_USERDATA);
- g_plugin.setByte(hContact, "AvatarPopups", (BYTE)IsDlgButtonChecked(hwnd, IDC_POPUPUSER));
- g_plugin.setByte(hContact, "LogToDisk", (BYTE)IsDlgButtonChecked(hwnd, IDC_LOGUSER));
- g_plugin.setByte(hContact, "LogToHistory", (BYTE)IsDlgButtonChecked(hwnd, IDC_HISTORYUSER));
+ g_plugin.setByte(hContact, "AvatarPopups", (uint8_t)IsDlgButtonChecked(hwnd, IDC_POPUPUSER));
+ g_plugin.setByte(hContact, "LogToDisk", (uint8_t)IsDlgButtonChecked(hwnd, IDC_LOGUSER));
+ g_plugin.setByte(hContact, "LogToHistory", (uint8_t)IsDlgButtonChecked(hwnd, IDC_HISTORYUSER));
CleanupAvatarPic(hwnd);
EndDialog(hwnd, 0);
diff --git a/plugins/AvatarHistory/src/popup.h b/plugins/AvatarHistory/src/popup.h index 4ae896d0c7..9a432051fa 100644 --- a/plugins/AvatarHistory/src/popup.h +++ b/plugins/AvatarHistory/src/popup.h @@ -34,8 +34,8 @@ struct Options { wchar_t popup_removed[1024];
WORD popup_delay_type;
WORD popup_timeout;
- BYTE popup_use_win_colors;
- BYTE popup_use_default_colors;
+ uint8_t popup_use_win_colors;
+ uint8_t popup_use_default_colors;
COLORREF popup_bkg_color;
COLORREF popup_text_color;
WORD popup_left_click_action;
diff --git a/plugins/AvatarHistory/src/utils.cpp b/plugins/AvatarHistory/src/utils.cpp index 8ee3ad52a5..826acc6daa 100644 --- a/plugins/AvatarHistory/src/utils.cpp +++ b/plugins/AvatarHistory/src/utils.cpp @@ -38,8 +38,8 @@ bool ContactEnabled(MCONTACT hContact, char *setting, int def) if (!ProtocolEnabled(proto))
return false;
- BYTE globpref = g_plugin.getByte(setting, def);
- BYTE userpref = g_plugin.getByte(hContact, setting, BST_INDETERMINATE);
+ uint8_t globpref = g_plugin.getByte(setting, def);
+ uint8_t userpref = g_plugin.getByte(hContact, setting, BST_INDETERMINATE);
return (globpref && userpref == BST_INDETERMINATE) || userpref == BST_CHECKED;
}
diff --git a/plugins/BASS_interface/src/Bass.h b/plugins/BASS_interface/src/Bass.h index 50db57dcef..fab48d6120 100644 --- a/plugins/BASS_interface/src/Bass.h +++ b/plugins/BASS_interface/src/Bass.h @@ -18,7 +18,7 @@ typedef unsigned __int64 QWORD; #include <stdint.h> #define WINAPI #define CALLBACK -typedef uint8_t BYTE; +typedef uint8_t uint8_t; typedef uint16_t WORD; typedef uint32_t DWORD; typedef uint64_t QWORD; @@ -32,8 +32,8 @@ typedef int BOOL; #define TRUE 1 #define FALSE 0 #endif -#define LOBYTE(a) (BYTE)(a) -#define HIBYTE(a) (BYTE)((a)>>8) +#define LOBYTE(a) (uint8_t)(a) +#define HIBYTE(a) (uint8_t)((a)>>8) #define LOWORD(a) (WORD)(a) #define HIWORD(a) (WORD)((a)>>16) #define MAKEWORD(a,b) (WORD)(((a)&0xff)|((b)<<8)) @@ -658,7 +658,7 @@ RETURN : TRUE = continue recording, FALSE = stop */ #define BASS_TAG_APE_BINARY 0x1000 // + index #, binary APE tag : TAG_APE_BINARY structure #define BASS_TAG_MUSIC_NAME 0x10000 // MOD music name : ANSI string #define BASS_TAG_MUSIC_MESSAGE 0x10001 // MOD message : ANSI string -#define BASS_TAG_MUSIC_ORDERS 0x10002 // MOD order list : BYTE array of pattern numbers +#define BASS_TAG_MUSIC_ORDERS 0x10002 // MOD order list : uint8_t array of pattern numbers #define BASS_TAG_MUSIC_AUTH 0x10003 // MOD author : UTF-8 string #define BASS_TAG_MUSIC_INST 0x10100 // + instrument #, MOD instrument name : ANSI string #define BASS_TAG_MUSIC_CHAN 0x10200 // + channel #, MOD channel name : ANSI string @@ -672,7 +672,7 @@ typedef struct { char album[30]; char year[4]; char comment[30]; - BYTE genre; + uint8_t genre; } TAG_ID3; // Binary APE tag structure @@ -696,8 +696,8 @@ typedef struct { char OriginationTime[8]; // time of creation (hh-mm-ss) QWORD TimeReference; // first sample count since midnight (little-endian) WORD Version; // BWF version (little-endian) - BYTE UMID[64]; // SMPTE UMID - BYTE Reserved[190]; + uint8_t UMID[64]; // SMPTE UMID + uint8_t Reserved[190]; #if defined(__GNUC__) && __GNUC__<3 char CodingHistory[0]; // history #elif 1 // change to 0 if compiler fails the following line diff --git a/plugins/BasicHistory/src/Options.cpp b/plugins/BasicHistory/src/Options.cpp index 8e97f38438..f434dab93d 100644 --- a/plugins/BasicHistory/src/Options.cpp +++ b/plugins/BasicHistory/src/Options.cpp @@ -156,7 +156,7 @@ struct FontOptionsList wchar_t* szDescr;
COLORREF defColour;
wchar_t* szDefFace;
- BYTE defStyle;
+ uint8_t defStyle;
char defSize;
wchar_t* szBackgroundName;
DWORD flags;
diff --git a/plugins/BasicHistory/src/RichHtmlExport.cpp b/plugins/BasicHistory/src/RichHtmlExport.cpp index dc712cc1f2..d4322abac6 100644 --- a/plugins/BasicHistory/src/RichHtmlExport.cpp +++ b/plugins/BasicHistory/src/RichHtmlExport.cpp @@ -143,10 +143,10 @@ void ExtractFile(short int iRes, const std::wstring &fileName) #pragma pack(push, 2)
typedef struct
{
- BYTE bWidth; // Width, in pixels, of the image
- BYTE bHeight; // Height, in pixels, of the image
- BYTE bColorCount; // Number of colors in image (0 if >=8bpp)
- BYTE bReserved; // Reserved ( must be 0)
+ uint8_t bWidth; // Width, in pixels, of the image
+ uint8_t bHeight; // Height, in pixels, of the image
+ uint8_t bColorCount; // Number of colors in image (0 if >=8bpp)
+ uint8_t bReserved; // Reserved ( must be 0)
WORD wPlanes; // Color Planes
WORD wBitCount; // Bits per pixel
DWORD dwBytesInRes; // How many bytes in this resource?
diff --git a/plugins/Boltun/src/boltun.cpp b/plugins/Boltun/src/boltun.cpp index f764e3fc84..cf1bac9af8 100644 --- a/plugins/Boltun/src/boltun.cpp +++ b/plugins/Boltun/src/boltun.cpp @@ -455,8 +455,8 @@ static int ContactClick(WPARAM hContact, LPARAM, BOOL clickNotToChat) }
}
- g_plugin.setByte(hContact, DB_CONTACT_BOLTUN_AUTO_CHAT, (BYTE)boltunautochat);
- g_plugin.setByte(hContact, DB_CONTACT_BOLTUN_NOT_TO_CHAT, (BYTE)boltunnottochat);
+ g_plugin.setByte(hContact, DB_CONTACT_BOLTUN_AUTO_CHAT, (uint8_t)boltunautochat);
+ g_plugin.setByte(hContact, DB_CONTACT_BOLTUN_NOT_TO_CHAT, (uint8_t)boltunnottochat);
return 0;
}
diff --git a/plugins/BossKeyPlus/src/BossKey.cpp b/plugins/BossKeyPlus/src/BossKey.cpp index 038f421609..869eef985e 100644 --- a/plugins/BossKeyPlus/src/BossKey.cpp +++ b/plugins/BossKeyPlus/src/BossKey.cpp @@ -33,7 +33,7 @@ int protoCount; PROTOACCOUNT **proto;
unsigned *oldStatus;
wchar_t **oldStatusMsg;
-BYTE g_bOldSetting;
+uint8_t g_bOldSetting;
CMPlugin g_plugin;
@@ -304,7 +304,7 @@ LRESULT CALLBACK ListenWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPara if (g_wMask & OPT_CHANGESTATUS) // is this even needed?
{
- BYTE bReqMode = g_plugin.getByte("stattype", 2);
+ uint8_t bReqMode = g_plugin.getByte("stattype", 2);
unsigned uMode = (STATUS_ARR_TO_ID[bReqMode]);
DBVARIANT dbVar;
if (g_wMask & OPT_USEDEFMSG || g_plugin.getWString("statmsg", &dbVar)) {
@@ -476,8 +476,8 @@ static wchar_t* GetBossKeyText(void) {
WORD wHotKey = db_get_w(0, "SkinHotKeys", "Hide/Show Miranda", HOTKEYCODE(HOTKEYF_CONTROL, VK_F12));
- BYTE key = LOBYTE(wHotKey);
- BYTE shift = HIBYTE(wHotKey);
+ uint8_t key = LOBYTE(wHotKey);
+ uint8_t shift = HIBYTE(wHotKey);
static wchar_t buf[128];
mir_snwprintf(buf, L"%s%s%s%s%s",
diff --git a/plugins/BossKeyPlus/src/Options.cpp b/plugins/BossKeyPlus/src/Options.cpp index febde01740..7d05135e10 100644 --- a/plugins/BossKeyPlus/src/Options.cpp +++ b/plugins/BossKeyPlus/src/Options.cpp @@ -32,7 +32,7 @@ class COptMainDlg : public CDlgBase void ComboboxSelState()
{
- BYTE bSelection = (BYTE)m_cbStatusList.GetCurSel();
+ uint8_t bSelection = (uint8_t)m_cbStatusList.GetCurSel();
WORD wMode = STATUS_ARR_TO_ID[bSelection];
if (m_chkUsrDefMsg.GetState()) {
wchar_t *ptszDefMsg = GetDefStatusMsg(wMode, nullptr);
@@ -134,7 +134,7 @@ public: // write down status type
if (m_chkChangeStatus.GetState()) {
- g_plugin.setByte("stattype", (BYTE)m_cbStatusList.GetCurSel());
+ g_plugin.setByte("stattype", (uint8_t)m_cbStatusList.GetCurSel());
// status msg, if needed
if (m_edtStatMsg.Enabled()) { // meaning we should save it
diff --git a/plugins/BuddyExpectator/src/options.cpp b/plugins/BuddyExpectator/src/options.cpp index 467828b600..06e1e9560a 100644 --- a/plugins/BuddyExpectator/src/options.cpp +++ b/plugins/BuddyExpectator/src/options.cpp @@ -50,7 +50,7 @@ void LoadOptions() options.iShowPopup2 = g_plugin.getByte("iShowPopUp2", 1);
options.iShowEvent2 = g_plugin.getByte("iShowEvent2", 0);
- options.action2 = (GoneContactAction)g_plugin.getByte("Action2", (BYTE)GCA_NOACTION);
+ options.action2 = (GoneContactAction)g_plugin.getByte("Action2", (uint8_t)GCA_NOACTION);
options.notifyFirstOnline = g_plugin.getByte("bShowFirstSight", 0) ? true : false;
options.hideInactive = g_plugin.getByte("bHideInactive", 0) ? true : false;
options.enableMissYou = g_plugin.getByte("bMissYouEnabled", 1) ? true : false;
@@ -69,7 +69,7 @@ void SaveOptions() g_plugin.setByte("iShowPopUp2", options.iShowPopup2);
g_plugin.setByte("iShowEvent2", options.iShowEvent2);
- g_plugin.setByte("Action2", (BYTE)options.action2);
+ g_plugin.setByte("Action2", (uint8_t)options.action2);
g_plugin.setByte("bShowFirstSight", options.notifyFirstOnline ? 1 : 0);
g_plugin.setByte("bHideInactive", options.hideInactive ? 1 : 0);
g_plugin.setByte("bMissYouEnabled", options.enableMissYou ? 1 : 0);
diff --git a/plugins/BuddyPounce/src/main.cpp b/plugins/BuddyPounce/src/main.cpp index 0562776660..a128e0dbd0 100644 --- a/plugins/BuddyPounce/src/main.cpp +++ b/plugins/BuddyPounce/src/main.cpp @@ -56,7 +56,7 @@ int MsgAck(WPARAM, LPARAM lParam) }
// check to reuse
if (reuse > 1)
- g_plugin.setByte(ack->hContact, "Reuse", (BYTE)(reuse - 1));
+ g_plugin.setByte(ack->hContact, "Reuse", (uint8_t)(reuse - 1));
else {
g_plugin.setByte(ack->hContact, "Reuse", 0);
g_plugin.setWString(ack->hContact, "PounceMsg", L"");
@@ -222,8 +222,8 @@ INT_PTR AddSimpleMessage(WPARAM wParam, LPARAM lParam) g_plugin.setWString(hContact, "PounceMsg", message);
g_plugin.setWord(hContact, "SendIfMyStatusIsFLAG", (WORD)g_plugin.getWord("SendIfMyStatusIsFLAG", 1));
g_plugin.setWord(hContact, "SendIfTheirStatusIsFLAG", (WORD)g_plugin.getWord("SendIfTheirStatusIsFLAG", 1));
- g_plugin.setByte(hContact, "Reuse", (BYTE)g_plugin.getByte("Reuse", 0));
- g_plugin.setByte(hContact, "GiveUpDays", (BYTE)g_plugin.getByte("GiveUpDays", 0));
+ g_plugin.setByte(hContact, "Reuse", (uint8_t)g_plugin.getByte("Reuse", 0));
+ g_plugin.setByte(hContact, "GiveUpDays", (uint8_t)g_plugin.getByte("GiveUpDays", 0));
g_plugin.setDword(hContact, "GiveUpDate", (DWORD)(g_plugin.getByte(hContact, "GiveUpDays", 0)*SECONDSINADAY));
return 0;
}
diff --git a/plugins/BuddyPounce/src/options.cpp b/plugins/BuddyPounce/src/options.cpp index df13f1a05b..16cc57cc1f 100644 --- a/plugins/BuddyPounce/src/options.cpp +++ b/plugins/BuddyPounce/src/options.cpp @@ -104,7 +104,7 @@ void COptionsDlg::onSelChange_Settings(CCtrlListBox*) edtNumber.SetInt(g_plugin.getWord(hContact, "ConfirmTimeout")); break; } - g_plugin.setByte(hContact, "LastSetting", (BYTE)item); + g_plugin.setByte(hContact, "LastSetting", (uint8_t)item); NotifyChange(); } @@ -112,10 +112,10 @@ void COptionsDlg::saveLastSetting() { switch (g_plugin.getByte(hContact, "LastSetting", 2)) { case 3: // Reuse Pounce - g_plugin.setByte(hContact, "Reuse", (BYTE)edtNumber.GetInt()); + g_plugin.setByte(hContact, "Reuse", (uint8_t)edtNumber.GetInt()); break; case 4: // Give Up delay - g_plugin.setByte(hContact, "GiveUpDays", (BYTE)edtNumber.GetInt()); + g_plugin.setByte(hContact, "GiveUpDays", (uint8_t)edtNumber.GetInt()); g_plugin.setDword(hContact, "GiveUpDate", (DWORD)edtNumber.GetInt() * SECONDSINADAY); break; case 5: // confirm window diff --git a/plugins/ChangeKeyboardLayout/src/stdafx.h b/plugins/ChangeKeyboardLayout/src/stdafx.h index d76e96c72f..8d89dee754 100644 --- a/plugins/ChangeKeyboardLayout/src/stdafx.h +++ b/plugins/ChangeKeyboardLayout/src/stdafx.h @@ -82,18 +82,18 @@ typedef struct BOOL ChangeSystemLayout;
BOOL CopyToClipboard;
BOOL ShowPopup;
- BYTE bCaseOperations;
+ uint8_t bCaseOperations;
} MainOptions;
typedef struct
{
- BYTE bColourType;
+ uint8_t bColourType;
COLORREF crTextColour;
COLORREF crBackColour;
- BYTE bTimeoutType;
- BYTE bTimeout;
- BYTE bLeftClick;
- BYTE bRightClick;
+ uint8_t bTimeoutType;
+ uint8_t bTimeout;
+ uint8_t bLeftClick;
+ uint8_t bRightClick;
POPUPACTION paActions[1];
} PopupOptions;
diff --git a/plugins/ChangeKeyboardLayout/src/text_operations.cpp b/plugins/ChangeKeyboardLayout/src/text_operations.cpp index 06e7a8f3ea..37fbd00c1f 100644 --- a/plugins/ChangeKeyboardLayout/src/text_operations.cpp +++ b/plugins/ChangeKeyboardLayout/src/text_operations.cpp @@ -101,7 +101,7 @@ wchar_t* GenerateLayoutString(HKL hklLayout) SHORT shVirtualKey = VkKeyScanExW(ptszKeybEng[i], g_plugin.hklEng);
UINT iScanCode = MapVirtualKeyExW(shVirtualKey & 0x00FF, 0, g_plugin.hklEng);
- BYTE bState[256] = {};
+ uint8_t bState[256] = {};
if (shVirtualKey & 0x0100) bState[VK_SHIFT] = 0x80;
if (shVirtualKey & 0x0200) bState[VK_CONTROL] = 0x80;
@@ -213,7 +213,7 @@ HKL GetLayoutOfText(LPCTSTR ptszInText) return hklCurLay;
}
-int ChangeLayout(HWND hTextWnd, BYTE TextOperation, BOOL CurrentWord)
+int ChangeLayout(HWND hTextWnd, uint8_t TextOperation, BOOL CurrentWord)
{
HKL hklCurLay = nullptr, hklToLay = nullptr;
@@ -221,7 +221,7 @@ int ChangeLayout(HWND hTextWnd, BYTE TextOperation, BOOL CurrentWord) CHARRANGE crSelection = { 0 }, crTemp = { 0 };
DWORD dwStartWord, dwEndWord;
- BYTE WindowType = WTYPE_Unknown;
+ uint8_t WindowType = WTYPE_Unknown;
BOOL WindowIsReadOnly, TwoWay;
if (hTextWnd == nullptr)
diff --git a/plugins/ChangeKeyboardLayout/src/text_operations.h b/plugins/ChangeKeyboardLayout/src/text_operations.h index c06c266992..786d811c2d 100644 --- a/plugins/ChangeKeyboardLayout/src/text_operations.h +++ b/plugins/ChangeKeyboardLayout/src/text_operations.h @@ -11,6 +11,6 @@ wchar_t *GetLayoutString(HKL hklLayout); HKL GetLayoutOfText(LPCTSTR ptzsInText);
wchar_t *ChangeTextCase(LPCTSTR ptszInText);
wchar_t *ChangeTextLayout(LPCTSTR ptzsInText, HKL hklCurLay, HKL hklToLay, BOOL TwoWay);
-int ChangeLayout(HWND hTextWnd, BYTE bTextOperation, BOOL CurrentWord);
+int ChangeLayout(HWND hTextWnd, uint8_t bTextOperation, BOOL CurrentWord);
#endif
\ No newline at end of file diff --git a/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp b/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp index 8ea557eb05..c489ddd1d9 100644 --- a/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp +++ b/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp @@ -75,7 +75,7 @@ static VOID CALLBACK ShowContactMenu(void *param) DestroyWindow(hMenuWnd);
}
-void Popup_DoAction(HWND hWnd, BYTE Action, PLUGIN_DATA*)
+void Popup_DoAction(HWND hWnd, uint8_t Action, PLUGIN_DATA*)
{
MCONTACT hContact = PUGetContact(hWnd);
switch (Action) {
diff --git a/plugins/Clist_blind/src/clcopts.cpp b/plugins/Clist_blind/src/clcopts.cpp index 1a29f31be9..74fb2fc4f3 100644 --- a/plugins/Clist_blind/src/clcopts.cpp +++ b/plugins/Clist_blind/src/clcopts.cpp @@ -89,10 +89,10 @@ public: exStyle |= checkBoxToStyleEx[i].flag;
db_set_dw(0, "CLC", "ExStyle", exStyle);
- db_set_b(0, "CLC", "ShowIdle", (BYTE)(IsDlgButtonChecked(m_hwnd, IDC_IDLE) ? 1 : 0));
- db_set_b(0, "CLC", "LeftMargin", (BYTE)SendDlgItemMessage(m_hwnd, IDC_LEFTMARGINSPIN, UDM_GETPOS, 0, 0));
+ db_set_b(0, "CLC", "ShowIdle", (uint8_t)(IsDlgButtonChecked(m_hwnd, IDC_IDLE) ? 1 : 0));
+ db_set_b(0, "CLC", "LeftMargin", (uint8_t)SendDlgItemMessage(m_hwnd, IDC_LEFTMARGINSPIN, UDM_GETPOS, 0, 0));
db_set_w(0, "CLC", "ScrollTime", (WORD)SendDlgItemMessage(m_hwnd, IDC_SMOOTHTIMESPIN, UDM_GETPOS, 0, 0));
- db_set_b(0, "CLC", "GroupIndent", (BYTE)SendDlgItemMessage(m_hwnd, IDC_GROUPINDENTSPIN, UDM_GETPOS, 0, 0));
+ db_set_b(0, "CLC", "GroupIndent", (uint8_t)SendDlgItemMessage(m_hwnd, IDC_GROUPINDENTSPIN, UDM_GETPOS, 0, 0));
wchar_t tmp[1024];
GetDlgItemText(m_hwnd, IDC_T_CONTACT, tmp, _countof(tmp));
diff --git a/plugins/Clist_blind/src/clistopts.cpp b/plugins/Clist_blind/src/clistopts.cpp index b0cf370b15..f6be83ca73 100644 --- a/plugins/Clist_blind/src/clistopts.cpp +++ b/plugins/Clist_blind/src/clistopts.cpp @@ -82,13 +82,13 @@ public: {
int iTrayIcon = chkDontCycle.IsChecked() ? SETTING_TRAYICON_SINGLE : (chkCycle.IsChecked() ? SETTING_TRAYICON_CYCLE : SETTING_TRAYICON_MULTI);
- g_plugin.setByte("SortByStatus", (BYTE)(g_bSortByStatus = IsDlgButtonChecked(m_hwnd, IDC_SORTBYSTATUS)));
- g_plugin.setByte("SortByProto", (BYTE)(g_bSortByProto = IsDlgButtonChecked(m_hwnd, IDC_SORTBYPROTO)));
- g_plugin.setByte("AlwaysMulti", (BYTE)!IsDlgButtonChecked(m_hwnd, IDC_ALWAYSMULTI));
+ g_plugin.setByte("SortByStatus", (uint8_t)(g_bSortByStatus = IsDlgButtonChecked(m_hwnd, IDC_SORTBYSTATUS)));
+ g_plugin.setByte("SortByProto", (uint8_t)(g_bSortByProto = IsDlgButtonChecked(m_hwnd, IDC_SORTBYPROTO)));
+ g_plugin.setByte("AlwaysMulti", (uint8_t)!IsDlgButtonChecked(m_hwnd, IDC_ALWAYSMULTI));
g_plugin.setByte("TrayIcon", iTrayIcon);
g_plugin.setWord("CycleTime", (WORD)SendDlgItemMessage(m_hwnd, IDC_CYCLETIMESPIN, UDM_GETPOS, 0, 0));
g_plugin.setWord("IconFlashTime", (WORD)SendDlgItemMessage(m_hwnd, IDC_BLINKSPIN, UDM_GETPOS, 0, 0));
- g_plugin.setByte("DisableTrayFlash", (BYTE)IsDlgButtonChecked(m_hwnd, IDC_DISABLEBLINK));
+ g_plugin.setByte("DisableTrayFlash", (uint8_t)IsDlgButtonChecked(m_hwnd, IDC_DISABLEBLINK));
int cur = SendDlgItemMessage(m_hwnd, IDC_PRIMARYSTATUS, CB_GETCURSEL, 0, 0);
PROTOACCOUNT *pa = (PROTOACCOUNT *)SendDlgItemMessage(m_hwnd, IDC_PRIMARYSTATUS, CB_GETITEMDATA, cur, 0);
diff --git a/plugins/Clist_blind/src/cluiopts.cpp b/plugins/Clist_blind/src/cluiopts.cpp index 3464f9b892..3af3cb4af7 100644 --- a/plugins/Clist_blind/src/cluiopts.cpp +++ b/plugins/Clist_blind/src/cluiopts.cpp @@ -89,17 +89,17 @@ public: bool OnApply() override
{
- g_plugin.setByte("OnTop", (BYTE)IsDlgButtonChecked(m_hwnd, IDC_ONTOP));
- g_plugin.setByte("ToolWindow", (BYTE)IsDlgButtonChecked(m_hwnd, IDC_TOOLWND));
- g_plugin.setByte("BringToFront", (BYTE)IsDlgButtonChecked(m_hwnd, IDC_BRINGTOFRONT));
- db_set_b(0, "CLUI", "FadeInOut", (BYTE)IsDlgButtonChecked(m_hwnd, IDC_FADEINOUT));
- db_set_b(0, "CLUI", "AutoSizeUpward", (BYTE)IsDlgButtonChecked(m_hwnd, IDC_AUTOSIZEUPWARD));
- g_plugin.setByte("WindowShadow", (BYTE)IsDlgButtonChecked(m_hwnd, IDC_DROPSHADOW));
- g_plugin.setByte("OnDesktop", (BYTE)IsDlgButtonChecked(m_hwnd, IDC_ONDESKTOP));
- db_set_b(0, "CLUI", "ShowCaption", (BYTE)IsDlgButtonChecked(m_hwnd, IDC_SHOWCAPTION));
- db_set_b(0, "CLUI", "ShowMainMenu", (BYTE)IsDlgButtonChecked(m_hwnd, IDC_SHOWMAINMENU));
- db_set_b(0, "CLUI", "ClientAreaDrag", (BYTE)IsDlgButtonChecked(m_hwnd, IDC_CLIENTDRAG));
- g_plugin.setByte("Min2Tray", (BYTE)IsDlgButtonChecked(m_hwnd, IDC_MIN2TRAY));
+ g_plugin.setByte("OnTop", (uint8_t)IsDlgButtonChecked(m_hwnd, IDC_ONTOP));
+ g_plugin.setByte("ToolWindow", (uint8_t)IsDlgButtonChecked(m_hwnd, IDC_TOOLWND));
+ g_plugin.setByte("BringToFront", (uint8_t)IsDlgButtonChecked(m_hwnd, IDC_BRINGTOFRONT));
+ db_set_b(0, "CLUI", "FadeInOut", (uint8_t)IsDlgButtonChecked(m_hwnd, IDC_FADEINOUT));
+ db_set_b(0, "CLUI", "AutoSizeUpward", (uint8_t)IsDlgButtonChecked(m_hwnd, IDC_AUTOSIZEUPWARD));
+ g_plugin.setByte("WindowShadow", (uint8_t)IsDlgButtonChecked(m_hwnd, IDC_DROPSHADOW));
+ g_plugin.setByte("OnDesktop", (uint8_t)IsDlgButtonChecked(m_hwnd, IDC_ONDESKTOP));
+ db_set_b(0, "CLUI", "ShowCaption", (uint8_t)IsDlgButtonChecked(m_hwnd, IDC_SHOWCAPTION));
+ db_set_b(0, "CLUI", "ShowMainMenu", (uint8_t)IsDlgButtonChecked(m_hwnd, IDC_SHOWMAINMENU));
+ db_set_b(0, "CLUI", "ClientAreaDrag", (uint8_t)IsDlgButtonChecked(m_hwnd, IDC_CLIENTDRAG));
+ g_plugin.setByte("Min2Tray", (uint8_t)IsDlgButtonChecked(m_hwnd, IDC_MIN2TRAY));
g_plugin.setWord("HideTime", spinHideTime.GetPosition());
db_set_b(0, "CLUI", "MaxSizeHeight", spinMaxSize.GetPosition());
@@ -157,7 +157,7 @@ public: ShowWindow(g_clistApi.hwndContactList, IsDlgButtonChecked(m_hwnd, IDC_MIN2TRAY) ? SW_HIDE : SW_SHOW);
if (IsDlgButtonChecked(m_hwnd, IDC_TRANSPARENT)) {
SetWindowLongPtr(g_clistApi.hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(g_clistApi.hwndContactList, GWL_EXSTYLE) | WS_EX_LAYERED);
- SetLayeredWindowAttributes(g_clistApi.hwndContactList, RGB(0, 0, 0), (BYTE)g_plugin.getByte("AutoAlpha", SETTING_AUTOALPHA_DEFAULT), LWA_ALPHA);
+ SetLayeredWindowAttributes(g_clistApi.hwndContactList, RGB(0, 0, 0), (uint8_t)g_plugin.getByte("AutoAlpha", SETTING_AUTOALPHA_DEFAULT), LWA_ALPHA);
}
else SetWindowLongPtr(g_clistApi.hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(g_clistApi.hwndContactList, GWL_EXSTYLE) & ~WS_EX_LAYERED);
@@ -236,7 +236,7 @@ public: {
chkShow.SetState(db_get_b(0, "CLUI", "ShowSBar", 1));
- BYTE showOpts = db_get_b(0, "CLUI", "SBarShow", 1);
+ uint8_t showOpts = db_get_b(0, "CLUI", "SBarShow", 1);
CheckDlgButton(m_hwnd, IDC_SHOWICON, showOpts & 1 ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(m_hwnd, IDC_SHOWPROTO, showOpts & 2 ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(m_hwnd, IDC_SHOWSTATUS, showOpts & 4 ? BST_CHECKED : BST_UNCHECKED);
@@ -253,17 +253,17 @@ public: {
db_set_b(0, "CLUI", "ShowSBar", chkShow.GetState());
db_set_b(0, "CLUI", "SBarShow",
- (BYTE)((IsDlgButtonChecked(m_hwnd, IDC_SHOWICON) ? 1 : 0) |
+ (uint8_t)((IsDlgButtonChecked(m_hwnd, IDC_SHOWICON) ? 1 : 0) |
(IsDlgButtonChecked(m_hwnd, IDC_SHOWPROTO) ? 2 : 0) |
(IsDlgButtonChecked(m_hwnd, IDC_SHOWSTATUS) ? 4 : 0)));
- db_set_b(0, "CLUI", "SBarRightClk", (BYTE)IsDlgButtonChecked(m_hwnd, IDC_RIGHTMIRANDA));
- db_set_b(0, "CLUI", "EqualSections", (BYTE)IsDlgButtonChecked(m_hwnd, IDC_EQUALSECTIONS));
- db_set_b(0, "CLUI", "SBarBevel", (BYTE)IsDlgButtonChecked(m_hwnd, IDC_SBPANELBEVEL));
+ db_set_b(0, "CLUI", "SBarRightClk", (uint8_t)IsDlgButtonChecked(m_hwnd, IDC_RIGHTMIRANDA));
+ db_set_b(0, "CLUI", "EqualSections", (uint8_t)IsDlgButtonChecked(m_hwnd, IDC_EQUALSECTIONS));
+ db_set_b(0, "CLUI", "SBarBevel", (uint8_t)IsDlgButtonChecked(m_hwnd, IDC_SBPANELBEVEL));
g_clistApi.pfnLoadCluiGlobalOpts();
- if (db_get_b(0, "CLUI", "ShowGrip", 1) != (BYTE)IsDlgButtonChecked(m_hwnd, IDC_SHOWGRIP)) {
+ if (db_get_b(0, "CLUI", "ShowGrip", 1) != (uint8_t)IsDlgButtonChecked(m_hwnd, IDC_SHOWGRIP)) {
HWND parent = GetParent(g_clistApi.hwndStatus);
int flags = WS_CHILD | CCS_BOTTOM;
- db_set_b(0, "CLUI", "ShowGrip", (BYTE)IsDlgButtonChecked(m_hwnd, IDC_SHOWGRIP));
+ db_set_b(0, "CLUI", "ShowGrip", (uint8_t)IsDlgButtonChecked(m_hwnd, IDC_SHOWGRIP));
ShowWindow(g_clistApi.hwndStatus, SW_HIDE);
DestroyWindow(g_clistApi.hwndStatus);
flags |= db_get_b(0, "CLUI", "ShowSBar", 1) ? WS_VISIBLE : 0;
diff --git a/plugins/Clist_modern/src/cluiframes.cpp b/plugins/Clist_modern/src/cluiframes.cpp index fb47d34952..403ad5188f 100644 --- a/plugins/Clist_modern/src/cluiframes.cpp +++ b/plugins/Clist_modern/src/cluiframes.cpp @@ -88,7 +88,7 @@ static COLORREF sttBkColour; static COLORREF sttSelBkColour;
static BOOL sttBkUseWinColours;
-BYTE AlignCOLLIconToLeft; //will hide frame icon
+uint8_t AlignCOLLIconToLeft; //will hide frame icon
//for old multiwindow
#define MPCF_CONTEXTFRAMEMENU 3
@@ -130,7 +130,7 @@ int CLUIFrames_OnMoving(HWND hwnd, RECT *r) return 0;
}
-int SetAlpha(BYTE Alpha)
+int SetAlpha(uint8_t Alpha)
{
for (int i = 0; i < g_nFramesCount; i++) {
FRAMEWND &F = g_pfwFrames[i];
@@ -679,10 +679,10 @@ static int CLUIFramesStoreFrameSettings(int Frameid) CMStringA buf;
db_set_ws(0, CLUIFrameModule, buf.Format("Name%d", storpos), F.name);
- db_set_b(0, CLUIFrameModule, buf.Format("Collapse%d", storpos), (BYTE)btoint(F.collapsed));
- db_set_b(0, CLUIFrameModule, buf.Format("Locked%d", storpos), (BYTE)btoint(F.Locked));
- db_set_b(0, CLUIFrameModule, buf.Format("Visible%d", storpos), (BYTE)btoint(F.visible));
- db_set_b(0, CLUIFrameModule, buf.Format("TBVisile%d", storpos), (BYTE)btoint(F.TitleBar.ShowTitleBar));
+ db_set_b(0, CLUIFrameModule, buf.Format("Collapse%d", storpos), (uint8_t)btoint(F.collapsed));
+ db_set_b(0, CLUIFrameModule, buf.Format("Locked%d", storpos), (uint8_t)btoint(F.Locked));
+ db_set_b(0, CLUIFrameModule, buf.Format("Visible%d", storpos), (uint8_t)btoint(F.visible));
+ db_set_b(0, CLUIFrameModule, buf.Format("TBVisile%d", storpos), (uint8_t)btoint(F.TitleBar.ShowTitleBar));
db_set_w(0, CLUIFrameModule, buf.Format("Height%d", storpos), (WORD)F.height);
db_set_w(0, CLUIFrameModule, buf.Format("HeightCollapsed%d", storpos), (WORD)F.HeightWhenCollapsed);
@@ -693,8 +693,8 @@ static int CLUIFramesStoreFrameSettings(int Frameid) db_set_w(0, CLUIFrameModule, buf.Format("FloatW%d", storpos), (WORD)F.FloatingSize.x);
db_set_w(0, CLUIFrameModule, buf.Format("FloatH%d", storpos), (WORD)F.FloatingSize.y);
- db_set_b(0, CLUIFrameModule, buf.Format("Floating%d", storpos), (BYTE)btoint(F.floating));
- db_set_b(0, CLUIFrameModule, buf.Format("UseBorder%d", storpos), (BYTE)btoint(F.UseBorder));
+ db_set_b(0, CLUIFrameModule, buf.Format("Floating%d", storpos), (uint8_t)btoint(F.floating));
+ db_set_b(0, CLUIFrameModule, buf.Format("UseBorder%d", storpos), (uint8_t)btoint(F.UseBorder));
db_set_w(0, CLUIFrameModule, buf.Format("Order%d", storpos), (WORD)F.order);
db_set_w(0, CLUIFrameModule, "StoredFrames", (WORD)maxstored);
@@ -2939,7 +2939,7 @@ static LRESULT CALLBACK CLUIFrameSubContainerProc(HWND hwnd, UINT msg, WPARAM wP switch (msg) {
case WM_ACTIVATE:
if (g_bTransparentFlag) {
- BYTE alpha;
+ uint8_t alpha;
if ((wParam != WA_INACTIVE || ((HWND)lParam == hwnd) || GetParent((HWND)lParam) == hwnd)) {
HWND hw = lParam ? GetParent((HWND)lParam) : nullptr;
alpha = g_plugin.getByte("Alpha", SETTING_ALPHA_DEFAULT);
diff --git a/plugins/Clist_modern/src/modern_aniavatars.cpp b/plugins/Clist_modern/src/modern_aniavatars.cpp index 9f8f3c4435..9dc29c2ed8 100644 --- a/plugins/Clist_modern/src/modern_aniavatars.cpp +++ b/plugins/Clist_modern/src/modern_aniavatars.cpp @@ -96,7 +96,7 @@ struct ANIAVA_WINDOWINFO BOOL bPlaying;
int overlayIconIdx;
- BYTE bAlpha;
+ uint8_t bAlpha;
BOOL bOrderTop;
BOOL bPaused; // was request do not draw
@@ -107,7 +107,7 @@ struct ANIAVA_POSINFO {
RECT rcPos;
int idxOverlay;
- BYTE bAlpha;
+ uint8_t bAlpha;
};
struct ANIAVA_SYNCCALLITEM
@@ -132,8 +132,8 @@ static BOOL s_bModuleStarted; static mir_cs s_CS;
// options
-static BYTE s_bFlags; // 0x1 has border, 0x2 has round corners, 0x4 has overlay, 0x8 background color
-static BYTE s_cornerRadius;
+static uint8_t s_bFlags; // 0x1 has border, 0x2 has round corners, 0x4 has overlay, 0x8 background color
+static uint8_t s_cornerRadius;
static COLORREF s_borderColor;
static COLORREF s_bkgColor;
static HIMAGELIST s_overlayIconImageList;
@@ -453,7 +453,7 @@ static void _AniAva_LoadOptions() s_cornerRadius = g_plugin.getByte("AvatarsUseCustomCornerSize", SETTINGS_AVATARUSECUTOMCORNERSIZE_DEFAULT) ? g_plugin.getWord("AvatarsCustomCornerSize", SETTINGS_AVATARCORNERSIZE_DEFAULT) : 0;
if (s_bFlags & AAO_HAS_OVERLAY) {
// check image list
- BYTE type = g_plugin.getByte("AvatarsOverlayType", SETTINGS_AVATAROVERLAYTYPE_DEFAULT);
+ uint8_t type = g_plugin.getByte("AvatarsOverlayType", SETTINGS_AVATAROVERLAYTYPE_DEFAULT);
switch (type) {
case SETTING_AVATAR_OVERLAY_TYPE_NORMAL:
s_overlayIconImageList = hAvatarOverlays;
@@ -490,7 +490,7 @@ static void _AniAva_RenderAvatar(ANIAVA_WINDOWINFO * dat, HDC hdcParent = nullpt if (dat->bPlaying && IsWindowVisible(dat->hWindow)) {
POINT ptWnd = { 0 };
SIZE szWnd = { dat->rcPos.right - dat->rcPos.left, dat->rcPos.bottom - dat->rcPos.top };
- BLENDFUNCTION bf = { AC_SRC_OVER, 0, BYTE(g_CluiData.bCurrentAlpha * dat->bAlpha / 256), AC_SRC_ALPHA };
+ BLENDFUNCTION bf = { AC_SRC_OVER, 0, uint8_t(g_CluiData.bCurrentAlpha * dat->bAlpha / 256), AC_SRC_ALPHA };
POINT pt_from = { 0, 0 };
HDC hDC_animation = GetDC(nullptr);
HDC copyFromDC;
@@ -898,7 +898,7 @@ int AniAva_RenderAvatar(MCONTACT hContact, HDC hdcMem, RECT *rc) /////////////////////////////////////////////////////////////////////////////////////////
// update avatars pos
-int AniAva_SetAvatarPos(MCONTACT hContact, RECT *rc, int overlayIdx, BYTE bAlpha)
+int AniAva_SetAvatarPos(MCONTACT hContact, RECT *rc, int overlayIdx, uint8_t bAlpha)
{
aacheck 0;
mir_cslock lck(s_CS);
diff --git a/plugins/Clist_modern/src/modern_clc.cpp b/plugins/Clist_modern/src/modern_clc.cpp index 3b2a64c481..050e550525 100644 --- a/plugins/Clist_modern/src/modern_clc.cpp +++ b/plugins/Clist_modern/src/modern_clc.cpp @@ -35,7 +35,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. static HANDLE hShowInfoTipEvent;
static POINT HitPoint;
static BOOL fMouseUpped;
-static BYTE IsDragToScrollMode = 0;
+static uint8_t IsDragToScrollMode = 0;
static int StartDragPos = 0;
static int StartScrollPos = 0;
static BOOL g_bSortTimerIsSet = FALSE;
@@ -1055,7 +1055,7 @@ static LRESULT clcOnLButtonUp(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, fMouseUpped = TRUE;
if (hitcontact != nullptr && dat->bMetaExpanding) {
- BYTE doubleClickExpand = db_get_b(0, "CLC", "MetaDoubleClick", SETTING_METAAVOIDDBLCLICK_DEFAULT);
+ uint8_t doubleClickExpand = db_get_b(0, "CLC", "MetaDoubleClick", SETTING_METAAVOIDDBLCLICK_DEFAULT);
CLUI_SafeSetTimer(hwnd, TIMERID_SUBEXPAND, GetDoubleClickTime()*doubleClickExpand, nullptr);
}
else if (dat->iHotTrack == -1 && dat->iDragItem == -1)
@@ -1296,7 +1296,7 @@ static LRESULT clcOnDestroy(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LP static LRESULT clcOnIntmGroupChanged(ClcData *dat, HWND hwnd, UINT, WPARAM wParam, LPARAM)
{
WORD iExtraImage[EXTRA_ICON_COUNT];
- BYTE flags = 0;
+ uint8_t flags = 0;
ClcContact *contact;
if (!Clist_FindItem(hwnd, dat, wParam, &contact))
@@ -1643,9 +1643,9 @@ HRESULT ClcLoadModule() int ClcUnloadModule()
{
- if (g_CluiData.bOldUseGroups != (BYTE)-1)
+ if (g_CluiData.bOldUseGroups != (uint8_t)-1)
Clist::UseGroups = g_CluiData.bOldUseGroups;
- if (g_CluiData.boldHideOffline != (BYTE)-1)
+ if (g_CluiData.boldHideOffline != (uint8_t)-1)
Clist::HideOffline = g_CluiData.boldHideOffline;
return 0;
diff --git a/plugins/Clist_modern/src/modern_clc.h b/plugins/Clist_modern/src/modern_clc.h index 0a641635d7..7f6f9308da 100644 --- a/plugins/Clist_modern/src/modern_clc.h +++ b/plugins/Clist_modern/src/modern_clc.h @@ -164,7 +164,7 @@ enum { struct tContactItems
{
- BYTE itemType; //one of above CIT_ definitions
+ uint8_t itemType; //one of above CIT_ definitions
RECT itemRect;
};
@@ -189,10 +189,10 @@ struct ClcContact : public ClcContactBase RECT pos_contact_time;
RECT pos_extra[EXTRA_ICON_COUNT];
DWORD lastPaintCounter;
- BYTE bContactRate;
+ uint8_t bContactRate;
// For extended layout
- BYTE ext_nItemsNum;
+ uint8_t ext_nItemsNum;
BOOL ext_fItemsValid;
tContactItems ext_mpItemsDesc[EXTRA_ICON_COUNT + 10]; //up to 10 items
@@ -225,16 +225,16 @@ struct ClcModernFontInfo { HFONT hFont;
int fontHeight, changed;
COLORREF colour;
- BYTE effect;
+ uint8_t effect;
COLORREF effectColour1;
COLORREF effectColour2;
};
struct ClcData : public ClcDataBase
{
- BYTE HiLightMode;
- BYTE doubleClickExpand;
- BYTE IsMetaContactsEnabled;
+ uint8_t HiLightMode;
+ uint8_t doubleClickExpand;
+ uint8_t IsMetaContactsEnabled;
time_t last_tick_time;
bool bForceInDialog, bPlaceOfflineToRoot, bMetaIgnoreEmptyExtra, bMetaExpanding;
int subIndent;
@@ -261,7 +261,7 @@ struct ClcData : public ClcDataBase BOOL row_align_right_items_to_right;
int row_items[NUM_ITEM_TYPE];
BOOL row_hide_group_icon;
- BYTE row_align_group_mode;
+ uint8_t row_align_group_mode;
// Avatar
BOOL avatars_show;
@@ -301,18 +301,18 @@ struct ClcData : public ClcDataBase ClcModernFontInfo fontModernInfo[FONTID_MODERN_MAX + 1];
HWND hWnd;
- BYTE menuOwnerType;
+ uint8_t menuOwnerType;
int menuOwnerID;
DWORD m_paintCouter; //range is enoght to 49 days if painting will occure each one millisecond
- BYTE drawOverlayedStatus;
+ uint8_t drawOverlayedStatus;
int nInsertionLevel;
- BYTE dbbMetaHideExtra;
- BYTE dbbBlendInActiveState;
- BYTE dbbBlend25;
+ uint8_t dbbMetaHideExtra;
+ uint8_t dbbBlendInActiveState;
+ uint8_t dbbBlend25;
XPTHANDLE hCheckBoxTheme;
- BYTE bCompactMode;
+ uint8_t bCompactMode;
__forceinline int getRowHeight(int iRow) const
{ return (row_heights && row_variable_height) ? row_heights[iRow] : rowHeight;
@@ -358,7 +358,7 @@ COLORREF cliGetColor(char *module, char *color, COLORREF defColor); // clcopts.c
int ClcOptInit(WPARAM wParam, LPARAM lParam);
DWORD GetDefaultExStyle(void);
-void GetFontSetting(int i, LOGFONT *lf, COLORREF *colour, BYTE *effect, COLORREF *eColour1, COLORREF *eColour2);
+void GetFontSetting(int i, LOGFONT *lf, COLORREF *colour, uint8_t *effect, COLORREF *eColour1, COLORREF *eColour2);
// groups.c
int GetContactCachedStatus(MCONTACT hContact);
diff --git a/plugins/Clist_modern/src/modern_clcmsgs.cpp b/plugins/Clist_modern/src/modern_clcmsgs.cpp index 93a2117cdc..bb4ef73c49 100644 --- a/plugins/Clist_modern/src/modern_clcmsgs.cpp +++ b/plugins/Clist_modern/src/modern_clcmsgs.cpp @@ -200,7 +200,7 @@ LRESULT cli_ProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wP index += contact->iSubNumber;
}
- BYTE k = db_get_b(0, "CLC", "MetaExpanding", SETTING_METAEXPANDING_DEFAULT);
+ uint8_t k = db_get_b(0, "CLC", "MetaExpanding", SETTING_METAEXPANDING_DEFAULT);
if (k) {
for (int i = 0; i < mainindex; i++) {
ClcContact *tempCont = group->cl[i];
diff --git a/plugins/Clist_modern/src/modern_clcopts.cpp b/plugins/Clist_modern/src/modern_clcopts.cpp index 1a14954084..468fa1eefe 100644 --- a/plugins/Clist_modern/src/modern_clcopts.cpp +++ b/plugins/Clist_modern/src/modern_clcopts.cpp @@ -58,13 +58,13 @@ struct const wchar_t *szDescr;
COLORREF defColour;
const wchar_t *szDefFace;
- BYTE defCharset, defStyle;
+ uint8_t defCharset, defStyle;
char defSize;
FONTEFFECT defeffect;
COLORREF colour;
wchar_t szFace[LF_FACESIZE];
- BYTE charset, style;
+ uint8_t charset, style;
char size;
}
static fontOptionsList[] =
@@ -191,7 +191,7 @@ DWORD GetDefaultExStyle(void) return ret;
}
-void GetFontSetting(int i, LOGFONT *lf, COLORREF *colour, BYTE *effect, COLORREF *eColour1, COLORREF *eColour2)
+void GetFontSetting(int i, LOGFONT *lf, COLORREF *colour, uint8_t *effect, COLORREF *eColour1, COLORREF *eColour2)
{
for (auto &p : fontOptionsList) {
if (p.fontID == i) {
@@ -291,7 +291,7 @@ static DWORD MakeCheckBoxTreeFlags(HWND hwndTree) static void CheckButtons(HWND hwndDlg)
{
- BYTE t = IsDlgButtonChecked(hwndDlg, IDC_METAEXPAND);
+ uint8_t t = IsDlgButtonChecked(hwndDlg, IDC_METAEXPAND);
EnableWindow(GetDlgItem(hwndDlg, IDC_METADBLCLK), t);
EnableWindow(GetDlgItem(hwndDlg, IDC_METASUBEXTRA), t);
EnableWindow(GetDlgItem(hwndDlg, IDC_SUBINDENTSPIN), t);
@@ -331,15 +331,15 @@ static INT_PTR CALLBACK DlgProcClistAdditionalOpts(HWND hwndDlg, UINT msg, WPARA case 0:
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
- db_set_b(0, "CLC", "Meta", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_META));
- db_set_b(0, "CLC", "MetaDoubleClick", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_METADBLCLK));
- db_set_b(0, "CLC", "MetaHideExtra", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_METASUBEXTRA));
- db_set_b(0, "CLC", "MetaIgnoreEmptyExtra", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_METASUBEXTRA_IGN));
- db_set_b(0, "CLC", "MetaExpanding", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_METAEXPAND));
- db_set_b(0, "ModernData", "InternalAwayMsgDiscovery", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_DISCOVER_AWAYMSG));
- db_set_b(0, "ModernData", "RemoveAwayMessageForOffline", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_REMOVE_OFFLINE_AWAYMSG));
-
- db_set_b(0, "CLC", "SubIndent", (BYTE)SendDlgItemMessage(hwndDlg, IDC_SUBINDENTSPIN, UDM_GETPOS, 0, 0));
+ db_set_b(0, "CLC", "Meta", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_META));
+ db_set_b(0, "CLC", "MetaDoubleClick", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_METADBLCLK));
+ db_set_b(0, "CLC", "MetaHideExtra", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_METASUBEXTRA));
+ db_set_b(0, "CLC", "MetaIgnoreEmptyExtra", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_METASUBEXTRA_IGN));
+ db_set_b(0, "CLC", "MetaExpanding", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_METAEXPAND));
+ db_set_b(0, "ModernData", "InternalAwayMsgDiscovery", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_DISCOVER_AWAYMSG));
+ db_set_b(0, "ModernData", "RemoveAwayMessageForOffline", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_REMOVE_OFFLINE_AWAYMSG));
+
+ db_set_b(0, "CLC", "SubIndent", (uint8_t)SendDlgItemMessage(hwndDlg, IDC_SUBINDENTSPIN, UDM_GETPOS, 0, 0));
ClcOptionsChanged();
CLUI_ReloadCLUIOptions();
PostMessage(g_clistApi.hwndContactList, WM_SIZE, 0, 0);
@@ -432,10 +432,10 @@ static INT_PTR CALLBACK DlgProcClistListOpts(HWND hwndDlg, UINT msg, WPARAM wPar else
db_set_dw(0, "CLC", "GreyoutFlags", 0);
- db_set_b(0, "CLC", "ShowIdle", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_IDLE) ? 1 : 0));
+ db_set_b(0, "CLC", "ShowIdle", (uint8_t)(IsDlgButtonChecked(hwndDlg, IDC_IDLE) ? 1 : 0));
db_set_w(0, "CLC", "ScrollTime", (WORD)SendDlgItemMessage(hwndDlg, IDC_SMOOTHTIMESPIN, UDM_GETPOS, 0, 0));
- db_set_b(0, "CLC", "GroupIndent", (BYTE)SendDlgItemMessage(hwndDlg, IDC_GROUPINDENTSPIN, UDM_GETPOS, 0, 0));
- db_set_b(0, "CLC", "NoVScrollBar", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_NOSCROLLBAR) ? 1 : 0));
+ db_set_b(0, "CLC", "GroupIndent", (uint8_t)SendDlgItemMessage(hwndDlg, IDC_GROUPINDENTSPIN, UDM_GETPOS, 0, 0));
+ db_set_b(0, "CLC", "NoVScrollBar", (uint8_t)(IsDlgButtonChecked(hwndDlg, IDC_NOSCROLLBAR) ? 1 : 0));
ClcOptionsChanged();
return TRUE;
@@ -522,12 +522,12 @@ static INT_PTR CALLBACK DlgProcClistOpts(HWND hwndDlg, UINT msg, WPARAM wParam, case 0:
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
- db_set_b(0, "CLC", "GammaCorrect", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_GAMMACORRECT));
+ db_set_b(0, "CLC", "GammaCorrect", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_GAMMACORRECT));
int hil = 0;
if (IsDlgButtonChecked(hwndDlg, IDC_HILIGHTMODE1)) hil = 1;
if (IsDlgButtonChecked(hwndDlg, IDC_HILIGHTMODE2)) hil = 2;
if (IsDlgButtonChecked(hwndDlg, IDC_HILIGHTMODE3)) hil = 3;
- db_set_b(0, "CLC", "HiLightMode", (BYTE)hil);
+ db_set_b(0, "CLC", "HiLightMode", (uint8_t)hil);
int s1 = SendDlgItemMessage(hwndDlg, IDC_CLSORT1, CB_GETCURSEL, 0, 0);
int s2 = SendDlgItemMessage(hwndDlg, IDC_CLSORT2, CB_GETCURSEL, 0, 0);
@@ -535,12 +535,12 @@ static INT_PTR CALLBACK DlgProcClistOpts(HWND hwndDlg, UINT msg, WPARAM wParam, if (s1 >= 0) s1 = sortbyValue[s1];
if (s2 >= 0) s2 = sortbyValue[s2];
if (s3 >= 0) s3 = sortbyValue[s3];
- g_plugin.setByte("SortBy1", (BYTE)s1);
- g_plugin.setByte("SortBy2", (BYTE)s2);
- g_plugin.setByte("SortBy3", (BYTE)s3);
+ g_plugin.setByte("SortBy1", (uint8_t)s1);
+ g_plugin.setByte("SortBy2", (uint8_t)s2);
+ g_plugin.setByte("SortBy3", (uint8_t)s3);
- g_plugin.setByte("NoOfflineBottom", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_NOOFFLINEMOVE));
- g_plugin.setByte("PlaceOfflineToRoot", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_OFFLINETOROOT));
+ g_plugin.setByte("NoOfflineBottom", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_NOOFFLINEMOVE));
+ g_plugin.setByte("PlaceOfflineToRoot", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_OFFLINETOROOT));
Clist_LoadContactTree(); /* this won't do job properly since it only really works when changes happen */
Clist_InitAutoRebuild(g_clistApi.hwndContactTree); /* force reshuffle */
@@ -565,7 +565,7 @@ static INT_PTR CALLBACK DlgProcTrayOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L CheckDlgButton(hwndDlg, IDC_NOOFFLINEMOVE, g_plugin.getByte("NoOfflineBottom", SETTING_NOOFFLINEBOTTOM_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_OFFLINETOROOT, g_plugin.getByte("PlaceOfflineToRoot", SETTING_PLACEOFFLINETOROOT_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
{
- BYTE trayOption = db_get_b(0, "CLUI", "XStatusTray", SETTING_TRAYOPTION_DEFAULT);
+ uint8_t trayOption = db_get_b(0, "CLUI", "XStatusTray", SETTING_TRAYOPTION_DEFAULT);
CheckDlgButton(hwndDlg, IDC_SHOWXSTATUS, (trayOption & 3) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_SHOWNORMAL, (trayOption & 2) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_TRANSPARENTOVERLAY, (trayOption & 4) ? BST_CHECKED : BST_UNCHECKED);
@@ -677,9 +677,9 @@ static INT_PTR CALLBACK DlgProcTrayOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
g_plugin.setWord("IconFlashTime", (WORD)SendDlgItemMessage(hwndDlg, IDC_BLINKSPIN, UDM_GETPOS, 0, 0));
- g_plugin.setByte("DisableTrayFlash", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_DISABLEBLINK));
+ g_plugin.setByte("DisableTrayFlash", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_DISABLEBLINK));
- BYTE xOptions = 0;
+ uint8_t xOptions = 0;
xOptions = IsDlgButtonChecked(hwndDlg, IDC_SHOWXSTATUS) ? 1 : 0;
xOptions |= (xOptions && IsDlgButtonChecked(hwndDlg, IDC_SHOWNORMAL)) ? 2 : 0;
xOptions |= (xOptions && IsDlgButtonChecked(hwndDlg, IDC_TRANSPARENTOVERLAY)) ? 4 : 0;
@@ -858,28 +858,28 @@ static INT_PTR CALLBACK DlgProcClistBehaviourOpts(HWND hwndDlg, UINT msg, WPARAM case WM_NOTIFY:
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
- db_set_b(0, "ModernData", "HideBehind", (BYTE)SendDlgItemMessage(hwndDlg, IDC_HIDEMETHOD, CB_GETCURSEL, 0, 0));
+ db_set_b(0, "ModernData", "HideBehind", (uint8_t)SendDlgItemMessage(hwndDlg, IDC_HIDEMETHOD, CB_GETCURSEL, 0, 0));
db_set_w(0, "ModernData", "ShowDelay", (WORD)SendDlgItemMessage(hwndDlg, IDC_HIDETIMESPIN2, UDM_GETPOS, 0, 0));
db_set_w(0, "ModernData", "HideDelay", (WORD)SendDlgItemMessage(hwndDlg, IDC_HIDETIMESPIN3, UDM_GETPOS, 0, 0));
db_set_w(0, "ModernData", "HideBehindBorderSize", (WORD)SendDlgItemMessage(hwndDlg, IDC_HIDETIMESPIN4, UDM_GETPOS, 0, 0));
- db_set_b(0, "CLUI", "DragToScroll", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_DRAGTOSCROLL));
- g_plugin.setByte("BringToFront", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_BRINGTOFRONT));
+ db_set_b(0, "CLUI", "DragToScroll", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_DRAGTOSCROLL));
+ g_plugin.setByte("BringToFront", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_BRINGTOFRONT));
g_bChangingMode = true;
- db_set_b(0, "CLUI", "ClientAreaDrag", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_CLIENTDRAG));
- db_set_b(0, "CLUI", "AutoSize", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AUTOSIZE));
- db_set_b(0, "CLUI", "LockSize", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_LOCKSIZING));
- db_set_b(0, "CLUI", "MaxSizeHeight", (BYTE)GetDlgItemInt(hwndDlg, IDC_MAXSIZEHEIGHT, nullptr, FALSE));
- db_set_b(0, "CLUI", "MinSizeHeight", (BYTE)GetDlgItemInt(hwndDlg, IDC_MINSIZEHEIGHT, nullptr, FALSE));
- db_set_b(0, "CLUI", "AutoSizeUpward", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AUTOSIZEUPWARD));
- db_set_b(0, "CLUI", "SnapToEdges", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SNAPTOEDGES));
+ db_set_b(0, "CLUI", "ClientAreaDrag", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_CLIENTDRAG));
+ db_set_b(0, "CLUI", "AutoSize", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_AUTOSIZE));
+ db_set_b(0, "CLUI", "LockSize", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_LOCKSIZING));
+ db_set_b(0, "CLUI", "MaxSizeHeight", (uint8_t)GetDlgItemInt(hwndDlg, IDC_MAXSIZEHEIGHT, nullptr, FALSE));
+ db_set_b(0, "CLUI", "MinSizeHeight", (uint8_t)GetDlgItemInt(hwndDlg, IDC_MINSIZEHEIGHT, nullptr, FALSE));
+ db_set_b(0, "CLUI", "AutoSizeUpward", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_AUTOSIZEUPWARD));
+ db_set_b(0, "CLUI", "SnapToEdges", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_SNAPTOEDGES));
- db_set_b(0, "CLUI", "DockToSides", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_DOCKTOSIDES));
+ db_set_b(0, "CLUI", "DockToSides", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_DOCKTOSIDES));
db_set_b(0, "CLUI", "EventArea",
- (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_EVENTAREA_ALWAYS) ? 2 : (BYTE)IsDlgButtonChecked(hwndDlg, IDC_EVENTAREA) ? 1 : 0));
+ (uint8_t)(IsDlgButtonChecked(hwndDlg, IDC_EVENTAREA_ALWAYS) ? 2 : (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_EVENTAREA) ? 1 : 0));
- g_plugin.setByte("AutoHide", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AUTOHIDE));
+ g_plugin.setByte("AutoHide", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_AUTOHIDE));
g_plugin.setWord("HideTime", (WORD)SendDlgItemMessage(hwndDlg, IDC_HIDETIMESPIN, UDM_GETPOS, 0, 0));
CLUI_ChangeWindowMode();
SendMessage(g_clistApi.hwndContactTree, WM_SIZE, 0, 0); //forces it to send a cln_listsizechanged
@@ -1088,10 +1088,10 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP case WM_NOTIFY:
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
- db_set_b(0, "CLUI", "LeftClientMargin", (BYTE)SendDlgItemMessage(hwndDlg, IDC_LEFTMARGINSPIN, UDM_GETPOS, 0, 0));
- db_set_b(0, "CLUI", "RightClientMargin", (BYTE)SendDlgItemMessage(hwndDlg, IDC_RIGHTMARGINSPIN, UDM_GETPOS, 0, 0));
- db_set_b(0, "CLUI", "TopClientMargin", (BYTE)SendDlgItemMessage(hwndDlg, IDC_TOPMARGINSPIN, UDM_GETPOS, 0, 0));
- db_set_b(0, "CLUI", "BottomClientMargin", (BYTE)SendDlgItemMessage(hwndDlg, IDC_BOTTOMMARGINSPIN, UDM_GETPOS, 0, 0));
+ db_set_b(0, "CLUI", "LeftClientMargin", (uint8_t)SendDlgItemMessage(hwndDlg, IDC_LEFTMARGINSPIN, UDM_GETPOS, 0, 0));
+ db_set_b(0, "CLUI", "RightClientMargin", (uint8_t)SendDlgItemMessage(hwndDlg, IDC_RIGHTMARGINSPIN, UDM_GETPOS, 0, 0));
+ db_set_b(0, "CLUI", "TopClientMargin", (uint8_t)SendDlgItemMessage(hwndDlg, IDC_TOPMARGINSPIN, UDM_GETPOS, 0, 0));
+ db_set_b(0, "CLUI", "BottomClientMargin", (uint8_t)SendDlgItemMessage(hwndDlg, IDC_BOTTOMMARGINSPIN, UDM_GETPOS, 0, 0));
db_set_b(0, "ModernData", "DisableEngine", IsDlgButtonChecked(hwndDlg, IDC_DISABLEENGINE));
db_set_b(0, "ModernData", "AeroGlass", IsDlgButtonChecked(hwndDlg, IDC_AEROGLASS));
if (BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_DISABLEENGINE)) {
@@ -1101,25 +1101,25 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP db_unset(0, "ModernData", "EnableLayering");
}
g_CluiData.dwKeyColor = db_get_dw(0, "ModernSettings", "KeyColor", (DWORD)SETTING_KEYCOLOR_DEFAULT);
- g_plugin.setByte("OnDesktop", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ONDESKTOP));
- g_plugin.setByte("OnTop", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ONTOP));
+ g_plugin.setByte("OnDesktop", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_ONDESKTOP));
+ g_plugin.setByte("OnTop", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_ONTOP));
SetWindowPos(g_clistApi.hwndContactList, IsDlgButtonChecked(hwndDlg, IDC_ONTOP) ? HWND_TOPMOST : HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
- db_set_b(0, "CLUI", "DragToScroll", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_DRAGTOSCROLL));
+ db_set_b(0, "CLUI", "DragToScroll", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_DRAGTOSCROLL));
//====== Non-Layered Mode ======
- g_plugin.setByte("ToolWindow", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_TOOLWND));
- db_set_b(0, "CLUI", "ShowCaption", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOWCAPTION));
- db_set_b(0, "CLUI", "ShowMainMenu", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOWMAINMENU));
- g_plugin.setByte("ThinBorder", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_BORDER));
- g_plugin.setByte("NoBorder", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_NOBORDERWND));
+ g_plugin.setByte("ToolWindow", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_TOOLWND));
+ db_set_b(0, "CLUI", "ShowCaption", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_SHOWCAPTION));
+ db_set_b(0, "CLUI", "ShowMainMenu", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_SHOWMAINMENU));
+ g_plugin.setByte("ThinBorder", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_BORDER));
+ g_plugin.setByte("NoBorder", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_NOBORDERWND));
{
wchar_t title[256];
GetDlgItemText(hwndDlg, IDC_TITLETEXT, title, _countof(title));
g_plugin.setWString("TitleText", title);
}
- g_plugin.setByte("Min2Tray", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_MIN2TRAY));
- g_plugin.setByte("WindowShadow", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_DROPSHADOW));
- db_set_b(0, "CLC", "RoundCorners", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ROUNDCORNERS));
+ g_plugin.setByte("Min2Tray", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_MIN2TRAY));
+ g_plugin.setByte("WindowShadow", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_DROPSHADOW));
+ db_set_b(0, "CLC", "RoundCorners", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_ROUNDCORNERS));
//====== End of Non-Layered Mode ======
g_bChangingMode = true;
@@ -1140,7 +1140,7 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP g_CluiData.fOnDesktop = false;
}
AniAva_UpdateParent();
- db_set_b(0, "CLUI", "FadeInOut", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_FADEINOUT));
+ db_set_b(0, "CLUI", "FadeInOut", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_FADEINOUT));
g_CluiData.fSmoothAnimation = IsDlgButtonChecked(hwndDlg, IDC_FADEINOUT) != 0;
{
int i1 = SendDlgItemMessage(hwndDlg, IDC_FRAMESSPIN, UDM_GETPOS, 0, 0);
@@ -1150,10 +1150,10 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP db_set_dw(0, "CLUIFrames", "GapBetweenTitleBar", (DWORD)i2);
Sync(CLUIFramesOnClistResize, (WPARAM)g_clistApi.hwndContactList, 0);
}
- g_plugin.setByte("Transparent", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_TRANSPARENT));
- g_plugin.setByte("Alpha", (BYTE)SendDlgItemMessage(hwndDlg, IDC_TRANSACTIVE, TBM_GETPOS, 0, 0));
- g_plugin.setByte("AutoAlpha", (BYTE)SendDlgItemMessage(hwndDlg, IDC_TRANSINACTIVE, TBM_GETPOS, 0, 0));
- g_plugin.setByte("OnDesktop", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ONDESKTOP));
+ g_plugin.setByte("Transparent", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_TRANSPARENT));
+ g_plugin.setByte("Alpha", (uint8_t)SendDlgItemMessage(hwndDlg, IDC_TRANSACTIVE, TBM_GETPOS, 0, 0));
+ g_plugin.setByte("AutoAlpha", (uint8_t)SendDlgItemMessage(hwndDlg, IDC_TRANSINACTIVE, TBM_GETPOS, 0, 0));
+ g_plugin.setByte("OnDesktop", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_ONDESKTOP));
ske_LoadSkinFromDB();
CLUI_UpdateLayeredMode();
@@ -1197,12 +1197,12 @@ static int bitmapRelatedControls[] = { struct BkgrItem
{
- BYTE changed;
- BYTE useBitmap;
+ uint8_t changed;
+ uint8_t useBitmap;
COLORREF bkColor, selColor;
char filename[MAX_PATH];
WORD flags;
- BYTE useWinColours;
+ uint8_t useWinColours;
};
struct BkgrData
{
@@ -1393,7 +1393,7 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, continue;
char *module = bkgrList[indx] + mir_strlen(bkgrList[indx]) + 1;
- db_set_b(0, module, "UseBitmap", (BYTE)p.useBitmap);
+ db_set_b(0, module, "UseBitmap", (uint8_t)p.useBitmap);
COLORREF col;
if ((col = p.bkColor) == DEFAULT_BKCOLOUR)
@@ -1406,7 +1406,7 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, else
db_set_dw(0, module, "SelBkColour", col);
- db_set_b(0, module, "UseWinColours", (BYTE)p.useWinColours);
+ db_set_b(0, module, "UseWinColours", (uint8_t)p.useWinColours);
char str[MAX_PATH];
int retval = PathToAbsolute(p.filename, str);
diff --git a/plugins/Clist_modern/src/modern_clcpaint.cpp b/plugins/Clist_modern/src/modern_clcpaint.cpp index 85c7854e3c..8f5d493b88 100644 --- a/plugins/Clist_modern/src/modern_clcpaint.cpp +++ b/plugins/Clist_modern/src/modern_clcpaint.cpp @@ -88,13 +88,13 @@ const int CLCPaint::SELECTION_BORDER = 6; const int CLCPaint::MIN_TEXT_WIDTH = 20;
const int CLCPaint::BUF2SIZE = 7;
-const BYTE CLCPaint::GIM_SELECTED_AFFECT = 1;
-const BYTE CLCPaint::GIM_HOT_AFFECT = 2;
-const BYTE CLCPaint::GIM_TEMP_AFFECT = 4;
-const BYTE CLCPaint::GIM_IDLE_AFFECT = 8;
-const BYTE CLCPaint::GIM_EXTRAICON_AFFECT = CLCPaint::GIM_SELECTED_AFFECT | CLCPaint::GIM_HOT_AFFECT | CLCPaint::GIM_IDLE_AFFECT | CLCPaint::GIM_TEMP_AFFECT;
-const BYTE CLCPaint::GIM_STATUSICON_AFFECT = CLCPaint::GIM_IDLE_AFFECT | CLCPaint::GIM_TEMP_AFFECT;
-const BYTE CLCPaint::GIM_AVATAR_AFFECT = CLCPaint::GIM_IDLE_AFFECT | CLCPaint::GIM_TEMP_AFFECT;
+const uint8_t CLCPaint::GIM_SELECTED_AFFECT = 1;
+const uint8_t CLCPaint::GIM_HOT_AFFECT = 2;
+const uint8_t CLCPaint::GIM_TEMP_AFFECT = 4;
+const uint8_t CLCPaint::GIM_IDLE_AFFECT = 8;
+const uint8_t CLCPaint::GIM_EXTRAICON_AFFECT = CLCPaint::GIM_SELECTED_AFFECT | CLCPaint::GIM_HOT_AFFECT | CLCPaint::GIM_IDLE_AFFECT | CLCPaint::GIM_TEMP_AFFECT;
+const uint8_t CLCPaint::GIM_STATUSICON_AFFECT = CLCPaint::GIM_IDLE_AFFECT | CLCPaint::GIM_TEMP_AFFECT;
+const uint8_t CLCPaint::GIM_AVATAR_AFFECT = CLCPaint::GIM_IDLE_AFFECT | CLCPaint::GIM_TEMP_AFFECT;
CLCPaint::CLCPaint()
{
@@ -1050,9 +1050,9 @@ void CLCPaint::_PreparePaintContext(ClcData *dat, HDC hdc, int paintMode, RECT & int gValue = GetRValue(pc.tmpbkcolour) + gDelta;
int bValue = GetRValue(pc.tmpbkcolour) + bDelta;
- BYTE brValue = (rValue > 255) ? 255 : rValue < 0 ? 0 : (BYTE)rValue;
- BYTE bgValue = (gValue > 255) ? 255 : gValue < 0 ? 0 : (BYTE)gValue;
- BYTE bbValue = (bValue > 255) ? 255 : bValue < 0 ? 0 : (BYTE)bValue;
+ uint8_t brValue = (rValue > 255) ? 255 : rValue < 0 ? 0 : (uint8_t)rValue;
+ uint8_t bgValue = (gValue > 255) ? 255 : gValue < 0 ? 0 : (uint8_t)gValue;
+ uint8_t bbValue = (bValue > 255) ? 255 : bValue < 0 ? 0 : (uint8_t)bValue;
pc.hBrushAlternateGrey = CreateSolidBrush(GetNearestColor(pc.hdcMem, RGB(brValue, bgValue, bbValue)));
}
@@ -2169,7 +2169,7 @@ void CLCPaint::_DrawContactText(HDC hdcMem, ClcData *dat, ClcContact *Drawing, i text_rc.left = min(text_rc.left, prcItem->left);
}
-void CLCPaint::_DrawContactSubText(HDC hdcMem, ClcData *dat, ClcContact *Drawing, int &selected, int &hottrack, RECT &text_rc, RECT *prcItem, UINT uTextFormat, BYTE itemType)
+void CLCPaint::_DrawContactSubText(HDC hdcMem, ClcData *dat, ClcContact *Drawing, int &selected, int &hottrack, RECT &text_rc, RECT *prcItem, UINT uTextFormat, uint8_t itemType)
{
if (Drawing->type == CLCIT_GROUP) {
wchar_t *szCounts = Clist_GetGroupCountsText(dat, Drawing);
diff --git a/plugins/Clist_modern/src/modern_clcpaint.h b/plugins/Clist_modern/src/modern_clcpaint.h index 20699e003c..6a17e9dc73 100644 --- a/plugins/Clist_modern/src/modern_clcpaint.h +++ b/plugins/Clist_modern/src/modern_clcpaint.h @@ -27,13 +27,13 @@ private: static const int MIN_TEXT_WIDTH;
static const int BUF2SIZE;
- static const BYTE GIM_SELECTED_AFFECT;
- static const BYTE GIM_HOT_AFFECT;
- static const BYTE GIM_TEMP_AFFECT;
- static const BYTE GIM_IDLE_AFFECT;
- static const BYTE GIM_EXTRAICON_AFFECT;
- static const BYTE GIM_STATUSICON_AFFECT;
- static const BYTE GIM_AVATAR_AFFECT;
+ static const uint8_t GIM_SELECTED_AFFECT;
+ static const uint8_t GIM_HOT_AFFECT;
+ static const uint8_t GIM_TEMP_AFFECT;
+ static const uint8_t GIM_IDLE_AFFECT;
+ static const uint8_t GIM_EXTRAICON_AFFECT;
+ static const uint8_t GIM_STATUSICON_AFFECT;
+ static const uint8_t GIM_AVATAR_AFFECT;
enum tagenumHASHINDEX
{
@@ -116,7 +116,7 @@ private: void _DrawContactAvatar(HDC hdcMem, ClcData *dat, ClcContact *Drawing, RECT *row_rc, int& selected, int& hottrack, RECT *prcItem);
void _DrawContactIcon(HDC hdcMem, ClcData *dat, ClcContact *Drawing, int& selected, int& hottrack, RECT *prcItem);
void _DrawContactText(HDC hdcMem, ClcData *dat, ClcContact *Drawing, int& selected, int& hottrack, RECT& text_rc, RECT *prcItem, UINT uTextFormat);
- void _DrawContactSubText(HDC hdcMem, ClcData *dat, ClcContact *Drawing, int& selected, int& hottrack, RECT& text_rc, RECT *prcItem, UINT uTextFormat, BYTE itemType);
+ void _DrawContactSubText(HDC hdcMem, ClcData *dat, ClcContact *Drawing, int& selected, int& hottrack, RECT& text_rc, RECT *prcItem, UINT uTextFormat, uint8_t itemType);
void _DrawContactTime(HDC hdcMem, ClcData *dat, ClcContact *Drawing, RECT *prcItem);
void _DrawContactExtraIcon(HDC hdcMem, ClcData *dat, ClcContact *Drawing, int& selected, int& hottrack, RECT *rc, int iImage);
void _DrawContactSelection(HDC hdcMem, ClcData *dat, int& selected, int& hottrack, RECT *rcPaint, RECT *prcItem);
diff --git a/plugins/Clist_modern/src/modern_clistmenus.cpp b/plugins/Clist_modern/src/modern_clistmenus.cpp index 1ac895e99b..c734c2885e 100644 --- a/plugins/Clist_modern/src/modern_clistmenus.cpp +++ b/plugins/Clist_modern/src/modern_clistmenus.cpp @@ -57,7 +57,7 @@ static IconItem iconList[] = static int FAV_OnContactMenuBuild(WPARAM hContact, LPARAM)
{
- BYTE bContactRate = g_plugin.getByte(hContact, "Rate");
+ uint8_t bContactRate = g_plugin.getByte(hContact, "Rate");
if (bContactRate > _countof(rates) - 1)
bContactRate = _countof(rates) - 1;
@@ -78,7 +78,7 @@ static int FAV_OnContactMenuBuild(WPARAM hContact, LPARAM) INT_PTR FAV_SetRate(WPARAM hContact, LPARAM nRate)
{
if (hContact)
- g_plugin.setByte(hContact, "Rate", (BYTE)nRate);
+ g_plugin.setByte(hContact, "Rate", (uint8_t)nRate);
return 0;
}
diff --git a/plugins/Clist_modern/src/modern_clistmod.cpp b/plugins/Clist_modern/src/modern_clistmod.cpp index 176f679f74..8033acbdb8 100644 --- a/plugins/Clist_modern/src/modern_clistmod.cpp +++ b/plugins/Clist_modern/src/modern_clistmod.cpp @@ -42,7 +42,7 @@ int SkinOptInit(WPARAM wParam, LPARAM lParam); HICON cliGetIconFromStatusMode(MCONTACT hContact, const char *szProto, int status)
{
// check if options is turned on
- BYTE trayOption = db_get_b(0, "CLUI", "XStatusTray", SETTING_TRAYOPTION_DEFAULT);
+ uint8_t trayOption = db_get_b(0, "CLUI", "XStatusTray", SETTING_TRAYOPTION_DEFAULT);
if ((trayOption & 3) && szProto != nullptr) {
if (ProtoServiceExists(szProto, PS_GETCUSTOMSTATUSICON)) {
// check status is online
@@ -171,7 +171,7 @@ HRESULT CluiLoadModule() #define GWVS_PARTIALLY_COVERED 4
int GetWindowVisibleState(HWND, int, int);
-__inline DWORD GetDIBPixelColor(int X, int Y, int Width, int Height, int ByteWidth, BYTE * ptr)
+__inline DWORD GetDIBPixelColor(int X, int Y, int Width, int Height, int ByteWidth, uint8_t * ptr)
{
DWORD res = 0;
if (X >= 0 && X < Width && Y >= 0 && Y < Height && ptr)
@@ -203,13 +203,13 @@ int GetWindowVisibleState(HWND hWnd, int iStepX, int iStepY) int maxx = 0;
int maxy = 0;
int wx = 0;
- BYTE *ptr = nullptr;
+ uint8_t *ptr = nullptr;
HRGN rgn = nullptr;
HBITMAP WindowImage = g_CluiData.fLayered ? ske_GetCurrentWindowImage() : nullptr;
if (WindowImage && g_CluiData.fLayered) {
BITMAP bmp;
GetObject(WindowImage, sizeof(BITMAP), &bmp);
- ptr = (BYTE*)bmp.bmBits;
+ ptr = (uint8_t*)bmp.bmBits;
maxx = bmp.bmWidth;
maxy = bmp.bmHeight;
wx = bmp.bmWidthBytes;
@@ -301,7 +301,7 @@ int GetWindowVisibleState(HWND hWnd, int iStepX, int iStepY) return GWVS_PARTIALLY_COVERED;
}
-BYTE g_bCalledFromShowHide = 0;
+uint8_t g_bCalledFromShowHide = 0;
int cliShowHide(bool bAlwaysShow)
{
diff --git a/plugins/Clist_modern/src/modern_clistopts.cpp b/plugins/Clist_modern/src/modern_clistopts.cpp index 4674c315da..acc206f351 100644 --- a/plugins/Clist_modern/src/modern_clistopts.cpp +++ b/plugins/Clist_modern/src/modern_clistopts.cpp @@ -194,12 +194,12 @@ static INT_PTR CALLBACK DlgProcItemRowOpts(HWND hwndDlg, UINT msg, WPARAM wParam case PSN_APPLY:
g_plugin.setWord("MinRowHeight", (WORD)SendDlgItemMessage(hwndDlg, IDC_MIN_ROW_HEIGHT_SPIN, UDM_GETPOS, 0, 0));
g_plugin.setWord("RowBorder", (WORD)SendDlgItemMessage(hwndDlg, IDC_ROW_BORDER_SPIN, UDM_GETPOS, 0, 0));
- g_plugin.setByte("VariableRowHeight", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_VARIABLE_ROW_HEIGHT));
- g_plugin.setByte("AlignLeftItemsToLeft", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ALIGN_TO_LEFT));
- g_plugin.setByte("AlignRightItemsToRight", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ALIGN_TO_RIGHT));
- db_set_b(0, "CLC", "CompactMode", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_MINIMODE));
- db_set_b(0, "CLC", "LeftMargin", (BYTE)SendDlgItemMessage(hwndDlg, IDC_LEFTMARGINSPIN, UDM_GETPOS, 0, 0));
- db_set_b(0, "CLC", "RightMargin", (BYTE)SendDlgItemMessage(hwndDlg, IDC_RIGHTMARGINSPIN, UDM_GETPOS, 0, 0));
+ g_plugin.setByte("VariableRowHeight", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_VARIABLE_ROW_HEIGHT));
+ g_plugin.setByte("AlignLeftItemsToLeft", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_ALIGN_TO_LEFT));
+ g_plugin.setByte("AlignRightItemsToRight", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_ALIGN_TO_RIGHT));
+ db_set_b(0, "CLC", "CompactMode", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_MINIMODE));
+ db_set_b(0, "CLC", "LeftMargin", (uint8_t)SendDlgItemMessage(hwndDlg, IDC_LEFTMARGINSPIN, UDM_GETPOS, 0, 0));
+ db_set_b(0, "CLC", "RightMargin", (uint8_t)SendDlgItemMessage(hwndDlg, IDC_RIGHTMARGINSPIN, UDM_GETPOS, 0, 0));
{
HWND hwndList = GetDlgItem(hwndDlg, IDC_LIST_ORDER);
for (int i = 0; i < NUM_ITEM_TYPE; i++) {
@@ -375,17 +375,17 @@ static INT_PTR CALLBACK DlgProcItemAvatarOpts(HWND hwndDlg, UINT msg, WPARAM wPa case 0:
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
- g_plugin.setByte("AvatarsShow", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOW_AVATARS));
- g_plugin.setByte("AvatarsAnimated", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOW_ANIAVATARS));
- g_plugin.setByte("AvatarsInSeparateWnd", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AVATAR_FASTDRAW));
+ g_plugin.setByte("AvatarsShow", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_SHOW_AVATARS));
+ g_plugin.setByte("AvatarsAnimated", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_SHOW_ANIAVATARS));
+ g_plugin.setByte("AvatarsInSeparateWnd", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_AVATAR_FASTDRAW));
- g_plugin.setByte("AvatarsDrawBorders", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AVATAR_DRAW_BORDER));
+ g_plugin.setByte("AvatarsDrawBorders", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_AVATAR_DRAW_BORDER));
g_plugin.setDword("AvatarsBorderColor", (DWORD)SendDlgItemMessage(hwndDlg, IDC_AVATAR_BORDER_COLOR, CPM_GETCOLOUR, 0, 0));
- g_plugin.setByte("AvatarsRoundCorners", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AVATAR_ROUND_CORNERS));
- g_plugin.setByte("AvatarsIgnoreSizeForRow", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AVATAR_IGNORE_SIZE));
- g_plugin.setByte("AvatarsUseCustomCornerSize", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AVATAR_CUSTOM_CORNER_SIZE_CHECK));
+ g_plugin.setByte("AvatarsRoundCorners", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_AVATAR_ROUND_CORNERS));
+ g_plugin.setByte("AvatarsIgnoreSizeForRow", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_AVATAR_IGNORE_SIZE));
+ g_plugin.setByte("AvatarsUseCustomCornerSize", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_AVATAR_CUSTOM_CORNER_SIZE_CHECK));
g_plugin.setWord("AvatarsCustomCornerSize", (WORD)SendDlgItemMessage(hwndDlg, IDC_AVATAR_CUSTOM_CORNER_SIZE_SPIN, UDM_GETPOS, 0, 0));
- g_plugin.setByte("AvatarsDrawOverlay", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AVATAR_OVERLAY_ICONS));
+ g_plugin.setByte("AvatarsDrawOverlay", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_AVATAR_OVERLAY_ICONS));
g_plugin.setWord("AvatarsSize", (WORD)SendDlgItemMessage(hwndDlg, IDC_AVATAR_SIZE_SPIN, UDM_GETPOS, 0, 0));
g_plugin.setWord("AvatarsWidth", (WORD)SendDlgItemMessage(hwndDlg, IDC_AVATAR_WIDTH_SPIN, UDM_GETPOS, 0, 0));
@@ -444,13 +444,13 @@ static INT_PTR CALLBACK DlgProcItemIconOpts(HWND hwndDlg, UINT msg, WPARAM wPara case 0:
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
- g_plugin.setByte("IconHideOnAvatar", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_HIDE_ICON_ON_AVATAR));
- g_plugin.setByte("IconDrawOnAvatarSpace", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_DRAW_ON_AVATAR_SPACE));
- g_plugin.setByte("HideGroupsIcon", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_HIDE_GROUPSICON));
- g_plugin.setByte("IconIgnoreSizeForRownHeight", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_NOTCHECKICONSIZE));
- g_plugin.setByte("AlwaysShowAlwaysVisIcon", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ALWAYS_VISIBLEICON));
+ g_plugin.setByte("IconHideOnAvatar", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_HIDE_ICON_ON_AVATAR));
+ g_plugin.setByte("IconDrawOnAvatarSpace", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_DRAW_ON_AVATAR_SPACE));
+ g_plugin.setByte("HideGroupsIcon", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_HIDE_GROUPSICON));
+ g_plugin.setByte("IconIgnoreSizeForRownHeight", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_NOTCHECKICONSIZE));
+ g_plugin.setByte("AlwaysShowAlwaysVisIcon", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_ALWAYS_VISIBLEICON));
{
- BYTE ovr = IsDlgButtonChecked(hwndDlg, IDC_USEXSTATUS) ? 1 : 0;
+ uint8_t ovr = IsDlgButtonChecked(hwndDlg, IDC_USEXSTATUS) ? 1 : 0;
if (ovr) ovr += IsDlgButtonChecked(hwndDlg, IDC_DRAWSTATUSOVERLAY) ? 2 : 0;
db_set_b(0, "CLC", "DrawOverlayedStatus", ovr);
}
@@ -483,8 +483,8 @@ static INT_PTR CALLBACK DlgProcItemContactTimeOpts(HWND hwndDlg, UINT msg, WPARA case 0:
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
- g_plugin.setByte("ContactTimeShow", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOW));
- g_plugin.setByte("ContactTimeShowOnlyIfDifferent", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOW_ONLY_IF_DIFFERENT));
+ g_plugin.setByte("ContactTimeShow", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_SHOW));
+ g_plugin.setByte("ContactTimeShowOnlyIfDifferent", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_SHOW_ONLY_IF_DIFFERENT));
ClcOptionsChanged();
return TRUE;
}
@@ -547,16 +547,16 @@ static INT_PTR CALLBACK DlgProcItemTextOpts(HWND hwndDlg, UINT msg, WPARAM wPara case 0:
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
- g_plugin.setByte("TextRTL", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_RTL));
- g_plugin.setByte("AlignGroupCaptions", (BYTE)SendDlgItemMessage(hwndDlg, IDC_ALIGNGROUPCOMBO, CB_GETCURSEL, 0, 0));
- g_plugin.setByte("TextAlignToRight", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ALIGN_RIGHT));
- g_plugin.setByte("TextReplaceSmileys", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_REPLACE_SMILEYS));
- g_plugin.setByte("TextResizeSmileys", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_RESIZE_SMILEYS));
- g_plugin.setByte("TextUseProtocolSmileys", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_USE_PROTOCOL_SMILEYS));
- g_plugin.setByte("TextIgnoreSizeForRownHeight", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_IGNORE_SIZE));
- g_plugin.setByte("FirstLineDrawSmileys", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_DRAW_SMILEYS_ON_FIRST_LINE));
- g_plugin.setByte("FirstLineAppendNick", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_APPEND_NICK));
- g_plugin.setByte("TrimText", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_TRIM_TEXT));
+ g_plugin.setByte("TextRTL", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_RTL));
+ g_plugin.setByte("AlignGroupCaptions", (uint8_t)SendDlgItemMessage(hwndDlg, IDC_ALIGNGROUPCOMBO, CB_GETCURSEL, 0, 0));
+ g_plugin.setByte("TextAlignToRight", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_ALIGN_RIGHT));
+ g_plugin.setByte("TextReplaceSmileys", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_REPLACE_SMILEYS));
+ g_plugin.setByte("TextResizeSmileys", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_RESIZE_SMILEYS));
+ g_plugin.setByte("TextUseProtocolSmileys", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_USE_PROTOCOL_SMILEYS));
+ g_plugin.setByte("TextIgnoreSizeForRownHeight", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_IGNORE_SIZE));
+ g_plugin.setByte("FirstLineDrawSmileys", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_DRAW_SMILEYS_ON_FIRST_LINE));
+ g_plugin.setByte("FirstLineAppendNick", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_APPEND_NICK));
+ g_plugin.setByte("TrimText", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_TRIM_TEXT));
ClcOptionsChanged();
return TRUE;
}
@@ -688,9 +688,9 @@ static INT_PTR CALLBACK DlgProcItemSecondLineOpts(HWND hwndDlg, UINT msg, WPARAM case 0:
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
- g_plugin.setByte("SecondLineShow", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOW));
+ g_plugin.setByte("SecondLineShow", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_SHOW));
g_plugin.setWord("SecondLineTopSpace", (WORD)SendDlgItemMessage(hwndDlg, IDC_TOP_SPACE_SPIN, UDM_GETPOS, 0, 0));
- g_plugin.setByte("SecondLineDrawSmileys", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_DRAW_SMILEYS));
+ g_plugin.setByte("SecondLineDrawSmileys", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_DRAW_SMILEYS));
WORD radio;
if (IsDlgButtonChecked(hwndDlg, IDC_STATUS))
@@ -712,10 +712,10 @@ static INT_PTR CALLBACK DlgProcItemSecondLineOpts(HWND hwndDlg, UINT msg, WPARAM t[TEXT_TEXT_MAX_LENGTH - 1] = '\0';
g_plugin.setWString("SecondLineText", t);
- g_plugin.setByte("SecondLineXStatusHasPriority", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_XSTATUS_HAS_PRIORITY));
- g_plugin.setByte("SecondLineShowStatusIfNoAway", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOW_STATUS_IF_NOAWAY));
- g_plugin.setByte("SecondLineShowListeningIfNoAway", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOW_LISTENING_IF_NOAWAY));
- g_plugin.setByte("SecondLineUseNameAndMessageForXStatus", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_USE_NAME_AND_MESSAGE));
+ g_plugin.setByte("SecondLineXStatusHasPriority", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_XSTATUS_HAS_PRIORITY));
+ g_plugin.setByte("SecondLineShowStatusIfNoAway", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_SHOW_STATUS_IF_NOAWAY));
+ g_plugin.setByte("SecondLineShowListeningIfNoAway", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_SHOW_LISTENING_IF_NOAWAY));
+ g_plugin.setByte("SecondLineUseNameAndMessageForXStatus", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_USE_NAME_AND_MESSAGE));
ClcOptionsChanged();
return TRUE;
}
@@ -845,9 +845,9 @@ static INT_PTR CALLBACK DlgProcItemThirdLineOpts(HWND hwndDlg, UINT msg, WPARAM case 0:
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
- g_plugin.setByte("ThirdLineShow", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOW));
+ g_plugin.setByte("ThirdLineShow", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_SHOW));
g_plugin.setWord("ThirdLineTopSpace", (WORD)SendDlgItemMessage(hwndDlg, IDC_TOP_SPACE_SPIN, UDM_GETPOS, 0, 0));
- g_plugin.setByte("ThirdLineDrawSmileys", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_DRAW_SMILEYS));
+ g_plugin.setByte("ThirdLineDrawSmileys", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_DRAW_SMILEYS));
{
int radio;
if (IsDlgButtonChecked(hwndDlg, IDC_STATUS))
@@ -873,10 +873,10 @@ static INT_PTR CALLBACK DlgProcItemThirdLineOpts(HWND hwndDlg, UINT msg, WPARAM g_plugin.setWString("ThirdLineText", t);
}
- g_plugin.setByte("ThirdLineXStatusHasPriority", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_XSTATUS_HAS_PRIORITY));
- g_plugin.setByte("ThirdLineUseNameAndMessageForXStatus", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_USE_NAME_AND_MESSAGE));
- g_plugin.setByte("ThirdLineShowStatusIfNoAway", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOW_STATUS_IF_NOAWAY));
- g_plugin.setByte("ThirdLineShowListeningIfNoAway", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOW_LISTENING_IF_NOAWAY));
+ g_plugin.setByte("ThirdLineXStatusHasPriority", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_XSTATUS_HAS_PRIORITY));
+ g_plugin.setByte("ThirdLineUseNameAndMessageForXStatus", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_USE_NAME_AND_MESSAGE));
+ g_plugin.setByte("ThirdLineShowStatusIfNoAway", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_SHOW_STATUS_IF_NOAWAY));
+ g_plugin.setByte("ThirdLineShowListeningIfNoAway", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_SHOW_LISTENING_IF_NOAWAY));
ClcOptionsChanged();
return TRUE;
}
diff --git a/plugins/Clist_modern/src/modern_clisttray.cpp b/plugins/Clist_modern/src/modern_clisttray.cpp index b300c8a012..8c81d31480 100644 --- a/plugins/Clist_modern/src/modern_clisttray.cpp +++ b/plugins/Clist_modern/src/modern_clisttray.cpp @@ -173,9 +173,9 @@ VOID CALLBACK cliTrayCycleTimerProc(HWND, UINT, UINT_PTR, DWORD) void SettingsMigrate(void)
{
- BYTE TrayIcon = g_plugin.getByte("TrayIcon");
- BYTE AlwaysPrimary = g_plugin.getByte("AlwaysPrimary");
- BYTE AlwaysMulti = g_plugin.getByte("AlwaysMulti");
+ uint8_t TrayIcon = g_plugin.getByte("TrayIcon");
+ uint8_t AlwaysPrimary = g_plugin.getByte("AlwaysPrimary");
+ uint8_t AlwaysMulti = g_plugin.getByte("AlwaysMulti");
ptrA PrimaryStatus(g_plugin.getStringA("PrimaryStatus"));
// these strings must always be set
@@ -246,7 +246,7 @@ static int GetGoodAccNum(bool *bDiffers, bool *bConn = nullptr) return res;
}
-BYTE OldMode; //
+uint8_t OldMode; //
UINT_PTR TimerID = 0;
int cliTrayIconInit(HWND hwnd)
@@ -275,7 +275,7 @@ int cliTrayIconInit(HWND hwnd) return 0;
}
- BYTE Mode;
+ uint8_t Mode;
if (!bDiffers) // all equal
OldMode = Mode = g_plugin.getByte("tiModeS", TRAY_ICON_MODE_GLOBAL);
else
@@ -341,7 +341,7 @@ int cliTrayCalcChanged(const char *szChangedProto, int, int) GetGoodAccNum(&bDiffers, &bConn);
// if the icon number to be changed, reinitialize module from scratch
- BYTE Mode = g_plugin.getByte((!bDiffers) ? "tiModeS" : "tiModeV", TRAY_ICON_MODE_GLOBAL);
+ uint8_t Mode = g_plugin.getByte((!bDiffers) ? "tiModeS" : "tiModeV", TRAY_ICON_MODE_GLOBAL);
if (Mode != OldMode) {
OldMode = Mode;
Clist_TrayIconIconsChanged();
diff --git a/plugins/Clist_modern/src/modern_clui.cpp b/plugins/Clist_modern/src/modern_clui.cpp index b3fa6beaf0..b938250856 100644 --- a/plugins/Clist_modern/src/modern_clui.cpp +++ b/plugins/Clist_modern/src/modern_clui.cpp @@ -70,7 +70,7 @@ RECT g_rcEdgeSizingRect = { 0 }; /* Module global variables */
-static BYTE bAlphaEnd;
+static uint8_t bAlphaEnd;
static int bOldHideOffline;
static int bOldUseGroups;
@@ -502,8 +502,8 @@ int CLUI_ShowWindowMod(HWND hWnd, int nCmd) static BOOL CLUI_WaitThreadsCompletion()
{
- static BYTE bEntersCount = 0;
- static const BYTE bcMAX_AWAITING_RETRY = 10; // repeat awaiting only 10 times
+ static uint8_t bEntersCount = 0;
+ static const uint8_t bcMAX_AWAITING_RETRY = 10; // repeat awaiting only 10 times
TRACE("CLUI_WaitThreadsCompletion Enter");
if (bEntersCount < bcMAX_AWAITING_RETRY && (g_CluiData.mutexPaintLock || g_hAwayMsgThread || g_hGetTextAsyncThread || g_hSmoothAnimationThread) && !Miranda_IsTerminated()) {
TRACE("Waiting threads");
@@ -1366,7 +1366,7 @@ static int CLUI_SmoothAlphaThreadTransition() return 1;
}
-int CLUI_SmoothAlphaTransition(HWND hwnd, BYTE GoalAlpha, BOOL wParam)
+int CLUI_SmoothAlphaTransition(HWND hwnd, uint8_t GoalAlpha, BOOL wParam)
{
if (!g_CluiData.fLayered && (!g_CluiData.fSmoothAnimation && !g_bTransparentFlag)) {
if (GoalAlpha > 0 && wParam != 2) {
@@ -1958,9 +1958,9 @@ LRESULT CLUI::OnAutoAlphaTimer(UINT, WPARAM, LPARAM) // change
bTransparentFocus = inwnd;
if (bTransparentFocus)
- CLUI_SmoothAlphaTransition(m_hWnd, (BYTE)g_plugin.getByte("Alpha", SETTING_ALPHA_DEFAULT), 1);
+ CLUI_SmoothAlphaTransition(m_hWnd, (uint8_t)g_plugin.getByte("Alpha", SETTING_ALPHA_DEFAULT), 1);
else
- CLUI_SmoothAlphaTransition(m_hWnd, (BYTE)(g_bTransparentFlag ? g_plugin.getByte("AutoAlpha", SETTING_AUTOALPHA_DEFAULT) : 255), 1);
+ CLUI_SmoothAlphaTransition(m_hWnd, (uint8_t)(g_bTransparentFlag ? g_plugin.getByte("AutoAlpha", SETTING_AUTOALPHA_DEFAULT) : 255), 1);
}
if (!bTransparentFocus)
KillTimer(m_hWnd, TM_AUTOALPHA);
@@ -2079,7 +2079,7 @@ LRESULT CLUI::OnActivate(UINT msg, WPARAM wParam, LPARAM lParam) }
RedrawWindow(m_hWnd, nullptr, nullptr, RDW_INVALIDATE | RDW_ALLCHILDREN);
if (g_bTransparentFlag) {
- BYTE alpha;
+ uint8_t alpha;
if (wParam != WA_INACTIVE || CLUI_CheckOwnedByClui((HWND)lParam) || ((HWND)lParam == m_hWnd) || GetParent((HWND)lParam) == m_hWnd)
alpha = g_plugin.getByte("Alpha", SETTING_ALPHA_DEFAULT);
else
@@ -2167,7 +2167,7 @@ LRESULT CLUI::OnShowWindow(UINT, WPARAM wParam, LPARAM lParam) if (lParam) return 0;
if (mutex_bShowHideCalledFromAnimation) return 1;
- BYTE gAlpha = (!wParam) ? 0 : (g_plugin.getByte("Transparent", SETTING_TRANSPARENT_DEFAULT) ? g_plugin.getByte("Alpha", SETTING_ALPHA_DEFAULT) : 255);
+ uint8_t gAlpha = (!wParam) ? 0 : (g_plugin.getByte("Transparent", SETTING_TRANSPARENT_DEFAULT) ? g_plugin.getByte("Alpha", SETTING_ALPHA_DEFAULT) : 255);
if (wParam) {
g_CluiData.bCurrentAlpha = 0;
Sync(CLUIFrames_OnShowHide, 1);
@@ -2519,7 +2519,7 @@ LRESULT CLUI::OnDestroy(UINT, WPARAM, LPARAM) UnLoadCLUIFramesModule();
//ExtFrames_Uninit();
TRACE("CLUI.c: WM_DESTROY - UnLoadCLUIFramesModule DONE\n");
- g_plugin.setByte("State", (BYTE)state);
+ g_plugin.setByte("State", (uint8_t)state);
ske_UnloadSkin(&g_SkinObjectList);
delete m_pCLUI;
diff --git a/plugins/Clist_modern/src/modern_commonprototypes.h b/plugins/Clist_modern/src/modern_commonprototypes.h index fa9e3b066e..fd42e9fca6 100644 --- a/plugins/Clist_modern/src/modern_commonprototypes.h +++ b/plugins/Clist_modern/src/modern_commonprototypes.h @@ -21,7 +21,7 @@ extern bool g_bPostWasCanceled; extern bool g_bTransparentFlag;
extern bool g_bFullRepaint;
extern bool g_bMultiConnectionMode;
-extern BYTE g_bCalledFromShowHide;
+extern uint8_t g_bCalledFromShowHide;
extern HWND g_hCLUIOptionsWnd;
extern UINT g_dwMainThreadID;
extern HWND g_hwndViewModeFrame;
@@ -70,7 +70,7 @@ int CLUI_ReloadCLUIOptions(); int CLUI_ShowFromBehindEdge();
int CLUI_SizingGetWindowRect(HWND hwnd, RECT *rc);
int CLUI_SizingOnBorder(POINT, int);
-int CLUI_SmoothAlphaTransition(HWND hwnd, BYTE GoalAlpha, BOOL wParam);
+int CLUI_SmoothAlphaTransition(HWND hwnd, uint8_t GoalAlpha, BOOL wParam);
int CLUI_TestCursorOnBorders();
int CLUI_UpdateTimer();
void CLUI_UpdateLayeredMode();
@@ -89,7 +89,7 @@ void EventArea_ConfigureEventArea(); /* ModernSkinButton */
int ModernSkinButton_AddButton(HWND parent, char *ID, char *CommandService, char *StateDefService, char *HandeService, int Left, int Top, int Right, int Bottom, DWORD AlignedTo, wchar_t *Hint, char *DBkey, char *TypeDef, int MinWidth, int MinHeight);
int ModernSkinButtonLoadModule();
-int ModernSkinButton_ReposButtons(HWND parent, BYTE draw, RECT *r);
+int ModernSkinButton_ReposButtons(HWND parent, uint8_t draw, RECT *r);
int ModernSkinButtonUnloadModule(WPARAM, LPARAM);
/* RowHeight */
@@ -101,13 +101,13 @@ void ske_ApplyTranslucency(void); int ske_BltBackImage(HWND destHWND, HDC destDC, RECT *BltClientRect);
HBITMAP ske_CreateDIB32(int cx, int cy);
HBITMAP ske_CreateDIB32Point(int cx, int cy, void ** bits);
-HRGN ske_CreateOpaqueRgn(BYTE Level, bool Opaque);
-HICON ske_CreateJoinedIcon(HICON hBottom, HICON hTop, BYTE alpha);
+HRGN ske_CreateOpaqueRgn(uint8_t Level, bool Opaque);
+HICON ske_CreateJoinedIcon(HICON hBottom, HICON hTop, uint8_t alpha);
int ske_DrawImageAt(HDC hdc, RECT *rc);
BOOL ske_DrawIconEx(HDC hdc, int xLeft, int yTop, HICON hIcon, int cxWidth, int cyWidth, UINT istepIfAniCur, HBRUSH hbrFlickerFreeDraw, UINT diFlags);
int ske_DrawNonFramedObjects(BOOL Erase, RECT *r);
BOOL ske_DrawText(HDC hdc, LPCTSTR lpString, int nCount, RECT *lpRect, UINT format);
-SKINOBJECTDESCRIPTOR* ske_FindObjectByName(const char *szName, BYTE objType, SKINOBJECTSLIST *Skin);
+SKINOBJECTDESCRIPTOR* ske_FindObjectByName(const char *szName, uint8_t objType, SKINOBJECTSLIST *Skin);
HBITMAP ske_GetCurrentWindowImage();
int ske_GetFullFilename(wchar_t *buf, const wchar_t *file, wchar_t *skinfolder, BOOL madeAbsolute);
BOOL ske_ImageList_DrawEx(HIMAGELIST himl, int i, HDC hdcDst, int x, int y, int dx, int dy, COLORREF rgbBk, COLORREF rgbFg, UINT fStyle);
@@ -122,7 +122,7 @@ int ske_PrepareImageButDontUpdateIt(RECT *r); int ske_ReCreateBackImage(BOOL Erase, RECT *w);
int ske_RedrawCompleteWindow();
bool ske_ResetTextEffect(HDC);
-bool ske_SelectTextEffect(HDC hdc, BYTE EffectID, DWORD FirstColor, DWORD SecondColor);
+bool ske_SelectTextEffect(HDC hdc, uint8_t EffectID, DWORD FirstColor, DWORD SecondColor);
INT_PTR ske_Service_DrawGlyph(WPARAM wParam, LPARAM lParam);
BOOL ske_SetRectOpaque(HDC memdc, RECT *fr, BOOL force = FALSE);
BOOL ske_SetRgnOpaque(HDC memdc, HRGN hrgn, BOOL force = FALSE);
@@ -148,7 +148,7 @@ FRAMEWND* FindFrameByItsHWND(HWND FrameHwnd); //cluiframes.c int DrawTitleBar(HDC hdcMem2, RECT *rect, int Frameid);
int FindFrameID(HWND FrameHwnd);
-int SetAlpha(BYTE Alpha);
+int SetAlpha(uint8_t Alpha);
/* others TODO: move above */
@@ -156,8 +156,8 @@ int Docking_ProcessWindowMessage(WPARAM wParam, LPARAM lParam); void DrawBackGround(HWND hwnd, HDC mhdc, HBITMAP hBmpBackground, COLORREF bkColour, DWORD backgroundBmpUse);
HRESULT BackgroundsLoadModule();
int BackgroundsUnloadModule();
-char* GetParamN(char *string, char *buf, int buflen, BYTE paramN, char Delim, BOOL SkipSpaces); //mod_skin_selector.c
-wchar_t* GetParamN(wchar_t *string, wchar_t *buf, int buflen, BYTE paramN, wchar_t Delim, BOOL SkipSpaces);
+char* GetParamN(char *string, char *buf, int buflen, uint8_t paramN, char Delim, BOOL SkipSpaces); //mod_skin_selector.c
+wchar_t* GetParamN(wchar_t *string, wchar_t *buf, int buflen, uint8_t paramN, wchar_t Delim, BOOL SkipSpaces);
DWORD CompareContacts2_getLMTime(MCONTACT u); //contact.c
DWORD mod_CalcHash(const char *a); //mod_skin_selector.c
HICON cliGetIconFromStatusMode(MCONTACT hContact, const char *szProto, int status); //clistmod.c
@@ -182,7 +182,7 @@ INT_PTR SetUseGroups(WPARAM wParam, LPARAM lParam); INT_PTR ToggleSounds(WPARAM wParam, LPARAM lParam); //contact.c
void ClcOptionsChanged(); //clc.c
void Docking_GetMonitorRectFromWindow(HWND hWnd, RECT *rc); //Docking.c
-void DrawAvatarImageWithGDIp(HDC hDestDC, int x, int y, DWORD width, DWORD height, HBITMAP hbmp, int x1, int y1, DWORD width1, DWORD height1, DWORD flag, BYTE alpha); //gdiplus.cpp
+void DrawAvatarImageWithGDIp(HDC hDestDC, int x, int y, DWORD width, DWORD height, HBITMAP hbmp, int x1, int y1, DWORD width1, DWORD height1, DWORD flag, uint8_t alpha); //gdiplus.cpp
void InitGdiPlus(); //gdiplus.cpp
void ShutdownGdiPlus(); //gdiplus.cpp
void UnloadAvatarOverlayIcon(); //clc.c
@@ -252,7 +252,7 @@ extern HRESULT(WINAPI *g_proc_DWMEnableBlurBehindWindow)(HWND hWnd, DWM_BLURBEHI /* SkinEngine.c */
-BYTE SkinDBGetContactSettingByte(MCONTACT hContact, const char* szSection, const char*szKey, BYTE bDefault);
+uint8_t SkinDBGetContactSettingByte(MCONTACT hContact, const char* szSection, const char*szKey, uint8_t bDefault);
extern OVERLAYICONINFO g_pAvatarOverlayIcons[MAX_STATUS_COUNT];
extern OVERLAYICONINFO g_pStatusOverlayIcons[MAX_STATUS_COUNT];
diff --git a/plugins/Clist_modern/src/modern_contact.cpp b/plugins/Clist_modern/src/modern_contact.cpp index 5cb553bbe9..49c9e8cc43 100644 --- a/plugins/Clist_modern/src/modern_contact.cpp +++ b/plugins/Clist_modern/src/modern_contact.cpp @@ -90,7 +90,7 @@ int cliCompareContacts(const ClcContact *contact1, const ClcContact *contact2) ClcCacheEntry *c1 = contact1->pce, *c2 = contact2->pce;
for (int i = 0; i < _countof(g_CluiData.bSortByOrder); i++) {
- BYTE &by = g_CluiData.bSortByOrder[i];
+ uint8_t &by = g_CluiData.bSortByOrder[i];
if (by == SORTBY_STATUS) { //status
int ordera = GetStatusModeOrdering(c1->getStatus());
@@ -177,6 +177,6 @@ INT_PTR SetUseGroups(WPARAM wParam, LPARAM) INT_PTR ToggleSounds(WPARAM, LPARAM)
{
db_set_b(0, "Skin", "UseSound",
- (BYTE)!db_get_b(0, "Skin", "UseSound", SETTING_ENABLESOUNDS_DEFAULT));
+ (uint8_t)!db_get_b(0, "Skin", "UseSound", SETTING_ENABLESOUNDS_DEFAULT));
return 0;
}
diff --git a/plugins/Clist_modern/src/modern_docking.cpp b/plugins/Clist_modern/src/modern_docking.cpp index e7a63e9a57..fc22f00af3 100644 --- a/plugins/Clist_modern/src/modern_docking.cpp +++ b/plugins/Clist_modern/src/modern_docking.cpp @@ -102,7 +102,7 @@ int Docking_ProcessWindowMessage(WPARAM wParam, LPARAM lParam) MSG *msg = (MSG*)wParam;
if (msg->message == WM_DESTROY)
- g_plugin.setByte("Docked", (BYTE)g_CluiData.fDocked);
+ g_plugin.setByte("Docked", (uint8_t)g_CluiData.fDocked);
if (!g_CluiData.fDocked && msg->message != WM_CREATE && msg->message != WM_MOVING && msg->message != WM_CREATEDOCKED && msg->message != WM_MOVE && msg->message != WM_SIZE) return 0;
switch (msg->message) {
@@ -197,7 +197,7 @@ int Docking_ProcessWindowMessage(WPARAM wParam, LPARAM lParam) Sync(CLUIFrames_OnMoving, msg->hwnd, (LPRECT)msg->lParam);
g_CluiData.mutexPreventDockMoving = 1;
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
- g_plugin.setByte("Docked", (BYTE)g_CluiData.fDocked);
+ g_plugin.setByte("Docked", (uint8_t)g_CluiData.fDocked);
ModernSkinButton_ReposButtons(msg->hwnd, SBRF_DO_NOT_DRAW, nullptr);
return TRUE;
}
@@ -294,7 +294,7 @@ int Docking_ProcessWindowMessage(WPARAM wParam, LPARAM lParam) GetCursorPos(&pt);
PostMessage(msg->hwnd, WM_NCLBUTTONDOWN, HTCAPTION, MAKELPARAM(pt.x, pt.y));
SetWindowPos(msg->hwnd, nullptr, pt.x - rc.right / 2, pt.y - GetSystemMetrics(SM_CYFRAME) - GetSystemMetrics(SM_CYSMCAPTION) / 2, g_plugin.getDword("Width", 0), g_plugin.getDword("Height", 0), SWP_NOZORDER);
- g_plugin.setByte("Docked", (BYTE)g_CluiData.fDocked);
+ g_plugin.setByte("Docked", (uint8_t)g_CluiData.fDocked);
// ModernSkinButton_ReposButtons(msg->hwnd, SBRF_DO_NOT_DRAW, nullptr);
}
return 1;
diff --git a/plugins/Clist_modern/src/modern_effectenum.h b/plugins/Clist_modern/src/modern_effectenum.h index aff63b837c..e6fe8bb64c 100644 --- a/plugins/Clist_modern/src/modern_effectenum.h +++ b/plugins/Clist_modern/src/modern_effectenum.h @@ -4,16 +4,16 @@ typedef signed char sbyte; typedef struct _MODERNEFFECTMATRIX
{
sbyte matrix[25];
- BYTE topEffect;
- BYTE leftEffect;
- BYTE rightEffect;
- BYTE bottomEffect;
- BYTE cycleCount; //low 7 bits
+ uint8_t topEffect;
+ uint8_t leftEffect;
+ uint8_t rightEffect;
+ uint8_t bottomEffect;
+ uint8_t cycleCount; //low 7 bits
}MODERNEFFECTMATRIX;
typedef struct _MODERNEFFECT
{
- BYTE EffectID;
+ uint8_t EffectID;
MODERNEFFECTMATRIX EffectMatrix;
DWORD EffectColor1;
DWORD EffectColor2;
@@ -90,4 +90,4 @@ MODERNEFFECTMATRIX ModernEffectsEnum[] = { extern wchar_t * ModernEffectNames[];
#endif
extern BOOL SkinEngine_ResetTextEffect(HDC);
-extern BOOL SkinEngine_SelectTextEffect(HDC hdc, BYTE EffectID, DWORD FirstColor, DWORD SecondColor);
\ No newline at end of file +extern BOOL SkinEngine_SelectTextEffect(HDC hdc, uint8_t EffectID, DWORD FirstColor, DWORD SecondColor);
\ No newline at end of file diff --git a/plugins/Clist_modern/src/modern_gdiplus.cpp b/plugins/Clist_modern/src/modern_gdiplus.cpp index cbc36d8f79..7a11b64b70 100644 --- a/plugins/Clist_modern/src/modern_gdiplus.cpp +++ b/plugins/Clist_modern/src/modern_gdiplus.cpp @@ -15,7 +15,7 @@ using namespace Gdiplus; HBITMAP ske_CreateDIB32(int cx, int cy);
-BYTE saved_alpha;
+uint8_t saved_alpha;
ULONG_PTR g_gdiplusToken;
int g_hottrack;
@@ -43,9 +43,9 @@ static ColorMatrix ClrMatrix = 0.0f, 0.0f, 0.0f, 0.0f, 1.0f
};
-DWORD argb_from_cola(COLORREF col, BYTE alpha)
+DWORD argb_from_cola(COLORREF col, uint8_t alpha)
{
- return((BYTE)(alpha) << 24 | col);
+ return((uint8_t)(alpha) << 24 | col);
}
HBITMAP GDIPlus_LoadGlyphImage(const wchar_t *tszFileName)
@@ -63,17 +63,17 @@ HBITMAP GDIPlus_LoadGlyphImage(const wchar_t *tszFileName) return hbmp;
}
-void DrawAvatarImageWithGDIp(HDC hDestDC, int x, int y, DWORD width, DWORD height, HBITMAP hbmp, int x1, int y1, DWORD width1, DWORD height1, DWORD flag, BYTE alpha)
+void DrawAvatarImageWithGDIp(HDC hDestDC, int x, int y, DWORD width, DWORD height, HBITMAP hbmp, int x1, int y1, DWORD width1, DWORD height1, DWORD flag, uint8_t alpha)
{
BITMAP bmp;
Bitmap *bm;
- BYTE * bmbits = nullptr;
+ uint8_t * bmbits = nullptr;
GetObject(hbmp, sizeof(BITMAP), &bmp);
Graphics g(hDestDC);
if (bmp.bmBitsPixel == 32 && (flag&AVS_PREMULTIPLIED)) {
- bmbits = (BYTE*)bmp.bmBits;
+ bmbits = (uint8_t*)bmp.bmBits;
if (!bmbits) {
- bmbits = (BYTE*)malloc(bmp.bmHeight*bmp.bmWidthBytes);
+ bmbits = (uint8_t*)malloc(bmp.bmHeight*bmp.bmWidthBytes);
GetBitmapBits(hbmp, bmp.bmHeight*bmp.bmWidthBytes, bmbits);
}
bm = new Bitmap(bmp.bmWidth, bmp.bmHeight, bmp.bmWidthBytes, PixelFormat32bppPARGB, bmbits);
@@ -110,7 +110,7 @@ BOOL GDIPlus_AlphaBlend(HDC hdcDest, int nXOriginDest, int nYOriginDest, int nWi Bitmap *bm;
if (bmp.bmBitsPixel == 32 && bf->AlphaFormat) {
- bm = new Bitmap(bmp.bmWidth, bmp.bmHeight, bmp.bmWidthBytes, PixelFormat32bppPARGB, (BYTE*)bmp.bmBits);
+ bm = new Bitmap(bmp.bmWidth, bmp.bmHeight, bmp.bmWidthBytes, PixelFormat32bppPARGB, (uint8_t*)bmp.bmBits);
bm->RotateFlip(RotateNoneFlipY);
}
else bm = new Bitmap(hbmp, nullptr);
diff --git a/plugins/Clist_modern/src/modern_global_structure.h b/plugins/Clist_modern/src/modern_global_structure.h index ba134cdaae..6e76a7367c 100644 --- a/plugins/Clist_modern/src/modern_global_structure.h +++ b/plugins/Clist_modern/src/modern_global_structure.h @@ -23,8 +23,8 @@ struct CLUIDATA char varFilter[2048];
DWORD lastMsgFilter;
char current_viewmode[256], old_viewmode[256];
- BYTE boldHideOffline;
- BYTE bOldUseGroups;
+ uint8_t boldHideOffline;
+ uint8_t bOldUseGroups;
DWORD statusMaskFilter;
DWORD stickyMaskFilter;
DWORD filterFlags;
@@ -48,10 +48,10 @@ struct CLUIDATA bool fSortNoOfflineBottom;
bool fAutoSize;
bool fAeroGlass;
- BYTE bCurrentAlpha;
- BYTE bSTATE;
- BYTE bBehindEdgeSettings;
- BYTE bSortByOrder[3];
+ uint8_t bCurrentAlpha;
+ uint8_t bSTATE;
+ uint8_t bBehindEdgeSettings;
+ uint8_t bSortByOrder[3];
signed char nBehindEdgeState;
diff --git a/plugins/Clist_modern/src/modern_image_array.cpp b/plugins/Clist_modern/src/modern_image_array.cpp index cd2ec11052..1b96633d77 100644 --- a/plugins/Clist_modern/src/modern_image_array.cpp +++ b/plugins/Clist_modern/src/modern_image_array.cpp @@ -575,7 +575,7 @@ BOOL ImageArray_RemoveImage(IMAGE_ARRAY_DATA *iad, int pos) -BOOL ImageArray_DrawImage(IMAGE_ARRAY_DATA *iad, int pos, HDC hdcDest, int nXDest, int nYDest, BYTE Alpha)
+BOOL ImageArray_DrawImage(IMAGE_ARRAY_DATA *iad, int pos, HDC hdcDest, int nXDest, int nYDest, uint8_t Alpha)
{
if (hdcDest == nullptr || pos < 0 || pos >= iad->nodes_size)
return FALSE;
diff --git a/plugins/Clist_modern/src/modern_image_array.h b/plugins/Clist_modern/src/modern_image_array.h index 1572f83922..45899fceef 100644 --- a/plugins/Clist_modern/src/modern_image_array.h +++ b/plugins/Clist_modern/src/modern_image_array.h @@ -79,6 +79,6 @@ BOOL ImageArray_ChangeImage(IMAGE_ARRAY_DATA *iad, HBITMAP hBmp, int pos); BOOL ImageArray_RemoveImage(IMAGE_ARRAY_DATA *iad, int pos);
// Draw an image
-BOOL ImageArray_DrawImage(IMAGE_ARRAY_DATA *iad, int pos, HDC hdcDest, int nXDest, int nYDest, BYTE Alpha);
+BOOL ImageArray_DrawImage(IMAGE_ARRAY_DATA *iad, int pos, HDC hdcDest, int nXDest, int nYDest, uint8_t Alpha);
#endif // __IMAGE_ARRAY_H__
diff --git a/plugins/Clist_modern/src/modern_skinbutton.cpp b/plugins/Clist_modern/src/modern_skinbutton.cpp index 132d85b4da..5fe7f39945 100644 --- a/plugins/Clist_modern/src/modern_skinbutton.cpp +++ b/plugins/Clist_modern/src/modern_skinbutton.cpp @@ -38,10 +38,10 @@ HWND SetToolTip(HWND hwnd, wchar_t * tip); typedef struct _ModernSkinButtonCtrl { HWND hwnd; - BYTE down; // button state - BYTE focus; // has focus (1 or 0) - BYTE hover; - BYTE IsSwitcher; + uint8_t down; // button state + uint8_t focus; // has focus (1 or 0) + uint8_t hover; + uint8_t IsSwitcher; BOOL fCallOnPress; char * ID; char * CommandService; @@ -236,7 +236,7 @@ static int ModernSkinButtonToggleDBValue(char * ValueDBSection, char *ValueTypeD case 'b': curval = db_get_b(0, section, key, l2); curval = (curval == l2) ? l1 : l2; - db_set_b(0, section, key, (BYTE)curval); + db_set_b(0, section, key, (uint8_t)curval); break; } mir_free(section); @@ -490,7 +490,7 @@ HWND SetToolTip(HWND hwnd, wchar_t * tip) typedef struct _MButton { HWND hwnd; - BYTE ConstrainPositionFrom; //(BBRRTTLL) L = 0 - from left, L = 1 from right, L = 2 from center + uint8_t ConstrainPositionFrom; //(BBRRTTLL) L = 0 - from left, L = 1 from right, L = 2 from center int OrL, OrR, OrT, OrB; int minW, minH; ModernSkinButtonCtrl * bct; @@ -564,7 +564,7 @@ int ModernSkinButton_AddButton(HWND parent, Buttons[ButtonsCount].OrT = Top; Buttons[ButtonsCount].OrR = Right; Buttons[ButtonsCount].OrB = Bottom; - Buttons[ButtonsCount].ConstrainPositionFrom = (BYTE)sbFlags; + Buttons[ButtonsCount].ConstrainPositionFrom = (uint8_t)sbFlags; Buttons[ButtonsCount].minH = MinHeight; Buttons[ButtonsCount].minW = MinWidth; ButtonsCount++; @@ -641,7 +641,7 @@ int ModernSkinButtonDeleteAll() return 0; } -int ModernSkinButton_ReposButtons(HWND parent, BYTE draw, RECT *pRect) +int ModernSkinButton_ReposButtons(HWND parent, uint8_t draw, RECT *pRect) { RECT rc, clr, rd; BOOL altDraw = FALSE; diff --git a/plugins/Clist_modern/src/modern_skinengine.cpp b/plugins/Clist_modern/src/modern_skinengine.cpp index 36ea9594a3..43b5675d15 100644 --- a/plugins/Clist_modern/src/modern_skinengine.cpp +++ b/plugins/Clist_modern/src/modern_skinengine.cpp @@ -37,13 +37,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /* tga header */ struct tga_header_t { - BYTE id_lenght; /* size of image id */ - BYTE colormap_type; /* 1 is has a colormap */ - BYTE image_type; /* compression type */ + uint8_t id_lenght; /* size of image id */ + uint8_t colormap_type; /* 1 is has a colormap */ + uint8_t image_type; /* compression type */ short cm_first_entry; /* colormap origin */ short cm_length; /* colormap length */ - BYTE cm_size; /* colormap size */ + uint8_t cm_size; /* colormap size */ short x_origin; /* bottom left x coord origin */ short y_origin; /* bottom left y coord origin */ @@ -51,8 +51,8 @@ struct tga_header_t short width; /* picture width (in pixels) */ short height; /* picture height (in pixels) */ - BYTE pixel_depth; /* bits per pixel: 8, 16, 24 or 32 */ - BYTE image_descriptor; /* 24 bits = 0x00; 32 bits = 0x80 */ + uint8_t pixel_depth; /* bits per pixel: 8, 16, 24 or 32 */ + uint8_t image_descriptor; /* 24 bits = 0x00; 32 bits = 0x80 */ }; #pragma pack(pop) @@ -86,8 +86,8 @@ static SKINOBJECTSLIST *pCurrentSkin = nullptr; static char **pszSettingName = nullptr; static int nArrayLen = 0; -static BYTE pbGammaWeight[256] = { 0 }; -static BYTE pbGammaWeightAdv[256] = { 0 }; +static uint8_t pbGammaWeight[256] = { 0 }; +static uint8_t pbGammaWeightAdv[256] = { 0 }; static BOOL bGammaWeightFilled = FALSE; static mir_cs cs_SkinChanging; @@ -95,7 +95,7 @@ static mir_cs cs_SkinChanging; static LISTMODERNMASK *MainModernMaskList = nullptr; /* Private module procedures */ -static BOOL ske_GetMaskBit(BYTE *line, int x); +static BOOL ske_GetMaskBit(uint8_t *line, int x); static INT_PTR ske_Service_AlphaTextOut(WPARAM wParam, LPARAM lParam); static INT_PTR ske_Service_DrawIconEx(WPARAM wParam, LPARAM lParam); @@ -105,7 +105,7 @@ static void ske_AddParseSkinFont(char * szFontID, char * szDefineString); static int ske_GetSkinFromDB(char * szSection, SKINOBJECTSLIST * Skin); static SKINOBJECTDESCRIPTOR* ske_FindObject(const char *szName, SKINOBJECTSLIST *Skin); static int ske_LoadSkinFromResource(BOOL bOnlyObjects); -static void ske_PreMultiplyChannels(HBITMAP hbmp, BYTE Mult); +static void ske_PreMultiplyChannels(HBITMAP hbmp, uint8_t Mult); static int ske_ValidateSingleFrameImage(FRAMEWND * Frame, BOOL SkipBkgBlitting); static INT_PTR ske_Service_UpdateFrameImage(WPARAM wParam, LPARAM lParam); static INT_PTR ske_Service_InvalidateFrameImage(WPARAM wParam, LPARAM lParam); @@ -116,7 +116,7 @@ static MODERNEFFECT meCurrentEffect = { 0xFF, { 0 }, 0, 0 }; ////////////////////////////////////////////////////////////////////////// // Ini file parser -IniParser::IniParser(wchar_t * tcsFileName, BYTE flags) : _Flags(flags) +IniParser::IniParser(wchar_t * tcsFileName, uint8_t flags) : _Flags(flags) { _DoInit(); if (!tcsFileName) return; @@ -134,7 +134,7 @@ IniParser::IniParser(wchar_t * tcsFileName, BYTE flags) : _Flags(flags) } } -IniParser::IniParser(HINSTANCE hInst, const char * resourceName, const char * resourceType, BYTE flags) : _Flags(flags) +IniParser::IniParser(HINSTANCE hInst, const char * resourceName, const char * resourceType, uint8_t flags) : _Flags(flags) { _DoInit(); _LoadResourceIni(hInst, resourceName, resourceType); @@ -183,7 +183,7 @@ HRESULT IniParser::WriteStrToDb(const char * szSection, const char * szName, con switch (szValue[0]) { case 'b': - db_set_b(0, szSection, szName, (BYTE)atoi(szValue + 1)); + db_set_b(0, szSection, szName, (uint8_t)atoi(szValue + 1)); break; case 'w': @@ -566,7 +566,7 @@ BOOL ske_SetRgnOpaque(HDC memdc, HRGN hrgn, BOOL force) BOOL ske_SetRectOpaque(HDC memdc, RECT *fr, BOOL force) { int f = 0; - BYTE *bits; + uint8_t *bits; BITMAP bmp; if (g_CluiData.fDisableSkinEngine && !force) @@ -580,11 +580,11 @@ BOOL ske_SetRectOpaque(HDC memdc, RECT *fr, BOOL force) if (!bmp.bmBits) { f = 1; - bits = (BYTE*)mir_alloc(bmp.bmWidthBytes*bmp.bmHeight); + bits = (uint8_t*)mir_alloc(bmp.bmWidthBytes*bmp.bmHeight); GetBitmapBits(hbmp, bmp.bmWidthBytes*bmp.bmHeight, bits); } else - bits = (BYTE*)bmp.bmBits; + bits = (uint8_t*)bmp.bmBits; int sx = (fr->left > 0) ? fr->left : 0; int sy = (fr->top > 0) ? fr->top : 0; @@ -593,9 +593,9 @@ BOOL ske_SetRectOpaque(HDC memdc, RECT *fr, BOOL force) int width = ex - sx; - BYTE *pLine = ((BYTE *)bits) + (bmp.bmHeight - sy - 1) * bmp.bmWidthBytes + (sx << 2) + 3; + uint8_t *pLine = ((uint8_t *)bits) + (bmp.bmHeight - sy - 1) * bmp.bmWidthBytes + (sx << 2) + 3; for (int y = 0; y < (ey - sy); y++) { - BYTE *pColumn = pLine; + uint8_t *pColumn = pLine; for (int x = 0; x < width; x++) { *pColumn = 255; pColumn += 4; @@ -610,7 +610,7 @@ BOOL ske_SetRectOpaque(HDC memdc, RECT *fr, BOOL force) return 1; } -static BOOL ske_SkinFillRectByGlyph(HDC hDest, HDC hSource, RECT *rFill, RECT *rGlyph, RECT *rClip, BYTE mode, BYTE drawMode) +static BOOL ske_SkinFillRectByGlyph(HDC hDest, HDC hSource, RECT *rFill, RECT *rGlyph, RECT *rClip, uint8_t mode, uint8_t drawMode) { BLENDFUNCTION bf = { AC_SRC_OVER, 0, 255, AC_SRC_ALPHA }; @@ -922,7 +922,7 @@ HBITMAP ske_CreateDIB32Point(int cx, int cy, void **bits) return DirectBitmap; } -HRGN ske_CreateOpaqueRgn(BYTE Level, bool Opaque) +HRGN ske_CreateOpaqueRgn(uint8_t Level, bool Opaque) { if (!g_pCachedWindow) return nullptr; @@ -986,7 +986,7 @@ static int ske_DrawSkinObject(SKINDRAWREQUEST *preq, GLYPHOBJECT *pobj) int k = 0; //BITMAP bmp = {0}; HBITMAP membmp = nullptr, oldbmp = nullptr, oldglyph = nullptr; - BYTE Is32Bit = 0; + uint8_t Is32Bit = 0; RECT PRect; POINT mode2offset = { 0 }; int depth = 0; @@ -1241,7 +1241,7 @@ static int ske_DrawSkinObject(SKINDRAWREQUEST *preq, GLYPHOBJECT *pobj) if ((k > 0 || k == -1) && mode == 2) { { - BLENDFUNCTION bf = { AC_SRC_OVER, 0, pobj->dwAlpha, BYTE(pobj->bmBitsPixel == 32 && pobj->Style != ST_BRUSH ? AC_SRC_ALPHA : 0) }; + BLENDFUNCTION bf = { AC_SRC_OVER, 0, pobj->dwAlpha, uint8_t(pobj->bmBitsPixel == 32 && pobj->Style != ST_BRUSH ? AC_SRC_ALPHA : 0) }; OffsetRect(&PRect, mode2offset.x, mode2offset.y); ske_AlphaBlend(preq->hDC, PRect.left, PRect.top, PRect.right - PRect.left, PRect.bottom - PRect.top, memdc, 0, 0, PRect.right - PRect.left, PRect.bottom - PRect.top, bf); @@ -1370,7 +1370,7 @@ static SKINOBJECTDESCRIPTOR* ske_FindObjectByMask(MODERNMASK *pModernMask, SKINO return sk->pMaskList ? skin_FindObjectByMask(pModernMask, sk->pMaskList) : nullptr; } -SKINOBJECTDESCRIPTOR* ske_FindObjectByName(const char *szName, BYTE objType, SKINOBJECTSLIST *Skin) +SKINOBJECTDESCRIPTOR* ske_FindObjectByName(const char *szName, uint8_t objType, SKINOBJECTSLIST *Skin) { SKINOBJECTSLIST *sk = (Skin == nullptr) ? (&g_SkinObjectList) : Skin; for (DWORD i = 0; i < sk->dwObjLPAlocated; i++) { @@ -1411,7 +1411,7 @@ INT_PTR ske_Service_DrawGlyph(WPARAM wParam, LPARAM lParam) if (gl->hGlyph) { BITMAP bmp = { 0 }; GetObject(gl->hGlyph, sizeof(BITMAP), &bmp); - gl->bmBitsPixel = (BYTE)bmp.bmBitsPixel; + gl->bmBitsPixel = (uint8_t)bmp.bmBitsPixel; gl->bmHeight = bmp.bmHeight; gl->bmWidth = bmp.bmWidth; } @@ -1422,11 +1422,11 @@ INT_PTR ske_Service_DrawGlyph(WPARAM wParam, LPARAM lParam) } -void ske_PreMultiplyChannels(HBITMAP hbmp, BYTE Mult) +void ske_PreMultiplyChannels(HBITMAP hbmp, uint8_t Mult) { BITMAP bmp; BOOL flag = FALSE; - BYTE *pBitmapBits; + uint8_t *pBitmapBits; DWORD Len; int bh, bw, y, x; @@ -1440,9 +1440,9 @@ void ske_PreMultiplyChannels(HBITMAP hbmp, BYTE Mult) GetBitmapBits(hbmp, Len, pBitmapBits); } else - pBitmapBits = (BYTE *)bmp.bmBits; + pBitmapBits = (uint8_t *)bmp.bmBits; for (y = 0; y < bh; ++y) { - BYTE *pPixel = pBitmapBits + bw * 4 * y; + uint8_t *pPixel = pBitmapBits + bw * 4 * y; for (x = 0; x < bw; ++x) { if (Mult) { @@ -1492,20 +1492,20 @@ This function is required to load TGA to dib buffer myself Major part of routines is from http://tfcduke.developpez.com/tutoriel/format/tga/fichiers/tga.c */ -static BOOL ske_ReadTGAImageData(void *From, DWORD fromSize, BYTE *destBuf, DWORD bufSize, BOOL RLE) +static BOOL ske_ReadTGAImageData(void *From, DWORD fromSize, uint8_t *destBuf, DWORD bufSize, BOOL RLE) { - BYTE *pos = destBuf; - BYTE *from = fromSize ? (BYTE *)From : nullptr; + uint8_t *pos = destBuf; + uint8_t *from = fromSize ? (uint8_t *)From : nullptr; FILE *fp = !fromSize ? (FILE *)From : nullptr; DWORD destCount = 0; DWORD fromCount = 0; if (!RLE) { while (((from && fromCount < fromSize) || (fp && fromCount < bufSize)) && (destCount < bufSize)) { - BYTE r = from ? from[fromCount++] : (BYTE)fgetc(fp); - BYTE g = from ? from[fromCount++] : (BYTE)fgetc(fp); - BYTE b = from ? from[fromCount++] : (BYTE)fgetc(fp); - BYTE a = from ? from[fromCount++] : (BYTE)fgetc(fp); + uint8_t r = from ? from[fromCount++] : (uint8_t)fgetc(fp); + uint8_t g = from ? from[fromCount++] : (uint8_t)fgetc(fp); + uint8_t b = from ? from[fromCount++] : (uint8_t)fgetc(fp); + uint8_t a = from ? from[fromCount++] : (uint8_t)fgetc(fp); pos[destCount++] = r; pos[destCount++] = g; pos[destCount++] = b; @@ -1516,14 +1516,14 @@ static BOOL ske_ReadTGAImageData(void *From, DWORD fromSize, BYTE *destBuf, DWOR } } else { - BYTE rgba[4]; - BYTE packet_header; - BYTE *ptr = pos; - BYTE size; + uint8_t rgba[4]; + uint8_t packet_header; + uint8_t *ptr = pos; + uint8_t size; int i; while (ptr < pos + bufSize) { /* read first byte */ - packet_header = from ? from[fromCount] : (BYTE)fgetc(fp); + packet_header = from ? from[fromCount] : (uint8_t)fgetc(fp); if (from) from++; size = 1 + (packet_header & 0x7f); if (packet_header & 0x80) { @@ -1532,7 +1532,7 @@ static BOOL ske_ReadTGAImageData(void *From, DWORD fromSize, BYTE *destBuf, DWOR *((DWORD*)rgba) = *((DWORD*)(from + fromCount)); fromCount += 4; } - else fread(rgba, sizeof(BYTE), 4, fp); + else fread(rgba, sizeof(uint8_t), 4, fp); for (i = 0; i < size; ++i, ptr += 4) { ptr[2] = rgba[2]; ptr[1] = rgba[1]; @@ -1542,10 +1542,10 @@ static BOOL ske_ReadTGAImageData(void *From, DWORD fromSize, BYTE *destBuf, DWOR } else { /* not run-length packet */ for (i = 0; i < size; ++i, ptr += 4) { - ptr[0] = from ? from[fromCount++] : (BYTE)fgetc(fp); - ptr[1] = from ? from[fromCount++] : (BYTE)fgetc(fp); - ptr[2] = from ? from[fromCount++] : (BYTE)fgetc(fp); - ptr[3] = from ? from[fromCount++] : (BYTE)fgetc(fp); + ptr[0] = from ? from[fromCount++] : (uint8_t)fgetc(fp); + ptr[1] = from ? from[fromCount++] : (uint8_t)fgetc(fp); + ptr[2] = from ? from[fromCount++] : (uint8_t)fgetc(fp); + ptr[3] = from ? from[fromCount++] : (uint8_t)fgetc(fp); } } } @@ -1555,7 +1555,7 @@ static BOOL ske_ReadTGAImageData(void *From, DWORD fromSize, BYTE *destBuf, DWOR static HBITMAP ske_LoadGlyphImage_TGA(const wchar_t *szFilename) { - BYTE *colormap = nullptr; + uint8_t *colormap = nullptr; int cx = 0, cy = 0; BOOL err = FALSE; tga_header_t header; @@ -1575,7 +1575,7 @@ static HBITMAP ske_LoadGlyphImage_TGA(const wchar_t *szFilename) } /*memory allocation */ - colormap = (BYTE*)mir_alloc(header.width*header.height * 4); + colormap = (uint8_t*)mir_alloc(header.width*header.height * 4); cx = header.width; cy = header.height; fseek(fp, header.id_lenght, SEEK_CUR); @@ -1590,11 +1590,11 @@ static HBITMAP ske_LoadGlyphImage_TGA(const wchar_t *szFilename) HGLOBAL hRes = LoadResource(g_plugin.getInst(), hRSrc); if (!hRes) return nullptr; DWORD size = SizeofResource(g_plugin.getInst(), hRSrc); - BYTE *mem = (BYTE*)LockResource(hRes); + uint8_t *mem = (uint8_t*)LockResource(hRes); if (size > sizeof(header)) { tga_header_t *tgahdr = (tga_header_t*)mem; if (tgahdr->pixel_depth == 32 && (tgahdr->image_type == 2 || tgahdr->image_type == 10)) { - colormap = (BYTE*)mir_alloc(tgahdr->width*tgahdr->height * 4); + colormap = (uint8_t*)mir_alloc(tgahdr->width*tgahdr->height * 4); cx = tgahdr->width; cy = tgahdr->height; ske_ReadTGAImageData((void*)(mem + sizeof(tga_header_t) + tgahdr->id_lenght + tgahdr->cm_length), size - (sizeof(tga_header_t) + tgahdr->id_lenght + tgahdr->cm_length), colormap, cx*cy * 4, tgahdr->image_type == 10); @@ -1607,7 +1607,7 @@ static HBITMAP ske_LoadGlyphImage_TGA(const wchar_t *szFilename) return nullptr; // create dib section - BYTE *pt; + uint8_t *pt; HBITMAP hbmp = ske_CreateDIB32Point(cx, cy, (void**)&pt); if (hbmp) memcpy(pt, colormap, cx*cy * 4); @@ -2010,7 +2010,7 @@ bool ske_ResetTextEffect(HDC hdc) return true; } -bool ske_SelectTextEffect(HDC hdc, BYTE EffectID, DWORD FirstColor, DWORD SecondColor) +bool ske_SelectTextEffect(HDC hdc, uint8_t EffectID, DWORD FirstColor, DWORD SecondColor) { if (EffectID > MAXPREDEFINEDEFFECTS) return false; @@ -2047,22 +2047,22 @@ static bool ske_GetTextEffect(HDC hdc, MODERNEFFECT *modernEffect) return true; } -static bool ske_DrawTextEffect(BYTE *destPt, BYTE *maskPt, DWORD width, DWORD height, MODERNEFFECT *effect) +static bool ske_DrawTextEffect(uint8_t *destPt, uint8_t *maskPt, DWORD width, DWORD height, MODERNEFFECT *effect) { sbyte *buf; sbyte *outbuf; sbyte *bufline, *buflineTop, *buflineMid; int sign = 0; - BYTE *maskline, *destline; - BYTE al, rl, gl, bl, ad, rd, gd, bd; + uint8_t *maskline, *destline; + uint8_t al, rl, gl, bl, ad, rd, gd, bd; int k = 0; DWORD x, y; sbyte *matrix; - BYTE mcTopStart; - BYTE mcBottomEnd; - BYTE mcLeftStart; - BYTE mcRightEnd; - BYTE effectCount; + uint8_t mcTopStart; + uint8_t mcBottomEnd; + uint8_t mcLeftStart; + uint8_t mcRightEnd; + uint8_t effectCount; int minX = width; int maxX = 0; int minY = height; @@ -2070,7 +2070,7 @@ static bool ske_DrawTextEffect(BYTE *destPt, BYTE *maskPt, DWORD width, DWORD he if (effect->EffectID == 0xFF) return false; if (!width || !height) return false; if (!destPt) return false; - buf = (sbyte*)mir_alloc(width*height*sizeof(BYTE)); + buf = (sbyte*)mir_alloc(width*height*sizeof(uint8_t)); { matrix = effect->EffectMatrix.matrix; mcTopStart = 2 - effect->EffectMatrix.topEffect; @@ -2079,11 +2079,11 @@ static bool ske_DrawTextEffect(BYTE *destPt, BYTE *maskPt, DWORD width, DWORD he mcRightEnd = 3 + effect->EffectMatrix.rightEffect; effectCount = effect->EffectMatrix.cycleCount; } - al = 255 - ((BYTE)(effect->EffectColor1 >> 24)); + al = 255 - ((uint8_t)(effect->EffectColor1 >> 24)); rl = GetRValue(effect->EffectColor1); gl = GetGValue(effect->EffectColor1); bl = GetBValue(effect->EffectColor1); - ad = 255 - ((BYTE)(effect->EffectColor2 >> 24)); + ad = 255 - ((uint8_t)(effect->EffectColor2 >> 24)); rd = GetRValue(effect->EffectColor2); gd = GetGValue(effect->EffectColor2); bd = GetBValue(effect->EffectColor2); @@ -2093,7 +2093,7 @@ static bool ske_DrawTextEffect(BYTE *destPt, BYTE *maskPt, DWORD width, DWORD he bufline = buf + y*width; maskline = maskPt + ((y*width) << 2); for (x = 0; x < width; x++) { - BYTE a = (sbyte)(DWORD)((maskline[0] + maskline[2] + maskline[1] + maskline[1]) >> 4); + uint8_t a = (sbyte)(DWORD)((maskline[0] + maskline[2] + maskline[1] + maskline[1]) >> 4); *bufline = a; if (a != 0) { minX = min((int)x, minX); @@ -2146,7 +2146,7 @@ static bool ske_DrawTextEffect(BYTE *destPt, BYTE *maskPt, DWORD width, DWORD he buf = outbuf; } { - BYTE r1, b1, g1, a1; + uint8_t r1, b1, g1, a1; b1 = bl; r1 = rl; g1 = gl; a1 = al; sign = 1; //perform out to dest for (y = 0; y < height; y++) { @@ -2154,7 +2154,7 @@ static bool ske_DrawTextEffect(BYTE *destPt, BYTE *maskPt, DWORD width, DWORD he destline = destPt + ((y*width) << 2); for (x = 0; x < width; x++) { sbyte val = *bufline; - BYTE absVal = ((val < 0) ? -val : val); + uint8_t absVal = ((val < 0) ? -val : val); if (val != 0) { if (val > 0 && sign < 0) { @@ -2187,19 +2187,19 @@ static int ske_AlphaTextOut(HDC hDC, LPCTSTR lpString, int nCount, RECT *lpRect, // Step first fill fast calc correction tables: static bool _tables_empty = true; - static BYTE gammaTbl[256]; // Gamma correction table + static uint8_t gammaTbl[256]; // Gamma correction table static WORD blueMulTbl[256]; // blue coefficient multiplication table static WORD greenMulTbl[256]; // green coefficient multiplication table static WORD redMulTbl[256]; // red coefficient multiplication table if (_tables_empty) { // fill tables double gammaCfPw = 1000 / (double)DBGetContactSettingRangedWord(0, "ModernData", "AlphaTextOutGamma", 700, 1, 5000); - BYTE blueCf = db_get_b(0, "ModernData", "AlphaTextOutBlueCorrection", 28); - BYTE redCf = db_get_b(0, "ModernData", "AlphaTextOutRed Correction", 77); - BYTE greenCf = db_get_b(0, "ModernData", "AlphaTextOutGreen Correction", 151); + uint8_t blueCf = db_get_b(0, "ModernData", "AlphaTextOutBlueCorrection", 28); + uint8_t redCf = db_get_b(0, "ModernData", "AlphaTextOutRed Correction", 77); + uint8_t greenCf = db_get_b(0, "ModernData", "AlphaTextOutGreen Correction", 151); for (int i = 0; i < 256; i++) { - gammaTbl[i] = (BYTE)(255 * pow((double)i / 255, gammaCfPw)); + gammaTbl[i] = (uint8_t)(255 * pow((double)i / 255, gammaCfPw)); blueMulTbl[i] = i * blueCf; redMulTbl[i] = i * redCf; greenMulTbl[i] = i * greenCf; @@ -2216,13 +2216,13 @@ static int ske_AlphaTextOut(HDC hDC, LPCTSTR lpString, int nCount, RECT *lpRect, GetObject(hDestBitmap, sizeof(BITMAP), &bmpDest); bool destHasNotDIB = (bmpDest.bmBits == nullptr); - BYTE *pDestBits; + uint8_t *pDestBits; if (destHasNotDIB) { - pDestBits = (BYTE*)mir_alloc(bmpDest.bmHeight * bmpDest.bmWidthBytes); + pDestBits = (uint8_t*)mir_alloc(bmpDest.bmHeight * bmpDest.bmWidthBytes); GetBitmapBits(hDestBitmap, bmpDest.bmHeight*bmpDest.bmWidthBytes, pDestBits); } else - pDestBits = (BYTE*)bmpDest.bmBits; + pDestBits = (uint8_t*)bmpDest.bmBits; // Creating offscreen buffer HDC hOffscreenDC = CreateCompatibleDC(hDC); @@ -2302,13 +2302,13 @@ static int ske_AlphaTextOut(HDC hDC, LPCTSTR lpString, int nCount, RECT *lpRect, // probably here are mess ofscreen and temp buff dc //Create bitmap image for offscreen - BYTE *bits = nullptr; + uint8_t *bits = nullptr; HBITMAP hbmp = ske_CreateDIB32Point(textSize.cx, textSize.cy, (void**)&bits); if (bits != nullptr) { HBITMAP holdbmp = (HBITMAP)SelectObject(hOffscreenDC, hbmp); //Create buffer bitmap image for temp text - BYTE *bufbits = nullptr; + uint8_t *bufbits = nullptr; HBITMAP bufbmp = ske_CreateDIB32Point(textSize.cx, textSize.cy, (void**)&bufbits); if (bufbits != nullptr) { HDC bufDC = CreateCompatibleDC(hDC); @@ -2336,12 +2336,12 @@ static int ske_AlphaTextOut(HDC hDC, LPCTSTR lpString, int nCount, RECT *lpRect, DWORD width = textSize.cx; DWORD heigh = textSize.cy; - BYTE *pDestScanLine, *pBufScanLine, *pix, *bufpix; + uint8_t *pDestScanLine, *pBufScanLine, *pix, *bufpix; - BYTE al = 255 - ((BYTE)(ARGBcolor >> 24)); - BYTE r = GetRValue(ARGBcolor); - BYTE g = GetGValue(ARGBcolor); - BYTE b = GetBValue(ARGBcolor); + uint8_t al = 255 - ((uint8_t)(ARGBcolor >> 24)); + uint8_t r = GetRValue(ARGBcolor); + uint8_t g = GetGValue(ARGBcolor); + uint8_t b = GetBValue(ARGBcolor); for (DWORD y = 2; y < heigh - 2; y++) { int lineBytes = y * (width << 2); @@ -2354,9 +2354,9 @@ static int ske_AlphaTextOut(HDC hDC, LPCTSTR lpString, int nCount, RECT *lpRect, bufpix = pBufScanLine + (x << 2); // Monochromatic - BYTE bx = gammaTbl[bufpix[0]]; - BYTE gx = gammaTbl[bufpix[1]]; - BYTE rx = gammaTbl[bufpix[2]]; + uint8_t bx = gammaTbl[bufpix[0]]; + uint8_t gx = gammaTbl[bufpix[1]]; + uint8_t rx = gammaTbl[bufpix[2]]; if (al != 255) { bx *= al / 255; @@ -2364,10 +2364,10 @@ static int ske_AlphaTextOut(HDC hDC, LPCTSTR lpString, int nCount, RECT *lpRect, rx *= al / 255; } - BYTE ax = (BYTE)(((DWORD)rx * 77 + (DWORD)gx * 151 + (DWORD)bx * 28 + 128) / 256); + uint8_t ax = (uint8_t)(((DWORD)rx * 77 + (DWORD)gx * 151 + (DWORD)bx * 28 + 128) / 256); if (ax) { //Normalize components to gray - BYTE axx = 255 - ((r + g + b) >> 2); // Coefficient of grayance, more white font - more gray edges + uint8_t axx = 255 - ((r + g + b) >> 2); // Coefficient of grayance, more white font - more gray edges WORD atx = ax * (255 - axx); bx = (atx + bx * axx) / 255; gx = (atx + gx * axx) / 255; @@ -2380,7 +2380,7 @@ static int ske_AlphaTextOut(HDC hDC, LPCTSTR lpString, int nCount, RECT *lpRect, pix[0] += brx; pix[1] += grx; pix[2] += rrx; - pix[3] = (BYTE)(ax + (BYTE)(255 - ax)*pix[3] / 255); + pix[3] = (uint8_t)(ax + (uint8_t)(255 - ax)*pix[3] / 255); } } } @@ -2473,13 +2473,13 @@ HICON ske_ImageList_GetIcon(HIMAGELIST himl, int i) // TODO: Direct draw Icon from imagelist without // extracting of icon if (bm.bmBitsPixel == 32) { - BYTE *bits = (BYTE*)bm.bmBits; + uint8_t *bits = (uint8_t*)bm.bmBits; if (!bits) { - bits = (BYTE*)mir_alloc(bm.bmWidthBytes*bm.bmHeight); + bits = (uint8_t*)mir_alloc(bm.bmWidthBytes*bm.bmHeight); GetBitmapBits(imi.hbmImage, bm.bmWidthBytes*bm.bmHeight, bits); } - BYTE *bcbits = bits + (bm.bmHeight - imi.rcImage.bottom)*bm.bmWidthBytes + (imi.rcImage.left*bm.bmBitsPixel >> 3); + uint8_t *bcbits = bits + (bm.bmHeight - imi.rcImage.bottom)*bm.bmWidthBytes + (imi.rcImage.left*bm.bmBitsPixel >> 3); for (int iy = 0; iy < imi.rcImage.bottom - imi.rcImage.top; iy++) { int x; // Dummy microsoft fix - alpha can be less than r,g or b @@ -2489,11 +2489,11 @@ HICON ske_ImageList_GetIcon(HIMAGELIST himl, int i) DWORD *c = ((DWORD*)bcbits); for (x = 0; x < imi.rcImage.right - imi.rcImage.left; x++) { DWORD val = *c; - BYTE a = (BYTE)((val) >> 24); + uint8_t a = (uint8_t)((val) >> 24); if (a != 0) { - BYTE r = (BYTE)((val & 0xFF0000) >> 16); - BYTE g = (BYTE)((val & 0xFF00) >> 8); - BYTE b = (BYTE)(val & 0xFF); + uint8_t r = (uint8_t)((val & 0xFF0000) >> 16); + uint8_t g = (uint8_t)((val & 0xFF00) >> 8); + uint8_t b = (uint8_t)(val & 0xFF); if (a < r || a < g || a < b) { a = max(max(r, g), b); val = a << 24 | r << 16 | g << 8 | b; @@ -2523,7 +2523,7 @@ BOOL ske_ImageList_DrawEx(HIMAGELIST himl, int i, HDC hdcDst, int x, int y, int if (g_CluiData.fDisableSkinEngine) return ImageList_DrawEx(himl, i, hdcDst, x, y, dx, dy, rgbBk, rgbFg, fStyle); - BYTE alpha; + uint8_t alpha; if (fStyle & ILD_BLEND25) alpha = 64; else if (fStyle & ILD_BLEND50) @@ -2553,14 +2553,14 @@ static INT_PTR ske_Service_DrawIconEx(WPARAM wParam, LPARAM) BOOL ske_DrawIconEx(HDC hdcDst, int xLeft, int yTop, HICON hIcon, int cxWidth, int cyWidth, UINT istepIfAniCur, HBRUSH hbrFlickerFreeDraw, UINT diFlags) { ICONINFO ici; - BYTE alpha = (BYTE)((diFlags & 0xFF000000) >> 24); + uint8_t alpha = (uint8_t)((diFlags & 0xFF000000) >> 24); HBITMAP tBmp = nullptr; - BYTE *imbits, *imimagbits, *immaskbits; - BYTE *t1, *t2, *t3; + uint8_t *imbits, *imimagbits, *immaskbits; + uint8_t *t1, *t2, *t3; //lockimagelist - BYTE hasmask = FALSE, no32bit = FALSE, noMirrorMask = FALSE, hasalpha = FALSE; + uint8_t hasmask = FALSE, no32bit = FALSE, noMirrorMask = FALSE, hasalpha = FALSE; alpha = alpha ? alpha : 255; if (g_CluiData.fDisableSkinEngine && !(diFlags & 0x80)) @@ -2597,16 +2597,16 @@ BOOL ske_DrawIconEx(HDC hdcDst, int xLeft, int yTop, HICON hIcon, int cxWidth, i bool NoDIBImage = (imbt.bmBits == nullptr); if (NoDIBImage) { - imimagbits = (BYTE*)mir_alloc(cy*imbt.bmWidthBytes); + imimagbits = (uint8_t*)mir_alloc(cy*imbt.bmWidthBytes); GetBitmapBits(ici.hbmColor, cy*imbt.bmWidthBytes, (void*)imimagbits); } - else imimagbits = (BYTE*)imbt.bmBits; + else imimagbits = (uint8_t*)imbt.bmBits; if (immaskbt.bmBits == nullptr) { - immaskbits = (BYTE*)mir_alloc(cy*immaskbt.bmWidthBytes); + immaskbits = (uint8_t*)mir_alloc(cy*immaskbt.bmWidthBytes); GetBitmapBits(ici.hbmMask, cy*immaskbt.bmWidthBytes, (void*)immaskbits); } - else immaskbits = (BYTE*)immaskbt.bmBits; + else immaskbits = (uint8_t*)immaskbt.bmBits; HDC imDC = CreateCompatibleDC(hdcDst); DWORD icy = imbt.bmHeight; @@ -2638,12 +2638,12 @@ BOOL ske_DrawIconEx(HDC hdcDst, int xLeft, int yTop, HICON hIcon, int cxWidth, i t2 = imbits + (!no32bit ? y : (icy - y - 1))*mwb2; t3 = immaskbits + (noMirrorMask ? y : (h - y - 1 - top))*mwb; for (x = 0; x < right; x++) { - BYTE mask = 0; - BYTE a = 0; + uint8_t mask = 0; + uint8_t a = 0; DWORD *src = (DWORD*)(t1 + (x << 2)); DWORD *dest = (DWORD*)(t2 + (x << 2)); if (hasalpha && !hasmask) - a = ((BYTE*)src)[3]; + a = ((uint8_t*)src)[3]; else { mask = ((1 << (7 - x % 8))&(*(t3 + (x >> 3)))) != 0; if (mask) { @@ -2652,22 +2652,22 @@ BOOL ske_DrawIconEx(HDC hdcDst, int xLeft, int yTop, HICON hIcon, int cxWidth, i continue; } - if (((BYTE*)src)[3]>0) - a = ((BYTE*)src)[3]; + if (((uint8_t*)src)[3]>0) + a = ((uint8_t*)src)[3]; else a = 0; } else if (hasalpha || hasmask) - a = (((BYTE*)src)[3] > 0 ? ((BYTE*)src)[3] : 255); + a = (((uint8_t*)src)[3] > 0 ? ((uint8_t*)src)[3] : 255); else if (!hasalpha && !hasmask) a = 255; else { *dest = 0; continue; } } if (a > 0) { - ((BYTE*)dest)[3] = a; - ((BYTE*)dest)[0] = ((BYTE*)src)[0] * a / 255; - ((BYTE*)dest)[1] = ((BYTE*)src)[1] * a / 255; - ((BYTE*)dest)[2] = ((BYTE*)src)[2] * a / 255; + ((uint8_t*)dest)[3] = a; + ((uint8_t*)dest)[0] = ((uint8_t*)src)[0] * a / 255; + ((uint8_t*)dest)[1] = ((uint8_t*)src)[1] * a / 255; + ((uint8_t*)dest)[2] = ((uint8_t*)src)[2] * a / 255; } else *dest = 0; } @@ -3200,7 +3200,7 @@ void ske_ApplyTranslucency() if (!g_CluiData.fLayered && IsTransparancy) { if (!layered) SetWindowLongPtr(hwnd, GWL_EXSTYLE, GetWindowLongPtr(hwnd, GWL_EXSTYLE) | WS_EX_LAYERED); - SetLayeredWindowAttributes(hwnd, RGB(0, 0, 0), (BYTE)g_CluiData.bCurrentAlpha, LWA_ALPHA); + SetLayeredWindowAttributes(hwnd, RGB(0, 0, 0), (uint8_t)g_CluiData.bCurrentAlpha, LWA_ALPHA); } AniAva_RedrawAllAvatars(FALSE); @@ -3280,7 +3280,7 @@ static DWORD ske_HexToARGB(char *Hex) char *st; DWORD AARRGGBB = strtoul(buf2, &st, 16); - BYTE alpha = (BYTE)((AARRGGBB & 0xFF000000) >> 24); + uint8_t alpha = (uint8_t)((AARRGGBB & 0xFF000000) >> 24); alpha = 255 - ((alpha == 0) ? 255 : alpha); AARRGGBB = (alpha << 24) + ((AARRGGBB & 0x00FF0000) >> 16) + ((AARRGGBB & 0x000000FF) << 16) + (AARRGGBB & 0x0000FF00); return AARRGGBB; @@ -3449,14 +3449,14 @@ static void ske_AddParseSkinFont(char *szFontID, char *szDefineString) } /* - * ske_CheckHasAlfaChannel - checks if image has at least one BYTE in alpha chennel + * ske_CheckHasAlfaChannel - checks if image has at least one uint8_t in alpha chennel * that is not a 0. (is image real 32 bit or just 24 bit) */ -static BOOL ske_CheckHasAlfaChannel(BYTE *from, int widthByte, int height) +static BOOL ske_CheckHasAlfaChannel(uint8_t *from, int widthByte, int height) { DWORD *pt = (DWORD*)from; for (int j = 0; j < height; j++) { - BYTE *add = (BYTE*)pt + widthByte; + uint8_t *add = (uint8_t*)pt + widthByte; while (pt < (DWORD*)add) { if ((*pt & 0xFF000000) != 0) return TRUE; @@ -3471,7 +3471,7 @@ static BOOL ske_CheckHasAlfaChannel(BYTE *from, int widthByte, int height) * ske_CheckIconHasMask - checks if mask image has at least one that is not a 0. * Not sure is ir required or not */ -static BOOL ske_CheckIconHasMask(BYTE *from) +static BOOL ske_CheckIconHasMask(uint8_t *from) { for (int i = 0; i < 16 * 16 / 8; i++) if (from[i] != 0) @@ -3483,7 +3483,7 @@ static BOOL ske_CheckIconHasMask(BYTE *from) /* * ske_GetMaskBit - return value of apropriate mask bit in line at x position */ -static BOOL ske_GetMaskBit(BYTE *line, int x) +static BOOL ske_GetMaskBit(uint8_t *line, int x) { return ((*(line + (x >> 3)))&(0x01 << (7 - (x & 0x07)))) != 0; } @@ -3493,19 +3493,19 @@ static BOOL ske_GetMaskBit(BYTE *line, int x) * X2 - overlaying points. */ -static DWORD ske_Blend(DWORD X1, DWORD X2, BYTE alpha) +static DWORD ske_Blend(DWORD X1, DWORD X2, uint8_t alpha) { - BYTE a1 = (BYTE)(X1 >> 24); - BYTE a2 = (BYTE)(((X2 >> 24)*alpha) >> 8); - BYTE r1 = (BYTE)(X1 >> 16); - BYTE r2 = (BYTE)(X2 >> 16); - BYTE g1 = (BYTE)(X1 >> 8); - BYTE g2 = (BYTE)(X2 >> 8); - BYTE b1 = (BYTE)(X1); - BYTE b2 = (BYTE)(X2); + uint8_t a1 = (uint8_t)(X1 >> 24); + uint8_t a2 = (uint8_t)(((X2 >> 24)*alpha) >> 8); + uint8_t r1 = (uint8_t)(X1 >> 16); + uint8_t r2 = (uint8_t)(X2 >> 16); + uint8_t g1 = (uint8_t)(X1 >> 8); + uint8_t g2 = (uint8_t)(X2 >> 8); + uint8_t b1 = (uint8_t)(X1); + uint8_t b2 = (uint8_t)(X2); - BYTE a_1 = ~a1; - BYTE a_2 = ~a2; + uint8_t a_1 = ~a1; + uint8_t a_2 = ~a2; WORD am = (WORD)a1*a_2; /* it is possible to use >>8 instead of /255 but it is require additional @@ -3531,7 +3531,7 @@ static DWORD ske_Blend(DWORD X1, DWORD X2, BYTE alpha) * CreateJoinedIcon - creates new icon by drawing hTop over hBottom. */ -HICON ske_CreateJoinedIcon(HICON hBottom, HICON hTop, BYTE alpha) +HICON ske_CreateJoinedIcon(HICON hBottom, HICON hTop, uint8_t alpha) { ICONINFO iNew = { 0 }; ICONINFO iciBottom = { 0 }; @@ -3545,7 +3545,7 @@ HICON ske_CreateJoinedIcon(HICON hBottom, HICON hTop, BYTE alpha) HDC tempDC = CreateCompatibleDC(nullptr); - BYTE *ptPixels; + uint8_t *ptPixels; HBITMAP nImage = ske_CreateDIB32Point(16, 16, (void**)&ptPixels); HBITMAP oImage = (HBITMAP)SelectObject(tempDC, nImage); @@ -3558,37 +3558,37 @@ HICON ske_CreateJoinedIcon(HICON hBottom, HICON hTop, BYTE alpha) GetObject(iciTop.hbmMask, sizeof(BITMAP), &bmp_top_mask); if (bmp_bottom.bmBitsPixel == 32 && bmp_top.bmBitsPixel == 32) { - BYTE *BottomBuffer, *TopBuffer, *BottomMaskBuffer, *TopMaskBuffer; - BYTE *bb, *tb, *bmb, *tmb; - BYTE *db = ptPixels; + uint8_t *BottomBuffer, *TopBuffer, *BottomMaskBuffer, *TopMaskBuffer; + uint8_t *bb, *tb, *bmb, *tmb; + uint8_t *db = ptPixels; int vstep_d = 16 * 4; int vstep_b = bmp_bottom.bmWidthBytes; int vstep_t = bmp_top.bmWidthBytes; int vstep_bm = bmp_bottom_mask.bmWidthBytes; int vstep_tm = bmp_top_mask.bmWidthBytes; alpha = alpha ? alpha : 255; - if (bmp_bottom.bmBits) bb = BottomBuffer = (BYTE*)bmp_bottom.bmBits; + if (bmp_bottom.bmBits) bb = BottomBuffer = (uint8_t*)bmp_bottom.bmBits; else { - BottomBuffer = (BYTE*)mir_alloc(bmp_bottom.bmHeight*bmp_bottom.bmWidthBytes); + BottomBuffer = (uint8_t*)mir_alloc(bmp_bottom.bmHeight*bmp_bottom.bmWidthBytes); GetBitmapBits(iciBottom.hbmColor, bmp_bottom.bmHeight*bmp_bottom.bmWidthBytes, BottomBuffer); bb = BottomBuffer + vstep_b*(bmp_bottom.bmHeight - 1); vstep_b = -vstep_b; } - if (bmp_top.bmBits) tb = TopBuffer = (BYTE*)bmp_top.bmBits; + if (bmp_top.bmBits) tb = TopBuffer = (uint8_t*)bmp_top.bmBits; else { - TopBuffer = (BYTE*)mir_alloc(bmp_top.bmHeight*bmp_top.bmWidthBytes); + TopBuffer = (uint8_t*)mir_alloc(bmp_top.bmHeight*bmp_top.bmWidthBytes); GetBitmapBits(iciTop.hbmColor, bmp_top.bmHeight*bmp_top.bmWidthBytes, TopBuffer); tb = TopBuffer + vstep_t*(bmp_top.bmHeight - 1); vstep_t = -vstep_t; } if (bmp_bottom_mask.bmBits) { - BottomMaskBuffer = (BYTE*)bmp_bottom_mask.bmBits; + BottomMaskBuffer = (uint8_t*)bmp_bottom_mask.bmBits; bmb = BottomMaskBuffer; } else { - BottomMaskBuffer = (BYTE*)mir_alloc(bmp_bottom_mask.bmHeight*bmp_bottom_mask.bmWidthBytes); + BottomMaskBuffer = (uint8_t*)mir_alloc(bmp_bottom_mask.bmHeight*bmp_bottom_mask.bmWidthBytes); GetBitmapBits(iciBottom.hbmMask, bmp_bottom_mask.bmHeight*bmp_bottom_mask.bmWidthBytes, BottomMaskBuffer); bmb = BottomMaskBuffer + vstep_bm*(bmp_bottom_mask.bmHeight - 1); vstep_bm = -vstep_bm; @@ -3596,11 +3596,11 @@ HICON ske_CreateJoinedIcon(HICON hBottom, HICON hTop, BYTE alpha) } if (bmp_top_mask.bmBits) { - TopMaskBuffer = (BYTE*)bmp_top_mask.bmBits; + TopMaskBuffer = (uint8_t*)bmp_top_mask.bmBits; tmb = TopMaskBuffer; } else { - TopMaskBuffer = (BYTE*)mir_alloc(bmp_top_mask.bmHeight*bmp_top_mask.bmWidthBytes); + TopMaskBuffer = (uint8_t*)mir_alloc(bmp_top_mask.bmHeight*bmp_top_mask.bmWidthBytes); GetBitmapBits(iciTop.hbmMask, bmp_top_mask.bmHeight*bmp_top_mask.bmWidthBytes, TopMaskBuffer); tmb = TopMaskBuffer + vstep_tm*(bmp_top_mask.bmHeight - 1); vstep_tm = -vstep_tm; @@ -3651,7 +3651,7 @@ HICON ske_CreateJoinedIcon(HICON hBottom, HICON hTop, BYTE alpha) SelectObject(tempDC, oImage); DeleteDC(tempDC); - BYTE p[32] = { 0 }; + uint8_t p[32] = { 0 }; HBITMAP nMask = CreateBitmap(16, 16, 1, 1, (void*)&p); { HDC tempDC2 = CreateCompatibleDC(nullptr); @@ -3703,13 +3703,13 @@ BOOL SkinDBGetContactSetting(MCONTACT hContact, const char *szSection, const cha return db_get(hContact, szSection, szKey, retdbv); } -BYTE SkinDBGetContactSettingByte(MCONTACT hContact, const char *szSection, const char *szKey, BYTE bDefault) +uint8_t SkinDBGetContactSettingByte(MCONTACT hContact, const char *szSection, const char *szKey, uint8_t bDefault) { DBVARIANT dbv = { 0 }; BOOL bSkinned = FALSE; if (!SkinDBGetContactSetting(hContact, szSection, szKey, &dbv, &bSkinned)) { if (dbv.type == DBVT_BYTE) { - BYTE retVal = dbv.bVal; + uint8_t retVal = dbv.bVal; db_free(&dbv); return retVal; } diff --git a/plugins/Clist_modern/src/modern_skinengine.h b/plugins/Clist_modern/src/modern_skinengine.h index d59f64f680..d9f3cf440e 100644 --- a/plugins/Clist_modern/src/modern_skinengine.h +++ b/plugins/Clist_modern/src/modern_skinengine.h @@ -4,7 +4,7 @@ #define ske_H_INC
/* Definitions */
-#define GetAValue(argb)((BYTE)((argb)>>24))
+#define GetAValue(argb)((uint8_t)((argb)>>24))
#define DEFAULTSKINSECTION "ModernSkin"
@@ -32,7 +32,7 @@ struct GLYPHIMAGE wchar_t *szFileName;
DWORD dwLoadedTimes;
HBITMAP hGlyph;
- BYTE isSemiTransp;
+ uint8_t isSemiTransp;
};
typedef GLYPHIMAGE *LPGLYPHIMAGE;
@@ -44,15 +44,15 @@ struct CURRWNDIMAGEDATA HDC hScreenDC;
HBITMAP hImageDIB, hImageOld;
HBITMAP hBackDIB, hBackOld;
- BYTE * hImageDIBByte;
- BYTE * hBackDIBByte;
+ uint8_t * hImageDIBByte;
+ uint8_t * hBackDIBByte;
int Width, Height;
};
struct EFFECTSSTACKITEM
{
HDC hdc;
- BYTE EffectID;
+ uint8_t EffectID;
DWORD FirstColor;
DWORD SecondColor;
};
@@ -69,8 +69,8 @@ public: typedef HRESULT(*ParserCallback_t)(const char *szSection, const char *szKey, const char *szValue, IniParser *This);
- IniParser(wchar_t *szFileName, BYTE flags = FLAG_WITH_SETTINGS);
- IniParser(HINSTANCE hInst, const char *resourceName, const char *resourceType, BYTE flags = FLAG_ONLY_OBJECTS);
+ IniParser(wchar_t *szFileName, uint8_t flags = FLAG_WITH_SETTINGS);
+ IniParser(HINSTANCE hInst, const char *resourceName, const char *resourceType, uint8_t flags = FLAG_ONLY_OBJECTS);
~IniParser();
bool CheckOK() { return _isValid; }
@@ -105,7 +105,7 @@ private: DWORD _dwSizeOfRes;
char* _pPosition;
- BYTE _Flags;
+ uint8_t _Flags;
};
diff --git a/plugins/Clist_modern/src/modern_skinselector.cpp b/plugins/Clist_modern/src/modern_skinselector.cpp index cea33b7f92..bd96db90e3 100644 --- a/plugins/Clist_modern/src/modern_skinselector.cpp +++ b/plugins/Clist_modern/src/modern_skinselector.cpp @@ -232,7 +232,7 @@ static int ParseToModernMask(MODERNMASK *mm, char *szText) if (!mm || !szText) return -1;
unsigned int textLen = (unsigned)mir_strlen(szText);
- BYTE curParam = 0;
+ uint8_t curParam = 0;
unsigned int startPos = 0;
char *pszParam;
@@ -278,7 +278,7 @@ static BOOL CompareModernMask(MODERNMASK *mmValue, MODERNMASK *mmTemplate) {
//TODO
BOOL res = TRUE;
- BYTE pVal = 0, pTemp = 0;
+ uint8_t pVal = 0, pTemp = 0;
while (pTemp < mmTemplate->dwParamCnt && pVal < mmValue->dwParamCnt) {
// find pTemp parameter in mValue
DWORD vh, ph;
@@ -363,7 +363,7 @@ SKINOBJECTDESCRIPTOR* skin_FindObjectByRequest(char *szValue, LISTMODERNMASK *mm return res;
}
-wchar_t* GetParamNT(char *string, wchar_t *buf, int buflen, BYTE paramN, char Delim, BOOL SkipSpaces)
+wchar_t* GetParamNT(char *string, wchar_t *buf, int buflen, uint8_t paramN, char Delim, BOOL SkipSpaces)
{
char *ansibuf = (char*)mir_alloc(buflen / sizeof(wchar_t));
GetParamN(string, ansibuf, buflen / sizeof(wchar_t), paramN, Delim, SkipSpaces);
@@ -372,7 +372,7 @@ wchar_t* GetParamNT(char *string, wchar_t *buf, int buflen, BYTE paramN, char De return buf;
}
-wchar_t* GetParamN(wchar_t *string, wchar_t *buf, int buflen, BYTE paramN, wchar_t Delim, BOOL SkipSpaces)
+wchar_t* GetParamN(wchar_t *string, wchar_t *buf, int buflen, uint8_t paramN, wchar_t Delim, BOOL SkipSpaces)
{
size_t i = 0, start = 0, CurentCount = 0, len;
while (i < mir_wstrlen(string)) {
@@ -398,7 +398,7 @@ wchar_t* GetParamN(wchar_t *string, wchar_t *buf, int buflen, BYTE paramN, wchar return buf;
}
-char* GetParamN(char *string, char *buf, int buflen, BYTE paramN, char Delim, BOOL SkipSpaces)
+char* GetParamN(char *string, char *buf, int buflen, uint8_t paramN, char Delim, BOOL SkipSpaces)
{
size_t i = 0, start = 0, CurentCount = 0, len;
while (i < mir_strlen(string)) {
diff --git a/plugins/Clist_modern/src/modern_skinselector.h b/plugins/Clist_modern/src/modern_skinselector.h index a7106a63e6..9567f95870 100644 --- a/plugins/Clist_modern/src/modern_skinselector.h +++ b/plugins/Clist_modern/src/modern_skinselector.h @@ -36,7 +36,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. struct MASKPARAM
{
DWORD dwId;
- BYTE bMaskParamFlag;
+ uint8_t bMaskParamFlag;
char* szName;
DWORD dwValueHash;
char* szValue;
@@ -71,6 +71,6 @@ DWORD mod_CalcHash(const char *a); int RegisterObjectByParce(char *ObjectName, char *Params);
SKINOBJECTDESCRIPTOR* skin_FindObjectByRequest(char *szValue, LISTMODERNMASK *mmTemplateList);
SKINOBJECTDESCRIPTOR* skin_FindObjectByMask(MODERNMASK *mm, LISTMODERNMASK *mmTemplateList);
-wchar_t * GetParamNT(char *string, wchar_t *buf, int buflen, BYTE paramN, char Delim, BOOL SkipSpaces);
+wchar_t * GetParamNT(char *string, wchar_t *buf, int buflen, uint8_t paramN, char Delim, BOOL SkipSpaces);
int SkinDrawGlyphMask(HDC hdc, RECT *rcSize, RECT *rcClip, MODERNMASK *ModernMask);
#endif
diff --git a/plugins/Clist_modern/src/modern_static_clui.h b/plugins/Clist_modern/src/modern_static_clui.h index c3bae487c0..725f8746bd 100644 --- a/plugins/Clist_modern/src/modern_static_clui.h +++ b/plugins/Clist_modern/src/modern_static_clui.h @@ -69,7 +69,7 @@ int EventArea_Create(HWND hCluiWnd); int ExtraImage_ExtraIDToColumnNum(int extra); int ModernSkinButtonLoadModule(); -int ModernSkinButton_ReposButtons(HWND parent, BYTE draw, RECT *r); +int ModernSkinButton_ReposButtons(HWND parent, uint8_t draw, RECT *r); void ske_ApplyTranslucency(); HBITMAP ske_CreateDIB32(int cx, int cy); @@ -88,7 +88,7 @@ int UnhookAll(); int CLUI_IsInMainWindow(HWND hwnd); int CLUI_SizingOnBorder(POINT pt, int size); -int CLUI_SmoothAlphaTransition(HWND hwnd, BYTE GoalAlpha, BOOL wParam); +int CLUI_SmoothAlphaTransition(HWND hwnd, uint8_t GoalAlpha, BOOL wParam); int CLUI_TestCursorOnBorders(); static int CLUI_SmoothAlphaThreadTransition(); diff --git a/plugins/Clist_modern/src/modern_statusbar.cpp b/plugins/Clist_modern/src/modern_statusbar.cpp index fb968fb775..1f28b12e89 100644 --- a/plugins/Clist_modern/src/modern_statusbar.cpp +++ b/plugins/Clist_modern/src/modern_statusbar.cpp @@ -35,7 +35,7 @@ struct ProtoItemData : public MZeroedObject int fullWidth;
RECT protoRect;
- BYTE xStatusMode; // 0-only main, 1-xStatus, 2-main as overlay
+ uint8_t xStatusMode; // 0-only main, 1-xStatus, 2-main as overlay
bool bDoubleIcons;
bool bShowProtoIcon;
bool bShowProtoName;
@@ -72,7 +72,7 @@ int LoadStatusBarData() g_StatusBarData.rectBorders.right = db_get_dw(0, "CLUI", "RightOffset", SETTING_RIGHTOFFSET_DEFAULT);
g_StatusBarData.rectBorders.top = db_get_dw(0, "CLUI", "TopOffset", SETTING_TOPOFFSET_DEFAULT);
g_StatusBarData.rectBorders.bottom = db_get_dw(0, "CLUI", "BottomOffset", SETTING_BOTTOMOFFSET_DEFAULT);
- g_StatusBarData.extraspace = (BYTE)db_get_dw(0, "CLUI", "SpaceBetween", SETTING_SPACEBETWEEN_DEFAULT);
+ g_StatusBarData.extraspace = (uint8_t)db_get_dw(0, "CLUI", "SpaceBetween", SETTING_SPACEBETWEEN_DEFAULT);
if (g_StatusBarData.BarFont) {
DeleteObject(g_StatusBarData.BarFont);
@@ -188,7 +188,7 @@ int ModernDrawStatusBarWorker(HWND hWnd, HDC hDC) mir_snprintf(buf, "SBarShow_%s", szProto);
- BYTE showOps = db_get_b(0, "CLUI", buf, SETTING_SBARSHOW_DEFAULT);
+ uint8_t showOps = db_get_b(0, "CLUI", buf, SETTING_SBARSHOW_DEFAULT);
p = new ProtoItemData;
p->bShowProtoIcon = (showOps & 1) != 0;
p->bShowProtoName = (showOps & 2) != 0;
@@ -653,7 +653,7 @@ LRESULT CALLBACK ModernStatusProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa if (ID) {
int res = CallService(MS_CLIST_FRAMES_GETFRAMEOPTIONS, MAKEWPARAM(FO_FLAGS, ID), 0);
if (res >= 0)
- db_set_b(0, "CLUI", "ShowSBar", (BYTE)(wParam/*(res&F_VISIBLE)*/ ? 1 : 0));
+ db_set_b(0, "CLUI", "ShowSBar", (uint8_t)(wParam/*(res&F_VISIBLE)*/ ? 1 : 0));
}
}
break;
diff --git a/plugins/Clist_modern/src/modern_statusbar.h b/plugins/Clist_modern/src/modern_statusbar.h index 5687c10c5b..4c164a4b09 100644 --- a/plugins/Clist_modern/src/modern_statusbar.h +++ b/plugins/Clist_modern/src/modern_statusbar.h @@ -12,20 +12,20 @@ typedef struct tagSTATUSBARDATA {
BOOL sameWidth;
RECT rectBorders;
- BYTE extraspace;
- BYTE Align;
- BYTE VAlign;
+ uint8_t extraspace;
+ uint8_t Align;
+ uint8_t VAlign;
bool bShowProtoIcon;
bool bShowProtoName;
bool bShowStatusName;
bool bConnectingIcon;
HFONT BarFont;
DWORD fontColor;
- BYTE TextEffectID;
+ uint8_t TextEffectID;
DWORD TextEffectColor1;
DWORD TextEffectColor2;
- BYTE xStatusMode; // 0-only main, 1-xStatus, 2-main as overlay
- BYTE nProtosPerLine;
+ uint8_t xStatusMode; // 0-only main, 1-xStatus, 2-main as overlay
+ uint8_t nProtosPerLine;
bool bShowProtoEmails;
HBITMAP hBmpBackground;
@@ -36,7 +36,7 @@ typedef struct tagSTATUSBARDATA XPTHANDLE hTheme;
BOOL perProtoConfig;
- BYTE SBarRightClk;
+ uint8_t SBarRightClk;
} STATUSBARDATA;
diff --git a/plugins/Clist_modern/src/modern_statusbar_options.cpp b/plugins/Clist_modern/src/modern_statusbar_options.cpp index d096236e6a..3513df1b6d 100644 --- a/plugins/Clist_modern/src/modern_statusbar_options.cpp +++ b/plugins/Clist_modern/src/modern_statusbar_options.cpp @@ -29,11 +29,11 @@ typedef struct _StatusBarProtocolOptions char *szName;
BOOL AccountIsCustomized;
BOOL HideAccount;
- BYTE SBarShow;
- BYTE SBarRightClk;
- BYTE UseConnectingIcon;
- BYTE ShowUnreadEmails;
- BYTE ShowXStatus;
+ uint8_t SBarShow;
+ uint8_t SBarRightClk;
+ uint8_t UseConnectingIcon;
+ uint8_t ShowUnreadEmails;
+ uint8_t ShowXStatus;
int PaddingLeft;
int PaddingRight;
} StatusBarProtocolOptions;
@@ -52,7 +52,7 @@ static void UpdateXStatusIconOptions(HWND hwndDlg, StatusBarProtocolOptions &dat EnableWindow(GetDlgItem(hwndDlg, IDC_TRANSPARENTOVERLAY), en && IsDlgButtonChecked(hwndDlg, IDC_SHOWXSTATUS) && IsDlgButtonChecked(hwndDlg, IDC_SHOWNORMAL) && BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_SHOWBOTH));
- BYTE val = 0;
+ uint8_t val = 0;
if (IsDlgButtonChecked(hwndDlg, IDC_SHOWXSTATUS)) {
if (IsDlgButtonChecked(hwndDlg, IDC_SHOWBOTH)) val = 3;
else if (IsDlgButtonChecked(hwndDlg, IDC_SHOWNORMAL)) val = 2;
@@ -89,7 +89,7 @@ static void UpdateStatusBarOptionsDisplay(HWND hwndDlg) CheckDlgButton(hwndDlg, IDC_SHOWUNREADEMAIL, (sbpo.ShowUnreadEmails == 1) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_TRANSPARENTOVERLAY, (sbpo.ShowXStatus & 4) ? BST_CHECKED : BST_UNCHECKED);
{
- BYTE showOpts = sbpo.SBarShow;
+ uint8_t showOpts = sbpo.SBarShow;
CheckDlgButton(hwndDlg, IDC_SHOWICON, showOpts & 1 ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_SHOWPROTO, showOpts & 2 ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_SHOWSTATUS, showOpts & 4 ? BST_CHECKED : BST_UNCHECKED);
@@ -397,19 +397,19 @@ INT_PTR CALLBACK DlgProcSBarOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l char settingBuf[256];
mir_snprintf(settingBuf, "SBarAccountIsCustom_%s", sbpo->szName);
- db_set_b(0, "CLUI", settingBuf, (BYTE)sbpo->AccountIsCustomized);
+ db_set_b(0, "CLUI", settingBuf, (uint8_t)sbpo->AccountIsCustomized);
mir_snprintf(settingBuf, "HideAccount_%s", sbpo->szName);
- db_set_b(0, "CLUI", settingBuf, (BYTE)sbpo->HideAccount);
+ db_set_b(0, "CLUI", settingBuf, (uint8_t)sbpo->HideAccount);
mir_snprintf(settingBuf, "SBarShow_%s", sbpo->szName);
- db_set_b(0, "CLUI", settingBuf, (BYTE)sbpo->SBarShow);
+ db_set_b(0, "CLUI", settingBuf, (uint8_t)sbpo->SBarShow);
mir_snprintf(settingBuf, "SBarRightClk_%s", sbpo->szName);
- db_set_b(0, "CLUI", settingBuf, (BYTE)sbpo->SBarRightClk);
+ db_set_b(0, "CLUI", settingBuf, (uint8_t)sbpo->SBarRightClk);
mir_snprintf(settingBuf, "UseConnectingIcon_%s", sbpo->szName);
- db_set_b(0, "CLUI", settingBuf, (BYTE)sbpo->UseConnectingIcon);
+ db_set_b(0, "CLUI", settingBuf, (uint8_t)sbpo->UseConnectingIcon);
mir_snprintf(settingBuf, "ShowUnreadEmails_%s", sbpo->szName);
- db_set_b(0, "CLUI", settingBuf, (BYTE)sbpo->ShowUnreadEmails);
+ db_set_b(0, "CLUI", settingBuf, (uint8_t)sbpo->ShowUnreadEmails);
mir_snprintf(settingBuf, "ShowXStatus_%s", sbpo->szName);
db_set_b(0, "CLUI", settingBuf, sbpo->ShowXStatus);
mir_snprintf(settingBuf, "PaddingLeft_%s", sbpo->szName);
@@ -418,25 +418,25 @@ INT_PTR CALLBACK DlgProcSBarOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l db_set_dw(0, "CLUI", settingBuf, sbpo->PaddingRight);
}
- db_set_b(0, "CLUI", "SBarShow", (BYTE)_GlobalOptions.SBarShow);
- db_set_b(0, "CLUI", "SBarRightClk", (BYTE)_GlobalOptions.SBarRightClk);
- db_set_b(0, "CLUI", "UseConnectingIcon", (BYTE)_GlobalOptions.UseConnectingIcon);
- db_set_b(0, "CLUI", "ShowUnreadEmails", (BYTE)_GlobalOptions.ShowUnreadEmails);
+ db_set_b(0, "CLUI", "SBarShow", (uint8_t)_GlobalOptions.SBarShow);
+ db_set_b(0, "CLUI", "SBarRightClk", (uint8_t)_GlobalOptions.SBarRightClk);
+ db_set_b(0, "CLUI", "UseConnectingIcon", (uint8_t)_GlobalOptions.UseConnectingIcon);
+ db_set_b(0, "CLUI", "ShowUnreadEmails", (uint8_t)_GlobalOptions.ShowUnreadEmails);
db_set_b(0, "CLUI", "ShowXStatus", _GlobalOptions.ShowXStatus);
db_set_dw(0, "CLUI", "PaddingLeft", _GlobalOptions.PaddingLeft);
db_set_dw(0, "CLUI", "PaddingRight", _GlobalOptions.PaddingRight);
- db_set_b(0, "CLUI", "StatusBarProtosPerLine", (BYTE)SendDlgItemMessage(hwndDlg, IDC_MULTI_SPIN, UDM_GETPOS, 0, 0));
- db_set_b(0, "CLUI", "EqualSections", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_EQUALSECTIONS));
- db_set_b(0, "CLUI", "Align", (BYTE)SendDlgItemMessage(hwndDlg, IDC_SBAR_HORIZ_ALIGN, CB_GETCURSEL, 0, 0));
- db_set_b(0, "CLUI", "VAlign", (BYTE)SendDlgItemMessage(hwndDlg, IDC_SBAR_VERT_ALIGN, CB_GETCURSEL, 0, 0));
+ db_set_b(0, "CLUI", "StatusBarProtosPerLine", (uint8_t)SendDlgItemMessage(hwndDlg, IDC_MULTI_SPIN, UDM_GETPOS, 0, 0));
+ db_set_b(0, "CLUI", "EqualSections", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_EQUALSECTIONS));
+ db_set_b(0, "CLUI", "Align", (uint8_t)SendDlgItemMessage(hwndDlg, IDC_SBAR_HORIZ_ALIGN, CB_GETCURSEL, 0, 0));
+ db_set_b(0, "CLUI", "VAlign", (uint8_t)SendDlgItemMessage(hwndDlg, IDC_SBAR_VERT_ALIGN, CB_GETCURSEL, 0, 0));
db_set_dw(0, "CLUI", "LeftOffset", (DWORD)SendDlgItemMessage(hwndDlg, IDC_OFFSETSPIN, UDM_GETPOS, 0, 0));
db_set_dw(0, "CLUI", "RightOffset", (DWORD)SendDlgItemMessage(hwndDlg, IDC_OFFSETSPIN2, UDM_GETPOS, 0, 0));
db_set_dw(0, "CLUI", "TopOffset", (DWORD)SendDlgItemMessage(hwndDlg, IDC_SBAR_BORDER_TOP_SPIN, UDM_GETPOS, 0, 0));
db_set_dw(0, "CLUI", "BottomOffset", (DWORD)SendDlgItemMessage(hwndDlg, IDC_SBAR_BORDER_BOTTOM_SPIN, UDM_GETPOS, 0, 0));
db_set_dw(0, "CLUI", "SpaceBetween", (DWORD)SendDlgItemMessage(hwndDlg, IDC_OFFSETSPIN3, UDM_GETPOS, 0, 0));
- db_set_b(0, "CLUI", "ShowSBar", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOWSBAR));
+ db_set_b(0, "CLUI", "ShowSBar", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_SHOWSBAR));
LoadStatusBarData();
cliCluiProtocolStatusChanged(0, nullptr);
diff --git a/plugins/Clist_modern/src/modern_toolbar.cpp b/plugins/Clist_modern/src/modern_toolbar.cpp index 62d18be1a6..e4b935d374 100644 --- a/plugins/Clist_modern/src/modern_toolbar.cpp +++ b/plugins/Clist_modern/src/modern_toolbar.cpp @@ -327,7 +327,7 @@ static int Toolbar_ModulesLoaded(WPARAM, LPARAM) TopToolbar_SetCustomProc(CustomizeButton, 0);
- BYTE bOldSetting = 0;
+ uint8_t bOldSetting = 0;
if (!db_get_b(0, "Compatibility", "TTB_Upgrade", 0)) {
if (bOldSetting = db_get_b(0, "CLUI", "ShowButtonBar", 1)) {
CopySettings("BUTTWIDTH", "option_Bar0_BtnWidth", 20);
diff --git a/plugins/Clist_modern/src/modern_viewmodebar.cpp b/plugins/Clist_modern/src/modern_viewmodebar.cpp index a9bcc83f1d..61b12e346a 100644 --- a/plugins/Clist_modern/src/modern_viewmodebar.cpp +++ b/plugins/Clist_modern/src/modern_viewmodebar.cpp @@ -157,7 +157,7 @@ class CViewModeSetupDlg : public CDlgBase static int __cdecl FillModes(const char *szsetting, void *param)
{
- if (BYTE(szsetting[0]) == 246)
+ if (uint8_t(szsetting[0]) == 246)
return 1;
if (szsetting[0] == 13)
return 1;
@@ -557,7 +557,7 @@ class CViewModeSetupDlg : public CDlgBase DWORD lmdat = db_get_dw(0, CLVM_MODULE, szSetting, 0);
SetDlgItemInt(m_hwnd, IDC_LASTMSGVALUE, LOWORD(lmdat), FALSE);
- BYTE bTmp = LOBYTE(HIWORD(lmdat));
+ uint8_t bTmp = LOBYTE(HIWORD(lmdat));
SendDlgItemMessage(m_hwnd, IDC_LASTMESSAGEOP, CB_SETCURSEL, bTmp, 0);
bTmp = HIBYTE(HIWORD(lmdat));
SendDlgItemMessage(m_hwnd, IDC_LASTMESSAGEUNIT, CB_SETCURSEL, bTmp, 0);
@@ -847,7 +847,7 @@ static int menuCounter = 0; static int FillMenuCallback(char *szSetting)
{
- if (BYTE(szSetting[0]) == 246)
+ if (uint8_t(szSetting[0]) == 246)
return 1;
if (szSetting[0] == 13)
return 1;
@@ -1219,18 +1219,18 @@ void ApplyViewMode(const char *szName) mir_snprintf(szSetting, "%c_LastMode", 246);
db_unset(0, CLVM_MODULE, szSetting);
- if (g_CluiData.bOldUseGroups != (BYTE)-1)
+ if (g_CluiData.bOldUseGroups != (uint8_t)-1)
CallService(MS_CLIST_SETUSEGROUPS, (WPARAM)g_CluiData.bOldUseGroups, 0);
Clist_Broadcast(CLM_AUTOREBUILD, 0, 0);
KillTimer(g_hwndViewModeFrame, TIMERID_VIEWMODEEXPIRE);
- if (g_CluiData.boldHideOffline != (BYTE)-1)
+ if (g_CluiData.boldHideOffline != (uint8_t)-1)
g_clistApi.pfnSetHideOffline(g_CluiData.boldHideOffline);
- if (g_CluiData.bOldUseGroups != (BYTE)-1)
+ if (g_CluiData.bOldUseGroups != (uint8_t)-1)
CallService(MS_CLIST_SETUSEGROUPS, (WPARAM)g_CluiData.bOldUseGroups, 0);
- g_CluiData.boldHideOffline = (BYTE)-1;
- g_CluiData.bOldUseGroups = (BYTE)-1;
+ g_CluiData.boldHideOffline = (uint8_t)-1;
+ g_CluiData.bOldUseGroups = (uint8_t)-1;
g_CluiData.current_viewmode[0] = 0;
g_CluiData.old_viewmode[0] = 0;
@@ -1306,12 +1306,12 @@ void ApplyViewMode(const char *szName) g_CluiData.bFilterEffective |= CLVM_STICKY_CONTACTS;
if (g_CluiData.bFilterEffective & CLVM_FILTER_STATUS) {
- if (g_CluiData.boldHideOffline == (BYTE)-1)
+ if (g_CluiData.boldHideOffline == (uint8_t)-1)
g_CluiData.boldHideOffline = Clist::HideOffline;
g_clistApi.pfnSetHideOffline(false);
}
- else if (g_CluiData.boldHideOffline != (BYTE)-1) {
+ else if (g_CluiData.boldHideOffline != (uint8_t)-1) {
g_clistApi.pfnSetHideOffline(g_CluiData.boldHideOffline);
g_CluiData.boldHideOffline = -1;
}
@@ -1323,12 +1323,12 @@ void ApplyViewMode(const char *szName) bUseGroups = 0;
if (bUseGroups != -1) {
- if (g_CluiData.bOldUseGroups == (BYTE)-1)
+ if (g_CluiData.bOldUseGroups == (uint8_t)-1)
g_CluiData.bOldUseGroups = Clist::UseGroups;
CallService(MS_CLIST_SETUSEGROUPS, bUseGroups, 0);
}
- else if (g_CluiData.bOldUseGroups != (BYTE)-1) {
+ else if (g_CluiData.bOldUseGroups != (uint8_t)-1) {
CallService(MS_CLIST_SETUSEGROUPS, g_CluiData.bOldUseGroups, 0);
g_CluiData.bOldUseGroups = -1;
}
diff --git a/plugins/Clist_modern/src/stdafx.h b/plugins/Clist_modern/src/stdafx.h index a9b2e1fb57..db6d97c5e1 100644 --- a/plugins/Clist_modern/src/stdafx.h +++ b/plugins/Clist_modern/src/stdafx.h @@ -241,7 +241,7 @@ int AniAva_UnloadModule(); int AniAva_UpdateOptions(); //reload options, //hot enable/disable engine
int AniAva_AddAvatar(MCONTACT hContact, wchar_t * szFilename, int width, int heigth); // adds avatars to be displayed
-int AniAva_SetAvatarPos(MCONTACT hContact, RECT *rc, int overlayIdx, BYTE bAlpha); // update avatars pos
+int AniAva_SetAvatarPos(MCONTACT hContact, RECT *rc, int overlayIdx, uint8_t bAlpha); // update avatars pos
int AniAva_InvalidateAvatarPositions(MCONTACT hContact); // reset positions of avatars to be drawn (still be painted at same place)
int AniAva_RemoveInvalidatedAvatars(); // all avatars without validated position will be stop painted and probably removed
int AniAva_RemoveAvatar(MCONTACT hContact); // remove avatar
diff --git a/plugins/Clist_nicer/src/Docking.cpp b/plugins/Clist_nicer/src/Docking.cpp index a4fedaf825..f3013e837d 100644 --- a/plugins/Clist_nicer/src/Docking.cpp +++ b/plugins/Clist_nicer/src/Docking.cpp @@ -97,7 +97,7 @@ int Docking_ProcessWindowMessage(WPARAM wParam, LPARAM lParam) MSG *msg = (MSG *)wParam;
if (msg->message == WM_DESTROY)
- g_plugin.setByte("Docked", (BYTE)docked);
+ g_plugin.setByte("Docked", (uint8_t)docked);
if (!docked && msg->message != WM_CREATE && msg->message != WM_MOVING && msg->message != WM_CREATEDOCKED && msg->message != WM_MOVE)
return 0;
diff --git a/plugins/Clist_nicer/src/alphablend.cpp b/plugins/Clist_nicer/src/alphablend.cpp index 077016d844..ec805b4794 100644 --- a/plugins/Clist_nicer/src/alphablend.cpp +++ b/plugins/Clist_nicer/src/alphablend.cpp @@ -26,13 +26,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. extern int g_hottrack, g_hottrack_done;
extern BOOL g_inCLCpaint;
-extern BYTE saved_alpha;
+extern uint8_t saved_alpha;
extern DWORD savedCORNER;
extern ImageItem *g_glyphItem;
-BYTE __forceinline percent_to_byte(UINT32 percent)
+uint8_t __forceinline percent_to_byte(UINT32 percent)
{
- return(BYTE)((FLOAT)(((FLOAT)percent) / 100) * 255);
+ return(uint8_t)((FLOAT)(((FLOAT)percent) / 100) * 255);
}
COLORREF __forceinline revcolref(COLORREF colref)
@@ -42,7 +42,7 @@ COLORREF __forceinline revcolref(COLORREF colref) DWORD __forceinline argb_from_cola(COLORREF col, UINT32 alpha)
{
- return((BYTE)percent_to_byte(alpha) << 24 | col);
+ return((uint8_t)percent_to_byte(alpha) << 24 | col);
}
@@ -79,7 +79,7 @@ void __forceinline DrawBorderStyle(HDC hdcwnd, RECT *rc, DWORD BORDERSTYLE) if (hPenOld)
SelectObject(hdcwnd, hPenOld);
}
-void DrawAlpha(HDC hdcwnd, PRECT rc, DWORD basecolor, int alpha, DWORD basecolor2, BOOL transparent, BYTE FLG_GRADIENT, BYTE FLG_CORNER, DWORD BORDERSTYLE, ImageItem *imageItem)
+void DrawAlpha(HDC hdcwnd, PRECT rc, DWORD basecolor, int alpha, DWORD basecolor2, BOOL transparent, uint8_t FLG_GRADIENT, uint8_t FLG_CORNER, DWORD BORDERSTYLE, ImageItem *imageItem)
{
if (rc == nullptr)
return;
@@ -439,7 +439,7 @@ void __inline gradientVertical(UCHAR *ubRedFinal, UCHAR *ubGreenFinal, UCHAR *ub void __fastcall IMG_RenderImageItem(HDC hdc, ImageItem *item, RECT *rc)
{
- BYTE l = item->bLeft, r = item->bRight, t = item->bTop, b = item->bBottom;
+ uint8_t l = item->bLeft, r = item->bRight, t = item->bTop, b = item->bBottom;
LONG width = rc->right - rc->left;
LONG height = rc->bottom - rc->top;
BOOL isGlyph = (item->dwFlags & IMAGE_GLYPH) && g_glyphItem;
diff --git a/plugins/Clist_nicer/src/clc.cpp b/plugins/Clist_nicer/src/clc.cpp index 537f901f65..9d2925add7 100644 --- a/plugins/Clist_nicer/src/clc.cpp +++ b/plugins/Clist_nicer/src/clc.cpp @@ -95,7 +95,7 @@ static int ClcEventAdded(WPARAM hContact, LPARAM lParam) static int ClcMetamodeChanged(WPARAM bMetaEnabled, LPARAM)
{
if (BOOL(bMetaEnabled) != cfg::dat.bMetaEnabled) {
- cfg::dat.bMetaEnabled = (BYTE)bMetaEnabled;
+ cfg::dat.bMetaEnabled = (uint8_t)bMetaEnabled;
Clist_Broadcast(CLM_AUTOREBUILD, 0, 0);
}
return 0;
@@ -274,7 +274,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L case INTM_GROUPCHANGED:
{
WORD iExtraImage[EXTRA_ICON_COUNT];
- BYTE flags = 0;
+ uint8_t flags = 0;
if (!Clist_FindItem(hwnd, dat, wParam, &contact))
memset(iExtraImage, 0xFF, sizeof(iExtraImage));
else {
@@ -547,7 +547,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L if (!dat->bisEmbedded && szProto) { // may be a subcontact, forward the xstatus
MCONTACT hMasterContact = db_mc_tryMeta(hContact);
if (hMasterContact != hContact) // avoid recursive call of settings handler
- db_set_b(hMasterContact, META_PROTO, "XStatusId", (BYTE)db_get_b(hContact, szProto, "XStatusId", 0));
+ db_set_b(hMasterContact, META_PROTO, "XStatusId", (uint8_t)db_get_b(hContact, szProto, "XStatusId", 0));
break;
}
}
diff --git a/plugins/Clist_nicer/src/clc.h b/plugins/Clist_nicer/src/clc.h index 4c6907e305..f838cfea96 100644 --- a/plugins/Clist_nicer/src/clc.h +++ b/plugins/Clist_nicer/src/clc.h @@ -95,9 +95,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /* Extra icons settings */
typedef struct _OrderTreeData
{
- BYTE ID;
+ uint8_t ID;
const wchar_t * Name;
- BYTE Position;
+ uint8_t Position;
BOOL Visible;
BOOL fReserved;
} *PORDERTREEDATA, ORDERTREEDATA;
@@ -106,9 +106,9 @@ struct TExtraCache {
MCONTACT hContact;
HANDLE hTimeZone;
- BYTE valid;
+ uint8_t valid;
wchar_t *statusMsg;
- BYTE bStatusMsgValid;
+ uint8_t bStatusMsgValid;
DWORD dwCFlags;
DWORD dwDFlags; // display flags for caching only
StatusItems_t *status_item, *proto_status_item;
@@ -123,7 +123,7 @@ struct ClcCacheEntry : public ClcCacheEntryBase struct ClcContact : public ClcContactBase
{
BOOL bIsMeta;
- BYTE xStatus;
+ uint8_t xStatus;
int xStatusIcon;
MCONTACT hSubContact;
char *metaProto;
@@ -132,7 +132,7 @@ struct ClcContact : public ClcContactBase int avatarLeft, extraIconRightBegin;
int isRtl;
DWORD cFlags;
- BYTE bSecondLine;
+ uint8_t bSecondLine;
AVATARCACHEENTRY *ace;
TExtraCache *pExtra;
@@ -169,8 +169,8 @@ struct ClcData : public ClcDataBase int currentFontID;
int rightMargin;
- BYTE SelectMode;
- BYTE isMultiSelect;
+ uint8_t SelectMode;
+ uint8_t isMultiSelect;
HWND hwndParent;
DWORD lastSort;
DWORD lastRepaint;
@@ -226,7 +226,7 @@ struct TCluiData { DWORD topOffset, bottomOffset;
int statusBarHeight;
int soundsOff;
- BYTE bAvatarServiceAvail;
+ uint8_t bAvatarServiceAvail;
HICON hIconConnecting;
DWORD winFlags;
DWORD winFlagsEx;
@@ -245,16 +245,16 @@ struct TCluiData { DWORD avatarRadius;
int avatarSize;
BOOL bForceRefetchOnPaint;
- BYTE dualRowMode;
- BYTE avatarPadding;
- BYTE cornerRadius;
- BYTE isTransparent;
- BYTE alpha, autoalpha;
- BYTE fadeinout;
- BYTE autosize;
- BYTE gapBetweenFrames;
- BYTE titleBarHeight;
- BYTE bClipBorder, bRowSpacing;
+ uint8_t dualRowMode;
+ uint8_t avatarPadding;
+ uint8_t cornerRadius;
+ uint8_t isTransparent;
+ uint8_t alpha, autoalpha;
+ uint8_t fadeinout;
+ uint8_t autosize;
+ uint8_t gapBetweenFrames;
+ uint8_t titleBarHeight;
+ uint8_t bClipBorder, bRowSpacing;
HBITMAP bmpBackground, hbmBgOld, hbmBg;
HBITMAP hbmToolbar, hbmToolbarOld;
HDC hdcBg;
@@ -283,7 +283,7 @@ struct TCluiData { char varFilter[2048];
DWORD lastMsgFilter;
char current_viewmode[256], old_viewmode[256];
- BYTE boldHideOffline;
+ uint8_t boldHideOffline;
DWORD statusMaskFilter;
DWORD stickyMaskFilter;
DWORD filterFlags;
@@ -296,17 +296,17 @@ struct TCluiData { BOOL bShowXStatusOnSbar;
BOOL bLayeredHack;
HPEN hPen3DBright, hPen3DDark;
- BYTE bSkinnedButtonMode;
- BYTE bFirstRun;
- BYTE bUseDCMirroring;
- BYTE bCLeft, bCRight, bCTop, bCBottom;
- BYTE fullyInited;
- BYTE bAutoExpandGroups;
+ uint8_t bSkinnedButtonMode;
+ uint8_t bFirstRun;
+ uint8_t bUseDCMirroring;
+ uint8_t bCLeft, bCRight, bCTop, bCBottom;
+ uint8_t fullyInited;
+ uint8_t bAutoExpandGroups;
SIZE szOldCTreeSize;
- BYTE bWantFastGradients, bUseFastGradients;
- BYTE sortOrder[3];
- BYTE bGroupAlign;
- BYTE bSkinnedScrollbar;
+ uint8_t bWantFastGradients, bUseFastGradients;
+ uint8_t sortOrder[3];
+ uint8_t bGroupAlign;
+ uint8_t bSkinnedScrollbar;
DWORD langPackCP;
BOOL fOnDesktop;
int group_padding;
@@ -385,11 +385,11 @@ size_t MY_pathToAbsolute(const wchar_t *pSrc, wchar_t *pOut); int GetDropTargetInformation(HWND hwnd, struct ClcData *dat, POINT pt);
void LoadClcOptions(HWND hwnd, struct ClcData *dat, BOOL bFirst);
-BYTE GetCachedStatusMsg(TExtraCache* p, char *szProto);
+uint8_t GetCachedStatusMsg(TExtraCache* p, char *szProto);
void GetExtendedInfo(ClcContact *contact, struct ClcData *dat);
LRESULT CALLBACK NewStatusBarWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
void HideShowNotifyFrame();
-DWORD GetCLUIWindowStyle(BYTE style);
+DWORD GetCLUIWindowStyle(uint8_t style);
void ApplyCLUIBorderStyle();
int FrameNCCalcSize(HWND hwnd, WNDPROC oldWndProc, WPARAM wParam, LPARAM lParam, BOOL hasTitleBar);
diff --git a/plugins/Clist_nicer/src/clcitems.cpp b/plugins/Clist_nicer/src/clcitems.cpp index 08b1445842..b8c69babfe 100644 --- a/plugins/Clist_nicer/src/clcitems.cpp +++ b/plugins/Clist_nicer/src/clcitems.cpp @@ -152,7 +152,7 @@ void RebuildEntireList(HWND hwnd, struct ClcData *dat) * get it and store it properly formatted in the extra data cache
*/
-BYTE GetCachedStatusMsg(TExtraCache *p, char *szProto)
+uint8_t GetCachedStatusMsg(TExtraCache *p, char *szProto)
{
if (p == nullptr)
return 0;
@@ -346,14 +346,14 @@ void LoadSkinItemToCache(TExtraCache *cEntry) cEntry->status_item->TEXTCOLOR = db_get_dw(hContact, "EXTBK", "TEXT", RGB(20, 20, 20));
cEntry->status_item->COLOR = db_get_dw(hContact, "EXTBK", "COLOR1", RGB(224, 224, 224));
cEntry->status_item->COLOR2 = db_get_dw(hContact, "EXTBK", "COLOR2", RGB(224, 224, 224));
- cEntry->status_item->ALPHA = (BYTE)db_get_b(hContact, "EXTBK", "ALPHA", 100);
+ cEntry->status_item->ALPHA = (uint8_t)db_get_b(hContact, "EXTBK", "ALPHA", 100);
cEntry->status_item->MARGIN_LEFT = (DWORD)db_get_b(hContact, "EXTBK", "LEFT", 0);
cEntry->status_item->MARGIN_RIGHT = (DWORD)db_get_b(hContact, "EXTBK", "RIGHT", 0);
cEntry->status_item->MARGIN_TOP = (DWORD)db_get_b(hContact, "EXTBK", "TOP", 0);
cEntry->status_item->MARGIN_BOTTOM = (DWORD)db_get_b(hContact, "EXTBK", "BOTTOM", 0);
- cEntry->status_item->COLOR2_TRANSPARENT = (BYTE)db_get_b(hContact, "EXTBK", "TRANS", 1);
+ cEntry->status_item->COLOR2_TRANSPARENT = (uint8_t)db_get_b(hContact, "EXTBK", "TRANS", 1);
cEntry->status_item->BORDERSTYLE = db_get_dw(hContact, "EXTBK", "BDR", 0);
cEntry->status_item->CORNER = db_get_b(hContact, "EXTBK", "CORNER", 0);
diff --git a/plugins/Clist_nicer/src/clcmsgs.cpp b/plugins/Clist_nicer/src/clcmsgs.cpp index e714ba26e6..d6d6aa33f0 100644 --- a/plugins/Clist_nicer/src/clcmsgs.cpp +++ b/plugins/Clist_nicer/src/clcmsgs.cpp @@ -70,7 +70,7 @@ LRESULT ProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPARAM if (contact->type != CLCIT_CONTACT)
return 0;
contact->flags ^= CONTACTF_PRIORITY;
- g_plugin.setByte(contact->hContact, "Priority", (BYTE)(contact->flags & CONTACTF_PRIORITY ? 1 : 0));
+ g_plugin.setByte(contact->hContact, "Priority", (uint8_t)(contact->flags & CONTACTF_PRIORITY ? 1 : 0));
Clist_Broadcast(CLM_AUTOREBUILD, 0, 0);
}
return 0;
diff --git a/plugins/Clist_nicer/src/clcopts.cpp b/plugins/Clist_nicer/src/clcopts.cpp index 0e77ca2282..8851f896e5 100644 --- a/plugins/Clist_nicer/src/clcopts.cpp +++ b/plugins/Clist_nicer/src/clcopts.cpp @@ -112,12 +112,12 @@ public: if (curSel == 0 || curSel == CB_ERR)
cfg::dat.sortOrder[i] = 0;
else
- cfg::dat.sortOrder[i] = (BYTE)curSel;
+ cfg::dat.sortOrder[i] = (uint8_t)curSel;
}
g_plugin.setDword("SortOrder", MAKELONG(MAKEWORD(cfg::dat.sortOrder[0], cfg::dat.sortOrder[1]), MAKEWORD(cfg::dat.sortOrder[2], 0)));
cfg::dat.bDontSeparateOffline = IsDlgButtonChecked(m_hwnd, IDC_DONTSEPARATE) ? 1 : 0;
- g_plugin.setByte("DontSeparateOffline", (BYTE)cfg::dat.bDontSeparateOffline);
+ g_plugin.setByte("DontSeparateOffline", (uint8_t)cfg::dat.bDontSeparateOffline);
cfgSetFlag(m_hwnd, IDC_EVENTSONTOP, CLUI_STICKYEVENTS);
@@ -202,22 +202,22 @@ public: LRESULT curSel = SendDlgItemMessage(m_hwnd, IDC_GROUPALIGN, CB_GETCURSEL, 0, 0);
if (curSel != CB_ERR) {
- cfg::dat.bGroupAlign = (BYTE)curSel;
+ cfg::dat.bGroupAlign = (uint8_t)curSel;
db_set_b(0, "CLC", "GroupAlign", cfg::dat.bGroupAlign);
}
- cfg::dat.bRowSpacing = (BYTE)SendDlgItemMessage(m_hwnd, IDC_ROWGAPSPIN, UDM_GETPOS, 0, 0);
+ cfg::dat.bRowSpacing = (uint8_t)SendDlgItemMessage(m_hwnd, IDC_ROWGAPSPIN, UDM_GETPOS, 0, 0);
db_set_b(0, "CLC", "RowGap", cfg::dat.bRowSpacing);
BOOL translated;
- cfg::dat.avatarPadding = (BYTE)GetDlgItemInt(m_hwnd, IDC_AVATARPADDING, &translated, FALSE);
+ cfg::dat.avatarPadding = (uint8_t)GetDlgItemInt(m_hwnd, IDC_AVATARPADDING, &translated, FALSE);
g_plugin.setByte("AvatarPadding", cfg::dat.avatarPadding);
- db_set_b(0, "CLC", "LeftMargin", (BYTE)SendDlgItemMessage(m_hwnd, IDC_LEFTMARGINSPIN, UDM_GETPOS, 0, 0));
- db_set_b(0, "CLC", "RightMargin", (BYTE)SendDlgItemMessage(m_hwnd, IDC_RIGHTMARGINSPIN, UDM_GETPOS, 0, 0));
- db_set_b(0, "CLC", "GroupIndent", (BYTE)SendDlgItemMessage(m_hwnd, IDC_GROUPINDENTSPIN, UDM_GETPOS, 0, 0));
- db_set_b(0, "CLC", "RowHeight", (BYTE)SendDlgItemMessage(m_hwnd, IDC_ROWHEIGHTSPIN, UDM_GETPOS, 0, 0));
- db_set_b(0, "CLC", "GRowHeight", (BYTE)SendDlgItemMessage(m_hwnd, IDC_GROUPROWHEIGHTSPIN, UDM_GETPOS, 0, 0));
+ db_set_b(0, "CLC", "LeftMargin", (uint8_t)SendDlgItemMessage(m_hwnd, IDC_LEFTMARGINSPIN, UDM_GETPOS, 0, 0));
+ db_set_b(0, "CLC", "RightMargin", (uint8_t)SendDlgItemMessage(m_hwnd, IDC_RIGHTMARGINSPIN, UDM_GETPOS, 0, 0));
+ db_set_b(0, "CLC", "GroupIndent", (uint8_t)SendDlgItemMessage(m_hwnd, IDC_GROUPINDENTSPIN, UDM_GETPOS, 0, 0));
+ db_set_b(0, "CLC", "RowHeight", (uint8_t)SendDlgItemMessage(m_hwnd, IDC_ROWHEIGHTSPIN, UDM_GETPOS, 0, 0));
+ db_set_b(0, "CLC", "GRowHeight", (uint8_t)SendDlgItemMessage(m_hwnd, IDC_GROUPROWHEIGHTSPIN, UDM_GETPOS, 0, 0));
return true;
}
};
@@ -320,19 +320,19 @@ public: g_plugin.setWord("AvatarSize", (WORD)cfg::dat.avatarSize);
cfg::dat.bNoOfflineAvatars = IsDlgButtonChecked(m_hwnd, IDC_NOAVATARSOFFLINE) ? TRUE : FALSE;
- g_plugin.setByte("NoOfflineAV", (BYTE)cfg::dat.bNoOfflineAvatars);
+ g_plugin.setByte("NoOfflineAV", (uint8_t)cfg::dat.bNoOfflineAvatars);
cfg::dat.bShowLocalTime = chkLocalTime.GetState();
- db_set_b(0, "CLC", "ShowLocalTime", (BYTE)cfg::dat.bShowLocalTime);
+ db_set_b(0, "CLC", "ShowLocalTime", (uint8_t)cfg::dat.bShowLocalTime);
cfg::dat.bShowLocalTimeSelective = IsDlgButtonChecked(m_hwnd, IDC_SHOWLOCALTIMEONLYWHENDIFFERENT) ? 1 : 0;
- db_set_b(0, "CLC", "SelectiveLocalTime", (BYTE)cfg::dat.bShowLocalTimeSelective);
+ db_set_b(0, "CLC", "SelectiveLocalTime", (uint8_t)cfg::dat.bShowLocalTimeSelective);
KillTimer(g_clistApi.hwndContactTree, TIMERID_REFRESH);
if (cfg::dat.bShowLocalTime)
SetTimer(g_clistApi.hwndContactTree, TIMERID_REFRESH, 65000, nullptr);
- cfg::dat.dualRowMode = (BYTE)SendDlgItemMessage(m_hwnd, IDC_DUALROWMODE, CB_GETCURSEL, 0, 0);
+ cfg::dat.dualRowMode = (uint8_t)SendDlgItemMessage(m_hwnd, IDC_DUALROWMODE, CB_GETCURSEL, 0, 0);
if (cfg::dat.dualRowMode == CB_ERR)
cfg::dat.dualRowMode = 0;
db_set_b(0, "CLC", "DualRowMode", cfg::dat.dualRowMode);
@@ -394,7 +394,7 @@ public: db_set_b(0, "CLC", "ShowIdle", IsDlgButtonChecked(m_hwnd, IDC_IDLE) ? 1 : 0);
cfg::dat.bCenterStatusIcons = IsDlgButtonChecked(m_hwnd, IDC_STATUSICONSCENTERED) ? 1 : 0;
- db_set_b(0, "CLC", "si_centered", (BYTE)cfg::dat.bCenterStatusIcons);
+ db_set_b(0, "CLC", "si_centered", (uint8_t)cfg::dat.bCenterStatusIcons);
return true;
}
};
diff --git a/plugins/Clist_nicer/src/clcpaint.cpp b/plugins/Clist_nicer/src/clcpaint.cpp index de22664a9b..84b3418f35 100644 --- a/plugins/Clist_nicer/src/clcpaint.cpp +++ b/plugins/Clist_nicer/src/clcpaint.cpp @@ -31,7 +31,7 @@ extern ImageItem *g_glyphItem; extern int hClcProtoCount;
-static BYTE divide3[765] = { 255 };
+static uint8_t divide3[765] = { 255 };
extern char *im_clients[];
extern HICON im_clienthIcons[];
extern HICON overlayicons[];
@@ -42,8 +42,8 @@ extern LONG g_cxsmIcon, g_cysmIcon; int g_hottrack, g_center, g_ignoreselforgroups, g_selectiveIcon, g_hottrack_done;
HWND g_focusWnd;
-BYTE selBlend;
-BYTE saved_alpha;
+uint8_t selBlend;
+uint8_t saved_alpha;
int my_status;
BOOL g_inCLCpaint = FALSE;
@@ -342,7 +342,7 @@ static BOOL pi_selectiveIcon; static BOOL av_left, av_right, av_rightwithnick;
static BOOL mirror_rtl, mirror_always, mirror_rtltext;
-BYTE savedCORNER = -1;
+uint8_t savedCORNER = -1;
int g_padding_y = 0;
void __inline PaintItem(HDC hdcMem, ClcGroup *group, ClcContact *contact, int indent, int y, struct ClcData *dat, int index, HWND hwnd, DWORD style, RECT *clRect, BOOL *bFirstNGdrawn, int groupCountsFontTopShift, int rowHeight)
@@ -374,8 +374,8 @@ void __inline PaintItem(HDC hdcMem, ClcGroup *group, ClcContact *contact, int in int scanIndex = group->scanIndex;
BOOL av_local_wanted = (g_list_avatars > 0);
- BYTE type = contact->type;
- BYTE flags = contact->flags;
+ uint8_t type = contact->type;
+ uint8_t flags = contact->flags;
int selected = index == dat->selection && (dat->bShowSelAlways || dat->exStyle & CLS_EX_SHOWSELALWAYS || g_focusWnd == hwnd) && type != CLCIT_DIVIDER;
avatar_done = FALSE;
@@ -491,7 +491,7 @@ set_bg_l: *sfirstitem_NG, *ssingleitem_NG, *sevencontact_pos, *soddcontact_pos, *pp_item;
if (cstatus >= ID_STATUS_OFFLINE && cstatus <= ID_STATUS_MAX) {
- BYTE perstatus_ignored;
+ uint8_t perstatus_ignored;
if ((flags & CONTACTF_IDLE) && !arStatusItems[ID_EXTBKIDLE - ID_STATUS_OFFLINE]->IGNORED)
sitem = arStatusItems[ID_EXTBKIDLE - ID_STATUS_OFFLINE];
@@ -1106,7 +1106,7 @@ bgskipped: rcContent.bottom = y + rowHeight;
if (cstatus >= ID_STATUS_OFFLINE && cstatus <= ID_STATUS_MAX) {
- BYTE smsgValid = cEntry->bStatusMsgValid;
+ uint8_t smsgValid = cEntry->bStatusMsgValid;
if ((dwFlags & CLUI_FRAME_SHOWSTATUSMSG && smsgValid > STATUSMSG_XSTATUSID) || smsgValid == STATUSMSG_XSTATUSNAME)
szText = cEntry->statusMsg;
diff --git a/plugins/Clist_nicer/src/clcutils.cpp b/plugins/Clist_nicer/src/clcutils.cpp index 0070290182..7eac040108 100644 --- a/plugins/Clist_nicer/src/clcutils.cpp +++ b/plugins/Clist_nicer/src/clcutils.cpp @@ -204,7 +204,7 @@ int HitTest(HWND hwnd, struct ClcData *dat, int testx, int testy, ClcContact **c RECT clRect;
HFONT hFont;
DWORD style = GetWindowLongPtr(hwnd, GWL_STYLE);
- BYTE mirror_mode = cfg::dat.bUseDCMirroring;
+ uint8_t mirror_mode = cfg::dat.bUseDCMirroring;
if (flags)
*flags = 0;
diff --git a/plugins/Clist_nicer/src/clistopts.cpp b/plugins/Clist_nicer/src/clistopts.cpp index 4e0820cd8f..a0741a8c15 100644 --- a/plugins/Clist_nicer/src/clistopts.cpp +++ b/plugins/Clist_nicer/src/clistopts.cpp @@ -90,12 +90,12 @@ public: bool OnApply() override
{
- g_plugin.setByte("AlwaysMulti", (BYTE)BST_UNCHECKED == IsDlgButtonChecked(m_hwnd, IDC_ALWAYSMULTI));
- g_plugin.setByte("TrayIcon", (BYTE)(chkDontCycle.GetState() ? SETTING_TRAYICON_SINGLE : (chkCycle.GetState() ? SETTING_TRAYICON_CYCLE : SETTING_TRAYICON_MULTI)));
+ g_plugin.setByte("AlwaysMulti", (uint8_t)BST_UNCHECKED == IsDlgButtonChecked(m_hwnd, IDC_ALWAYSMULTI));
+ g_plugin.setByte("TrayIcon", (uint8_t)(chkDontCycle.GetState() ? SETTING_TRAYICON_SINGLE : (chkCycle.GetState() ? SETTING_TRAYICON_CYCLE : SETTING_TRAYICON_MULTI)));
g_plugin.setWord("CycleTime", (WORD)SendDlgItemMessage(m_hwnd, IDC_CYCLETIMESPIN, UDM_GETPOS, 0, 0));
g_plugin.setWord("IconFlashTime", (WORD)SendDlgItemMessage(m_hwnd, IDC_BLINKSPIN, UDM_GETPOS, 0, 0));
- g_plugin.setByte("DisableTrayFlash", (BYTE)IsDlgButtonChecked(m_hwnd, IDC_DISABLEBLINK));
- g_plugin.setByte("AutoApplyLastViewMode", (BYTE)IsDlgButtonChecked(m_hwnd, IDC_APPLYLASTVIEWMODE));
+ g_plugin.setByte("DisableTrayFlash", (uint8_t)IsDlgButtonChecked(m_hwnd, IDC_DISABLEBLINK));
+ g_plugin.setByte("AutoApplyLastViewMode", (uint8_t)IsDlgButtonChecked(m_hwnd, IDC_APPLYLASTVIEWMODE));
cfgSetFlag(m_hwnd, CLUI_FRAME_EVENTAREASUNKEN, IDC_EVENTAREASUNKEN);
cfgSetFlag(m_hwnd, CLUI_FRAME_AUTOHIDENOTIFY, IDC_EVENTAREAAUTOHIDE);
@@ -104,7 +104,7 @@ public: cfgSetFlag(m_hwnd, CLUI_FRAME_CLISTSUNKEN, IDC_CLISTSUNKEN);
cfg::dat.bNoTrayTips = IsDlgButtonChecked(m_hwnd, IDC_NOTRAYINFOTIPS) ? 1 : 0;
- g_plugin.setByte("NoTrayTips", (BYTE)cfg::dat.bNoTrayTips);
+ g_plugin.setByte("NoTrayTips", (uint8_t)cfg::dat.bNoTrayTips);
{
int cursel = SendDlgItemMessage(m_hwnd, IDC_PRIMARYSTATUS, CB_GETCURSEL, 0, 0);
PROTOACCOUNT *pa = (PROTOACCOUNT *)SendDlgItemMessage(m_hwnd, IDC_PRIMARYSTATUS, CB_GETITEMDATA, cursel, 0);
@@ -255,9 +255,9 @@ public: cfgSetFlag(m_hwnd, IDC_FULLROWSELECT, CLUI_FULLROWSELECT);
db_set_w(0, "CLC", "ScrollTime", (WORD)SendDlgItemMessage(m_hwnd, IDC_SMOOTHTIMESPIN, UDM_GETPOS, 0, 0));
- db_set_b(0, "CLC", "NoVScrollBar", (BYTE)(IsDlgButtonChecked(m_hwnd, IDC_NOSCROLLBAR) ? 1 : 0));
+ db_set_b(0, "CLC", "NoVScrollBar", (uint8_t)(IsDlgButtonChecked(m_hwnd, IDC_NOSCROLLBAR) ? 1 : 0));
cfg::dat.bDblClkAvatars = IsDlgButtonChecked(m_hwnd, IDC_DBLCLKAVATARS) ? TRUE : FALSE;
- db_set_b(0, "CLC", "dblclkav", (BYTE)cfg::dat.bDblClkAvatars);
+ db_set_b(0, "CLC", "dblclkav", (uint8_t)cfg::dat.bDblClkAvatars);
Clist_ClcOptionsChanged();
CoolSB_SetupScrollBar();
@@ -362,30 +362,30 @@ public: bool OnApply() override
{
BOOL translated;
- BYTE windowStyle = (BYTE)SendDlgItemMessage(m_hwnd, IDC_BORDERSTYLE, CB_GETCURSEL, 0, 0);
+ uint8_t windowStyle = (uint8_t)SendDlgItemMessage(m_hwnd, IDC_BORDERSTYLE, CB_GETCURSEL, 0, 0);
- db_set_b(0, "CLUI", "FadeInOut", (BYTE)IsDlgButtonChecked(m_hwnd, IDC_FADEINOUT));
+ db_set_b(0, "CLUI", "FadeInOut", (uint8_t)IsDlgButtonChecked(m_hwnd, IDC_FADEINOUT));
cfg::dat.fadeinout = IsDlgButtonChecked(m_hwnd, IDC_FADEINOUT) ? 1 : 0;
- BYTE oldFading = cfg::dat.fadeinout;
+ uint8_t oldFading = cfg::dat.fadeinout;
cfg::dat.fadeinout = FALSE;
db_set_b(0, "CLUI", "WindowStyle", windowStyle);
cfg::dat.gapBetweenFrames = GetDlgItemInt(m_hwnd, IDC_FRAMEGAP, &translated, FALSE);
db_set_dw(0, "CLUIFrames", "GapBetweenFrames", cfg::dat.gapBetweenFrames);
- g_plugin.setByte("OnTop", (BYTE)IsDlgButtonChecked(m_hwnd, IDC_ONTOP));
+ g_plugin.setByte("OnTop", (uint8_t)IsDlgButtonChecked(m_hwnd, IDC_ONTOP));
SetWindowPos(g_clistApi.hwndContactList, IsDlgButtonChecked(m_hwnd, IDC_ONTOP) ? HWND_TOPMOST : HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
- cfg::dat.bCLeft = (BYTE)SendDlgItemMessage(m_hwnd, IDC_CLEFTSPIN, UDM_GETPOS, 0, 0);
- cfg::dat.bCRight = (BYTE)SendDlgItemMessage(m_hwnd, IDC_CRIGHTSPIN, UDM_GETPOS, 0, 0);
- cfg::dat.bCTop = (BYTE)SendDlgItemMessage(m_hwnd, IDC_CTOPSPIN, UDM_GETPOS, 0, 0);
- cfg::dat.bCBottom = (BYTE)SendDlgItemMessage(m_hwnd, IDC_CBOTTOMSPIN, UDM_GETPOS, 0, 0);
+ cfg::dat.bCLeft = (uint8_t)SendDlgItemMessage(m_hwnd, IDC_CLEFTSPIN, UDM_GETPOS, 0, 0);
+ cfg::dat.bCRight = (uint8_t)SendDlgItemMessage(m_hwnd, IDC_CRIGHTSPIN, UDM_GETPOS, 0, 0);
+ cfg::dat.bCTop = (uint8_t)SendDlgItemMessage(m_hwnd, IDC_CTOPSPIN, UDM_GETPOS, 0, 0);
+ cfg::dat.bCBottom = (uint8_t)SendDlgItemMessage(m_hwnd, IDC_CBOTTOMSPIN, UDM_GETPOS, 0, 0);
db_set_dw(0, "CLUI", "clmargins", MAKELONG(MAKEWORD(cfg::dat.bCLeft, cfg::dat.bCRight), MAKEWORD(cfg::dat.bCTop, cfg::dat.bCBottom)));
SendMessage(g_clistApi.hwndContactList, WM_SIZE, 0, 0);
- g_plugin.setByte("BringToFront", (BYTE)IsDlgButtonChecked(m_hwnd, IDC_BRINGTOFRONT));
- g_plugin.setByte("AlwaysHideOnTB", (BYTE)IsDlgButtonChecked(m_hwnd, IDC_ALWAYSHIDEONTASKBAR));
+ g_plugin.setByte("BringToFront", (uint8_t)IsDlgButtonChecked(m_hwnd, IDC_BRINGTOFRONT));
+ g_plugin.setByte("AlwaysHideOnTB", (uint8_t)IsDlgButtonChecked(m_hwnd, IDC_ALWAYSHIDEONTASKBAR));
if (windowStyle != SETTING_WINDOWSTYLE_DEFAULT) {
LONG style;
@@ -417,12 +417,12 @@ public: SetWindowLongPtr(g_clistApi.hwndContactList, GWL_EXSTYLE, style);
}
- cfg::dat.bClipBorder = (BYTE)GetDlgItemInt(m_hwnd, IDC_CLIPBORDER, &translated, FALSE);
+ cfg::dat.bClipBorder = (uint8_t)GetDlgItemInt(m_hwnd, IDC_CLIPBORDER, &translated, FALSE);
db_set_dw(0, "CLUI", "Frameflags", cfg::dat.dwFlags);
db_set_b(0, "CLUI", "clipborder", cfg::dat.bClipBorder);
- db_set_b(0, "CLUI", "ShowMainMenu", (BYTE)IsDlgButtonChecked(m_hwnd, IDC_SHOWMAINMENU));
- db_set_b(0, "CLUI", "ClientAreaDrag", (BYTE)IsDlgButtonChecked(m_hwnd, IDC_CLIENTDRAG));
+ db_set_b(0, "CLUI", "ShowMainMenu", (uint8_t)IsDlgButtonChecked(m_hwnd, IDC_SHOWMAINMENU));
+ db_set_b(0, "CLUI", "ClientAreaDrag", (uint8_t)IsDlgButtonChecked(m_hwnd, IDC_CLIENTDRAG));
ApplyCLUIBorderStyle();
@@ -444,19 +444,19 @@ public: }
db_set_b(0, "CLUI", "AutoSize", cfg::dat.autosize);
- db_set_b(0, "CLUI", "MaxSizeHeight", (BYTE)GetDlgItemInt(m_hwnd, IDC_MAXSIZEHEIGHT, nullptr, FALSE));
- db_set_b(0, "CLUI", "AutoSizeUpward", (BYTE)IsDlgButtonChecked(m_hwnd, IDC_AUTOSIZEUPWARD));
+ db_set_b(0, "CLUI", "MaxSizeHeight", (uint8_t)GetDlgItemInt(m_hwnd, IDC_MAXSIZEHEIGHT, nullptr, FALSE));
+ db_set_b(0, "CLUI", "AutoSizeUpward", (uint8_t)IsDlgButtonChecked(m_hwnd, IDC_AUTOSIZEUPWARD));
g_plugin.setByte("AutoHide", chkAutoHide.GetState());
g_plugin.setWord("HideTime", (WORD)SendDlgItemMessage(m_hwnd, IDC_HIDETIMESPIN, UDM_GETPOS, 0, 0));
g_plugin.setByte("Transparent", cfg::dat.isTransparent = chkTransparent.GetState());
- g_plugin.setByte("Alpha", cfg::dat.alpha = (BYTE)SendDlgItemMessage(m_hwnd, IDC_TRANSACTIVE, TBM_GETPOS, 0, 0));
- g_plugin.setByte("AutoAlpha", cfg::dat.autoalpha = (BYTE)SendDlgItemMessage(m_hwnd, IDC_TRANSINACTIVE, TBM_GETPOS, 0, 0));
- g_plugin.setByte("WindowShadow", (BYTE)IsDlgButtonChecked(m_hwnd, IDC_DROPSHADOW));
- g_plugin.setByte("OnDesktop", (BYTE)IsDlgButtonChecked(m_hwnd, IDC_ONDESKTOP));
+ g_plugin.setByte("Alpha", cfg::dat.alpha = (uint8_t)SendDlgItemMessage(m_hwnd, IDC_TRANSACTIVE, TBM_GETPOS, 0, 0));
+ g_plugin.setByte("AutoAlpha", cfg::dat.autoalpha = (uint8_t)SendDlgItemMessage(m_hwnd, IDC_TRANSINACTIVE, TBM_GETPOS, 0, 0));
+ g_plugin.setByte("WindowShadow", (uint8_t)IsDlgButtonChecked(m_hwnd, IDC_DROPSHADOW));
+ g_plugin.setByte("OnDesktop", (uint8_t)IsDlgButtonChecked(m_hwnd, IDC_ONDESKTOP));
db_set_dw(0, "CLUI", "Frameflags", cfg::dat.dwFlags);
cfg::dat.bFullTransparent = IsDlgButtonChecked(m_hwnd, IDC_FULLTRANSPARENT) ? 1 : 0;
- db_set_b(0, "CLUI", "fulltransparent", (BYTE)cfg::dat.bFullTransparent);
+ db_set_b(0, "CLUI", "fulltransparent", (uint8_t)cfg::dat.bFullTransparent);
if (cfg::dat.bLayeredHack)
SetWindowLongPtr(g_clistApi.hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(g_clistApi.hwndContactList, GWL_EXSTYLE) | WS_EX_LAYERED);
@@ -475,11 +475,11 @@ public: SetLayeredWindowAttributes(g_clistApi.hwndContactList, 0, 255, LWA_ALPHA | LWA_COLORKEY);
SetLayeredWindowAttributes(g_clistApi.hwndContactList,
(COLORREF)(cfg::dat.bFullTransparent ? cfg::dat.colorkey : 0),
- (BYTE)(cfg::dat.isTransparent ? cfg::dat.autoalpha : 255),
+ (uint8_t)(cfg::dat.isTransparent ? cfg::dat.autoalpha : 255),
(DWORD)((cfg::dat.isTransparent ? LWA_ALPHA : 0L) | (cfg::dat.bFullTransparent ? LWA_COLORKEY : 0L)));
}
else {
- SetLayeredWindowAttributes(g_clistApi.hwndContactList, RGB(0, 0, 0), (BYTE)255, LWA_ALPHA);
+ SetLayeredWindowAttributes(g_clistApi.hwndContactList, RGB(0, 0, 0), (uint8_t)255, LWA_ALPHA);
if (!cfg::dat.bLayeredHack)
SetWindowLongPtr(g_clistApi.hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(g_clistApi.hwndContactList, GWL_EXSTYLE) & ~WS_EX_LAYERED);
}
@@ -591,8 +591,8 @@ public: bool OnApply() override
{
- db_set_b(0, "CLC", "UseBitmap", (BYTE)IsDlgButtonChecked(m_hwnd, IDC_BITMAP));
- db_set_b(0, "CLC", "UseWinColours", (BYTE)IsDlgButtonChecked(m_hwnd, IDC_WINCOLOUR));
+ db_set_b(0, "CLC", "UseBitmap", (uint8_t)IsDlgButtonChecked(m_hwnd, IDC_BITMAP));
+ db_set_b(0, "CLC", "UseWinColours", (uint8_t)IsDlgButtonChecked(m_hwnd, IDC_WINCOLOUR));
char str[MAX_PATH], strrel[MAX_PATH];
GetDlgItemTextA(m_hwnd, IDC_FILENAME, str, _countof(str));
@@ -616,7 +616,7 @@ public: flags |= CLBF_PROPORTIONAL;
db_set_w(0, "CLC", "BkBmpUse", flags);
cfg::dat.bWallpaperMode = IsDlgButtonChecked(m_hwnd, IDC_SKINMODE) ? 1 : 0;
- db_set_b(0, "CLUI", "UseBkSkin", (BYTE)cfg::dat.bWallpaperMode);
+ db_set_b(0, "CLUI", "UseBkSkin", (uint8_t)cfg::dat.bWallpaperMode);
return true;
}
@@ -672,7 +672,7 @@ public: {
chkShowSbar.SetState(db_get_b(0, "CLUI", "ShowSBar", 1));
- BYTE showOpts = db_get_b(0, "CLUI", "SBarShow", 1);
+ uint8_t showOpts = db_get_b(0, "CLUI", "SBarShow", 1);
CheckDlgButton(m_hwnd, IDC_SHOWICON, showOpts & 1 ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(m_hwnd, IDC_SHOWPROTO, showOpts & 2 ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(m_hwnd, IDC_SHOWSTATUS, showOpts & 4 ? BST_CHECKED : BST_UNCHECKED);
@@ -690,20 +690,20 @@ public: bool OnApply() override
{
- db_set_b(0, "CLUI", "ShowSBar", (BYTE)chkShowSbar.GetState());
- db_set_b(0, "CLUI", "SBarShow", (BYTE)((IsDlgButtonChecked(m_hwnd, IDC_SHOWICON) ? 1 : 0) | (IsDlgButtonChecked(m_hwnd, IDC_SHOWPROTO) ? 2 : 0) | (IsDlgButtonChecked(m_hwnd, IDC_SHOWSTATUS) ? 4 : 0)));
- db_set_b(0, "CLUI", "SBarRightClk", (BYTE)IsDlgButtonChecked(m_hwnd, IDC_RIGHTMIRANDA));
- db_set_b(0, "CLUI", "EqualSections", (BYTE)IsDlgButtonChecked(m_hwnd, IDC_EQUALSECTIONS));
- db_set_b(0, "CLUI", "sb_skinned", (BYTE)IsDlgButtonChecked(m_hwnd, IDC_SKINBACKGROUND));
- db_set_b(0, "CLUI", "sbar_showlocked", (BYTE)IsDlgButtonChecked(m_hwnd, IDC_MARKLOCKED));
+ db_set_b(0, "CLUI", "ShowSBar", (uint8_t)chkShowSbar.GetState());
+ db_set_b(0, "CLUI", "SBarShow", (uint8_t)((IsDlgButtonChecked(m_hwnd, IDC_SHOWICON) ? 1 : 0) | (IsDlgButtonChecked(m_hwnd, IDC_SHOWPROTO) ? 2 : 0) | (IsDlgButtonChecked(m_hwnd, IDC_SHOWSTATUS) ? 4 : 0)));
+ db_set_b(0, "CLUI", "SBarRightClk", (uint8_t)IsDlgButtonChecked(m_hwnd, IDC_RIGHTMIRANDA));
+ db_set_b(0, "CLUI", "EqualSections", (uint8_t)IsDlgButtonChecked(m_hwnd, IDC_EQUALSECTIONS));
+ db_set_b(0, "CLUI", "sb_skinned", (uint8_t)IsDlgButtonChecked(m_hwnd, IDC_SKINBACKGROUND));
+ db_set_b(0, "CLUI", "sbar_showlocked", (uint8_t)IsDlgButtonChecked(m_hwnd, IDC_MARKLOCKED));
cfg::dat.bEqualSections = IsDlgButtonChecked(m_hwnd, IDC_EQUALSECTIONS) ? 1 : 0;
cfg::dat.bSkinnedStatusBar = IsDlgButtonChecked(m_hwnd, IDC_SKINBACKGROUND) ? 1 : 0;
cfg::dat.bShowXStatusOnSbar = IsDlgButtonChecked(m_hwnd, IDC_SHOWXSTATUS) ? 1 : 0;
- db_set_b(0, "CLUI", "xstatus_sbar", (BYTE)cfg::dat.bShowXStatusOnSbar);
- db_set_b(0, "CLUI", "SBarBevel", (BYTE)IsDlgButtonChecked(m_hwnd, IDC_SBPANELBEVEL));
- if (db_get_b(0, "CLUI", "ShowGrip", 1) != (BYTE)IsDlgButtonChecked(m_hwnd, IDC_SHOWGRIP)) {
- db_set_b(0, "CLUI", "ShowGrip", (BYTE)IsDlgButtonChecked(m_hwnd, IDC_SHOWGRIP));
+ db_set_b(0, "CLUI", "xstatus_sbar", (uint8_t)cfg::dat.bShowXStatusOnSbar);
+ db_set_b(0, "CLUI", "SBarBevel", (uint8_t)IsDlgButtonChecked(m_hwnd, IDC_SBPANELBEVEL));
+ if (db_get_b(0, "CLUI", "ShowGrip", 1) != (uint8_t)IsDlgButtonChecked(m_hwnd, IDC_SHOWGRIP)) {
+ db_set_b(0, "CLUI", "ShowGrip", (uint8_t)IsDlgButtonChecked(m_hwnd, IDC_SHOWGRIP));
ShowWindow(g_clistApi.hwndStatus, SW_HIDE);
mir_unsubclassWindow(g_clistApi.hwndStatus, NewStatusBarWndProc);
DestroyWindow(g_clistApi.hwndStatus);
diff --git a/plugins/Clist_nicer/src/clui.cpp b/plugins/Clist_nicer/src/clui.cpp index f4f674ca6d..276010e810 100644 --- a/plugins/Clist_nicer/src/clui.cpp +++ b/plugins/Clist_nicer/src/clui.cpp @@ -56,7 +56,7 @@ extern COLORREF g_CLUISkinnedBkColorRGB; extern FRAMEWND *wndFrameCLC; extern HPEN g_hPenCLUIFrames; -static BYTE old_cliststate, show_on_first_autosize = FALSE; +static uint8_t old_cliststate, show_on_first_autosize = FALSE; RECT cluiPos; @@ -112,9 +112,9 @@ static void Tweak_It(COLORREF clr) static void LayoutButtons(HWND hwnd, RECT *rc) { RECT rect; - BYTE left_offset = cfg::dat.bCLeft - (cfg::dat.dwFlags & CLUI_FRAME_CLISTSUNKEN ? 3 : 0); - BYTE right_offset = cfg::dat.bCRight - (cfg::dat.dwFlags & CLUI_FRAME_CLISTSUNKEN ? 3 : 0); - BYTE delta = left_offset + right_offset; + uint8_t left_offset = cfg::dat.bCLeft - (cfg::dat.dwFlags & CLUI_FRAME_CLISTSUNKEN ? 3 : 0); + uint8_t right_offset = cfg::dat.bCRight - (cfg::dat.dwFlags & CLUI_FRAME_CLISTSUNKEN ? 3 : 0); + uint8_t delta = left_offset + right_offset; ButtonItem *btnItems = g_ButtonItems; if (rc == nullptr) @@ -413,7 +413,7 @@ void SetDBButtonStates(MCONTACT hPassedContact) else { switch (buttonItem->type) { case DBVT_BYTE: { - BYTE val = db_get_b(hFinalContact, szModule, szSetting, 0); + uint8_t val = db_get_b(hFinalContact, szModule, szSetting, 0); result = (val == buttonItem->bValuePush[0]); break; } @@ -551,7 +551,7 @@ void ReloadThemedOptions() cfg::dat.bWallpaperMode = db_get_b(0, "CLUI", "UseBkSkin", 1); cfg::dat.bClipBorder = db_get_b(0, "CLUI", "clipborder", 0); cfg::dat.cornerRadius = db_get_b(0, "CLCExt", "CornerRad", 6); - cfg::dat.gapBetweenFrames = (BYTE)db_get_dw(0, "CLUIFrames", "GapBetweenFrames", 1); + cfg::dat.gapBetweenFrames = (uint8_t)db_get_dw(0, "CLUIFrames", "GapBetweenFrames", 1); cfg::dat.bUseDCMirroring = db_get_b(0, "CLC", "MirrorDC", 0); cfg::dat.bGroupAlign = db_get_b(0, "CLC", "GroupAlign", 0); if (cfg::dat.hBrushColorKey) @@ -824,7 +824,7 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l SendMessage(hwnd, WM_SETREDRAW, FALSE, FALSE); { LONG style; - BYTE windowStyle = db_get_b(0, "CLUI", "WindowStyle", SETTING_WINDOWSTYLE_TOOLWINDOW); + uint8_t windowStyle = db_get_b(0, "CLUI", "WindowStyle", SETTING_WINDOWSTYLE_TOOLWINDOW); ShowWindow(g_clistApi.hwndContactList, SW_HIDE); style = GetWindowLongPtr(g_clistApi.hwndContactList, GWL_EXSTYLE); if (windowStyle != SETTING_WINDOWSTYLE_DEFAULT) { @@ -1125,7 +1125,7 @@ skipbg: return 0; case CLUIINTM_REMOVEFROMTASKBAR: { - BYTE windowStyle = db_get_b(0, "CLUI", "WindowStyle", SETTING_WINDOWSTYLE_DEFAULT); + uint8_t windowStyle = db_get_b(0, "CLUI", "WindowStyle", SETTING_WINDOWSTYLE_DEFAULT); if (windowStyle == SETTING_WINDOWSTYLE_DEFAULT && g_plugin.getByte("AlwaysHideOnTB", 0)) RemoveFromTaskBar(hwnd); return 0; @@ -1259,7 +1259,7 @@ skipbg: if (wParam) { sourceAlpha = 0; destAlpha = cfg::dat.isTransparent ? cfg::dat.alpha : 255; - SetLayeredWindowAttributes(hwnd, cfg::dat.bFullTransparent ? (COLORREF)cfg::dat.colorkey : RGB(0, 0, 0), (BYTE)sourceAlpha, LWA_ALPHA | (cfg::dat.bFullTransparent ? LWA_COLORKEY : 0)); + SetLayeredWindowAttributes(hwnd, cfg::dat.bFullTransparent ? (COLORREF)cfg::dat.colorkey : RGB(0, 0, 0), (uint8_t)sourceAlpha, LWA_ALPHA | (cfg::dat.bFullTransparent ? LWA_COLORKEY : 0)); noRecurse = 1; ShowWindow(hwnd, SW_SHOW); RedrawWindow(hwnd, nullptr, nullptr, RDW_INVALIDATE | RDW_UPDATENOW | RDW_ALLCHILDREN); @@ -1272,17 +1272,17 @@ skipbg: for (startTick = GetTickCount();;) { thisTick = GetTickCount(); if (thisTick >= startTick + 200) { - SetLayeredWindowAttributes(hwnd, cfg::dat.bFullTransparent ? cfg::dat.colorkey : RGB(0, 0, 0), (BYTE)destAlpha, LWA_ALPHA | (cfg::dat.bFullTransparent ? LWA_COLORKEY : 0)); + SetLayeredWindowAttributes(hwnd, cfg::dat.bFullTransparent ? cfg::dat.colorkey : RGB(0, 0, 0), (uint8_t)destAlpha, LWA_ALPHA | (cfg::dat.bFullTransparent ? LWA_COLORKEY : 0)); g_fading_active = 0; return DefWindowProc(hwnd, msg, wParam, lParam); } - SetLayeredWindowAttributes(hwnd, cfg::dat.bFullTransparent ? cfg::dat.colorkey : RGB(0, 0, 0), (BYTE)(sourceAlpha + (destAlpha - sourceAlpha) * (int)(thisTick - startTick) / 200), LWA_ALPHA | (cfg::dat.bFullTransparent ? LWA_COLORKEY : 0)); + SetLayeredWindowAttributes(hwnd, cfg::dat.bFullTransparent ? cfg::dat.colorkey : RGB(0, 0, 0), (uint8_t)(sourceAlpha + (destAlpha - sourceAlpha) * (int)(thisTick - startTick) / 200), LWA_ALPHA | (cfg::dat.bFullTransparent ? LWA_COLORKEY : 0)); } } case WM_SYSCOMMAND: { - BYTE bWindowStyle = db_get_b(0, "CLUI", "WindowStyle", SETTING_WINDOWSTYLE_DEFAULT); + uint8_t bWindowStyle = db_get_b(0, "CLUI", "WindowStyle", SETTING_WINDOWSTYLE_DEFAULT); if (SETTING_WINDOWSTYLE_DEFAULT == bWindowStyle) { if (wParam == SC_RESTORE) { CallWindowProc(DefWindowProc, hwnd, msg, wParam, lParam); @@ -1352,7 +1352,7 @@ skipbg: } } else if (item->dwFlags & BUTTON_ISDBACTION) { - BYTE *pValue; + uint8_t *pValue; char *szModule = item->szModule; char *szSetting = item->szSetting; MCONTACT finalhContact = 0; @@ -1433,8 +1433,8 @@ skipbg: case IDC_TBSOUND: case IDC_STBSOUND: cfg::dat.soundsOff = !cfg::dat.soundsOff; - db_set_b(0, "CLUI", "NoSounds", (BYTE)cfg::dat.soundsOff); - db_set_b(0, "Skin", "UseSound", (BYTE)(cfg::dat.soundsOff ? 0 : 1)); + db_set_b(0, "CLUI", "NoSounds", (uint8_t)cfg::dat.soundsOff); + db_set_b(0, "Skin", "UseSound", (uint8_t)(cfg::dat.soundsOff ? 0 : 1)); return 0; case IDC_TBSELECTVIEWMODE: @@ -1634,7 +1634,7 @@ buttons_done: int nParts = SendMessage(g_clistApi.hwndStatus, SB_GETPARTS, 0, 0); SIZE textSize; - BYTE showOpts = db_get_b(0, "CLUI", "SBarShow", 1); + uint8_t showOpts = db_get_b(0, "CLUI", "SBarShow", 1); SetBkMode(dis->hDC, TRANSPARENT); int x = dis->rcItem.left; diff --git a/plugins/Clist_nicer/src/cluiframes.cpp b/plugins/Clist_nicer/src/cluiframes.cpp index 14b6ee3485..02bb548c61 100644 --- a/plugins/Clist_nicer/src/cluiframes.cpp +++ b/plugins/Clist_nicer/src/cluiframes.cpp @@ -425,10 +425,10 @@ int DBStoreFrameSettingsAtPos(int pos, int Frameid) db_set_ws(0, CLUIFrameModule, buf.Format("Name%d", pos), Frames[Frameid].name); //boolean - db_set_b(0, CLUIFrameModule, buf.Format("Collapse%d", pos), (BYTE)btoint(Frames[Frameid].collapsed)); - db_set_b(0, CLUIFrameModule, buf.Format("Locked%d", pos), (BYTE)btoint(Frames[Frameid].Locked)); - db_set_b(0, CLUIFrameModule, buf.Format("Visible%d", pos), (BYTE)btoint(Frames[Frameid].visible)); - db_set_b(0, CLUIFrameModule, buf.Format("TBVisile%d", pos), (BYTE)btoint(Frames[Frameid].TitleBar.ShowTitleBar)); + db_set_b(0, CLUIFrameModule, buf.Format("Collapse%d", pos), (uint8_t)btoint(Frames[Frameid].collapsed)); + db_set_b(0, CLUIFrameModule, buf.Format("Locked%d", pos), (uint8_t)btoint(Frames[Frameid].Locked)); + db_set_b(0, CLUIFrameModule, buf.Format("Visible%d", pos), (uint8_t)btoint(Frames[Frameid].visible)); + db_set_b(0, CLUIFrameModule, buf.Format("TBVisile%d", pos), (uint8_t)btoint(Frames[Frameid].TitleBar.ShowTitleBar)); db_set_w(0, CLUIFrameModule, buf.Format("Height%d", pos), (WORD)Frames[Frameid].height); db_set_w(0, CLUIFrameModule, buf.Format("HeightCollapsed%d", pos), (WORD)Frames[Frameid].HeightWhenCollapsed); @@ -439,8 +439,8 @@ int DBStoreFrameSettingsAtPos(int pos, int Frameid) db_set_w(0, CLUIFrameModule, buf.Format("FloatW%d", pos), (WORD)Frames[Frameid].FloatingSize.x); db_set_w(0, CLUIFrameModule, buf.Format("FloatH%d", pos), (WORD)Frames[Frameid].FloatingSize.y); - db_set_b(0, CLUIFrameModule, buf.Format("Floating%d", pos), (BYTE)btoint(Frames[Frameid].floating)); - db_set_b(0, CLUIFrameModule, buf.Format("UseBorder%d", pos), (BYTE)btoint(Frames[Frameid].UseBorder)); + db_set_b(0, CLUIFrameModule, buf.Format("Floating%d", pos), (uint8_t)btoint(Frames[Frameid].floating)); + db_set_b(0, CLUIFrameModule, buf.Format("UseBorder%d", pos), (uint8_t)btoint(Frames[Frameid].UseBorder)); db_set_w(0, CLUIFrameModule, buf.Format("Order%d", pos), (WORD)Frames[Frameid].order); db_set_b(0, CLUIFrameModule, buf.Format("Skinned%d", pos), Frames[Frameid].Skinned); diff --git a/plugins/Clist_nicer/src/cluiopts.cpp b/plugins/Clist_nicer/src/cluiopts.cpp index 337efc9e7d..81a44aef40 100644 --- a/plugins/Clist_nicer/src/cluiopts.cpp +++ b/plugins/Clist_nicer/src/cluiopts.cpp @@ -24,7 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "stdafx.h"
-DWORD GetCLUIWindowStyle(BYTE style)
+DWORD GetCLUIWindowStyle(uint8_t style)
{
DWORD dwBasic = WS_CLIPCHILDREN;
@@ -40,7 +40,7 @@ DWORD GetCLUIWindowStyle(BYTE style) void ApplyCLUIBorderStyle()
{
- BYTE windowStyle = db_get_b(0, "CLUI", "WindowStyle", SETTING_WINDOWSTYLE_TOOLWINDOW);
+ uint8_t windowStyle = db_get_b(0, "CLUI", "WindowStyle", SETTING_WINDOWSTYLE_TOOLWINDOW);
WINDOWPLACEMENT p;
bool minToTray = TRUE;
diff --git a/plugins/Clist_nicer/src/cluiservices.cpp b/plugins/Clist_nicer/src/cluiservices.cpp index ff9eb5a1a1..9ec455e5ab 100644 --- a/plugins/Clist_nicer/src/cluiservices.cpp +++ b/plugins/Clist_nicer/src/cluiservices.cpp @@ -87,7 +87,7 @@ void CluiProtocolStatusChanged(int, const char*) partCount = toshow;
}
else {
- BYTE showOpts = db_get_b(0, "CLUI", "SBarShow", 1);
+ uint8_t showOpts = db_get_b(0, "CLUI", "SBarShow", 1);
wchar_t szName[32];
HDC hdc = GetDC(nullptr);
@@ -134,7 +134,7 @@ void CluiProtocolStatusChanged(int, const char*) SendMessage(g_clistApi.hwndStatus, SB_SIMPLE, FALSE, 0);
partWidths[partCount - 1] = -1;
- BYTE windowStyle = db_get_b(0, "CLUI", "WindowStyle", 0);
+ uint8_t windowStyle = db_get_b(0, "CLUI", "WindowStyle", 0);
SendMessage(g_clistApi.hwndStatus, SB_SETMINHEIGHT, 18 + cfg::dat.bClipBorder + ((windowStyle == SETTING_WINDOWSTYLE_THINBORDER || windowStyle == SETTING_WINDOWSTYLE_NOBORDER) ? 3 : 0), 0);
SendMessage(g_clistApi.hwndStatus, SB_SETPARTS, partCount, (LPARAM)partWidths);
diff --git a/plugins/Clist_nicer/src/contact.cpp b/plugins/Clist_nicer/src/contact.cpp index 7cda00d4da..209fa4f2d6 100644 --- a/plugins/Clist_nicer/src/contact.cpp +++ b/plugins/Clist_nicer/src/contact.cpp @@ -125,7 +125,7 @@ void MF_UpdateThread(LPVOID) void MF_InitCheck(void)
{
- BYTE bMsgFrequency = g_plugin.getByte("fhistdata", 0);
+ uint8_t bMsgFrequency = g_plugin.getByte("fhistdata", 0);
if (!bMsgFrequency) {
for (auto &hContact : Contacts())
MF_CalcFrequency(hContact, 100, 0);
diff --git a/plugins/Clist_nicer/src/coolscroll.cpp b/plugins/Clist_nicer/src/coolscroll.cpp index 5a8828a312..01e1e3eede 100644 --- a/plugins/Clist_nicer/src/coolscroll.cpp +++ b/plugins/Clist_nicer/src/coolscroll.cpp @@ -96,7 +96,7 @@ LRESULT CALLBACK CoolSBWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lP //
static void CoolSB_ZeroMemory(void *ptr, DWORD bytes)
{
- BYTE *bptr = (BYTE *)ptr;
+ uint8_t *bptr = (uint8_t *)ptr;
while(bytes--) *bptr++ = 0;
}
diff --git a/plugins/Clist_nicer/src/extBackg.cpp b/plugins/Clist_nicer/src/extBackg.cpp index 74a0432325..697ef85f7c 100644 --- a/plugins/Clist_nicer/src/extBackg.cpp +++ b/plugins/Clist_nicer/src/extBackg.cpp @@ -330,17 +330,17 @@ void LoadExtBkSettingsFromDB() p->imageItem = nullptr;
CMStringA buffer;
buffer.Format("%s_IGNORE", p->szDBname);
- p->IGNORED = (BYTE)db_get_b(0, "CLCExt", buffer, p->IGNORED);
+ p->IGNORED = (uint8_t)db_get_b(0, "CLCExt", buffer, p->IGNORED);
buffer.Format("%s_GRADIENT", p->szDBname);
- p->GRADIENT = (BYTE)db_get_dw(0, "CLCExt", buffer, p->GRADIENT);
+ p->GRADIENT = (uint8_t)db_get_dw(0, "CLCExt", buffer, p->GRADIENT);
buffer.Format("%s_CORNER", p->szDBname);
- p->CORNER = (BYTE)db_get_dw(0, "CLCExt", buffer, p->CORNER);
+ p->CORNER = (uint8_t)db_get_dw(0, "CLCExt", buffer, p->CORNER);
buffer.Format("%s_COLOR", p->szDBname);
p->COLOR = db_get_dw(0, "CLCExt", buffer, p->COLOR);
buffer.Format("%s_COLOR2", p->szDBname);
p->COLOR2 = db_get_dw(0, "CLCExt", buffer, p->COLOR2);
buffer.Format("%s_COLOR2_TRANSPARENT", p->szDBname);
- p->COLOR2_TRANSPARENT = (BYTE)db_get_b(0, "CLCExt", buffer, p->COLOR2_TRANSPARENT);
+ p->COLOR2_TRANSPARENT = (uint8_t)db_get_b(0, "CLCExt", buffer, p->COLOR2_TRANSPARENT);
buffer.Format("%s_TEXTCOLOR", p->szDBname);
p->TEXTCOLOR = db_get_dw(0, "CLCExt", buffer, p->TEXTCOLOR);
buffer.Format("%s_ALPHA", p->szDBname);
@@ -391,15 +391,15 @@ static void SaveCompleteStructToDB() mir_snprintf(buffer, "%s_TEXTCOLOR", p->szDBname);
db_set_dw(0, "CLCExt", buffer, p->TEXTCOLOR);
mir_snprintf(buffer, "%s_ALPHA", p->szDBname);
- db_set_b(0, "CLCExt", buffer, (BYTE)p->ALPHA);
+ db_set_b(0, "CLCExt", buffer, (uint8_t)p->ALPHA);
mir_snprintf(buffer, "%s_MRGN_LEFT", p->szDBname);
- db_set_b(0, "CLCExt", buffer, (BYTE)p->MARGIN_LEFT);
+ db_set_b(0, "CLCExt", buffer, (uint8_t)p->MARGIN_LEFT);
mir_snprintf(buffer, "%s_MRGN_TOP", p->szDBname);
- db_set_b(0, "CLCExt", buffer, (BYTE)p->MARGIN_TOP);
+ db_set_b(0, "CLCExt", buffer, (uint8_t)p->MARGIN_TOP);
mir_snprintf(buffer, "%s_MRGN_RIGHT", p->szDBname);
- db_set_b(0, "CLCExt", buffer, (BYTE)p->MARGIN_RIGHT);
+ db_set_b(0, "CLCExt", buffer, (uint8_t)p->MARGIN_RIGHT);
mir_snprintf(buffer, "%s_MRGN_BOTTOM", p->szDBname);
- db_set_b(0, "CLCExt", buffer, (BYTE)p->MARGIN_BOTTOM);
+ db_set_b(0, "CLCExt", buffer, (uint8_t)p->MARGIN_BOTTOM);
mir_snprintf(buffer, "%s_BDRSTYLE", p->szDBname);
db_set_dw(0, "CLCExt", buffer, p->BORDERSTYLE);
}
@@ -439,24 +439,24 @@ void SaveNonStatusItemsSettings(HWND hwndDlg) {
BOOL translated;
- db_set_b(0, "CLCExt", "EXBK_EqualSelection", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_EQUALSELECTION));
- db_set_b(0, "CLCExt", "EXBK_SelBlend", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SELBLEND));
+ db_set_b(0, "CLCExt", "EXBK_EqualSelection", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_EQUALSELECTION));
+ db_set_b(0, "CLCExt", "EXBK_SelBlend", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_SELBLEND));
cfg::dat.cornerRadius = GetDlgItemInt(hwndDlg, IDC_CORNERRAD, &translated, FALSE);
cfg::dat.bApplyIndentToBg = IsDlgButtonChecked(hwndDlg, IDC_APPLYINDENTBG) ? 1 : 0;
cfg::dat.bUsePerProto = IsDlgButtonChecked(hwndDlg, IDC_USEPERPROTO) ? 1 : 0;
cfg::dat.bWantFastGradients = IsDlgButtonChecked(hwndDlg, IDC_FASTGRADIENT) ? 1 : 0;
cfg::dat.bOverridePerStatusColors = IsDlgButtonChecked(hwndDlg, IDC_OVERRIDEPERSTATUSCOLOR) ? 1 : 0;
- cfg::dat.titleBarHeight = (BYTE)GetDlgItemInt(hwndDlg, IDC_LASTITEMPADDING, &translated, FALSE);
+ cfg::dat.titleBarHeight = (uint8_t)GetDlgItemInt(hwndDlg, IDC_LASTITEMPADDING, &translated, FALSE);
cfg::dat.group_padding = GetDlgItemInt(hwndDlg, IDC_GRPTOPPADDING, &translated, FALSE);
db_set_b(0, "CLCExt", "CornerRad", cfg::dat.cornerRadius);
- db_set_b(0, "CLCExt", "applyindentbg", (BYTE)cfg::dat.bApplyIndentToBg);
- db_set_b(0, "CLCExt", "useperproto", (BYTE)cfg::dat.bUsePerProto);
- db_set_b(0, "CLCExt", "override_status", (BYTE)cfg::dat.bOverridePerStatusColors);
- db_set_b(0, "CLCExt", "bskinned", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_SETALLBUTTONSKINNED) ? 1 : 0));
+ db_set_b(0, "CLCExt", "applyindentbg", (uint8_t)cfg::dat.bApplyIndentToBg);
+ db_set_b(0, "CLCExt", "useperproto", (uint8_t)cfg::dat.bUsePerProto);
+ db_set_b(0, "CLCExt", "override_status", (uint8_t)cfg::dat.bOverridePerStatusColors);
+ db_set_b(0, "CLCExt", "bskinned", (uint8_t)(IsDlgButtonChecked(hwndDlg, IDC_SETALLBUTTONSKINNED) ? 1 : 0));
db_set_b(0, "CLCExt", "FastGradients", cfg::dat.bWantFastGradients);
- db_set_b(0, "CLC", "IgnoreSelforGroups", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_IGNORESELFORGROUPS));
+ db_set_b(0, "CLC", "IgnoreSelforGroups", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_IGNORESELFORGROUPS));
db_set_dw(0, "CLCExt", "grp_padding", cfg::dat.group_padding);
db_set_b(0, "CLCExt", "frame_height", cfg::dat.titleBarHeight);
@@ -573,7 +573,7 @@ void extbk_export(char *file) data = 0;
switch (_tagSettings[i].size) {
case 1:
- data = (DWORD)db_get_b(0, _tagSettings[i].szModule, _tagSettings[i].szSetting, (BYTE)_tagSettings[i].defaultval);
+ data = (DWORD)db_get_b(0, _tagSettings[i].szModule, _tagSettings[i].szSetting, (uint8_t)_tagSettings[i].defaultval);
break;
case 2:
data = (DWORD)db_get_w(0, _tagSettings[i].szModule, _tagSettings[i].szSetting, (DWORD)_tagSettings[i].defaultval);
@@ -617,17 +617,17 @@ static void PreMultiply(HBITMAP hBitmap, int mode) int width = bmp.bmWidth;
int height = bmp.bmHeight;
DWORD dwLen = width * height * 4;
- BYTE *p = (BYTE *)malloc(dwLen);
+ uint8_t *p = (uint8_t *)malloc(dwLen);
if (p == nullptr)
return;
GetBitmapBits(hBitmap, dwLen, p);
for (int y = 0; y < height; ++y) {
- BYTE *px = p + width * 4 * y;
+ uint8_t *px = p + width * 4 * y;
for (int x = 0; x < width; ++x) {
if (mode) {
- BYTE alpha = px[3];
+ uint8_t alpha = px[3];
px[0] = px[0] * alpha / 255;
px[1] = px[1] * alpha / 255;
px[2] = px[2] * alpha / 255;
@@ -648,7 +648,7 @@ static void CorrectBitmap32Alpha(HBITMAP hBitmap) return;
DWORD dwLen = bmp.bmWidth * bmp.bmHeight * (bmp.bmBitsPixel / 8);
- BYTE *p = (BYTE*)calloc(1, dwLen);
+ uint8_t *p = (uint8_t*)calloc(1, dwLen);
if (p == nullptr)
return;
@@ -656,7 +656,7 @@ static void CorrectBitmap32Alpha(HBITMAP hBitmap) BOOL fixIt = TRUE;
for (int y = 0; y < bmp.bmHeight; ++y) {
- BYTE *px = p + bmp.bmWidth * 4 * y;
+ uint8_t *px = p + bmp.bmWidth * 4 * y;
for (int x = 0; x < bmp.bmWidth; ++x) {
if (px[3] != 0)
@@ -757,7 +757,7 @@ static void ReadItem(StatusItems_t *this_item, char *szItem, char *file) GetPrivateProfileStringA(szItem, "Color2", def_color, buffer, 400, file);
this_item->COLOR2 = HexStringToLong(buffer);
- this_item->COLOR2_TRANSPARENT = (BYTE)GetPrivateProfileIntA(szItem, "COLOR2_TRANSPARENT", defaults->COLOR2_TRANSPARENT, file);
+ this_item->COLOR2_TRANSPARENT = (uint8_t)GetPrivateProfileIntA(szItem, "COLOR2_TRANSPARENT", defaults->COLOR2_TRANSPARENT, file);
this_item->CORNER = defaults->CORNER & CORNER_ACTIVE ? defaults->CORNER : 0;
GetPrivateProfileStringA(szItem, "Corner", "None", buffer, 400, file);
@@ -828,7 +828,7 @@ done_with_glyph: mir_snprintf(szFinalName, "%s\\%s\\%s", szDrive, szPath, buffer);
tmpItem.alpha = GetPrivateProfileIntA(itemname, "Alpha", 100, szFileName);
tmpItem.alpha = min(tmpItem.alpha, 100);
- tmpItem.alpha = (BYTE)((FLOAT)(((FLOAT)tmpItem.alpha) / 100) * 255);
+ tmpItem.alpha = (uint8_t)((FLOAT)(((FLOAT)tmpItem.alpha) / 100) * 255);
tmpItem.bf.SourceConstantAlpha = tmpItem.alpha;
tmpItem.bLeft = GetPrivateProfileIntA(itemname, "Left", 0, szFileName);
tmpItem.bRight = GetPrivateProfileIntA(itemname, "Right", 0, szFileName);
@@ -1111,7 +1111,7 @@ static void BTN_ReadItem(char *itemName, char *file) for (n = 0; n <= 1; n++) {
CMStringA szKey;
- BYTE *pValue;
+ uint8_t *pValue;
if (n == 0)
szKey = "dbonpush";
@@ -1123,7 +1123,7 @@ static void BTN_ReadItem(char *itemName, char *file) switch (szBuffer[0]) {
case 'b':
{
- BYTE value = (BYTE)atol(&szBuffer[1]);
+ uint8_t value = (uint8_t)atol(&szBuffer[1]);
pValue[0] = value;
tmpItem.type = DBVT_BYTE;
break;
@@ -1261,7 +1261,7 @@ void IMG_LoadItems() if (g_CLUIImageItem) {
cfg::dat.bFullTransparent = TRUE;
cfg::dat.dwFlags &= ~CLUI_FRAME_CLISTSUNKEN;
- db_set_b(0, "CLUI", "fulltransparent", (BYTE)cfg::dat.bFullTransparent);
+ db_set_b(0, "CLUI", "fulltransparent", (uint8_t)cfg::dat.bFullTransparent);
db_set_b(0, "CLUI", "WindowStyle", SETTING_WINDOWSTYLE_NOBORDER);
ApplyCLUIBorderStyle();
SetWindowLongPtr(g_clistApi.hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(g_clistApi.hwndContactList, GWL_EXSTYLE) | WS_EX_LAYERED);
@@ -1341,12 +1341,12 @@ void LoadPerContactSkins(wchar_t *tszFileName) db_set_dw(hContact, "EXTBK", "TEXT", items[j].TEXTCOLOR);
db_set_dw(hContact, "EXTBK", "COLOR1", items[j].COLOR);
db_set_dw(hContact, "EXTBK", "COLOR2", items[j].COLOR2);
- db_set_b(hContact, "EXTBK", "ALPHA", (BYTE)items[j].ALPHA);
+ db_set_b(hContact, "EXTBK", "ALPHA", (uint8_t)items[j].ALPHA);
- db_set_b(hContact, "EXTBK", "LEFT", (BYTE)items[j].MARGIN_LEFT);
- db_set_b(hContact, "EXTBK", "RIGHT", (BYTE)items[j].MARGIN_RIGHT);
- db_set_b(hContact, "EXTBK", "TOP", (BYTE)items[j].MARGIN_TOP);
- db_set_b(hContact, "EXTBK", "BOTTOM", (BYTE)items[j].MARGIN_BOTTOM);
+ db_set_b(hContact, "EXTBK", "LEFT", (uint8_t)items[j].MARGIN_LEFT);
+ db_set_b(hContact, "EXTBK", "RIGHT", (uint8_t)items[j].MARGIN_RIGHT);
+ db_set_b(hContact, "EXTBK", "TOP", (uint8_t)items[j].MARGIN_TOP);
+ db_set_b(hContact, "EXTBK", "BOTTOM", (uint8_t)items[j].MARGIN_BOTTOM);
db_set_b(hContact, "EXTBK", "TRANS", items[j].COLOR2_TRANSPARENT);
db_set_dw(hContact, "EXTBK", "BDR", items[j].BORDERSTYLE);
@@ -1420,17 +1420,17 @@ void extbk_import(char *file, HWND hwndDlg) mir_snprintf(szKey, "Font%dSize", n);
data = 0;
GetPrivateProfileStructA(szSection, "Size", &data, 1, file);
- db_set_b(0, "CLC", szKey, (BYTE)data);
+ db_set_b(0, "CLC", szKey, (uint8_t)data);
mir_snprintf(szKey, "Font%dSty", n);
data = 0;
GetPrivateProfileStructA(szSection, "Style", &data, 1, file);
- db_set_b(0, "CLC", szKey, (BYTE)data);
+ db_set_b(0, "CLC", szKey, (uint8_t)data);
mir_snprintf(szKey, "Font%dSet", n);
data = 0;
GetPrivateProfileStructA(szSection, "Set", &data, 1, file);
- db_set_b(0, "CLC", szKey, (BYTE)data);
+ db_set_b(0, "CLC", szKey, (uint8_t)data);
mir_snprintf(szKey, "Font%dCol", n);
data = 0;
@@ -1458,7 +1458,7 @@ void extbk_import(char *file, HWND hwndDlg) GetPrivateProfileStructA("Global", _tagSettings[i].szSetting, &data, _tagSettings[i].size, file);
switch (_tagSettings[i].size) {
case 1:
- db_set_b(0, _tagSettings[i].szModule, _tagSettings[i].szSetting, (BYTE)data);
+ db_set_b(0, _tagSettings[i].szModule, _tagSettings[i].szSetting, (uint8_t)data);
break;
case 4:
db_set_dw(0, _tagSettings[i].szModule, _tagSettings[i].szSetting, data);
@@ -1557,7 +1557,7 @@ static INT_PTR CALLBACK DlgProcSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L case IDC_USESKIN:
{
int useskin = IsDlgButtonChecked(hwndDlg, IDC_USESKIN);
- db_set_b(0, "CLUI", "useskin", (BYTE)(useskin ? 1 : 0));
+ db_set_b(0, "CLUI", "useskin", (uint8_t)(useskin ? 1 : 0));
}
break;
@@ -1603,7 +1603,7 @@ static INT_PTR CALLBACK DlgProcSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L else
skinChanged = TRUE;
db_set_ws(0, "CLC", "AdvancedSkin", final_path);
- db_set_b(0, "CLUI", "skin_changed", (BYTE)skinChanged);
+ db_set_b(0, "CLUI", "skin_changed", (uint8_t)skinChanged);
SetDlgItemText(hwndDlg, IDC_SKINFILENAME, final_path);
}
}
@@ -1776,7 +1776,7 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA tci.mask = TCIF_PARAM;
TabCtrl_GetItem(GetDlgItem(hwnd, IDC_OPTIONSTAB), TabCtrl_GetCurSel(GetDlgItem(hwnd, IDC_OPTIONSTAB)), &tci);
ShowWindow((HWND)tci.lParam, SW_SHOW);
- db_set_b(0, "CLUI", "opage", (BYTE)TabCtrl_GetCurSel(GetDlgItem(hwnd, IDC_OPTIONSTAB)));
+ db_set_b(0, "CLUI", "opage", (uint8_t)TabCtrl_GetCurSel(GetDlgItem(hwnd, IDC_OPTIONSTAB)));
Utils::enableDlgControl(hwnd, IDC_EXPORT, TabCtrl_GetCurSel(GetDlgItem(hwnd, IDC_OPTIONSTAB)) != 0);
Utils::enableDlgControl(hwnd, IDC_IMPORT, TabCtrl_GetCurSel(GetDlgItem(hwnd, IDC_OPTIONSTAB)) != 0);
break;
diff --git a/plugins/Clist_nicer/src/statusbar.cpp b/plugins/Clist_nicer/src/statusbar.cpp index a61bd60c1e..5a2d833c35 100644 --- a/plugins/Clist_nicer/src/statusbar.cpp +++ b/plugins/Clist_nicer/src/statusbar.cpp @@ -87,7 +87,7 @@ LRESULT CALLBACK NewStatusBarWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM HDC hdc = BeginPaint(hwnd, &ps);
HDC hdcMem = CreateCompatibleDC(hdc);
RECT rcClient, rcWindow;
- BYTE windowStyle = db_get_b(0, "CLUI", "WindowStyle", SETTING_WINDOWSTYLE_DEFAULT);
+ uint8_t windowStyle = db_get_b(0, "CLUI", "WindowStyle", SETTING_WINDOWSTYLE_DEFAULT);
LONG b_offset = cfg::dat.bClipBorder + (windowStyle == SETTING_WINDOWSTYLE_NOBORDER ? 2 : (windowStyle == SETTING_WINDOWSTYLE_THINBORDER ? 1 : 0));
GetClientRect(hwnd, &rcClient);
diff --git a/plugins/Clist_nicer/src/stdafx.h b/plugins/Clist_nicer/src/stdafx.h index 39216d9f92..5c95d1f8d6 100644 --- a/plugins/Clist_nicer/src/stdafx.h +++ b/plugins/Clist_nicer/src/stdafx.h @@ -93,7 +93,7 @@ typedef int (__cdecl *pfnDrawAvatar)(HDC hdcOrig, HDC hdcMem, RECT *rc, ClcCon BOOL __forceinline GetItemByStatus(int status, StatusItems_t *retitem);
-void DrawAlpha(HDC hdcwnd, PRECT rc, DWORD basecolor, int alpha, DWORD basecolor2, BOOL transparent, BYTE FLG_GRADIENT, BYTE FLG_CORNER, DWORD BORDERSTYLE, ImageItem *item);
+void DrawAlpha(HDC hdcwnd, PRECT rc, DWORD basecolor, int alpha, DWORD basecolor2, BOOL transparent, uint8_t FLG_GRADIENT, uint8_t FLG_CORNER, DWORD BORDERSTYLE, ImageItem *item);
void CustomizeButton(HWND hWnd, bool bIsSkinned, bool bIsThemed, bool bIsFlat = false, bool bIsTTButton = false);
diff --git a/plugins/Clist_nicer/src/viewmodes.cpp b/plugins/Clist_nicer/src/viewmodes.cpp index 99a560f5df..144a1ba011 100644 --- a/plugins/Clist_nicer/src/viewmodes.cpp +++ b/plugins/Clist_nicer/src/viewmodes.cpp @@ -513,7 +513,7 @@ void UpdateFilters() {
int useLastMsg = dwFlags & CLVM_USELASTMSG;
DWORD lmdat;
- BYTE bTmp;
+ uint8_t bTmp;
CheckDlgButton(sttClvmHwnd, IDC_LASTMSG, useLastMsg ? BST_CHECKED : BST_UNCHECKED);
Utils::enableDlgControl(sttClvmHwnd, IDC_LASTMESSAGEOP, useLastMsg);
@@ -778,7 +778,7 @@ static int menuCounter = 0; static int FillMenuCallback(char *szSetting)
{
- if ((BYTE)szSetting[0] == 246)
+ if ((uint8_t)szSetting[0] == 246)
return 1;
AppendMenuA(hViewModeMenu, MF_STRING, menuCounter++, szSetting);
@@ -964,7 +964,7 @@ clvm_reset_command: Clist_Broadcast(CLM_AUTOREBUILD, 0, 0);
SetDlgItemText(hwnd, IDC_SELECTMODE, TranslateT("No view mode"));
g_clistApi.pfnSetHideOffline(cfg::dat.boldHideOffline);
- cfg::dat.boldHideOffline = (BYTE)-1;
+ cfg::dat.boldHideOffline = (uint8_t)-1;
SetButtonStates();
cfg::dat.current_viewmode[0] = 0;
cfg::dat.old_viewmode[0] = 0;
@@ -1064,7 +1064,7 @@ void ApplyViewMode(const char *name) strncpy_s(cfg::dat.current_viewmode, name, _TRUNCATE);
if (cfg::dat.filterFlags & CLVM_USELASTMSG) {
- BYTE bSaved = cfg::dat.sortOrder[0];
+ uint8_t bSaved = cfg::dat.sortOrder[0];
cfg::dat.sortOrder[0] = SORTBY_LASTMSG;
for (auto &p : cfg::arCache)
@@ -1099,7 +1099,7 @@ void ApplyViewMode(const char *name) if (HIWORD(cfg::dat.filterFlags) > 0)
cfg::dat.bFilterEffective |= CLVM_STICKY_CONTACTS;
- if (cfg::dat.boldHideOffline == (BYTE)-1)
+ if (cfg::dat.boldHideOffline == (uint8_t)-1)
cfg::dat.boldHideOffline = Clist::HideOffline;
g_clistApi.pfnSetHideOffline(false);
diff --git a/plugins/Cln_skinedit/src/main.cpp b/plugins/Cln_skinedit/src/main.cpp index e599e3e64b..fe71f00b9d 100644 --- a/plugins/Cln_skinedit/src/main.cpp +++ b/plugins/Cln_skinedit/src/main.cpp @@ -424,31 +424,31 @@ static void UpdateStatusStructSettingsFromOptDlg(HWND hwndDlg, int index) if (ChangedSItems.bALPHA) { GetDlgItemTextA(hwndDlg, IDC_ALPHA, buf, 10); // can be removed now if (buf[0] != 0) - p->ALPHA = (BYTE)SendDlgItemMessage(hwndDlg, IDC_ALPHASPIN, UDM_GETPOS, 0, 0); + p->ALPHA = (uint8_t)SendDlgItemMessage(hwndDlg, IDC_ALPHASPIN, UDM_GETPOS, 0, 0); } if (ChangedSItems.bMARGIN_LEFT) { GetDlgItemTextA(hwndDlg, IDC_MRGN_LEFT, buf, 10); if (buf[0] != 0) - p->MARGIN_LEFT = (BYTE)SendDlgItemMessage(hwndDlg, IDC_MRGN_LEFT_SPIN, UDM_GETPOS, 0, 0); + p->MARGIN_LEFT = (uint8_t)SendDlgItemMessage(hwndDlg, IDC_MRGN_LEFT_SPIN, UDM_GETPOS, 0, 0); } if (ChangedSItems.bMARGIN_TOP) { GetDlgItemTextA(hwndDlg, IDC_MRGN_TOP, buf, 10); if (buf[0] != 0) - p->MARGIN_TOP = (BYTE)SendDlgItemMessage(hwndDlg, IDC_MRGN_TOP_SPIN, UDM_GETPOS, 0, 0); + p->MARGIN_TOP = (uint8_t)SendDlgItemMessage(hwndDlg, IDC_MRGN_TOP_SPIN, UDM_GETPOS, 0, 0); } if (ChangedSItems.bMARGIN_RIGHT) { GetDlgItemTextA(hwndDlg, IDC_MRGN_RIGHT, buf, 10); if (buf[0] != 0) - p->MARGIN_RIGHT = (BYTE)SendDlgItemMessage(hwndDlg, IDC_MRGN_RIGHT_SPIN, UDM_GETPOS, 0, 0); + p->MARGIN_RIGHT = (uint8_t)SendDlgItemMessage(hwndDlg, IDC_MRGN_RIGHT_SPIN, UDM_GETPOS, 0, 0); } if (ChangedSItems.bMARGIN_BOTTOM) { GetDlgItemTextA(hwndDlg, IDC_MRGN_BOTTOM, buf, 10); if (buf[0] != 0) - p->MARGIN_BOTTOM = (BYTE)SendDlgItemMessage(hwndDlg, IDC_MRGN_BOTTOM_SPIN, UDM_GETPOS, 0, 0); + p->MARGIN_BOTTOM = (uint8_t)SendDlgItemMessage(hwndDlg, IDC_MRGN_BOTTOM_SPIN, UDM_GETPOS, 0, 0); } if (ChangedSItems.bBORDERSTYLE) { bdrtype = SendDlgItemMessage(hwndDlg, IDC_BORDERTYPE, CB_GETCURSEL, 0, 0); diff --git a/plugins/CmdLine/src/utils.h b/plugins/CmdLine/src/utils.h index 75572a5c7e..3a010c7f72 100644 --- a/plugins/CmdLine/src/utils.h +++ b/plugins/CmdLine/src/utils.h @@ -48,6 +48,6 @@ wchar_t* GetContactID(MCONTACT hContact, char *szProto); MCONTACT GetContactFromID(wchar_t *szID, char *szProto);
void Proto_GetBaseAccountName(MCONTACT hContact, char *szProto, size_t size);
-int MyPUShowMessage(char *lpzText, BYTE kind);
+int MyPUShowMessage(char *lpzText, uint8_t kind);
#endif
\ No newline at end of file diff --git a/plugins/Console/src/Console.cpp b/plugins/Console/src/Console.cpp index d6c3d5dc6e..099b0a3984 100644 --- a/plugins/Console/src/Console.cpp +++ b/plugins/Console/src/Console.cpp @@ -154,7 +154,7 @@ static void ShowConsole(int show) ScrollDown(pActive);
}
ShowWindow(hwndConsole, show ? SW_SHOW : SW_HIDE);
- g_plugin.setByte("Show", (BYTE)(show ? 1 : 0));
+ g_plugin.setByte("Show", (uint8_t)(show ? 1 : 0));
if (hwnd)
SetForegroundWindow(hwnd);
@@ -979,7 +979,7 @@ static void SaveSettings(HWND hwndDlg) gWrapLen = len;
SetDlgItemInt(hwndDlg, IDC_WRAP, gWrapLen, FALSE);
- g_plugin.setByte("Wrap", (BYTE)len);
+ g_plugin.setByte("Wrap", (uint8_t)len);
len = GetDlgItemInt(hwndDlg, IDC_LIMIT, nullptr, FALSE);
if (len < MIN_LIMIT)
@@ -991,11 +991,11 @@ static void SaveSettings(HWND hwndDlg) SetDlgItemInt(hwndDlg, IDC_LIMIT, gLimit, FALSE);
g_plugin.setDword("Limit", len);
- g_plugin.setByte("SingleMode", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SINGLE));
- g_plugin.setByte("Separator", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SEPARATOR));
- g_plugin.setByte("ShowIcons", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOWICONS));
+ g_plugin.setByte("SingleMode", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_SINGLE));
+ g_plugin.setByte("Separator", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_SEPARATOR));
+ g_plugin.setByte("ShowIcons", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_SHOWICONS));
- g_plugin.setByte("ShowAtStart", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_START));
+ g_plugin.setByte("ShowAtStart", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_START));
}
diff --git a/plugins/CountryFlags/src/ip2country.cpp b/plugins/CountryFlags/src/ip2country.cpp index 2e8bae93db..ec834a22e1 100644 --- a/plugins/CountryFlags/src/ip2country.cpp +++ b/plugins/CountryFlags/src/ip2country.cpp @@ -27,18 +27,18 @@ extern struct CountryListEntry *countries; #define DATARECORD_SIZE (sizeof(DWORD)+sizeof(DWORD)+sizeof(WORD))
// mir_free() the return value
-static BYTE* GetDataHeader(BYTE *data, DWORD cbDataSize, DWORD *pnDataRecordCount)
+static uint8_t* GetDataHeader(uint8_t *data, DWORD cbDataSize, DWORD *pnDataRecordCount)
{
- BYTE *recordData;
+ uint8_t *recordData;
/* uncompressed size stored in first DWORD */
*pnDataRecordCount = (*(DWORD*)data) / DATARECORD_SIZE;
- recordData = (BYTE*)mir_alloc(*(DWORD*)data);
+ recordData = (uint8_t*)mir_alloc(*(DWORD*)data);
if (recordData != nullptr)
Huffman_Uncompress(data + sizeof(DWORD), recordData, cbDataSize - sizeof(DWORD), *(DWORD*)data);
return recordData;
}
-static int GetDataRecord(BYTE *data, DWORD index, DWORD *pdwFrom, DWORD *pdwTo)
+static int GetDataRecord(uint8_t *data, DWORD index, DWORD *pdwFrom, DWORD *pdwTo)
{
data += index * DATARECORD_SIZE;
*pdwFrom = *(DWORD*)data;
@@ -52,7 +52,7 @@ static int GetDataRecord(BYTE *data, DWORD index, DWORD *pdwFrom, DWORD *pdwTo) static mir_cs csRecordCache;
static DWORD nDataRecordsCount; /* protected by csRecordCache */
-static BYTE *dataRecords; /* protected by csRecordCache */
+static uint8_t *dataRecords; /* protected by csRecordCache */
#define UNLOADDELAY 30*1000 /* time after which the data records are being unloaded */
@@ -64,7 +64,7 @@ static void CALLBACK UnloadRecordCache(LPARAM) }
// function assumes it has got the csRecordCache mutex
-static BOOL EnsureRecordCacheLoaded(BYTE **pdata, DWORD *pcount)
+static BOOL EnsureRecordCacheLoaded(uint8_t **pdata, DWORD *pcount)
{
HRSRC hrsrc;
DWORD cb;
@@ -73,7 +73,7 @@ static BOOL EnsureRecordCacheLoaded(BYTE **pdata, DWORD *pcount) /* load record data list from resources */
hrsrc = FindResource(g_plugin.getInst(), MAKEINTRESOURCE(IDR_IPTOCOUNTRY), L"BIN");
cb = SizeofResource(g_plugin.getInst(), hrsrc);
- dataRecords = (BYTE*)LockResource(LoadResource(g_plugin.getInst(), hrsrc));
+ dataRecords = (uint8_t*)LockResource(LoadResource(g_plugin.getInst(), hrsrc));
if (cb <= sizeof(DWORD) || dataRecords == nullptr)
return FALSE;
/* uncompress record data */
@@ -97,7 +97,7 @@ static void LeaveRecordCache(void) INT_PTR ServiceIpToCountry(WPARAM wParam, LPARAM)
{
- BYTE *data;
+ uint8_t *data;
DWORD dwFrom, dwTo;
DWORD low = 0, i, high;
int id;
@@ -162,14 +162,14 @@ struct { #define ALLOC_STEP (800*1024) /* approx. size of data output */
struct ResizableByteBuffer {
- BYTE *buf;
+ uint8_t *buf;
DWORD cbLength, cbAlloced;
};
static void AppendToByteBuffer(struct ResizableByteBuffer *buffer, const void *append, DWORD cbAppendSize)
{
if (buffer->cbAlloced <= buffer->cbLength + cbAppendSize) {
- BYTE* buf = (BYTE*)mir_realloc(buffer->buf, buffer->cbAlloced + ALLOC_STEP + cbAppendSize);
+ uint8_t* buf = (uint8_t*)mir_realloc(buffer->buf, buffer->cbAlloced + ALLOC_STEP + cbAppendSize);
if (buf == NULL) return;
buffer->buf = buf;
buffer->cbAlloced += ALLOC_STEP + cbAppendSize;
@@ -253,11 +253,11 @@ static int EnumIpDataLines(const char *pszFileCSV, const char *pszFileOut) if (buffer.buf != NULL) {
HANDLE hFileOut;
DWORD cbWritten = 0;
- BYTE *compressed;
+ uint8_t *compressed;
DWORD cbCompressed;
/* compress whole data */
OutputDebugStringA("Compressing...\n"); /* all ascii */
- compressed = (BYTE*)mir_alloc(buffer.cbAlloced + 384);
+ compressed = (uint8_t*)mir_alloc(buffer.cbAlloced + 384);
if (compressed != NULL) {
cbCompressed = Huffman_Compress(buffer.buf, compressed, buffer.cbLength);
OutputDebugStringA("Done!\n"); /* all ascii */
diff --git a/plugins/CrashDumper/src/stdafx.h b/plugins/CrashDumper/src/stdafx.h index 0059d13503..c35c36a8bb 100644 --- a/plugins/CrashDumper/src/stdafx.h +++ b/plugins/CrashDumper/src/stdafx.h @@ -80,7 +80,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMOption<BYTE> bCatchCrashes, bClassicDates, bUploadChanged, bUseSubFolder, bSuccessPopups;
+ CMOption<uint8_t> bCatchCrashes, bClassicDates, bUploadChanged, bUseSubFolder, bSuccessPopups;
bool bNeedRestart = false, bServiceMode = false;
diff --git a/plugins/CrashDumper/src/upload.cpp b/plugins/CrashDumper/src/upload.cpp index 099dc5f694..075c448336 100644 --- a/plugins/CrashDumper/src/upload.cpp +++ b/plugins/CrashDumper/src/upload.cpp @@ -20,11 +20,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. HNETLIBUSER hNetlibUser;
-static void arrayToHex(BYTE* data, size_t datasz, char* res)
+static void arrayToHex(uint8_t* data, size_t datasz, char* res)
{
char* resptr = res;
for (unsigned i = 0; i < datasz; i++) {
- const BYTE ch = data[i];
+ const uint8_t ch = data[i];
const char ch0 = (char)(ch >> 4);
*resptr++ = (char)((ch0 <= 9) ? ('0' + ch0) : (('a' - 10) + ch0));
@@ -47,11 +47,11 @@ void GetLoginStr(char* user, size_t szuser, char* pass) user[0] = 0;
if (g_plugin.getString("Password", &dbv) == 0) {
- BYTE hash[16];
+ uint8_t hash[16];
mir_md5_state_t context;
mir_md5_init(&context);
- mir_md5_append(&context, (BYTE*)dbv.pszVal, (int)mir_strlen(dbv.pszVal));
+ mir_md5_append(&context, (uint8_t*)dbv.pszVal, (int)mir_strlen(dbv.pszVal));
mir_md5_finish(&context, hash);
arrayToHex(hash, sizeof(hash), pass);
@@ -224,7 +224,7 @@ bool ProcessVIHash(bool store) CMStringW buffer;
PrintVersionInfo(buffer, 0);
- BYTE hash[16];
+ uint8_t hash[16];
mir_md5_state_t context;
mir_md5_init(&context);
diff --git a/plugins/CryptoPP/src/base16.cpp b/plugins/CryptoPP/src/base16.cpp index f75ebe1d1b..3d531add45 100644 --- a/plugins/CryptoPP/src/base16.cpp +++ b/plugins/CryptoPP/src/base16.cpp @@ -4,7 +4,7 @@ char* base16encode(const char *inBuffer, size_t count) {
char *outBuffer = (char *)malloc(count * 2 + 1);
char *outBufferPtr = outBuffer;
- BYTE *inBufferPtr = (BYTE *)inBuffer;
+ uint8_t *inBufferPtr = (uint8_t *)inBuffer;
while (count) {
*outBufferPtr++ = encode16(((*inBufferPtr) >> 4) & 0x0F);
@@ -19,7 +19,7 @@ char* base16encode(const char *inBuffer, size_t count) char* base16decode(const char *inBuffer, size_t *count)
{
char *outBuffer = (char *)mir_alloc(*count);
- BYTE *outBufferPtr = (BYTE *)outBuffer;
+ uint8_t *outBufferPtr = (uint8_t *)outBuffer;
bool big_endian = false;
if (*inBuffer == '0' && *(inBuffer + 1) == 'x') {
@@ -28,7 +28,7 @@ char* base16decode(const char *inBuffer, size_t *count) *count -= 2;
}
while (*count > 1) {
- BYTE c0, c1;
+ uint8_t c0, c1;
if (big_endian) {
c1 = decode16(*--inBuffer);
c0 = decode16(*--inBuffer);
@@ -46,7 +46,7 @@ char* base16decode(const char *inBuffer, size_t *count) *count -= 2;
}
*outBufferPtr = '\0';
- *count = (int)(outBufferPtr - (BYTE *)outBuffer);
+ *count = (int)(outBufferPtr - (uint8_t *)outBuffer);
return outBuffer;
}
diff --git a/plugins/CryptoPP/src/cpp_gpgw.cpp b/plugins/CryptoPP/src/cpp_gpgw.cpp index 224ddf82d4..cf77a1e3c4 100644 --- a/plugins/CryptoPP/src/cpp_gpgw.cpp +++ b/plugins/CryptoPP/src/cpp_gpgw.cpp @@ -146,7 +146,7 @@ int __cdecl gpg_set_key(HANDLE context, LPCSTR RemoteKey) if (!_gpg_check_key(RemoteKey)) return 0;
SAFE_FREE(ptr->pgpKey);
- ptr->pgpKey = (BYTE *) malloc(strlen(RemoteKey)+1);
+ ptr->pgpKey = (uint8_t *) malloc(strlen(RemoteKey)+1);
strcpy((LPSTR)ptr->pgpKey,RemoteKey);
return 1;
diff --git a/plugins/CryptoPP/src/cpp_gzip.cpp b/plugins/CryptoPP/src/cpp_gzip.cpp index 1750a255a4..f8c4a154ea 100644 --- a/plugins/CryptoPP/src/cpp_gzip.cpp +++ b/plugins/CryptoPP/src/cpp_gzip.cpp @@ -1,7 +1,7 @@ #include "commonheaders.h"
// gzip data
-BYTE *cpp_gzip(BYTE *pData, size_t nLen, size_t& nCompressedLen)
+uint8_t *cpp_gzip(uint8_t *pData, size_t nLen, size_t& nCompressedLen)
{
string zipped;
Gzip gzip(new StringSink(zipped), 5); // 1 is fast, 9 is slow
@@ -16,7 +16,7 @@ BYTE *cpp_gzip(BYTE *pData, size_t nLen, size_t& nCompressedLen) }
// gunzip data
-BYTE *cpp_gunzip(BYTE *pCompressedData, size_t nCompressedLen, size_t& nLen)
+uint8_t *cpp_gunzip(uint8_t *pCompressedData, size_t nCompressedLen, size_t& nLen)
{
string unzipped;
Gunzip gunzip(new StringSink(unzipped));
diff --git a/plugins/CryptoPP/src/cpp_keys.cpp b/plugins/CryptoPP/src/cpp_keys.cpp index 38c82bf6b8..f327c575d1 100644 --- a/plugins/CryptoPP/src/cpp_keys.cpp +++ b/plugins/CryptoPP/src/cpp_keys.cpp @@ -24,8 +24,8 @@ LPSTR __cdecl cpp_init_keya(HANDLE context, int features) p->dh = new DH(p0, g0);
}
- BYTE priv1[KEYSIZE]; // private key of 2048 bit
- BYTE publ1[KEYSIZE + 2]; // public key of 2048 bit + faetures field
+ uint8_t priv1[KEYSIZE]; // private key of 2048 bit
+ uint8_t publ1[KEYSIZE + 2]; // public key of 2048 bit + faetures field
memset(priv1, 0, sizeof(priv1));
memset(publ1, 0, sizeof(publ1));
@@ -148,17 +148,17 @@ int __cdecl cpp_calc_keyx(HANDLE context) if (!p->KeyB) { ptr->error = ERROR_NO_KEYB; return 0; }
ptr->error = ERROR_NONE;
- BYTE agreeVal[KEYSIZE];
+ uint8_t agreeVal[KEYSIZE];
memset(agreeVal, 0, sizeof(agreeVal));
- BYTE agr = p->dh->Agree(agreeVal, p->KeyA, p->KeyB, true); // calculate key
+ uint8_t agr = p->dh->Agree(agreeVal, p->KeyA, p->KeyB, true); // calculate key
if (agr) {
// not needed anymore
SAFE_FREE(p->PubA);
SAFE_FREE(p->KeyA);
mir_free(p->KeyB); p->KeyB = nullptr;
- BYTE buffer[Tiger::DIGESTSIZE]; // buffer for hash
+ uint8_t buffer[Tiger::DIGESTSIZE]; // buffer for hash
memset(buffer, 0, sizeof(buffer));
// do this only if key exchanged is ok
@@ -179,7 +179,7 @@ int __cdecl cpp_init_keyp(HANDLE context, LPCSTR password) pCNTX ptr = get_context_on_id(context); if (!ptr) return 0;
pSIMDATA p = (pSIMDATA)cpp_alloc_pdata(ptr);
- BYTE buffer[Tiger::DIGESTSIZE]; // buffer for hash
+ uint8_t buffer[Tiger::DIGESTSIZE]; // buffer for hash
memset(buffer, 0, sizeof(buffer));
// calculate hash
diff --git a/plugins/CryptoPP/src/cpp_misc.cpp b/plugins/CryptoPP/src/cpp_misc.cpp index 0b05a59356..d7905b13b7 100644 --- a/plugins/CryptoPP/src/cpp_misc.cpp +++ b/plugins/CryptoPP/src/cpp_misc.cpp @@ -36,7 +36,7 @@ int __cdecl cpp_size_keyx(void) return(Tiger::DIGESTSIZE + 2);
}
-void __cdecl cpp_get_keyx(HANDLE context, BYTE *key)
+void __cdecl cpp_get_keyx(HANDLE context, uint8_t *key)
{
pCNTX ptr;
pSIMDATA p;
@@ -46,7 +46,7 @@ void __cdecl cpp_get_keyx(HANDLE context, BYTE *key) memcpy(key + Tiger::DIGESTSIZE, &ptr->features, 2);
}
-void __cdecl cpp_set_keyx(HANDLE context, BYTE *key)
+void __cdecl cpp_set_keyx(HANDLE context, uint8_t *key)
{
pCNTX ptr;
pSIMDATA p;
@@ -61,7 +61,7 @@ void __cdecl cpp_set_keyx(HANDLE context, BYTE *key) memcpy(&ptr->features, key + Tiger::DIGESTSIZE, 2);
}
-void __cdecl cpp_get_keyp(HANDLE context, BYTE *key)
+void __cdecl cpp_get_keyp(HANDLE context, uint8_t *key)
{
pCNTX ptr;
pSIMDATA p;
@@ -75,7 +75,7 @@ int __cdecl cpp_size_keyp(void) return(Tiger::DIGESTSIZE);
}
-void __cdecl cpp_set_keyp(HANDLE context, BYTE *key)
+void __cdecl cpp_set_keyp(HANDLE context, uint8_t *key)
{
pCNTX ptr;
pSIMDATA p;
diff --git a/plugins/CryptoPP/src/cpp_rsau.cpp b/plugins/CryptoPP/src/cpp_rsau.cpp index bf2266e84a..fb92835b59 100644 --- a/plugins/CryptoPP/src/cpp_rsau.cpp +++ b/plugins/CryptoPP/src/cpp_rsau.cpp @@ -113,7 +113,7 @@ string hash(string& b) string hash(uint8_t *b, size_t l)
{
- BYTE h[RSA_KEYSIZE];
+ uint8_t h[RSA_KEYSIZE];
RSA_CalculateDigest(h, b, l);
string s; s.assign((char*)&h, RSA_KEYSIZE);
return s;
@@ -131,7 +131,7 @@ string hash128(LPSTR b) string hash128(uint8_t *b, size_t l)
{
- BYTE h[RIPEMD128::DIGESTSIZE];
+ uint8_t h[RIPEMD128::DIGESTSIZE];
RIPEMD128().CalculateDigest(h, b, l);
string s; s.assign((char*)&h, sizeof(h));
return s;
@@ -149,7 +149,7 @@ string hash256(LPSTR b) string hash256(uint8_t *b, size_t l)
{
- BYTE h[RIPEMD256::DIGESTSIZE];
+ uint8_t h[RIPEMD256::DIGESTSIZE];
RIPEMD256().CalculateDigest(h, b, l);
string s; s.assign((char*)&h, sizeof(h));
return s;
diff --git a/plugins/CryptoPP/src/cpp_svcs.cpp b/plugins/CryptoPP/src/cpp_svcs.cpp index 23c05cb5e1..15d8202498 100644 --- a/plugins/CryptoPP/src/cpp_svcs.cpp +++ b/plugins/CryptoPP/src/cpp_svcs.cpp @@ -8,13 +8,13 @@ LPSTR __cdecl cpp_encrypt(pCNTX ptr, LPCSTR szPlainMsg) ptr->error = ERROR_NONE;
pSIMDATA p = (pSIMDATA)ptr->pdata;
- BYTE dataflag = 0;
+ uint8_t dataflag = 0;
size_t slen = strlen(szPlainMsg);
LPSTR szMsg;
if (ptr->features & FEATURES_GZIP) {
size_t clen;
- szMsg = (LPSTR)cpp_gzip((BYTE*)szPlainMsg, slen, clen);
+ szMsg = (LPSTR)cpp_gzip((uint8_t*)szPlainMsg, slen, clen);
if (clen >= slen) {
free(szMsg);
szMsg = _strdup(szPlainMsg);
@@ -38,9 +38,9 @@ LPSTR __cdecl cpp_encrypt(pCNTX ptr, LPCSTR szPlainMsg) unsigned clen = (unsigned)ciphered.length();
if (ptr->features & FEATURES_CRC32) {
- BYTE crc32[CRC32::DIGESTSIZE];
+ uint8_t crc32[CRC32::DIGESTSIZE];
memset(crc32, 0, sizeof(crc32));
- CRC32().CalculateDigest(crc32, (BYTE*)ciphered.data(), clen);
+ CRC32().CalculateDigest(crc32, (uint8_t*)ciphered.data(), clen);
ciphered.insert(0, (LPSTR)&crc32, CRC32::DIGESTSIZE);
ciphered.insert(0, (LPSTR)&clen, 2);
}
@@ -79,7 +79,7 @@ LPSTR __cdecl cpp_decrypt(pCNTX ptr, LPCSTR szEncMsg) LPSTR bciphered = ciphered;
- BYTE dataflag = 0;
+ uint8_t dataflag = 0;
if (ptr->features & FEATURES_GZIP) {
dataflag = *ciphered;
bciphered++; clen--; // cut GZIP flag
@@ -96,7 +96,7 @@ LPSTR __cdecl cpp_decrypt(pCNTX ptr, LPCSTR szEncMsg) return nullptr;
}
- BYTE crc32[CRC32::DIGESTSIZE];
+ uint8_t crc32[CRC32::DIGESTSIZE];
memset(crc32, 0, sizeof(crc32));
CRC32().CalculateDigest(crc32, (uint8_t*)(bciphered + CRC32::DIGESTSIZE), len);
diff --git a/plugins/CryptoPP/src/cryptopp.h b/plugins/CryptoPP/src/cryptopp.h index 5b8d304c40..f3c1cb8aca 100644 --- a/plugins/CryptoPP/src/cryptopp.h +++ b/plugins/CryptoPP/src/cryptopp.h @@ -87,7 +87,7 @@ typedef PGPDATA* pPGPDATA; typedef struct __GPGDATA {
- BYTE *gpgKeyID; // GPG KeyID
+ uint8_t *gpgKeyID; // GPG KeyID
} GPGDATA;
typedef GPGDATA* pGPGDATA;
@@ -155,8 +155,8 @@ extern LPCSTR szVersionStr; pCNTX get_context_on_id(int);
pCNTX get_context_on_id(HANDLE);
void cpp_free_keys(pCNTX);
-BYTE *cpp_gzip(BYTE*, size_t, size_t&);
-BYTE *cpp_gunzip(BYTE*, size_t, size_t&);
+uint8_t *cpp_gzip(uint8_t*, size_t, size_t&);
+uint8_t *cpp_gunzip(uint8_t*, size_t, size_t&);
string cpp_zlibc(string&);
string cpp_zlibd(string&);
diff --git a/plugins/CryptoPP/src/utf8.cpp b/plugins/CryptoPP/src/utf8.cpp index 6a0a6e21a7..03bcce1f36 100644 --- a/plugins/CryptoPP/src/utf8.cpp +++ b/plugins/CryptoPP/src/utf8.cpp @@ -27,7 +27,7 @@ LPSTR __cdecl utf8encode(LPCWSTR str) i = 0;
for (w = wszTemp; *w; w++) {
if (*w < 0x0080)
- szOut[i++] = (BYTE)*w;
+ szOut[i++] = (uint8_t)*w;
else if (*w < 0x0800) {
szOut[i++] = 0xc0 | (((*w) >> 6) & 0x3f);
szOut[i++] = 0x80 | ((*w) & 0x3f);
diff --git a/plugins/Db3x_mmap/src/dbcrypt.cpp b/plugins/Db3x_mmap/src/dbcrypt.cpp index 7778535d2c..39f523be8e 100644 --- a/plugins/Db3x_mmap/src/dbcrypt.cpp +++ b/plugins/Db3x_mmap/src/dbcrypt.cpp @@ -74,7 +74,7 @@ STDMETHODIMP_(BOOL) CDb3Mmap::ReadCryptoKey(MBinBuffer &buf) STDMETHODIMP_(BOOL) CDb3Mmap::StoreCryptoKey()
{
size_t iKeyLength = m_crypto->getKeyLength();
- BYTE *pKey = (BYTE*)_alloca(iKeyLength);
+ uint8_t *pKey = (uint8_t*)_alloca(iKeyLength);
m_crypto->getKey(pKey, iKeyLength);
DBCONTACTWRITESETTING dbcws = { "CryptoEngine", "StoredKey" };
@@ -196,7 +196,7 @@ void CDb3Mmap::ToggleSettingsEncryption(MCONTACT contactID) len = *(PWORD)(pBlob + 1);
// we need to convert a string into utf8 and encrypt it
if (!m_bEncrypted) {
- BYTE bSave = pBlob[len + 3]; pBlob[len + 3] = 0;
+ uint8_t bSave = pBlob[len + 3]; pBlob[len + 3] = 0;
arSettings.insert(new VarDescr(szSetting, mir_utf8encode((LPCSTR)pBlob + 3)));
pBlob[len + 3] = bSave;
}
@@ -207,7 +207,7 @@ void CDb3Mmap::ToggleSettingsEncryption(MCONTACT contactID) len = *(PWORD)(pBlob + 1);
// we need to encrypt these strings
if (!m_bEncrypted) {
- BYTE bSave = pBlob[len + 3]; pBlob[len + 3] = 0;
+ uint8_t bSave = pBlob[len + 3]; pBlob[len + 3] = 0;
arSettings.insert(new VarDescr(szSetting, (LPCSTR)pBlob + 3));
pBlob[len + 3] = bSave;
}
@@ -234,7 +234,7 @@ void CDb3Mmap::ToggleSettingsEncryption(MCONTACT contactID) for (auto &p : arSettings) {
if (!m_bEncrypted) {
size_t encodedLen;
- BYTE *pResult = m_crypto->encodeString(p->szValue, &encodedLen);
+ uint8_t *pResult = m_crypto->encodeString(p->szValue, &encodedLen);
if (pResult != nullptr) {
DBCONTACTWRITESETTING dbcws = { szModule, p->szVar };
dbcws.value.type = DBVT_ENCRYPTED;
@@ -285,8 +285,8 @@ void CDb3Mmap::ToggleEventsEncryption(MCONTACT contactID) size_t len;
DWORD ofsDest;
- mir_ptr<BYTE> pBlob;
- BYTE *pSource = DBRead(offset + offsetof(DBEvent, blob), nullptr);
+ mir_ptr<uint8_t> pBlob;
+ uint8_t *pSource = DBRead(offset + offsetof(DBEvent, blob), nullptr);
if (!m_bEncrypted) { // we need more space
if ((pBlob = m_crypto->encodeBuffer(pSource, evt.cbBlob, &len)) == nullptr)
return;
@@ -313,7 +313,7 @@ void CDb3Mmap::ToggleEventsEncryption(MCONTACT contactID) evt.flags |= DBEF_ENCRYPTED;
}
else {
- if ((pBlob = (BYTE*)m_crypto->decodeBuffer(pSource, evt.cbBlob, &len)) == nullptr)
+ if ((pBlob = (uint8_t*)m_crypto->decodeBuffer(pSource, evt.cbBlob, &len)) == nullptr)
return;
ofsDest = offset; // reuse the old space
diff --git a/plugins/Db3x_mmap/src/dbevents.cpp b/plugins/Db3x_mmap/src/dbevents.cpp index 69928a404c..806f51e955 100644 --- a/plugins/Db3x_mmap/src/dbevents.cpp +++ b/plugins/Db3x_mmap/src/dbevents.cpp @@ -64,12 +64,12 @@ MEVENT CDb3Mmap::AddEvent(MCONTACT contactID, const DBEVENTINFO *dbei) dbe.flags = dbei->flags;
dbe.wEventType = dbei->eventType;
dbe.cbBlob = dbei->cbBlob;
- BYTE *pBlob = dbei->pBlob;
+ uint8_t *pBlob = dbei->pBlob;
- mir_ptr<BYTE> pCryptBlob;
+ mir_ptr<uint8_t> pCryptBlob;
if (m_bEncrypted) {
size_t len;
- BYTE *pResult = m_crypto->encodeBuffer(pBlob, dbe.cbBlob, &len);
+ uint8_t *pResult = m_crypto->encodeBuffer(pBlob, dbe.cbBlob, &len);
if (pResult != nullptr) {
pCryptBlob = pBlob = pResult;
dbe.cbBlob = (DWORD)len;
@@ -302,7 +302,7 @@ BOOL CDb3Mmap::GetEvent(MEVENT hDbEvent, DBEVENTINFO *dbei) dbei->cbBlob = dbe->cbBlob;
if (bytesToCopy && dbei->pBlob) {
- BYTE *pSrc;
+ uint8_t *pSrc;
if (m_dbHeader.version >= DB_095_1_VERSION)
pSrc = DBRead(DWORD(hDbEvent) + offsetof(DBEvent, blob), nullptr);
else
@@ -310,7 +310,7 @@ BOOL CDb3Mmap::GetEvent(MEVENT hDbEvent, DBEVENTINFO *dbei) if (dbe->flags & DBEF_ENCRYPTED) {
dbei->flags &= ~DBEF_ENCRYPTED;
size_t len;
- BYTE* pBlob = (BYTE*)m_crypto->decodeBuffer(pSrc, dbe->cbBlob, &len);
+ uint8_t* pBlob = (uint8_t*)m_crypto->decodeBuffer(pSrc, dbe->cbBlob, &len);
if (pBlob == nullptr)
return 1;
diff --git a/plugins/Db3x_mmap/src/dbintf.h b/plugins/Db3x_mmap/src/dbintf.h index 43907534cf..4963ab95bf 100644 --- a/plugins/Db3x_mmap/src/dbintf.h +++ b/plugins/Db3x_mmap/src/dbintf.h @@ -78,7 +78,7 @@ DWORD __forceinline GetSettingValueLength(uint8_t *pSetting) struct DBSignature
{
char name[15];
- BYTE eof;
+ uint8_t eof;
};
struct ModuleName
@@ -90,7 +90,7 @@ struct ModuleName #include <pshpack1.h>
struct DBHeader
{
- BYTE signature[16]; // 'Miranda ICQ DB',0,26
+ uint8_t signature[16]; // 'Miranda ICQ DB',0,26
DWORD version; // as 4 bytes, ie 1.2.3.10 = 0x0102030a
DWORD ofsFileEnd; // offset of the end of the database - place to write new structures
DWORD slackSpace; // a counter of the number of bytes that have been
@@ -123,7 +123,7 @@ struct DBModuleName {
DWORD signature;
DWORD ofsNext; // offset to the next module name in the chain
- BYTE cbName; // number of characters in this module name
+ uint8_t cbName; // number of characters in this module name
char name[1]; // name, no nul terminator
};
@@ -136,7 +136,7 @@ struct DBContactSettings DWORD cbBlob; // size of the blob in bytes. May be larger than the
// actual size for reducing the number of moves
// required using granularity in resizing
- BYTE blob[1]; // the blob. a back-to-back sequence of DBSetting
+ uint8_t blob[1]; // the blob. a back-to-back sequence of DBSetting
// structs, the last has cbName = 0
};
@@ -152,7 +152,7 @@ struct DBEvent_094 // previous event storage format DWORD flags; // see m_database.h, db/event/add
WORD wEventType; // module-defined event type
DWORD cbBlob; // number of bytes in the blob
- BYTE blob[1]; // the blob. module-defined formatting
+ uint8_t blob[1]; // the blob. module-defined formatting
};
struct DBEvent
@@ -167,7 +167,7 @@ struct DBEvent DWORD flags; // see m_database.h, db/event/add
WORD wEventType; // module-defined event type
DWORD cbBlob; // number of bytes in the blob
- BYTE blob[1]; // the blob. module-defined formatting
+ uint8_t blob[1]; // the blob. module-defined formatting
bool __forceinline markedRead() const
{
diff --git a/plugins/Db3x_mmap/src/dbsettings.cpp b/plugins/Db3x_mmap/src/dbsettings.cpp index 9ed7ba662e..e4fa495431 100644 --- a/plugins/Db3x_mmap/src/dbsettings.cpp +++ b/plugins/Db3x_mmap/src/dbsettings.cpp @@ -112,7 +112,7 @@ LBL_Seek: if (isStatic && (pBlob[0] & DBVTF_VARIABLELENGTH) && VLT(dbv->type) != VLT(pBlob[0]))
return 1;
- BYTE iType = dbv->type = pBlob[0];
+ uint8_t iType = dbv->type = pBlob[0];
switch (iType) {
case DBVT_DELETED: /* this setting is deleted */
dbv->type = DBVT_DELETED;
@@ -150,7 +150,7 @@ LBL_Seek: memmove(dbv->pbVal, pBlob + 3, dbv->cpbVal);
}
else {
- dbv->pbVal = (BYTE *)mir_alloc(varLen);
+ dbv->pbVal = (uint8_t *)mir_alloc(varLen);
memmove(dbv->pbVal, pBlob + 3, varLen);
}
dbv->cpbVal = varLen;
@@ -419,7 +419,7 @@ STDMETHODIMP_(BOOL) CDb3Mmap::WriteContactSettingWorker(MCONTACT contactID, DBCO break;
}
- BYTE zero = 0;
+ uint8_t zero = 0;
DBWrite(ofsBlobPtr, &zero, 1);
// quit
diff --git a/plugins/DbEditorPP/src/exportimport.cpp b/plugins/DbEditorPP/src/exportimport.cpp index 8408a23215..3ad32a0b21 100644 --- a/plugins/DbEditorPP/src/exportimport.cpp +++ b/plugins/DbEditorPP/src/exportimport.cpp @@ -354,7 +354,7 @@ void importSettings(MCONTACT hContact, char *utf8) case 'b':
case 'B':
if (sscanf(end + 2, "%u", &value) == 1)
- db_set_b(hContact, module, setting, (BYTE)value);
+ db_set_b(hContact, module, setting, (uint8_t)value);
break;
case 'w':
case 'W':
diff --git a/plugins/DbEditorPP/src/main.cpp b/plugins/DbEditorPP/src/main.cpp index feade7ed71..d13c44bf7a 100644 --- a/plugins/DbEditorPP/src/main.cpp +++ b/plugins/DbEditorPP/src/main.cpp @@ -7,7 +7,7 @@ bool g_bServiceMode = false; bool g_bUsePopups;
CMPlugin g_plugin;
-BYTE nameOrder[NAMEORDERCOUNT];
+uint8_t nameOrder[NAMEORDERCOUNT];
HGENMENU hUserMenu;
MCONTACT hRestore;
diff --git a/plugins/DbEditorPP/src/settinglist.cpp b/plugins/DbEditorPP/src/settinglist.cpp index fde94ed280..1ac1c76d98 100644 --- a/plugins/DbEditorPP/src/settinglist.cpp +++ b/plugins/DbEditorPP/src/settinglist.cpp @@ -494,7 +494,7 @@ bool CMainDlg::EditLabelWndProc(HWND hwnd, UINT uMsg, WPARAM wParam) case 'B':
val = wcstoul(&value[1], nullptr, 0);
if (!val || value[1] == '0') {
- res = !db_set_b(m_hContact, m_module, m_setting, (BYTE)val);
+ res = !db_set_b(m_hContact, m_module, m_setting, (uint8_t)val);
}
else
res = setTextValue(m_hContact, m_module, m_setting, value, dbv.type);
diff --git a/plugins/DbEditorPP/src/stdafx.h b/plugins/DbEditorPP/src/stdafx.h index 6a41564f88..eb60394086 100644 --- a/plugins/DbEditorPP/src/stdafx.h +++ b/plugins/DbEditorPP/src/stdafx.h @@ -175,9 +175,9 @@ extern bool g_bUsePopups; #define HEX_DWORD 4
// main
-char *StringFromBlob(BYTE *blob, WORD len);
+char *StringFromBlob(uint8_t *blob, WORD len);
int WriteBlobFromString(MCONTACT hContact, const char *module, const char *setting, const char *value, int len);
-wchar_t *DBVType(BYTE type);
+wchar_t *DBVType(uint8_t type);
DWORD getNumericValue(DBVARIANT *dbv);
int setNumericValue(MCONTACT hContact, const char *module, const char *setting, DWORD value, int type);
int IsRealUnicode(wchar_t *value);
diff --git a/plugins/DbEditorPP/src/utils.cpp b/plugins/DbEditorPP/src/utils.cpp index 5b93ac8ad1..1979392d12 100644 --- a/plugins/DbEditorPP/src/utils.cpp +++ b/plugins/DbEditorPP/src/utils.cpp @@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include "stdafx.h" -extern BYTE nameOrder[NAMEORDERCOUNT]; +extern uint8_t nameOrder[NAMEORDERCOUNT]; ///////////////////////////////////////////////////////////////////////////////////////// @@ -40,7 +40,7 @@ int ListView_SetItemTextA(HWND hwndLV, int i, int iSubItem, const char *pszText) ///////////////////////////////////////////////////////////////////////////////////////// -char* StringFromBlob(BYTE *blob, WORD len) +char* StringFromBlob(uint8_t *blob, WORD len) { int j; char tmp[16]; @@ -58,9 +58,9 @@ char* StringFromBlob(BYTE *blob, WORD len) int WriteBlobFromString(MCONTACT hContact, const char *szModule, const char *szSetting, const char *szValue, int len) { int j = 0, i = 0; - BYTE b; + uint8_t b; int tmp, res = 0; - BYTE *data = (BYTE*)mir_alloc(2 + len / 2); + uint8_t *data = (uint8_t*)mir_alloc(2 + len / 2); if (!data) return 0; @@ -72,7 +72,7 @@ int WriteBlobFromString(MCONTACT hContact, const char *szModule, const char *szS (b >= 'A' && b <= 'F') || (b >= 'a' && b <= 'f')) { if (sscanf(&szValue[j], "%02X", &tmp) == 1) { - data[i++] = (BYTE)(tmp & 0xFF); + data[i++] = (uint8_t)(tmp & 0xFF); j++; } } @@ -87,10 +87,10 @@ int WriteBlobFromString(MCONTACT hContact, const char *szModule, const char *szS return res; } -wchar_t* DBVType(BYTE type) +wchar_t* DBVType(uint8_t type) { switch (type) { - case DBVT_BYTE: return L"BYTE"; + case DBVT_BYTE: return L"uint8_t"; case DBVT_WORD: return L"WORD"; case DBVT_DWORD: return L"DWORD"; case DBVT_ASCIIZ: return L"STRING"; @@ -120,7 +120,7 @@ int setNumericValue(MCONTACT hContact, const char *module, const char *setting, switch (type) { case DBVT_BYTE: if (value <= 0xFF) - return !db_set_b(hContact, module, setting, (BYTE)value); + return !db_set_b(hContact, module, setting, (uint8_t)value); break; case DBVT_WORD: diff --git a/plugins/Db_autobackups/src/options.cpp b/plugins/Db_autobackups/src/options.cpp index 55b618088b..cd19058170 100644 --- a/plugins/Db_autobackups/src/options.cpp +++ b/plugins/Db_autobackups/src/options.cpp @@ -42,7 +42,7 @@ class COptionsDlg : public CDlgBase m_cloudFileService.Enable(m_useCloudFile.IsChecked());
onChange_UseZip(0);
- BYTE backupTypes = g_plugin.backup_types;
+ uint8_t backupTypes = g_plugin.backup_types;
if (backupTypes == BT_DISABLED)
backupTypes = g_plugin.backup_types.Default();
m_backupOnStart.SetState((backupTypes & BT_START) != 0);
@@ -219,7 +219,7 @@ public: bool OnApply() override
{
- BYTE backupTypes = BT_DISABLED;
+ uint8_t backupTypes = BT_DISABLED;
if (m_backupOnStart.IsChecked())
backupTypes |= BT_START;
diff --git a/plugins/Db_autobackups/src/stdafx.h b/plugins/Db_autobackups/src/stdafx.h index 883372ea4d..452ea2b28a 100644 --- a/plugins/Db_autobackups/src/stdafx.h +++ b/plugins/Db_autobackups/src/stdafx.h @@ -40,16 +40,16 @@ struct CMPlugin : public PLUGIN<CMPlugin> HANDLE hevBackup;
wchar_t folder[MAX_PATH];
- CMOption<BYTE> backup_types;
+ CMOption<uint8_t> backup_types;
CMOption<WORD> period;
- CMOption<BYTE> period_type;
+ CMOption<uint8_t> period_type;
CMOption<wchar_t*> file_mask;
CMOption<WORD> num_backups;
- CMOption<BYTE> disable_progress;
- CMOption<BYTE> disable_popups;
- CMOption<BYTE> use_zip;
- CMOption<BYTE> backup_profile;
- CMOption<BYTE> use_cloudfile;
+ CMOption<uint8_t> disable_progress;
+ CMOption<uint8_t> disable_popups;
+ CMOption<uint8_t> use_zip;
+ CMOption<uint8_t> backup_profile;
+ CMOption<uint8_t> use_cloudfile;
CMOption<char*> cloudfile_service;
int Load() override;
diff --git a/plugins/Db_autobackups/src/zip.cpp b/plugins/Db_autobackups/src/zip.cpp index cd3e0187ef..ba7a95b342 100644 --- a/plugins/Db_autobackups/src/zip.cpp +++ b/plugins/Db_autobackups/src/zip.cpp @@ -23,7 +23,7 @@ int CreateZipFile(const wchar_t *szDestPath, OBJLIST<ZipFile> &lstFiles, const s int iOpenRes = zipOpenNewFileInZip(hZip, _T2A(zf->sZipPath.c_str()), &fi, nullptr, 0, nullptr, 0, "", Z_DEFLATED, Z_BEST_COMPRESSION);
if (iOpenRes == ZIP_OK) {
DWORD dwRead;
- BYTE buf[0x40000];
+ uint8_t buf[0x40000];
while (ReadFile(hSrcFile, buf, sizeof(buf), &dwRead, nullptr) && dwRead)
if (zipWriteInFileInZip(hZip, buf, dwRead) != ZIP_OK)
diff --git a/plugins/Dbx_mdbx/src/dbcrypt.cpp b/plugins/Dbx_mdbx/src/dbcrypt.cpp index 39251349c5..b58967b3b8 100644 --- a/plugins/Dbx_mdbx/src/dbcrypt.cpp +++ b/plugins/Dbx_mdbx/src/dbcrypt.cpp @@ -44,7 +44,7 @@ STDMETHODIMP_(BOOL) CDbxMDBX::ReadCryptoKey(MBinBuffer &buf) STDMETHODIMP_(BOOL) CDbxMDBX::StoreCryptoKey()
{
size_t iKeyLength = m_crypto->getKeyLength();
- BYTE *pKey = (BYTE*)_alloca(iKeyLength);
+ uint8_t *pKey = (uint8_t*)_alloca(iKeyLength);
m_crypto->getKey(pKey, iKeyLength);
{
txn_ptr trnlck(this);
@@ -129,15 +129,15 @@ STDMETHODIMP_(BOOL) CDbxMDBX::EnableEncryption(BOOL bEncrypted) }
const DBEvent *dbEvent = (const DBEvent*)data.iov_base;
- const BYTE *pBlob = (BYTE*)(dbEvent + 1);
+ const uint8_t *pBlob = (uint8_t*)(dbEvent + 1);
if (((dbEvent->flags & DBEF_ENCRYPTED) != 0) != bEncrypted) {
- mir_ptr<BYTE> pNewBlob;
+ mir_ptr<uint8_t> pNewBlob;
size_t nNewBlob;
uint32_t dwNewFlags;
if (dbEvent->flags & DBEF_ENCRYPTED) {
- pNewBlob = (BYTE*)m_crypto->decodeBuffer(pBlob, dbEvent->cbBlob, &nNewBlob);
+ pNewBlob = (uint8_t*)m_crypto->decodeBuffer(pBlob, dbEvent->cbBlob, &nNewBlob);
dwNewFlags = dbEvent->flags & (~DBEF_ENCRYPTED);
}
else {
@@ -146,7 +146,7 @@ STDMETHODIMP_(BOOL) CDbxMDBX::EnableEncryption(BOOL bEncrypted) }
data.iov_len = sizeof(DBEvent) + nNewBlob;
- mir_ptr<BYTE> pData((BYTE*)mir_alloc(data.iov_len));
+ mir_ptr<uint8_t> pData((uint8_t*)mir_alloc(data.iov_len));
data.iov_base = pData.get();
DBEvent *pNewDBEvent = (DBEvent *)data.iov_base;
diff --git a/plugins/Dbx_mdbx/src/dbevents.cpp b/plugins/Dbx_mdbx/src/dbevents.cpp index 8bfd07e297..18b59b6606 100644 --- a/plugins/Dbx_mdbx/src/dbevents.cpp +++ b/plugins/Dbx_mdbx/src/dbevents.cpp @@ -188,12 +188,12 @@ bool CDbxMDBX::EditEvent(MCONTACT contactID, MEVENT hDbEvent, const DBEVENTINFO dbe.flags = dbei->flags;
dbe.wEventType = dbei->eventType;
dbe.cbBlob = dbei->cbBlob;
- BYTE *pBlob = dbei->pBlob;
+ uint8_t *pBlob = dbei->pBlob;
- mir_ptr<BYTE> pCryptBlob;
+ mir_ptr<uint8_t> pCryptBlob;
if (m_bEncrypted) {
size_t len;
- BYTE *pResult = m_crypto->encodeBuffer(pBlob, dbe.cbBlob, &len);
+ uint8_t *pResult = m_crypto->encodeBuffer(pBlob, dbe.cbBlob, &len);
if (pResult != nullptr) {
pCryptBlob = pBlob = pResult;
dbe.cbBlob = (uint16_t)len;
@@ -207,7 +207,7 @@ bool CDbxMDBX::EditEvent(MCONTACT contactID, MEVENT hDbEvent, const DBEVENTINFO dbe.flags |= DBEF_HAS_ID;
}
- BYTE *recBuf = (BYTE*)_alloca(sizeof(dbe) + dbe.cbBlob + cbSrvId + 2), *p = recBuf;
+ uint8_t *recBuf = (uint8_t*)_alloca(sizeof(dbe) + dbe.cbBlob + cbSrvId + 2), *p = recBuf;
memcpy(p, &dbe, sizeof(dbe)); p += sizeof(dbe);
memcpy(p, pBlob, dbe.cbBlob); p += dbe.cbBlob;
if (*p != 0)
@@ -319,11 +319,11 @@ BOOL CDbxMDBX::GetEvent(MEVENT hDbEvent, DBEVENTINFO *dbei) dbei->cbBlob = (DWORD)cbBlob;
if (bytesToCopy && dbei->pBlob) {
- BYTE *pSrc = (BYTE*)dbe + sizeof(DBEvent);
+ uint8_t *pSrc = (uint8_t*)dbe + sizeof(DBEvent);
if (dbe->flags & DBEF_ENCRYPTED) {
dbei->flags &= ~DBEF_ENCRYPTED;
size_t len;
- BYTE* pBlob = (BYTE*)m_crypto->decodeBuffer(pSrc, dbe->cbBlob, &len);
+ uint8_t* pBlob = (uint8_t*)m_crypto->decodeBuffer(pSrc, dbe->cbBlob, &len);
if (pBlob == nullptr)
return 1;
diff --git a/plugins/Dbx_mdbx/src/dbintf.cpp b/plugins/Dbx_mdbx/src/dbintf.cpp index 9d3e44a910..3875eaae54 100644 --- a/plugins/Dbx_mdbx/src/dbintf.cpp +++ b/plugins/Dbx_mdbx/src/dbintf.cpp @@ -91,7 +91,7 @@ LBL_Fail: /////////////////////////////////////////////////////////////////////////////////////////
size_t iDefHeaderOffset = 0;
-BYTE bDefHeader[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
+uint8_t bDefHeader[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
int CDbxMDBX::Check(void)
{
@@ -100,7 +100,7 @@ int CDbxMDBX::Check(void) return EGROKPRF_CANTREAD;
fseek(pFile, (LONG)iDefHeaderOffset, SEEK_SET);
- BYTE buf[_countof(bDefHeader)];
+ uint8_t buf[_countof(bDefHeader)];
size_t cbRead = fread(buf, 1, _countof(buf), pFile);
fclose(pFile);
if (cbRead != _countof(buf))
diff --git a/plugins/Dbx_mdbx/src/dbintf.h b/plugins/Dbx_mdbx/src/dbintf.h index f847c43730..47be0cc7c2 100644 --- a/plugins/Dbx_mdbx/src/dbintf.h +++ b/plugins/Dbx_mdbx/src/dbintf.h @@ -94,10 +94,10 @@ struct DBSettingKey struct DBSettingValue
{
- BYTE type;
+ uint8_t type;
union
{
- BYTE bVal;
+ uint8_t bVal;
WORD wVal;
DWORD dwVal;
char szVal[];
@@ -105,7 +105,7 @@ struct DBSettingValue struct
{
size_t nLength;
- BYTE bVal[];
+ uint8_t bVal[];
} blob;
};
};
diff --git a/plugins/Dbx_mdbx/src/dbsettings.cpp b/plugins/Dbx_mdbx/src/dbsettings.cpp index c7d99f92f8..103bcfb636 100644 --- a/plugins/Dbx_mdbx/src/dbsettings.cpp +++ b/plugins/Dbx_mdbx/src/dbsettings.cpp @@ -36,7 +36,7 @@ void CDbxMDBX::FillSettings() if (szModule == nullptr)
continue;
- const BYTE *pBlob = (const BYTE*)data.iov_base;
+ const uint8_t *pBlob = (const uint8_t*)data.iov_base;
if (*pBlob == DBVT_DELETED)
continue;
@@ -51,7 +51,7 @@ void CDbxMDBX::FillSettings() WORD varLen;
- BYTE iType = dbv->type = pBlob[0]; pBlob++;
+ uint8_t iType = dbv->type = pBlob[0]; pBlob++;
switch (iType) {
case DBVT_BYTE: dbv->bVal = *pBlob; break;
case DBVT_WORD: dbv->wVal = *(WORD*)pBlob; break;
@@ -70,7 +70,7 @@ void CDbxMDBX::FillSettings() case DBVT_ENCRYPTED:
varLen = *(WORD*)pBlob;
pBlob += 2;
- dbv->pbVal = (BYTE *)mir_alloc(varLen);
+ dbv->pbVal = (uint8_t *)mir_alloc(varLen);
memcpy(dbv->pbVal, pBlob, varLen);
dbv->cpbVal = varLen;
break;
@@ -113,7 +113,7 @@ BOOL CDbxMDBX::WriteContactSettingWorker(MCONTACT contactID, DBCONTACTWRITESETTI data.iov_base = _alloca(data.iov_len);
- BYTE *pBlob = (BYTE*)data.iov_base;
+ uint8_t *pBlob = (uint8_t*)data.iov_base;
*pBlob++ = dbcws.value.type;
switch (dbcws.value.type) {
case DBVT_BYTE: *pBlob = dbcws.value.bVal; break;
diff --git a/plugins/Dbx_sqlite/src/dbcrypt.cpp b/plugins/Dbx_sqlite/src/dbcrypt.cpp index bfb7d29a8c..22f905d761 100644 --- a/plugins/Dbx_sqlite/src/dbcrypt.cpp +++ b/plugins/Dbx_sqlite/src/dbcrypt.cpp @@ -34,7 +34,7 @@ STDMETHODIMP_(BOOL) CDbxSQLite::ReadCryptoKey(MBinBuffer &buf) STDMETHODIMP_(BOOL) CDbxSQLite::StoreCryptoKey() { size_t iKeyLength = m_crypto->getKeyLength(); - BYTE *pKey = (BYTE*)_alloca(iKeyLength); + uint8_t *pKey = (uint8_t*)_alloca(iKeyLength); m_crypto->getKey(pKey, iKeyLength); mir_cslock lock(m_csDbAccess); @@ -114,14 +114,14 @@ STDMETHODIMP_(BOOL) CDbxSQLite::EnableEncryption(BOOL bEncrypt) continue; int id = sqlite3_column_int(stmt, 0); - auto *pBlob = (const BYTE *)sqlite3_column_blob(stmt, 2); + auto *pBlob = (const uint8_t *)sqlite3_column_blob(stmt, 2); unsigned cbBlob = sqlite3_column_bytes(stmt, 2); - mir_ptr<BYTE> pNewBlob; + mir_ptr<uint8_t> pNewBlob; size_t nNewBlob; if (dwFlags & DBEF_ENCRYPTED) { - pNewBlob = (BYTE*)m_crypto->decodeBuffer(pBlob, cbBlob, &nNewBlob); + pNewBlob = (uint8_t*)m_crypto->decodeBuffer(pBlob, cbBlob, &nNewBlob); dwFlags &= (~DBEF_ENCRYPTED); } else { diff --git a/plugins/Dbx_sqlite/src/dbevents.cpp b/plugins/Dbx_sqlite/src/dbevents.cpp index 1bd57740f5..d44f7fd062 100755 --- a/plugins/Dbx_sqlite/src/dbevents.cpp +++ b/plugins/Dbx_sqlite/src/dbevents.cpp @@ -92,10 +92,10 @@ MEVENT CDbxSQLite::AddEvent(MCONTACT hContact, const DBEVENTINFO *dbei) } else szEventId = ""; - mir_ptr<BYTE> pCryptBlob; + mir_ptr<uint8_t> pCryptBlob; if (m_bEncrypted) { size_t len; - BYTE *pResult = m_crypto->encodeBuffer(tmp.pBlob, tmp.cbBlob, &len); + uint8_t *pResult = m_crypto->encodeBuffer(tmp.pBlob, tmp.cbBlob, &len); if (pResult != nullptr) { pCryptBlob = tmp.pBlob = pResult; tmp.cbBlob = (uint16_t)len; @@ -219,10 +219,10 @@ BOOL CDbxSQLite::EditEvent(MCONTACT hContact, MEVENT hDbEvent, const DBEVENTINFO return 1; DBEVENTINFO tmp = *dbei; - mir_ptr<BYTE> pCryptBlob; + mir_ptr<uint8_t> pCryptBlob; if (m_bEncrypted) { size_t len; - BYTE *pResult = m_crypto->encodeBuffer(tmp.pBlob, tmp.cbBlob, &len); + uint8_t *pResult = m_crypto->encodeBuffer(tmp.pBlob, tmp.cbBlob, &len); if (pResult != nullptr) { pCryptBlob = tmp.pBlob = pResult; tmp.cbBlob = (uint16_t)len; @@ -318,12 +318,12 @@ BOOL CDbxSQLite::GetEvent(MEVENT hDbEvent, DBEVENTINFO *dbei) dbei->cbBlob = cbBlob; if (bytesToCopy && dbei->pBlob) { - BYTE *data = (BYTE *)sqlite3_column_blob(stmt, 5); + uint8_t *data = (uint8_t *)sqlite3_column_blob(stmt, 5); if (dbei->flags & DBEF_ENCRYPTED) { dbei->flags &= ~DBEF_ENCRYPTED; size_t len; - BYTE* pBlob = (BYTE*)m_crypto->decodeBuffer(data, cbBlob, &len); + uint8_t* pBlob = (uint8_t*)m_crypto->decodeBuffer(data, cbBlob, &len); if (pBlob == nullptr) return 1; diff --git a/plugins/Dbx_sqlite/src/dbsettings.cpp b/plugins/Dbx_sqlite/src/dbsettings.cpp index fc6f6c4c3a..b4b5551cea 100755 --- a/plugins/Dbx_sqlite/src/dbsettings.cpp +++ b/plugins/Dbx_sqlite/src/dbsettings.cpp @@ -48,7 +48,7 @@ void CDbxSQLite::InitSettings() dbv->cpbVal = sqlite3_column_bytes(stmt, 1); { const char *data = (const char *)sqlite3_column_blob(stmt, 1); - dbv->pbVal = (BYTE *)mir_alloc(dbv->cpbVal + 1); + dbv->pbVal = (uint8_t *)mir_alloc(dbv->cpbVal + 1); memcpy(dbv->pbVal, data, dbv->cpbVal); dbv->pbVal[dbv->cpbVal] = 0; } diff --git a/plugins/FTPFileYM/src/options.cpp b/plugins/FTPFileYM/src/options.cpp index f07e1d8168..10a4ed3716 100644 --- a/plugins/FTPFileYM/src/options.cpp +++ b/plugins/FTPFileYM/src/options.cpp @@ -106,7 +106,7 @@ INT_PTR CALLBACK Options::DlgProcOptsAccounts(HWND hwndDlg, UINT msg, WPARAM wPa }
else if (HIWORD(wParam) == CBN_SELCHANGE) {
if (LOWORD(wParam) == IDC_FTPLIST) {
- opt.selected = (BYTE)ComboBox_GetCurSel(GetDlgItem(hwndDlg, IDC_FTPLIST));
+ opt.selected = (uint8_t)ComboBox_GetCurSel(GetDlgItem(hwndDlg, IDC_FTPLIST));
CheckDlgButton(hwndDlg, IDC_DEFAULT, opt.selected == opt.defaultFTP ? BST_CHECKED : BST_UNCHECKED);
ServerList::FTP *ftp = ftpList.getSelected();
diff --git a/plugins/FTPFileYM/src/options.h b/plugins/FTPFileYM/src/options.h index 0c4051cf21..0179aca360 100644 --- a/plugins/FTPFileYM/src/options.h +++ b/plugins/FTPFileYM/src/options.h @@ -30,8 +30,8 @@ struct Options TR_DAYS
};
- BYTE selected;
- BYTE defaultFTP;
+ uint8_t selected;
+ uint8_t defaultFTP;
bool bCloseDlg;
bool bCopyLink;
bool bAutosend;
diff --git a/plugins/FavContacts/src/contact_cache.cpp b/plugins/FavContacts/src/contact_cache.cpp index 42f46da620..2416ed0c00 100644 --- a/plugins/FavContacts/src/contact_cache.cpp +++ b/plugins/FavContacts/src/contact_cache.cpp @@ -173,7 +173,7 @@ bool CContactCache::filter(int rate, wchar_t *str) int nKbdLayouts = GetKeyboardLayoutList(_countof(kbdLayouts), kbdLayouts);
wchar_t buf[256];
- BYTE keyState[256] = { 0 };
+ uint8_t keyState[256] = { 0 };
for (int iLayout = 0; iLayout < nKbdLayouts; ++iLayout) {
if (kbdLayoutActive == kbdLayouts[iLayout])
diff --git a/plugins/FavContacts/src/options.cpp b/plugins/FavContacts/src/options.cpp index af7034e7dd..2ad1d715dd 100644 --- a/plugins/FavContacts/src/options.cpp +++ b/plugins/FavContacts/src/options.cpp @@ -208,7 +208,7 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA sttSaveOptions();
for (auto &hContact : Contacts()) {
- BYTE fav = SendDlgItemMessage(hwnd, IDC_CLIST, CLM_GETCHECKMARK,
+ uint8_t fav = SendDlgItemMessage(hwnd, IDC_CLIST, CLM_GETCHECKMARK,
SendDlgItemMessage(hwnd, IDC_CLIST, CLM_FINDCONTACT, hContact, 0), 0);
if (fav != g_plugin.getByte(hContact, "IsFavourite"))
g_plugin.setByte(hContact, "IsFavourite", fav);
diff --git a/plugins/FavContacts/src/services.cpp b/plugins/FavContacts/src/services.cpp index 82e448aa63..4d0efee903 100644 --- a/plugins/FavContacts/src/services.cpp +++ b/plugins/FavContacts/src/services.cpp @@ -51,7 +51,7 @@ int ProcessSrmmEvent(WPARAM, LPARAM lParam) hDialogsList = WindowList_Create();
WindowList_Add(hDialogsList, event->hwndWindow, event->hContact);
- BYTE fav = g_plugin.getByte(event->hContact, "IsFavourite");
+ uint8_t fav = g_plugin.getByte(event->hContact, "IsFavourite");
Srmm_SetIconFlags(event->hContact, MODULENAME, 0, fav ? 0 : MBF_DISABLED);
if (event->hContact == hContactToActivate) {
@@ -86,7 +86,7 @@ int ProcessSrmmIconClick(WPARAM hContact, LPARAM lParam) return 0;
if (sicd->flags & MBCF_RIGHTBUTTON) {
- BYTE fav = !g_plugin.getByte(hContact, "IsFavourite");
+ uint8_t fav = !g_plugin.getByte(hContact, "IsFavourite");
g_plugin.setByte(hContact, "IsFavourite", fav);
if (fav)
CallService(MS_AV_GETAVATARBITMAP, hContact, 0);
diff --git a/plugins/FavContacts/src/stdafx.h b/plugins/FavContacts/src/stdafx.h index f974139199..ad34fea12b 100644 --- a/plugins/FavContacts/src/stdafx.h +++ b/plugins/FavContacts/src/stdafx.h @@ -70,17 +70,17 @@ struct CMPlugin : public PLUGIN<CMPlugin> struct Options
{
- BYTE bSecondLine;
- BYTE bAvatars;
- BYTE bAvatarBorder;
+ uint8_t bSecondLine;
+ uint8_t bAvatars;
+ uint8_t bAvatarBorder;
WORD wAvatarRadius;
- BYTE bNoTransparentBorder;
- BYTE bSysColors;
- BYTE bCenterHotkey;
- BYTE bUseGroups;
- BYTE bUseColumns;
- BYTE bRightAvatars;
- BYTE bDimIdle;
+ uint8_t bNoTransparentBorder;
+ uint8_t bSysColors;
+ uint8_t bCenterHotkey;
+ uint8_t bUseGroups;
+ uint8_t bUseColumns;
+ uint8_t bRightAvatars;
+ uint8_t bDimIdle;
WORD wMaxRecent;
COLORREF clLine1, clLine2, clBack;
diff --git a/plugins/FileAsMessage/src/dialog.cpp b/plugins/FileAsMessage/src/dialog.cpp index a1b4601812..ae6a02029f 100644 --- a/plugins/FileAsMessage/src/dialog.cpp +++ b/plugins/FileAsMessage/src/dialog.cpp @@ -235,7 +235,7 @@ int FILEECHO::createTransfer() #ifdef DEBUG
overhead = 0;
#endif
- BYTE bAuto = db_get_b(0, "SRFile", "AutoAccept", 0);
+ uint8_t bAuto = db_get_b(0, "SRFile", "AutoAccept", 0);
hFile = CreateFileA(filename, inSend ? GENERIC_READ : (GENERIC_READ | GENERIC_WRITE), inSend ? FILE_SHARE_READ : 0, nullptr, inSend ? OPEN_EXISTING : (bAuto ? CREATE_ALWAYS : CREATE_NEW), FILE_ATTRIBUTE_NORMAL, nullptr);
if (hFile == INVALID_HANDLE_VALUE && !inSend && GetLastError() == ERROR_FILE_EXISTS) {
@@ -609,7 +609,7 @@ void FILEECHO::cmdDATA(char *param) }
else {
size_t bufLen;
- mir_ptr<BYTE> buf((BYTE*)mir_base64_decode(param, &bufLen));
+ mir_ptr<uint8_t> buf((uint8_t*)mir_base64_decode(param, &bufLen));
memcpy(data, buf, min(bufLen, unsigned(data_end - data)));
data += bufLen;
}
diff --git a/plugins/FingerprintNG/src/fingerprint.cpp b/plugins/FingerprintNG/src/fingerprint.cpp index dce300cd1c..4302d48ab2 100644 --- a/plugins/FingerprintNG/src/fingerprint.cpp +++ b/plugins/FingerprintNG/src/fingerprint.cpp @@ -430,7 +430,7 @@ HBITMAP __fastcall CreateBitmap32Point(int cx, int cy, LPVOID* bits) } /* -* checkHasAlfa - checks if image has at least one BYTE in alpha channel +* checkHasAlfa - checks if image has at least one uint8_t in alpha channel * that is not a 0. (is image real 32 bit or just 24 bit) */ BOOL __fastcall checkHasAlfa(LPBYTE from, int width, int height) @@ -477,8 +477,8 @@ DWORD __fastcall blend(DWORD X1, DWORD X2) { RGBA* q1 = (RGBA*)&X1; RGBA* q2 = (RGBA*)&X2; - BYTE a_1 = ~q1->a; - BYTE a_2 = ~q2->a; + uint8_t a_1 = ~q1->a; + uint8_t a_2 = ~q2->a; WORD am = q1->a * a_2; WORD ar = q1->a + ((a_1 * q2->a) / 255); @@ -511,7 +511,7 @@ HICON __fastcall CreateJoinedIcon(HICON hBottom, HICON hTop) HBITMAP nMask, hbm, obmp, obmp2; LPBYTE ptPixels = nullptr; ICONINFO iNew = { 0 }; - BYTE p[32] = { 0 }; + uint8_t p[32] = { 0 }; tempDC = CreateCompatibleDC(nullptr); nImage = CreateBitmap32Point(16, 16, (LPVOID*)&ptPixels); diff --git a/plugins/FingerprintNG/src/options.cpp b/plugins/FingerprintNG/src/options.cpp index 9c6852998a..f9bd46944f 100644 --- a/plugins/FingerprintNG/src/options.cpp +++ b/plugins/FingerprintNG/src/options.cpp @@ -59,7 +59,7 @@ class COptDialog : public CDlgBase m_chkFacebbok, m_chkGG, m_chkICQ, m_chkIRC, m_chkJabber, m_chkRSS, m_chkVK, m_chkWeather, m_chkMulti, m_chkOthersProto,
m_chkOthers, m_chkStatusBar;
- void LoadDBCheckState(int idCtrl, LPCSTR szSetting, BYTE bDef)
+ void LoadDBCheckState(int idCtrl, LPCSTR szSetting, uint8_t bDef)
{
CCtrlCheck &item = *(CCtrlCheck*)FindControl(idCtrl);
item.SetState(g_plugin.getByte(szSetting, bDef));
diff --git a/plugins/FingerprintNG/src/stdafx.h b/plugins/FingerprintNG/src/stdafx.h index e25cb6ae39..5c18b48fc9 100644 --- a/plugins/FingerprintNG/src/stdafx.h +++ b/plugins/FingerprintNG/src/stdafx.h @@ -47,10 +47,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. struct RGBA
{
- BYTE b;
- BYTE g;
- BYTE r;
- BYTE a;
+ uint8_t b;
+ uint8_t g;
+ uint8_t r;
+ uint8_t a;
};
struct KN_FP_MASK
diff --git a/plugins/FloatingContacts/src/bitmap_funcs.cpp b/plugins/FloatingContacts/src/bitmap_funcs.cpp index 8412e0430f..c6ed9cfc34 100644 --- a/plugins/FloatingContacts/src/bitmap_funcs.cpp +++ b/plugins/FloatingContacts/src/bitmap_funcs.cpp @@ -59,7 +59,7 @@ MyBitmap::~MyBitmap() free();
}
-void MyBitmap::setAlpha(BYTE level)
+void MyBitmap::setAlpha(uint8_t level)
{
if (!bits) return;
@@ -72,7 +72,7 @@ void MyBitmap::setAlpha(BYTE level) }
}
-void MyBitmap::setAlphaRect(int x1, int y1, int x2, int y2, BYTE level)
+void MyBitmap::setAlphaRect(int x1, int y1, int x2, int y2, uint8_t level)
{
if (!bits) return;
@@ -550,12 +550,12 @@ void MyBitmap::Blur(int w, int h) {
if ((w <= 0) || (h <= 0)) return;
- BYTE *buf_src = new BYTE[width*height * 4];
+ uint8_t *buf_src = new uint8_t[width*height * 4];
long *buf_tmp = new long[width*height * 4];
- BYTE *buf_dst = (BYTE *)bits;
+ uint8_t *buf_dst = (uint8_t *)bits;
memcpy(buf_src, buf_dst, width*height * 4);
- BYTE *src, *dst;
+ uint8_t *src, *dst;
long *tmp;
src = buf_src;
@@ -591,7 +591,7 @@ void MyBitmap::Blur(int w, int h) ReadP(tmp, width, height, x - w, y + h, k) -
ReadP(tmp, width, height, x + w, y - h, k);
- *dst = BYTE(tot*mul);
+ *dst = uint8_t(tot*mul);
++dst;
++src;
@@ -605,7 +605,7 @@ void MyBitmap::Blur(int w, int h) void MyBitmap::IncreaseAlpha(float q)
{
- BYTE *p = (BYTE *)bits;
+ uint8_t *p = (uint8_t *)bits;
for (int i = 0; i < height; ++i) {
for (int j = 0; j < width; ++j) {
@@ -617,7 +617,7 @@ void MyBitmap::IncreaseAlpha(float q) float q1 = min(q, 255.f / p[3]);
for (int k = 0; k < 4; ++k) {
- *p = (BYTE)min(255, *p * q1);
+ *p = (uint8_t)min(255, *p * q1);
++p;
}
}
@@ -649,14 +649,14 @@ void MyBitmap::DrawIcon(HICON hic, int x, int y, int w, int h) DestroyIcon(hicTmp);
}
- BYTE *cbit = new BYTE[bmpColor.bmWidthBytes*bmpColor.bmHeight];
- BYTE *mbit = new BYTE[bmpMask.bmWidthBytes*bmpMask.bmHeight];
+ uint8_t *cbit = new uint8_t[bmpColor.bmWidthBytes*bmpColor.bmHeight];
+ uint8_t *mbit = new uint8_t[bmpMask.bmWidthBytes*bmpMask.bmHeight];
GetBitmapBits(info.hbmColor, bmpColor.bmWidthBytes*bmpColor.bmHeight, cbit);
GetBitmapBits(info.hbmMask, bmpMask.bmWidthBytes*bmpMask.bmHeight, mbit);
for (int i = 0; i < bmpColor.bmHeight; i++) {
for (int j = 0; j < bmpColor.bmWidth; j++) {
- BYTE *pixel = cbit + i*bmpColor.bmWidthBytes + j * 4;
+ uint8_t *pixel = cbit + i*bmpColor.bmWidthBytes + j * 4;
if (!pixel[3]) {
pixel[3] = (*(mbit + i*bmpMask.bmWidthBytes + j*bmpMask.bmBitsPixel / 8) & (1 << (7 - j % 8))) ? 0 : 255;
}
@@ -693,7 +693,7 @@ void MyBitmap::DrawText(wchar_t *str, int x, int y, int blur, int strength) sz.cx += (blur + 2) * 2; sz.cy += (blur + 2) * 2;
x -= blur + 2; y -= blur + 2;
- static BYTE pbGammaWeight[256] = { 0 };
+ static uint8_t pbGammaWeight[256] = { 0 };
static BOOL bGammaWeightFilled = FALSE;
if (!bGammaWeightFilled) {
@@ -705,7 +705,7 @@ void MyBitmap::DrawText(wchar_t *str, int x, int y, int blur, int strength) f = (double)i / 255;
f = pow(f, (1 / gamma));
- pbGammaWeight[i] = (BYTE)(255 * f);
+ pbGammaWeight[i] = (uint8_t)(255 * f);
}
bGammaWeightFilled = 1;
}
@@ -765,12 +765,12 @@ void MyBitmap::DrawText(wchar_t *str, int x, int y, int blur, int strength) gx = (pbGammaWeight[gx] * (255 - g) + gx*(g)) / 255;
rx = (pbGammaWeight[rx] * (255 - r) + rx*(r)) / 255;
- mx = (BYTE)(max(max(bx, rx), gx));
+ mx = (uint8_t)(max(max(bx, rx), gx));
if (1) {
- bx = (bx < mx) ? (BYTE)(((WORD)bx * 7 + (WORD)mx) >> 3) : bx;
- rx = (rx < mx) ? (BYTE)(((WORD)rx * 7 + (WORD)mx) >> 3) : rx;
- gx = (gx < mx) ? (BYTE)(((WORD)gx * 7 + (WORD)mx) >> 3) : gx;
+ bx = (bx < mx) ? (uint8_t)(((WORD)bx * 7 + (WORD)mx) >> 3) : bx;
+ rx = (rx < mx) ? (uint8_t)(((WORD)rx * 7 + (WORD)mx) >> 3) : rx;
+ gx = (gx < mx) ? (uint8_t)(((WORD)gx * 7 + (WORD)mx) >> 3) : gx;
// reduce boldeness at white fonts
}
COLOR32 cl = row_dst[j];
@@ -811,7 +811,7 @@ HRGN MyBitmap::buildOpaqueRgn(int level, bool opaque) const int addRectsCount = 64;
int rectsCount = addRectsCount;
- PRGNDATA pRgnData = (PRGNDATA)(new BYTE[sizeof(RGNDATAHEADER) + (rectsCount)*sizeof(RECT)]);
+ PRGNDATA pRgnData = (PRGNDATA)(new uint8_t[sizeof(RGNDATAHEADER) + (rectsCount)*sizeof(RECT)]);
LPRECT pRects = (LPRECT)(&pRgnData->Buffer);
memset(pRgnData, 0, sizeof(RGNDATAHEADER) + (rectsCount)*sizeof(RECT));
@@ -830,7 +830,7 @@ HRGN MyBitmap::buildOpaqueRgn(int level, bool opaque) SetRect(&pRects[pRgnData->rdh.nCount++], first, i, j, i + 1);
if ((int)(pRgnData->rdh.nCount) >= rectsCount) {
rectsCount += addRectsCount;
- LPRGNDATA pRgnDataNew = (LPRGNDATA)(new BYTE[sizeof(RGNDATAHEADER) + (rectsCount)*sizeof(RECT)]);
+ LPRGNDATA pRgnDataNew = (LPRGNDATA)(new uint8_t[sizeof(RGNDATAHEADER) + (rectsCount)*sizeof(RECT)]);
memcpy(pRgnDataNew, pRgnData, sizeof(RGNDATAHEADER) + pRgnData->rdh.nCount * sizeof(RECT));
delete[] pRgnData;
pRgnData = pRgnDataNew;
@@ -851,7 +851,7 @@ HRGN MyBitmap::buildOpaqueRgn(int level, bool opaque) SetRect(&pRects[pRgnData->rdh.nCount++], first, i, j, i + 1);
if ((int)(pRgnData->rdh.nCount) >= rectsCount) {
rectsCount += addRectsCount;
- LPRGNDATA pRgnDataNew = (LPRGNDATA)(new BYTE[sizeof(RGNDATAHEADER) + (rectsCount)*sizeof(RECT)]);
+ LPRGNDATA pRgnDataNew = (LPRGNDATA)(new uint8_t[sizeof(RGNDATAHEADER) + (rectsCount)*sizeof(RECT)]);
memcpy(pRgnDataNew, pRgnData, sizeof(RGNDATAHEADER) + pRgnData->rdh.nCount * sizeof(RECT));
delete[] pRgnData;
pRgnData = pRgnDataNew;
diff --git a/plugins/FloatingContacts/src/bitmap_funcs.h b/plugins/FloatingContacts/src/bitmap_funcs.h index 23192b6cf7..ff7476a028 100644 --- a/plugins/FloatingContacts/src/bitmap_funcs.h +++ b/plugins/FloatingContacts/src/bitmap_funcs.h @@ -55,9 +55,9 @@ public: HDC getDC() { return dcBmp; }
HBITMAP getBitmap() { return hBmp; }
- void setAlpha(BYTE level);
- void setAlphaRect(int x1, int y1, int x2, int y2, BYTE level);
- void setAlphaRect(RECT rc, BYTE level) { setAlphaRect(rc.left, rc.top, rc.right, rc.bottom, level); }
+ void setAlpha(uint8_t level);
+ void setAlphaRect(int x1, int y1, int x2, int y2, uint8_t level);
+ void setAlphaRect(RECT rc, uint8_t level) { setAlphaRect(rc.left, rc.top, rc.right, rc.bottom, level); }
void makeOpaque();
void makeOpaqueRect(int x1, int y1, int x2, int y2);
diff --git a/plugins/FloatingContacts/src/fltcont.h b/plugins/FloatingContacts/src/fltcont.h index 81afdedce5..4d2724cf8b 100644 --- a/plugins/FloatingContacts/src/fltcont.h +++ b/plugins/FloatingContacts/src/fltcont.h @@ -72,7 +72,7 @@ enum //extern BOOL bMoveTogether;
//extern BOOL bFixedWidth;
//extern int nThumbWidth;
-//extern BYTE thumbAlpha;
+//extern uint8_t thumbAlpha;
//extern BOOL bShowTip;
extern BOOL bEnableTip;
//extern WORD TimeIn;
@@ -99,7 +99,7 @@ extern WORD nBackgroundBmpUse; typedef struct _FCOptions
{
- BYTE thumbAlpha;
+ uint8_t thumbAlpha;
BOOL bHideOffline;
BOOL bHideAll;
BOOL bHideWhenFullscreen;
@@ -140,7 +140,7 @@ void ApplyOptionsChanges(); void OnStatusChanged();
-void SetThumbsOpacity(BYTE btAlpha);
+void SetThumbsOpacity(uint8_t btAlpha);
int OnOptionsInitialize(WPARAM wParam, LPARAM lParam);
diff --git a/plugins/FloatingContacts/src/main.cpp b/plugins/FloatingContacts/src/main.cpp index b8bb8e05f1..57894b3426 100644 --- a/plugins/FloatingContacts/src/main.cpp +++ b/plugins/FloatingContacts/src/main.cpp @@ -34,7 +34,7 @@ static void CreateThumbsFont(void); static void CreateBackgroundBrush(void);
static int GetContactStatus(MCONTACT hContact);
static void GetScreenRect(void);
-extern void SetThumbsOpacity(BYTE btAlpha);
+extern void SetThumbsOpacity(uint8_t btAlpha);
static int ClcStatusToPf2(int status);
static VOID CALLBACK ToTopTimerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime);
@@ -278,7 +278,7 @@ static int OnPrebuildContactMenu(WPARAM wParam, LPARAM) static void LoadDBSettings()
{
- fcOpt.thumbAlpha = (BYTE)((double)g_plugin.getByte("Opacity", 100) * 2.55);
+ fcOpt.thumbAlpha = (uint8_t)((double)g_plugin.getByte("Opacity", 100) * 2.55);
fcOpt.bHideOffline = (BOOL)g_plugin.getByte("HideOffline", 0);
fcOpt.bHideAll = (BOOL)g_plugin.getByte("HideAll", 0);
fcOpt.bHideWhenFullscreen = (BOOL)g_plugin.getByte("HideWhenFullscreen", 0);
@@ -423,7 +423,7 @@ static LRESULT __stdcall CommWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM return DefWindowProc(hwnd, uMsg, wParam, lParam);
}
-extern void SetThumbsOpacity(BYTE btAlpha)
+extern void SetThumbsOpacity(uint8_t btAlpha)
{
for (auto &it : thumbList)
it->SetThumbOpacity(btAlpha);
@@ -672,7 +672,7 @@ static IconItemT g_iconList[] = static INT_PTR OnMainMenu_HideAll(WPARAM, LPARAM)
{
fcOpt.bHideAll = !fcOpt.bHideAll;
- g_plugin.setByte("HideAll", (BYTE)fcOpt.bHideAll);
+ g_plugin.setByte("HideAll", (uint8_t)fcOpt.bHideAll);
OnStatusChanged();
@@ -696,7 +696,7 @@ static INT_PTR OnContactMenu_Remove(WPARAM hContact, LPARAM) static INT_PTR OnHotKey_HideWhenCListShow(WPARAM, LPARAM)
{
fcOpt.bHideWhenCListShow = !fcOpt.bHideWhenCListShow;
- g_plugin.setByte("HideWhenCListShow", (BYTE)fcOpt.bHideWhenCListShow);
+ g_plugin.setByte("HideWhenCListShow", (uint8_t)fcOpt.bHideWhenCListShow);
OnStatusChanged();
return 0;
}
@@ -825,7 +825,7 @@ static LRESULT __stdcall newMirandaWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, HideThumbsOnShowCList();
}
else if (!(wp->flags & SWP_NOMOVE)) {
- BYTE method = db_get_b(0, "ModernData", "HideBehind", 0);
+ uint8_t method = db_get_b(0, "ModernData", "HideBehind", 0);
if (method) {
WORD wBehindEdgeBorderSize = db_get_w(0, "ModernData", "HideBehindBorderSize", 0);
RECT rc = { wp->x, wp->y, wp->x + wp->cx, wp->y + wp->cy };
diff --git a/plugins/FloatingContacts/src/options.cpp b/plugins/FloatingContacts/src/options.cpp index 1db6ba9569..5e9406527f 100644 --- a/plugins/FloatingContacts/src/options.cpp +++ b/plugins/FloatingContacts/src/options.cpp @@ -106,42 +106,42 @@ static INT_PTR APIENTRY OptWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA BOOL bSuccess = FALSE;
fcOpt.bHideOffline = IsDlgButtonChecked(hwndDlg, IDC_CHK_HIDE_OFFLINE);
- g_plugin.setByte("HideOffline", (BYTE)fcOpt.bHideOffline);
+ g_plugin.setByte("HideOffline", (uint8_t)fcOpt.bHideOffline);
fcOpt.bHideAll = IsDlgButtonChecked(hwndDlg, IDC_CHK_HIDE_ALL);
- g_plugin.setByte("HideAll", (BYTE)fcOpt.bHideAll);
+ g_plugin.setByte("HideAll", (uint8_t)fcOpt.bHideAll);
fcOpt.bHideWhenFullscreen = IsDlgButtonChecked(hwndDlg, IDC_CHK_HIDE_WHEN_FULSCREEN);
- g_plugin.setByte("HideWhenFullscreen", (BYTE)fcOpt.bHideWhenFullscreen);
+ g_plugin.setByte("HideWhenFullscreen", (uint8_t)fcOpt.bHideWhenFullscreen);
fcOpt.bMoveTogether = IsDlgButtonChecked(hwndDlg, IDC_CHK_STICK);
- g_plugin.setByte("MoveTogether", (BYTE)fcOpt.bMoveTogether);
+ g_plugin.setByte("MoveTogether", (uint8_t)fcOpt.bMoveTogether);
fcOpt.bFixedWidth = IsDlgButtonChecked(hwndDlg, IDC_CHK_WIDTH);
- g_plugin.setByte("FixedWidth", (BYTE)fcOpt.bFixedWidth);
+ g_plugin.setByte("FixedWidth", (uint8_t)fcOpt.bFixedWidth);
fcOpt.nThumbWidth = GetDlgItemInt(hwndDlg, IDC_TXT_WIDTH, &bSuccess, FALSE);
g_plugin.setDword("Width", fcOpt.nThumbWidth);
if (bEnableTip) {
fcOpt.bShowTip = IsDlgButtonChecked(hwndDlg, IDC_CHK_TIP);
- g_plugin.setByte("ShowTip", (BYTE)fcOpt.bShowTip);
+ g_plugin.setByte("ShowTip", (uint8_t)fcOpt.bShowTip);
fcOpt.TimeIn = GetDlgItemInt(hwndDlg, IDC_TXT_TIMEIN, &bSuccess, FALSE);
g_plugin.setWord("TimeIn", fcOpt.TimeIn);
}
fcOpt.bToTop = IsDlgButtonChecked(hwndDlg, IDC_CHK_TOTOP);
- g_plugin.setByte("ToTop", (BYTE)fcOpt.bToTop);
+ g_plugin.setByte("ToTop", (uint8_t)fcOpt.bToTop);
fcOpt.ToTopTime = GetDlgItemInt(hwndDlg, IDC_TXT_TOTOPTIME, &bSuccess, FALSE);
g_plugin.setWord("ToTopTime", fcOpt.ToTopTime);
fcOpt.bHideWhenCListShow = IsDlgButtonChecked(hwndDlg, IDC_CHK_HIDE_WHEN_CLISTSHOW);
- g_plugin.setByte("HideWhenCListShow", (BYTE)fcOpt.bHideWhenCListShow);
+ g_plugin.setByte("HideWhenCListShow", (uint8_t)fcOpt.bHideWhenCListShow);
fcOpt.bUseSingleClick = IsDlgButtonChecked(hwndDlg, IDC_CHK_SINGLECLK);
- g_plugin.setByte("UseSingleClick", (BYTE)fcOpt.bUseSingleClick);
+ g_plugin.setByte("UseSingleClick", (uint8_t)fcOpt.bUseSingleClick);
fcOpt.bShowIdle = IsDlgButtonChecked(hwndDlg, IDC_CHK_SHOWIDLE);
- g_plugin.setByte("ShowIdle", (BYTE)fcOpt.bShowIdle);
+ g_plugin.setByte("ShowIdle", (uint8_t)fcOpt.bShowIdle);
ApplyOptionsChanges();
OnStatusChanged();
@@ -193,7 +193,7 @@ static INT_PTR APIENTRY OptSknWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP SHAutoComplete(GetDlgItem(hwndDlg, IDC_FILENAME), 1);
// Windows 2K/XP
- BYTE btOpacity = (BYTE)g_plugin.getByte("Opacity", 100);
+ uint8_t btOpacity = (uint8_t)g_plugin.getByte("Opacity", 100);
SendDlgItemMessage(hwndDlg, IDC_SLIDER_OPACITY, TBM_SETRANGE, TRUE, MAKELONG(0, 100));
SendDlgItemMessage(hwndDlg, IDC_SLIDER_OPACITY, TBM_SETPOS, TRUE, btOpacity);
@@ -225,7 +225,7 @@ static INT_PTR APIENTRY OptSknWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP case WM_HSCROLL:
if (wParam != TB_ENDTRACK) {
int nPos = (int)SendDlgItemMessage(hwndDlg, IDC_SLIDER_OPACITY, TBM_GETPOS, 0, 0);
- fcOpt.thumbAlpha = (BYTE)((nPos * 255) / 100);
+ fcOpt.thumbAlpha = (uint8_t)((nPos * 255) / 100);
SetThumbsOpacity(fcOpt.thumbAlpha);
mir_snprintf(szPercent, "%d%%", nPos);
@@ -278,26 +278,26 @@ static INT_PTR APIENTRY OptSknWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP if (0 == ((LPNMHDR)lParam)->idFrom) {
switch (((LPNMHDR)lParam)->code) {
case PSN_RESET:
- fcOpt.thumbAlpha = (BYTE)((double)g_plugin.getByte("Opacity", 100) * 2.55);
+ fcOpt.thumbAlpha = (uint8_t)((double)g_plugin.getByte("Opacity", 100) * 2.55);
SetThumbsOpacity(fcOpt.thumbAlpha);
break;
case PSN_APPLY:
// Border
- g_plugin.setByte("DrawBorder", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_DRAWBORDER));
+ g_plugin.setByte("DrawBorder", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_DRAWBORDER));
COLORREF col = SendDlgItemMessage(hwndDlg, IDC_LTEDGESCOLOR, CPM_GETCOLOUR, 0, 0);
g_plugin.setDword("LTEdgesColor", col);
col = SendDlgItemMessage(hwndDlg, IDC_RBEDGESCOLOR, CPM_GETCOLOUR, 0, 0);
g_plugin.setDword("RBEdgesColor", col);
- g_plugin.setByte("Opacity", (BYTE)SendDlgItemMessage(hwndDlg, IDC_SLIDER_OPACITY, TBM_GETPOS, 0, 0));
+ g_plugin.setByte("Opacity", (uint8_t)SendDlgItemMessage(hwndDlg, IDC_SLIDER_OPACITY, TBM_GETPOS, 0, 0));
// Backgroud
col = SendDlgItemMessage(hwndDlg, IDC_BKGCOLOUR, CPM_GETCOLOUR, 0, 0);
g_plugin.setDword("BkColor", col);
- g_plugin.setByte("BkUseBitmap", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_BITMAP));
+ g_plugin.setByte("BkUseBitmap", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_BITMAP));
wchar_t str[MAX_PATH];
GetDlgItemText(hwndDlg, IDC_FILENAME, str, _countof(str));
diff --git a/plugins/FloatingContacts/src/thumbs.cpp b/plugins/FloatingContacts/src/thumbs.cpp index 8455c8b8ef..91a34c1212 100644 --- a/plugins/FloatingContacts/src/thumbs.cpp +++ b/plugins/FloatingContacts/src/thumbs.cpp @@ -447,7 +447,7 @@ void ThumbInfo::ThumbDeselect(BOOL bMouse) SetThumbOpacity(fcOpt.thumbAlpha);
}
-void ThumbInfo::SetThumbOpacity(BYTE bAlpha)
+void ThumbInfo::SetThumbOpacity(uint8_t bAlpha)
{
if (bAlpha != btAlpha) {
btAlpha = bAlpha;
@@ -663,7 +663,7 @@ void ThumbInfo::PopupMessageDialog() Clist_ContactDoubleClicked(hContact);
}
-void ThumbInfo::OnTimer(BYTE idTimer)
+void ThumbInfo::OnTimer(uint8_t idTimer)
{
if (idTimer == TIMERID_SELECT_T) {
KillTimer(hwnd, TIMERID_SELECT_T);
diff --git a/plugins/FloatingContacts/src/thumbs.h b/plugins/FloatingContacts/src/thumbs.h index b7af34f8f3..339a58ac43 100644 --- a/plugins/FloatingContacts/src/thumbs.h +++ b/plugins/FloatingContacts/src/thumbs.h @@ -22,7 +22,7 @@ struct ThumbInfo BOOL fTipTimerActive;
POINT ptTipSt;
- BYTE btAlpha;
+ uint8_t btAlpha;
MyBitmap bmpContent;
POINT ptPos;
@@ -44,11 +44,11 @@ public: void OnMouseMove(int nX, int nY);
void ThumbSelect(BOOL bMouse);
void ThumbDeselect(BOOL bMouse);
- void SetThumbOpacity(BYTE btAlpha);
+ void SetThumbOpacity(uint8_t btAlpha);
void KillTip();
void UpdateContent();
void PopupMessageDialog();
- void OnTimer(BYTE idTimer);
+ void OnTimer(uint8_t idTimer);
};
void UndockThumbs(ThumbInfo *pThumb1, ThumbInfo *pThumb2);
diff --git a/plugins/HTTPServer/src/Glob.h b/plugins/HTTPServer/src/Glob.h index 3b913cc840..d688dbe351 100644 --- a/plugins/HTTPServer/src/Glob.h +++ b/plugins/HTTPServer/src/Glob.h @@ -55,7 +55,7 @@ using namespace std; #define MODULENAME "HTTPServer"
#define MSG_BOX_TITLE "Miranda NG HTTP-Server"
-#define SplitIpAddress( p ) (BYTE)(p>>24),(BYTE)(p>>16),(BYTE)(p>>8),(BYTE)(p)
+#define SplitIpAddress( p ) (uint8_t)(p>>24),(uint8_t)(p>>16),(uint8_t)(p>>8),(uint8_t)(p)
struct CMPlugin : public PLUGIN<CMPlugin>
{
diff --git a/plugins/HTTPServer/src/GuiElements.cpp b/plugins/HTTPServer/src/GuiElements.cpp index ab8219230f..f554f3f37b 100644 --- a/plugins/HTTPServer/src/GuiElements.cpp +++ b/plugins/HTTPServer/src/GuiElements.cpp @@ -1253,7 +1253,7 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP indexCreationMode = INDEX_CREATION_DISABLE;
}
- g_plugin.setByte("IndexCreationMode", (BYTE)indexCreationMode);
+ g_plugin.setByte("IndexCreationMode", (uint8_t)indexCreationMode);
return TRUE;
}
diff --git a/plugins/HTTPServer/src/main.cpp b/plugins/HTTPServer/src/main.cpp index 16c328fbf9..e8f227172d 100644 --- a/plugins/HTTPServer/src/main.cpp +++ b/plugins/HTTPServer/src/main.cpp @@ -770,7 +770,7 @@ int nSystemShutdown(WPARAM /*wparam*/, LPARAM /*lparam*/) }
pclFirstNode = nullptr;
- g_plugin.setByte("IndexCreationMode", (BYTE)indexCreationMode);
+ g_plugin.setByte("IndexCreationMode", (uint8_t)indexCreationMode);
FreeIndexHTMLTemplate();
return 0;
}
@@ -834,7 +834,7 @@ int CMPlugin::Load() if (indexCreationMode == INDEX_CREATION_HTML || indexCreationMode == INDEX_CREATION_DETECT)
if (!LoadIndexHTMLTemplate()) {
indexCreationMode = INDEX_CREATION_DISABLE;
- g_plugin.setByte("IndexCreationMode", (BYTE)indexCreationMode);
+ g_plugin.setByte("IndexCreationMode", (uint8_t)indexCreationMode);
}
HookEvent(ME_OPT_INITIALISE, OptionsInitialize);
diff --git a/plugins/HistoryLinkListPlus/src/linklist_dlg.cpp b/plugins/HistoryLinkListPlus/src/linklist_dlg.cpp index daf5213a87..d006cad0af 100644 --- a/plugins/HistoryLinkListPlus/src/linklist_dlg.cpp +++ b/plugins/HistoryLinkListPlus/src/linklist_dlg.cpp @@ -101,7 +101,7 @@ INT_PTR CALLBACK MainDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) LPTSTR link;
ENLINK *pENLink = (ENLINK*)lParam;
- BYTE mouseEvent = g_plugin.getByte(LINKLIST_MOUSE_EVENT, 0xFF);
+ uint8_t mouseEvent = g_plugin.getByte(LINKLIST_MOUSE_EVENT, 0xFF);
switch (pENLink->msg) {
case WM_MOUSEMOVE:
@@ -381,7 +381,7 @@ INT_PTR CALLBACK SearchDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam return TRUE;
case IDSEARCH:
- BYTE flags = 0x00;
+ uint8_t flags = 0x00;
wchar_t filter[FILTERTEXT];
HWND hListDlg = WindowList_Find(hWindowList, DlgParam->hContact);
@@ -421,7 +421,7 @@ This function handles the options dialog messages */
INT_PTR CALLBACK OptionsDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
- BYTE useDefault;
+ uint8_t useDefault;
switch (message) {
case WM_INITDIALOG:
diff --git a/plugins/HistoryLinkListPlus/src/linklist_fct.cpp b/plugins/HistoryLinkListPlus/src/linklist_fct.cpp index 63fbd15fa3..6994f9ebaf 100644 --- a/plugins/HistoryLinkListPlus/src/linklist_fct.cpp +++ b/plugins/HistoryLinkListPlus/src/linklist_fct.cpp @@ -42,7 +42,7 @@ int ExtractURI(DBEVENTINFO *dbei, MEVENT hEvent, LISTELEMENT *listStart) };
LISTELEMENT *newElement, *actualElement;
- BYTE type = LINK_UNKNOWN;
+ uint8_t type = LINK_UNKNOWN;
int direction, isLink, linkFound = 0;
wchar_t date[DATE_SIZE + 1];
wchar_t time[TIME_SIZE + 1];
@@ -243,7 +243,7 @@ Fill the richedit field with informations ;-) Special thanks to MatriX for his help with the cursor postion!
*/
-void WriteLinkList(HWND hDlg, BYTE params, LISTELEMENT *listStart, LPCTSTR searchString, int append)
+void WriteLinkList(HWND hDlg, uint8_t params, LISTELEMENT *listStart, LPCTSTR searchString, int append)
{
CHARFORMAT2 cf;
PARAFORMAT2 pf;
@@ -627,9 +627,9 @@ void WriteMessage(HWND hDlg, LISTELEMENT *listStart, int actLinePos) Little helper functions to get the actual state of
user options.
*/
-BYTE GetFlags(HMENU listMenu)
+uint8_t GetFlags(HMENU listMenu)
{
- BYTE returnflags = 0x00;
+ uint8_t returnflags = 0x00;
if (GetMenuState(listMenu, IDM_TYPE_WEB, MF_BYCOMMAND) == MF_UNCHECKED)
returnflags = returnflags | WLL_MAIL;
@@ -727,7 +727,7 @@ void DrawLine(HWND hDlg, size_t lineLen) /*
Little helper function to get informations about the linked list, such as number of links, etc
*/
-void GetListInfo(BYTE params, LISTELEMENT *listStart, LPCTSTR searchString, size_t *maxLen, size_t *elementCount, size_t *realElementCount)
+void GetListInfo(uint8_t params, LISTELEMENT *listStart, LPCTSTR searchString, size_t *maxLen, size_t *elementCount, size_t *realElementCount)
{
size_t tempLen;
LISTELEMENT *actualElement;
@@ -931,7 +931,7 @@ Read current coloursettings from the database void GetColour(MYCOLOURSET *colourSet)
{
DWORD colour;
- BYTE useDefault;
+ uint8_t useDefault;
useDefault = g_plugin.getByte(LINKLIST_USE_DEF, 0xFF);
if (useDefault == 0xFF)
@@ -1134,9 +1134,9 @@ void SetDBColour(MYCOLOURSET *colourSet) g_plugin.setDword(LINKLIST_TXT_COL, colourSet->text);
}
-BYTE GetUpdateSetting(void)
+uint8_t GetUpdateSetting(void)
{
- BYTE updateWindow;
+ uint8_t updateWindow;
updateWindow = g_plugin.getByte(LINKLIST_UPDATE_WINDOW, 0xFF);
if (updateWindow == 0xFF)
diff --git a/plugins/HistoryLinkListPlus/src/linklist_fct.h b/plugins/HistoryLinkListPlus/src/linklist_fct.h index 62b7bbc087..b6d016ebeb 100644 --- a/plugins/HistoryLinkListPlus/src/linklist_fct.h +++ b/plugins/HistoryLinkListPlus/src/linklist_fct.h @@ -21,21 +21,21 @@ #define _LINKLIST_FCT_H
void DrawLine(HWND, size_t);
-BYTE GetFlags(HMENU);
+uint8_t GetFlags(HMENU);
void GetFilterText(HMENU, LPTSTR, size_t);
-void GetListInfo(BYTE, LISTELEMENT*, LPCTSTR, size_t*, size_t*, size_t*);
+void GetListInfo(uint8_t, LISTELEMENT*, LPCTSTR, size_t*, size_t*, size_t*);
void GetListOptions(LISTOPTIONS*);
void SetListOptions(LISTOPTIONS*);
void ClearLinePos(LISTELEMENT*);
int GetLastLinePos(LISTELEMENT*);
-void WriteLinkList(HWND, BYTE, LISTELEMENT*, LPCTSTR, int);
+void WriteLinkList(HWND, uint8_t, LISTELEMENT*, LPCTSTR, int);
int WriteOptionExample(HWND, DWORD, DWORD, DWORD, DWORD, LISTOPTIONS*);
void WriteMessage(HWND, LISTELEMENT*, int);
void GetColour(MYCOLOURSET*);
void GetDBColour(MYCOLOURSET*);
void SetDBColour(MYCOLOURSET*);
int GetMirandaColour(MYCOLOURSET*);
-BYTE GetUpdateSetting(void);
+uint8_t GetUpdateSetting(void);
int LinklistResizer(HWND,LPARAM,UTILRESIZECONTROL*);
// RTF Save functions
BOOL SaveEditAsStream( HWND );
diff --git a/plugins/HistoryLinkListPlus/src/stdafx.h b/plugins/HistoryLinkListPlus/src/stdafx.h index f1dc8bbf58..d528ec95a5 100644 --- a/plugins/HistoryLinkListPlus/src/stdafx.h +++ b/plugins/HistoryLinkListPlus/src/stdafx.h @@ -73,8 +73,8 @@ #define TXT_COL_DEF 0x00000000
struct LISTELEMENT {
- BYTE direction;
- BYTE type;
+ uint8_t direction;
+ uint8_t type;
wchar_t date[DATE_SIZE];
wchar_t time[TIME_SIZE];
wchar_t link[LINK_MAX];
@@ -84,15 +84,15 @@ struct LISTELEMENT { };
typedef struct {
- BYTE openNewWindow;
- BYTE updateWindow;
- BYTE mouseEvent;
- BYTE saveSpecial;
- BYTE showDate;
- BYTE showLine;
- BYTE showTime;
- BYTE showDirection;
- BYTE showType;
+ uint8_t openNewWindow;
+ uint8_t updateWindow;
+ uint8_t mouseEvent;
+ uint8_t saveSpecial;
+ uint8_t showDate;
+ uint8_t showLine;
+ uint8_t showTime;
+ uint8_t showDirection;
+ uint8_t showType;
} LISTOPTIONS;
typedef struct {
diff --git a/plugins/HistoryStats/src/bandctrlimpl.cpp b/plugins/HistoryStats/src/bandctrlimpl.cpp index f0553dd4c6..f9f953fcc3 100644 --- a/plugins/HistoryStats/src/bandctrlimpl.cpp +++ b/plugins/HistoryStats/src/bandctrlimpl.cpp @@ -424,15 +424,15 @@ HICON BandCtrlImpl::convertToGray(HICON hIcon) BITMAP bmp;
if (GetObject(ii.hbmColor, sizeof(bmp), &bmp) && bmp.bmBitsPixel == 32) {
int nSize = bmp.bmHeight * bmp.bmWidthBytes;
- BYTE* pBits = new BYTE[nSize];
+ uint8_t* pBits = new uint8_t[nSize];
if (GetBitmapBits(ii.hbmColor, nSize, pBits)) {
for (int y = 0; y < bmp.bmHeight; ++y) {
- BYTE* pLine = pBits + y * bmp.bmWidthBytes;
+ uint8_t* pLine = pBits + y * bmp.bmWidthBytes;
for (int x = 0; x < bmp.bmWidth; ++x) {
DWORD color = reinterpret_cast<DWORD*>(pLine)[x];
- BYTE gray = (77 * GetBValue(color) + 150 * GetGValue(color) + 28 * GetRValue(color)) / 255;
+ uint8_t gray = (77 * GetBValue(color) + 150 * GetGValue(color) + 28 * GetRValue(color)) / 255;
color = (color & 0xFF000000) | RGB(gray, gray, gray);
diff --git a/plugins/HistoryStats/src/canvas.cpp b/plugins/HistoryStats/src/canvas.cpp index b85cca45fc..b64ffab679 100644 --- a/plugins/HistoryStats/src/canvas.cpp +++ b/plugins/HistoryStats/src/canvas.cpp @@ -1,7 +1,7 @@ #include "stdafx.h"
#include "canvas.h"
-void Canvas::updateTrans(BYTE* pData)
+void Canvas::updateTrans(uint8_t* pData)
{
// MEMO: this follwing transparency code only makes sense for m_nChannels == 4
assert(m_nChannels == 4);
@@ -87,7 +87,7 @@ HDC Canvas::beginDraw() m_pBMIH->biClrUsed = 0;
m_pBMIH->biClrImportant = 0;
- BYTE* pData = nullptr;
+ uint8_t* pData = nullptr;
m_hDC = CreateCompatibleDC(nullptr);
m_hBmp = CreateDIBSection(m_hDC, reinterpret_cast<BITMAPINFO*>(m_pBMIH), DIB_RGB_COLORS, reinterpret_cast<void**>(&pData), nullptr, 0);
@@ -112,7 +112,7 @@ bool Canvas::getDigest(Digest& digest) // read data from DIB
int nSize = m_nLineLength * m_nHeight;
- BYTE* pData = new BYTE[nSize];
+ uint8_t* pData = new uint8_t[nSize];
memset(pData, 0, nSize);
diff --git a/plugins/HistoryStats/src/canvas.h b/plugins/HistoryStats/src/canvas.h index 99213316f2..d1857d1c33 100644 --- a/plugins/HistoryStats/src/canvas.h +++ b/plugins/HistoryStats/src/canvas.h @@ -35,7 +35,7 @@ private: HGDIOBJ m_hOldBmp;
private:
- void updateTrans(BYTE* pData);
+ void updateTrans(uint8_t* pData);
public:
explicit Canvas(int nWidth, int nHeight);
diff --git a/plugins/HistoryStats/src/main.cpp b/plugins/HistoryStats/src/main.cpp index a3fc660c42..d871dff4c9 100644 --- a/plugins/HistoryStats/src/main.cpp +++ b/plugins/HistoryStats/src/main.cpp @@ -221,7 +221,7 @@ static INT_PTR MenuHistoryPaste(WPARAM wParam, LPARAM lParam) memset(&dbe, 0, sizeof(dbe));
dbe.cbSize = sizeof(dbe);
- dbe.pBlob = reinterpret_cast<BYTE*>(malloc(blobBuffer));
+ dbe.pBlob = reinterpret_cast<uint8_t*>(malloc(blobBuffer));
while (hEvent)
{
@@ -230,7 +230,7 @@ static INT_PTR MenuHistoryPaste(WPARAM wParam, LPARAM lParam) if (blobBuffer < dbe.cbBlob)
{
blobBuffer = 4096 * ((4095 + dbe.cbBlob) / 4096);
- dbe.pBlob = reinterpret_cast<BYTE*>(realloc(dbe.pBlob, blobBuffer));
+ dbe.pBlob = reinterpret_cast<uint8_t*>(realloc(dbe.pBlob, blobBuffer));
}
if (db_event_get(hEvent, &dbe) == 0) {
diff --git a/plugins/HistoryStats/src/utils.cpp b/plugins/HistoryStats/src/utils.cpp index aa656e11cb..71a7f78de3 100644 --- a/plugins/HistoryStats/src/utils.cpp +++ b/plugins/HistoryStats/src/utils.cpp @@ -829,7 +829,7 @@ ext::string utils::getGUID() upto_each_(i, sizeof(guid))
{
- BYTE val = reinterpret_cast<BYTE*>(&guid)[i];
+ uint8_t val = reinterpret_cast<uint8_t*>(&guid)[i];
strGUID[2 * i] = hexDigits[(val >> 4) & 0xF];
strGUID[2 * i + 1] = hexDigits[val & 0xF];
diff --git a/plugins/HistorySweeperLight/src/historysweeperlight.cpp b/plugins/HistorySweeperLight/src/historysweeperlight.cpp index afd9b155bc..028e92a757 100644 --- a/plugins/HistorySweeperLight/src/historysweeperlight.cpp +++ b/plugins/HistorySweeperLight/src/historysweeperlight.cpp @@ -88,7 +88,7 @@ struct BEventData static int CompareBookmarks(const void* p1, const void* p2)
{
- return (BYTE*)((BEventData*)p1)->hDBEvent - (BYTE*)((BEventData*)p2)->hDBEvent;
+ return (uint8_t*)((BEventData*)p1)->hDBEvent - (uint8_t*)((BEventData*)p2)->hDBEvent;
}
static void GetBookmarks(MCONTACT hContact, BEventData** books, size_t* bookcnt)
@@ -106,7 +106,7 @@ static void GetBookmarks(MCONTACT hContact, BEventData** books, size_t* bookcnt) size_t tbookcnt = 0;
size_t i;
- BYTE* evs = dbv.pbVal + sizeof(WORD);
+ uint8_t* evs = dbv.pbVal + sizeof(WORD);
for (i = 0; i < numb; ++i) {
tbooks[tbookcnt++] = *(BEventData*)evs;
diff --git a/plugins/HistorySweeperLight/src/main.cpp b/plugins/HistorySweeperLight/src/main.cpp index 416c83f319..6879740404 100644 --- a/plugins/HistorySweeperLight/src/main.cpp +++ b/plugins/HistorySweeperLight/src/main.cpp @@ -57,7 +57,7 @@ static int OnIconPressed(WPARAM hContact, LPARAM lParam) nh = (nh + 1) % 4;
- g_plugin.setByte(hContact, "SweepHistory", (BYTE)nh);
+ g_plugin.setByte(hContact, "SweepHistory", (uint8_t)nh);
Srmm_SetIconFlags(hContact, MODULENAME, nh, 0);
}
return 0;
diff --git a/plugins/HistorySweeperLight/src/options.cpp b/plugins/HistorySweeperLight/src/options.cpp index 50db5990f5..0c3ce0fef3 100644 --- a/plugins/HistorySweeperLight/src/options.cpp +++ b/plugins/HistorySweeperLight/src/options.cpp @@ -116,21 +116,21 @@ void SaveSettings(HWND hwndDlg) {
HWND hwndList = GetDlgItem(hwndDlg, IDC_LIST);
- g_plugin.setByte("StartupShutdownOlder", (BYTE)SendDlgItemMessage(hwndDlg, IDC_SSOLDER, CB_GETCURSEL, 0, 0));
- g_plugin.setByte("StartupShutdownKeep", (BYTE)SendDlgItemMessage(hwndDlg, IDC_SSKEEP, CB_GETCURSEL, 0, 0));
- g_plugin.setByte("UnsafeMode", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_UNSAFEMODE));
- g_plugin.setByte("SweepOnClose", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SWEEPONCLOSE));
- g_plugin.setByte("ChangeInMW", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_HISTMW));
+ g_plugin.setByte("StartupShutdownOlder", (uint8_t)SendDlgItemMessage(hwndDlg, IDC_SSOLDER, CB_GETCURSEL, 0, 0));
+ g_plugin.setByte("StartupShutdownKeep", (uint8_t)SendDlgItemMessage(hwndDlg, IDC_SSKEEP, CB_GETCURSEL, 0, 0));
+ g_plugin.setByte("UnsafeMode", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_UNSAFEMODE));
+ g_plugin.setByte("SweepOnClose", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_SWEEPONCLOSE));
+ g_plugin.setByte("ChangeInMW", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_HISTMW));
- g_plugin.setByte("SweepHistory", (BYTE)SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hAllContacts, 0));
- g_plugin.setByte("SweepSHistory", (BYTE)SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hSystemHistory, 0));
+ g_plugin.setByte("SweepHistory", (uint8_t)SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hAllContacts, 0));
+ g_plugin.setByte("SweepSHistory", (uint8_t)SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hSystemHistory, 0));
for (auto &hContact : Contacts()) {
HANDLE hItem = (HANDLE)SendMessage(hwndList, CLM_FINDCONTACT, hContact, 0);
int st = SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, 0);
if (st != 0)
- g_plugin.setByte(hContact, "SweepHistory", (BYTE)st);
+ g_plugin.setByte(hContact, "SweepHistory", (uint8_t)st);
else
g_plugin.delSetting(hContact, "SweepHistory");
}
diff --git a/plugins/IEHistory/src/stdafx.h b/plugins/IEHistory/src/stdafx.h index 5dc6758e3a..d0d04d4175 100644 --- a/plugins/IEHistory/src/stdafx.h +++ b/plugins/IEHistory/src/stdafx.h @@ -58,7 +58,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. struct CMPlugin : public PLUGIN<CMPlugin> { - CMOption<BYTE> bEnableRtl, bShowLastFirst, bUseWorker; + CMOption<uint8_t> bEnableRtl, bShowLastFirst, bUseWorker; CMOption<DWORD> iLoadCount; CMPlugin(); diff --git a/plugins/IEView/src/IEView.cpp b/plugins/IEView/src/IEView.cpp index 842e9bc33c..307106cb2c 100644 --- a/plugins/IEView/src/IEView.cpp +++ b/plugins/IEView/src/IEView.cpp @@ -670,12 +670,12 @@ STDMETHODIMP IEView::MapUrlToZone(LPCWSTR pwszUrl, DWORD *pdwZone, DWORD) return INET_E_DEFAULT_ACTION;
}
-STDMETHODIMP IEView::GetSecurityId(LPCWSTR, BYTE *, DWORD *, DWORD_PTR)
+STDMETHODIMP IEView::GetSecurityId(LPCWSTR, uint8_t *, DWORD *, DWORD_PTR)
{
return INET_E_DEFAULT_ACTION;
}
-STDMETHODIMP IEView::ProcessUrlAction(LPCWSTR pwszUrl, DWORD dwAction, BYTE *pPolicy, DWORD cbPolicy, BYTE *, DWORD, DWORD, DWORD)
+STDMETHODIMP IEView::ProcessUrlAction(LPCWSTR pwszUrl, DWORD dwAction, uint8_t *pPolicy, DWORD cbPolicy, uint8_t *, DWORD, DWORD, DWORD)
{
DWORD dwPolicy = URLPOLICY_ALLOW;
if (pwszUrl != nullptr && !mir_wstrcmp(pwszUrl, L"about:blank")) {
@@ -707,7 +707,7 @@ STDMETHODIMP IEView::ProcessUrlAction(LPCWSTR pwszUrl, DWORD dwAction, BYTE *pPo return INET_E_DEFAULT_ACTION;
}
-STDMETHODIMP IEView::QueryCustomPolicy(LPCWSTR, REFGUID, BYTE **, DWORD *, BYTE *, DWORD, DWORD)
+STDMETHODIMP IEView::QueryCustomPolicy(LPCWSTR, REFGUID, uint8_t **, DWORD *, uint8_t *, DWORD, DWORD)
{
return INET_E_DEFAULT_ACTION;
}
diff --git a/plugins/IEView/src/IEView.h b/plugins/IEView/src/IEView.h index 87f1240d90..4211b2d4de 100644 --- a/plugins/IEView/src/IEView.h +++ b/plugins/IEView/src/IEView.h @@ -359,9 +359,9 @@ extern "C" { STDMETHOD(SetSecuritySite)(THIS_ IInternetSecurityMgrSite*) PURE;
STDMETHOD(GetSecuritySite)(THIS_ IInternetSecurityMgrSite**) PURE;
STDMETHOD(MapUrlToZone)(THIS_ LPCWSTR,DWORD*,DWORD) PURE;
- STDMETHOD(GetSecurityId)(THIS_ LPCWSTR,BYTE*,DWORD*,DWORD_PTR) PURE;
- STDMETHOD(ProcessUrlAction)(THIS_ LPCWSTR,DWORD,BYTE*,DWORD,BYTE*,DWORD,DWORD,DWORD) PURE;
- STDMETHOD(QueryCustomPolicy)(THIS_ LPCWSTR,REFGUID,BYTE**,DWORD*,BYTE*,DWORD,DWORD) PURE;
+ STDMETHOD(GetSecurityId)(THIS_ LPCWSTR,uint8_t*,DWORD*,DWORD_PTR) PURE;
+ STDMETHOD(ProcessUrlAction)(THIS_ LPCWSTR,DWORD,uint8_t*,DWORD,uint8_t*,DWORD,DWORD,DWORD) PURE;
+ STDMETHOD(QueryCustomPolicy)(THIS_ LPCWSTR,REFGUID,uint8_t**,DWORD*,uint8_t*,DWORD,DWORD) PURE;
STDMETHOD(SetZoneMapping)(THIS_ DWORD,LPCWSTR,DWORD) PURE;
STDMETHOD(GetZoneMappings)(THIS_ DWORD,IEnumString**,DWORD) PURE;
};
@@ -502,9 +502,9 @@ class IEView :public IDispatch, public IOleClientSite, public IOleInPlaceSite, p STDMETHOD(SetSecuritySite)(IInternetSecurityMgrSite *pSite);
STDMETHOD(GetSecuritySite)(IInternetSecurityMgrSite **ppSite);
STDMETHOD(MapUrlToZone)(LPCWSTR pwszUrl, DWORD *pdwZone, DWORD dwFlags);
- STDMETHOD(GetSecurityId)(LPCWSTR pwszUrl, BYTE *pbSecurityId, DWORD *pcbSecurityId, DWORD_PTR dwReserved);
- STDMETHOD(ProcessUrlAction)(LPCWSTR pwszUrl, DWORD dwAction, BYTE *pPolicy, DWORD cbPolicy, BYTE *pContext, DWORD cbContext, DWORD dwFlags, DWORD dwReserved);
- STDMETHOD(QueryCustomPolicy)(LPCWSTR pwszUrl, REFGUID guidKey, BYTE **ppPolicy, DWORD *pcbPolicy, BYTE *pContext, DWORD cbContext, DWORD dwReserved);
+ STDMETHOD(GetSecurityId)(LPCWSTR pwszUrl, uint8_t *pbSecurityId, DWORD *pcbSecurityId, DWORD_PTR dwReserved);
+ STDMETHOD(ProcessUrlAction)(LPCWSTR pwszUrl, DWORD dwAction, uint8_t *pPolicy, DWORD cbPolicy, uint8_t *pContext, DWORD cbContext, DWORD dwFlags, DWORD dwReserved);
+ STDMETHOD(QueryCustomPolicy)(LPCWSTR pwszUrl, REFGUID guidKey, uint8_t **ppPolicy, DWORD *pcbPolicy, uint8_t *pContext, DWORD cbContext, DWORD dwReserved);
STDMETHOD(SetZoneMapping)(DWORD dwZone, LPCWSTR lpszPattern, DWORD dwFlags);
STDMETHOD(GetZoneMappings)(DWORD dwZone, IEnumString **ppenumString, DWORD dwFlags);
diff --git a/plugins/Import/src/dbrw/dbsettings.cpp b/plugins/Import/src/dbrw/dbsettings.cpp index b794e38875..ba9703b127 100644 --- a/plugins/Import/src/dbrw/dbsettings.cpp +++ b/plugins/Import/src/dbrw/dbsettings.cpp @@ -97,7 +97,7 @@ STDMETHODIMP_(BOOL) CDbxSQLite::GetContactSettingWorker(MCONTACT contactID, LPCS dbv->type = (int)sqlite3_column_int(set_stmts_prep[SQL_SET_STMT_READ], 0); switch (dbv->type) { case DBVT_BYTE: - dbv->bVal = (BYTE)sqlite3_column_int(set_stmts_prep[SQL_SET_STMT_READ], 1); + dbv->bVal = (uint8_t)sqlite3_column_int(set_stmts_prep[SQL_SET_STMT_READ], 1); break; case DBVT_WORD: dbv->wVal = (WORD)sqlite3_column_int(set_stmts_prep[SQL_SET_STMT_READ], 1); @@ -128,7 +128,7 @@ STDMETHODIMP_(BOOL) CDbxSQLite::GetContactSettingWorker(MCONTACT contactID, LPCS if (len) { size_t copylen = isStatic ? (len < dbv->cpbVal ? len : dbv->cpbVal) : len; if (!isStatic) - dbv->pbVal = (BYTE*)mir_alloc(copylen); + dbv->pbVal = (uint8_t*)mir_alloc(copylen); memcpy(dbv->pbVal, sqlite3_column_blob(set_stmts_prep[SQL_SET_STMT_READ], 1), copylen); dbv->cpbVal = (WORD)copylen; } diff --git a/plugins/Import/src/import.cpp b/plugins/Import/src/import.cpp index 1dccf81d41..2e5a8616d8 100644 --- a/plugins/Import/src/import.cpp +++ b/plugins/Import/src/import.cpp @@ -880,7 +880,7 @@ void CImportBatch::ImportHistory(MCONTACT hContact, PROTOACCOUNT **protocol, int bool bSkipAll = false;
DWORD cbAlloc = 4096;
- BYTE *eventBuf = (uint8_t*)mir_alloc(cbAlloc);
+ uint8_t *eventBuf = (uint8_t*)mir_alloc(cbAlloc);
// Get the start of the event chain
int i = 0;
diff --git a/plugins/KeyboardNotify/src/flash.cpp b/plugins/KeyboardNotify/src/flash.cpp index d1d9edfbd4..c56d3b6742 100644 --- a/plugins/KeyboardNotify/src/flash.cpp +++ b/plugins/KeyboardNotify/src/flash.cpp @@ -22,7 +22,7 @@ struct FLASHING_SEQUENCE {
unsigned int size;
unsigned int index;
- BYTE frame[MAX_PATH];
+ uint8_t frame[MAX_PATH];
};
@@ -34,19 +34,19 @@ void updateTrillianSeq(void); static void __cdecl TestThread(void *param);
static void PreviewThread(void *);
FLASHING_SEQUENCE str2FS(wchar_t *);
-BYTE KbdChar2Byte(char);
+uint8_t KbdChar2Byte(char);
void countUnopenEvents(int *, int *, int *);
-#define Leds2Flash ((BYTE)(bFlashLed[2] + (bFlashLed[0]<<1) + (bFlashLed[1]<<2)))
+#define Leds2Flash ((uint8_t)(bFlashLed[2] + (bFlashLed[0]<<1) + (bFlashLed[1]<<2)))
// Flashing settings
FLASHING_SEQUENCE *pFS;
BOOL bTemporarilyUseExtern;
-extern BYTE bFlashLed[3];
-extern BYTE bFlashEffect; extern BYTE bSequenceOrder;
+extern uint8_t bFlashLed[3];
+extern uint8_t bFlashEffect; extern uint8_t bSequenceOrder;
extern WORD wCustomTheme;
-extern BYTE bTrillianLedsMsg, bTrillianLedsFile, bTrillianLedsOther;
-extern BYTE bEmulateKeypresses;
+extern uint8_t bTrillianLedsMsg, bTrillianLedsFile, bTrillianLedsOther;
+extern uint8_t bEmulateKeypresses;
// TestThread/PreviewThread globals
extern int nWaitDelay; extern WORD wStartDelay;
@@ -57,13 +57,13 @@ void RestoreLEDState(void) if (bEmulateKeypresses)
keypresses_RestoreLEDState();
else
- ToggleKeyboardLights((BYTE)(LedState(VK_SCROLL) + (LedState(VK_NUMLOCK)<<1) + (LedState(VK_CAPITAL)<<2)));
+ ToggleKeyboardLights((uint8_t)(LedState(VK_SCROLL) + (LedState(VK_NUMLOCK)<<1) + (LedState(VK_CAPITAL)<<2)));
}
-BYTE getBlinkingLeds(void)
+uint8_t getBlinkingLeds(void)
{
if (!pFS->size)
- return (BYTE)(LedState(VK_SCROLL) + (LedState(VK_NUMLOCK)<<1) + (LedState(VK_CAPITAL)<<2));
+ return (uint8_t)(LedState(VK_SCROLL) + (LedState(VK_NUMLOCK)<<1) + (LedState(VK_CAPITAL)<<2));
pFS->index %= pFS->size;
if (bFlashEffect == FLASH_TRILLIAN && !bTemporarilyUseExtern && !pFS->index)
@@ -342,11 +342,11 @@ static void PreviewThread(void*) if (wStartDelay > 0)
Sleep(wStartDelay * 1000);
- BYTE unchangedLeds = (BYTE)(LedState(VK_SCROLL) * !bFlashLed[2] + ((LedState(VK_NUMLOCK) * !bFlashLed[0])<<1) + ((LedState(VK_CAPITAL) * !bFlashLed[1])<<2));
+ uint8_t unchangedLeds = (uint8_t)(LedState(VK_SCROLL) * !bFlashLed[2] + ((LedState(VK_NUMLOCK) * !bFlashLed[0])<<1) + ((LedState(VK_CAPITAL) * !bFlashLed[1])<<2));
while (bPreview)
for (unsigned i=0; bPreview && i < pFS->size; i++) {
- ToggleKeyboardLights((BYTE)(pFS->frame[i%pFS->size]|unchangedLeds));
+ ToggleKeyboardLights((uint8_t)(pFS->frame[i%pFS->size]|unchangedLeds));
Sleep(nWaitDelay);
}
@@ -375,7 +375,7 @@ FLASHING_SEQUENCE str2FS(wchar_t *str) }
-BYTE KbdChar2Byte(char kbdChar)
+uint8_t KbdChar2Byte(char kbdChar)
{
switch (kbdChar) {
case '1': //NumLock
diff --git a/plugins/KeyboardNotify/src/flash.h b/plugins/KeyboardNotify/src/flash.h index ee553f6834..1257ea1c7e 100644 --- a/plugins/KeyboardNotify/src/flash.h +++ b/plugins/KeyboardNotify/src/flash.h @@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #pragma once
void RestoreLEDState(void);
-BYTE getBlinkingLeds(void);
+uint8_t getBlinkingLeds(void);
void setFlashingSequence(void);
void useExternSequence(wchar_t *);
wchar_t *normalizeCustomString(wchar_t *);
@@ -27,4 +27,4 @@ wchar_t *getCurrentSequenceString(void); void testSequence(wchar_t *);
void previewFlashing(BOOL);
-#define LedState(a) (((BYTE)(GetKeyState(a) & 0xffff))!=0)
+#define LedState(a) (((uint8_t)(GetKeyState(a) & 0xffff))!=0)
diff --git a/plugins/KeyboardNotify/src/keyboard.cpp b/plugins/KeyboardNotify/src/keyboard.cpp index d8ea3dbfff..a0161cd342 100644 --- a/plugins/KeyboardNotify/src/keyboard.cpp +++ b/plugins/KeyboardNotify/src/keyboard.cpp @@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "stdafx.h"
// Globals
-extern BYTE bEmulateKeypresses;
+extern uint8_t bEmulateKeypresses;
HANDLE hKbdDev[10] = {INVALID_HANDLE_VALUE, INVALID_HANDLE_VALUE, INVALID_HANDLE_VALUE, INVALID_HANDLE_VALUE, INVALID_HANDLE_VALUE, INVALID_HANDLE_VALUE, INVALID_HANDLE_VALUE, INVALID_HANDLE_VALUE, INVALID_HANDLE_VALUE, INVALID_HANDLE_VALUE};
// Defines
@@ -52,7 +52,7 @@ BOOL OpenKeyboardDevice() return hKbdDev[0] != INVALID_HANDLE_VALUE;
}
-BOOL ToggleKeyboardLights(BYTE byte)
+BOOL ToggleKeyboardLights(uint8_t byte)
{
int i; BOOL result = FALSE;
KEYBOARD_INDICATOR_PARAMETERS InputBuffer; // Input buffer for DeviceIoControl
diff --git a/plugins/KeyboardNotify/src/keyboard.h b/plugins/KeyboardNotify/src/keyboard.h index 2e1ae08e51..f7a759dbd5 100644 --- a/plugins/KeyboardNotify/src/keyboard.h +++ b/plugins/KeyboardNotify/src/keyboard.h @@ -19,5 +19,5 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #pragma once
BOOL OpenKeyboardDevice(void);
-BOOL ToggleKeyboardLights(BYTE);
+BOOL ToggleKeyboardLights(uint8_t);
void CloseKeyboardDevice(void);
diff --git a/plugins/KeyboardNotify/src/keypresses.cpp b/plugins/KeyboardNotify/src/keypresses.cpp index 8b449f104b..85e521925e 100644 --- a/plugins/KeyboardNotify/src/keypresses.cpp +++ b/plugins/KeyboardNotify/src/keypresses.cpp @@ -19,11 +19,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "stdafx.h"
// Prototypes
-void SetLock(WORD, BYTE, unsigned int *, INPUT *);
+void SetLock(WORD, uint8_t, unsigned int *, INPUT *);
// Globals
BOOL LEDstateSaved = FALSE;
-BYTE LEDstate;
+uint8_t LEDstate;
void keypresses_RestoreLEDState(void)
@@ -33,27 +33,27 @@ void keypresses_RestoreLEDState(void) LEDstateSaved = FALSE;
}
-BOOL keypresses_ToggleKeyboardLights(BYTE byte)
+BOOL keypresses_ToggleKeyboardLights(uint8_t byte)
{
unsigned int n = 0;
INPUT keystrokes[6] = {0};
if (!LEDstateSaved) {
- LEDstate = (BYTE)(LedState(VK_SCROLL) + (LedState(VK_NUMLOCK)<<1) + (LedState(VK_CAPITAL)<<2));
+ LEDstate = (uint8_t)(LedState(VK_SCROLL) + (LedState(VK_NUMLOCK)<<1) + (LedState(VK_CAPITAL)<<2));
LEDstateSaved = TRUE;
}
- SetLock(VK_NUMLOCK, (BYTE)(byte&2), &n, keystrokes);
- SetLock(VK_CAPITAL, (BYTE)(byte&4), &n, keystrokes);
- SetLock(VK_SCROLL, (BYTE)(byte&1), &n, keystrokes);
+ SetLock(VK_NUMLOCK, (uint8_t)(byte&2), &n, keystrokes);
+ SetLock(VK_CAPITAL, (uint8_t)(byte&4), &n, keystrokes);
+ SetLock(VK_SCROLL, (uint8_t)(byte&1), &n, keystrokes);
SendInput(n, keystrokes, sizeof(INPUT));
return TRUE;
}
-void SetLock(WORD keyCode, BYTE value, unsigned int *n, INPUT *keystrokes)
+void SetLock(WORD keyCode, uint8_t value, unsigned int *n, INPUT *keystrokes)
{
- BYTE status;
+ uint8_t status;
GetAsyncKeyState(keyCode);
status = GetKeyState(keyCode) & 1;
diff --git a/plugins/KeyboardNotify/src/keypresses.h b/plugins/KeyboardNotify/src/keypresses.h index 8b9d40c375..1330738837 100644 --- a/plugins/KeyboardNotify/src/keypresses.h +++ b/plugins/KeyboardNotify/src/keypresses.h @@ -19,4 +19,4 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #pragma once
void keypresses_RestoreLEDState(void);
-BOOL keypresses_ToggleKeyboardLights(BYTE);
+BOOL keypresses_ToggleKeyboardLights(uint8_t);
diff --git a/plugins/KeyboardNotify/src/main.cpp b/plugins/KeyboardNotify/src/main.cpp index 322ba0ec93..88a31dbdde 100644 --- a/plugins/KeyboardNotify/src/main.cpp +++ b/plugins/KeyboardNotify/src/main.cpp @@ -40,39 +40,39 @@ UINT hReminderTimer = 0; HHOOK hMouseHook = nullptr;
HHOOK hKeyBoardHook = nullptr;
-BYTE bEmulateKeypresses = 0;
+uint8_t bEmulateKeypresses = 0;
DWORD dwLastInput = 0;
POINT lastGlobalMousePos = { 0, 0 };
-BYTE bFlashOnMsg;
-BYTE bFlashOnFile;
-BYTE bFlashOnGC;
-BYTE bFlashOnOther;
-BYTE bFullScreenMode;
-BYTE bScreenSaverRunning;
-BYTE bWorkstationLocked;
-BYTE bProcessesAreRunning;
-BYTE bWorkstationActive;
-BYTE bFlashIfMsgOpen;
-BYTE bFlashIfMsgWinNotTop;
-BYTE bFlashIfMsgOlder;
+uint8_t bFlashOnMsg;
+uint8_t bFlashOnFile;
+uint8_t bFlashOnGC;
+uint8_t bFlashOnOther;
+uint8_t bFullScreenMode;
+uint8_t bScreenSaverRunning;
+uint8_t bWorkstationLocked;
+uint8_t bProcessesAreRunning;
+uint8_t bWorkstationActive;
+uint8_t bFlashIfMsgOpen;
+uint8_t bFlashIfMsgWinNotTop;
+uint8_t bFlashIfMsgOlder;
WORD wSecondsOlder;
-BYTE bFlashUntil;
+uint8_t bFlashUntil;
WORD wBlinksNumber;
-BYTE bMirandaOrWindows;
+uint8_t bMirandaOrWindows;
WORD wStatusMap;
WORD wReminderCheck;
-BYTE bFlashLed[3];
-BYTE bFlashEffect;
-BYTE bSequenceOrder;
+uint8_t bFlashLed[3];
+uint8_t bFlashEffect;
+uint8_t bSequenceOrder;
WORD wCustomTheme;
WORD wStartDelay;
-BYTE bFlashSpeed;
-BYTE bOverride;
-BYTE bTrillianLedsMsg;
-BYTE bTrillianLedsURL;
-BYTE bTrillianLedsFile;
-BYTE bTrillianLedsOther;
+uint8_t bFlashSpeed;
+uint8_t bOverride;
+uint8_t bTrillianLedsMsg;
+uint8_t bTrillianLedsURL;
+uint8_t bTrillianLedsFile;
+uint8_t bTrillianLedsOther;
PROTOCOL_LIST ProtoList = { 0, nullptr };
PROCESS_LIST ProcessList = { 0, nullptr };
@@ -82,7 +82,7 @@ unsigned int nExternCount = 0; BOOL bFlashingEnabled = TRUE;
BOOL bReminderDisabled = FALSE;
-BYTE bMetaProtoEnabled = 0;
+uint8_t bMetaProtoEnabled = 0;
/////////////////////////////////////////////////////////////////////////////////////////
@@ -263,13 +263,13 @@ static void __cdecl FlashThreadFunction(void*) {
BOOL bEvent = FALSE;
DWORD dwEventStarted = 0, dwFlashStarted = 0;
- BYTE data, unchangedLeds;
+ uint8_t data, unchangedLeds;
Thread_SetName("KeyboardNotify: FlashThreadFunction");
MThreadLock threadLock(hThread);
while (true) {
- unchangedLeds = (BYTE)(LedState(VK_PAUSE) * !bFlashLed[2] + ((LedState(VK_NUMLOCK) * !bFlashLed[0]) << 1) + ((LedState(VK_CAPITAL) * !bFlashLed[1]) << 2));
+ unchangedLeds = (uint8_t)(LedState(VK_PAUSE) * !bFlashLed[2] + ((LedState(VK_NUMLOCK) * !bFlashLed[0]) << 1) + ((LedState(VK_CAPITAL) * !bFlashLed[1]) << 2));
GetAsyncKeyState(VK_PAUSE); // empty Pause/Break's keystroke buffer
// Start flashing
@@ -295,7 +295,7 @@ static void __cdecl FlashThreadFunction(void*) break;
data = getBlinkingLeds();
- ToggleKeyboardLights((BYTE)(data | unchangedLeds));
+ ToggleKeyboardLights((uint8_t)(data | unchangedLeds));
// Wait for exit event
if (WaitForSingleObject(hExitEvent, nWaitDelay) == WAIT_OBJECT_0) {
diff --git a/plugins/KeyboardNotify/src/options.cpp b/plugins/KeyboardNotify/src/options.cpp index b7d0cf23c9..91439d716a 100644 --- a/plugins/KeyboardNotify/src/options.cpp +++ b/plugins/KeyboardNotify/src/options.cpp @@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. void LoadSettings(void); -extern BYTE +extern uint8_t bFlashOnMsg, bFlashOnFile, bFlashOnGC, bFlashOnOther, bFullScreenMode, bScreenSaverRunning, bWorkstationLocked, bProcessesAreRunning, bWorkstationActive, bFlashIfMsgOpen, bFlashIfMsgOlder, bFlashUntil, bMirandaOrWindows, bFlashLed[3], bFlashEffect, bSequenceOrder, bFlashSpeed, bEmulateKeypresses, bOverride, bFlashIfMsgWinNotTop, bTrillianLedsMsg, bTrillianLedsURL, bTrillianLedsFile, bTrillianLedsOther; @@ -39,7 +39,7 @@ wchar_t *OrderName[] = { LPGENW("left -> right"), LPGENW("right -> left"), LPGEN PROCESS_LIST ProcessListAux; XSTATUS_INFO *XstatusListAux; -BYTE trillianLedsMsg, trillianLedsURL, trillianLedsFile, trillianLedsOther; +uint8_t trillianLedsMsg, trillianLedsURL, trillianLedsFile, trillianLedsOther; static void writeThemeToCombo(const wchar_t *theme, const wchar_t *custom, BOOL overrideExisting) { @@ -543,7 +543,7 @@ static INT_PTR CALLBACK DlgProcProtoOptions(HWND hwndDlg, UINT msg, WPARAM, LPAR for (int i = 0; i < ListView_GetItemCount(hList); i++) { lvItem.iItem = i; ListView_GetItem(hList, &lvItem); - g_plugin.setByte((char *)lvItem.lParam, (BYTE)ListView_GetCheckState(hList, lvItem.iItem)); + g_plugin.setByte((char *)lvItem.lParam, (uint8_t)ListView_GetCheckState(hList, lvItem.iItem)); } } @@ -731,27 +731,27 @@ static INT_PTR CALLBACK DlgProcBasicOptions(HWND hwndDlg, UINT msg, WPARAM wPara case WM_NOTIFY: { - BYTE untilMap = 0; + uint8_t untilMap = 0; WORD statusMap = 0; //Here we have pressed either the OK or the APPLY button. switch (((LPNMHDR)lParam)->idFrom) { case 0: switch (((LPNMHDR)lParam)->code) { case PSN_APPLY: - g_plugin.setByte("onmsg", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_ONMESSAGE) == BST_CHECKED ? 1 : 0)); - g_plugin.setByte("ongcmsg", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_GCMSG) == BST_CHECKED ? 1 : 0)); - g_plugin.setByte("onfile", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_ONFILE) == BST_CHECKED ? 1 : 0)); - g_plugin.setByte("onother", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_ONOTHER) == BST_CHECKED ? 1 : 0)); - - g_plugin.setByte("fscreenmode", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_FSCREEN) == BST_CHECKED ? 1 : 0)); - g_plugin.setByte("ssaverrunning", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_SSAVER) == BST_CHECKED ? 1 : 0)); - g_plugin.setByte("wstationlocked", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_LOCKED) == BST_CHECKED ? 1 : 0)); - g_plugin.setByte("procsrunning", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_PGMS) == BST_CHECKED ? 1 : 0)); - g_plugin.setByte("wstationactive", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_ACTIVE) == BST_CHECKED ? 1 : 0)); - - g_plugin.setByte("ifmsgopen", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_IFOPEN) == BST_CHECKED ? 1 : 0)); - g_plugin.setByte("ifmsgnottop", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_IFNOTTOP) == BST_CHECKED ? 1 : 0)); - g_plugin.setByte("ifmsgolder", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_IFOLDER) == BST_CHECKED ? 1 : 0)); + g_plugin.setByte("onmsg", (uint8_t)(IsDlgButtonChecked(hwndDlg, IDC_ONMESSAGE) == BST_CHECKED ? 1 : 0)); + g_plugin.setByte("ongcmsg", (uint8_t)(IsDlgButtonChecked(hwndDlg, IDC_GCMSG) == BST_CHECKED ? 1 : 0)); + g_plugin.setByte("onfile", (uint8_t)(IsDlgButtonChecked(hwndDlg, IDC_ONFILE) == BST_CHECKED ? 1 : 0)); + g_plugin.setByte("onother", (uint8_t)(IsDlgButtonChecked(hwndDlg, IDC_ONOTHER) == BST_CHECKED ? 1 : 0)); + + g_plugin.setByte("fscreenmode", (uint8_t)(IsDlgButtonChecked(hwndDlg, IDC_FSCREEN) == BST_CHECKED ? 1 : 0)); + g_plugin.setByte("ssaverrunning", (uint8_t)(IsDlgButtonChecked(hwndDlg, IDC_SSAVER) == BST_CHECKED ? 1 : 0)); + g_plugin.setByte("wstationlocked", (uint8_t)(IsDlgButtonChecked(hwndDlg, IDC_LOCKED) == BST_CHECKED ? 1 : 0)); + g_plugin.setByte("procsrunning", (uint8_t)(IsDlgButtonChecked(hwndDlg, IDC_PGMS) == BST_CHECKED ? 1 : 0)); + g_plugin.setByte("wstationactive", (uint8_t)(IsDlgButtonChecked(hwndDlg, IDC_ACTIVE) == BST_CHECKED ? 1 : 0)); + + g_plugin.setByte("ifmsgopen", (uint8_t)(IsDlgButtonChecked(hwndDlg, IDC_IFOPEN) == BST_CHECKED ? 1 : 0)); + g_plugin.setByte("ifmsgnottop", (uint8_t)(IsDlgButtonChecked(hwndDlg, IDC_IFNOTTOP) == BST_CHECKED ? 1 : 0)); + g_plugin.setByte("ifmsgolder", (uint8_t)(IsDlgButtonChecked(hwndDlg, IDC_IFOLDER) == BST_CHECKED ? 1 : 0)); g_plugin.setWord("secsolder", (WORD)SendDlgItemMessage(hwndDlg, IDC_OLDERSPIN, UDM_GETPOS, 0, 0)); if (IsDlgButtonChecked(hwndDlg, IDC_UNTILBLK) == BST_CHECKED) @@ -764,7 +764,7 @@ static INT_PTR CALLBACK DlgProcBasicOptions(HWND hwndDlg, UINT msg, WPARAM wPara untilMap |= UNTIL_CONDITIONS; g_plugin.setByte("funtil", untilMap); g_plugin.setWord("nblinks", (WORD)SendDlgItemMessage(hwndDlg, IDC_BLINKSPIN, UDM_GETPOS, 0, 0)); - g_plugin.setByte("mirorwin", (BYTE)SendDlgItemMessage(hwndDlg, IDC_MIRORWIN, CB_GETITEMDATA, (WPARAM)SendDlgItemMessage(hwndDlg, IDC_MIRORWIN, CB_GETCURSEL, 0, 0), 0)); + g_plugin.setByte("mirorwin", (uint8_t)SendDlgItemMessage(hwndDlg, IDC_MIRORWIN, CB_GETITEMDATA, (WPARAM)SendDlgItemMessage(hwndDlg, IDC_MIRORWIN, CB_GETCURSEL, 0, 0), 0)); if (IsDlgButtonChecked(hwndDlg, IDC_ONLINE) == BST_CHECKED) statusMap |= MAP_ONLINE; @@ -796,7 +796,7 @@ static INT_PTR CALLBACK DlgProcBasicOptions(HWND hwndDlg, UINT msg, WPARAM wPara if (XstatusListAux) for (i = 0; i < ProtoList.protoCount; i++) for (int j = 0; j < (int)XstatusListAux[i].count; j++) - g_plugin.setByte(fmtDBSettingName("%sxstatus%d", ProtoList.protoInfo[i].szProto, j), (BYTE)XstatusListAux[i].enabled[j]); + g_plugin.setByte(fmtDBSettingName("%sxstatus%d", ProtoList.protoInfo[i].szProto, j), (uint8_t)XstatusListAux[i].enabled[j]); LoadSettings(); return TRUE; @@ -924,9 +924,9 @@ static INT_PTR CALLBACK DlgProcEffectOptions(HWND hwndDlg, UINT msg, WPARAM wPar case 0: switch (((LPNMHDR)lParam)->code) { case PSN_APPLY: - g_plugin.setByte("fnum", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_NUM) == BST_CHECKED ? 1 : 0)); - g_plugin.setByte("fcaps", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CAPS) == BST_CHECKED ? 1 : 0)); - g_plugin.setByte("fscroll", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_SCROLL) == BST_CHECKED ? 1 : 0)); + g_plugin.setByte("fnum", (uint8_t)(IsDlgButtonChecked(hwndDlg, IDC_NUM) == BST_CHECKED ? 1 : 0)); + g_plugin.setByte("fcaps", (uint8_t)(IsDlgButtonChecked(hwndDlg, IDC_CAPS) == BST_CHECKED ? 1 : 0)); + g_plugin.setByte("fscroll", (uint8_t)(IsDlgButtonChecked(hwndDlg, IDC_SCROLL) == BST_CHECKED ? 1 : 0)); if (IsDlgButtonChecked(hwndDlg, IDC_INTURN) == BST_CHECKED) g_plugin.setByte("feffect", FLASH_INTURN); @@ -938,7 +938,7 @@ static INT_PTR CALLBACK DlgProcEffectOptions(HWND hwndDlg, UINT msg, WPARAM wPar g_plugin.setByte("feffect", FLASH_TRILLIAN); else g_plugin.setByte("feffect", FLASH_SAMETIME); - g_plugin.setByte("order", (BYTE)SendDlgItemMessage(hwndDlg, IDC_SEQORDER, CB_GETITEMDATA, (WPARAM)SendDlgItemMessage(hwndDlg, IDC_SEQORDER, CB_GETCURSEL, 0, 0), 0)); + g_plugin.setByte("order", (uint8_t)SendDlgItemMessage(hwndDlg, IDC_SEQORDER, CB_GETITEMDATA, (WPARAM)SendDlgItemMessage(hwndDlg, IDC_SEQORDER, CB_GETCURSEL, 0, 0), 0)); g_plugin.setWord("custom", (WORD)SendDlgItemMessage(hwndDlg, IDC_SCUSTOM, CB_GETITEMDATA, (WPARAM)SendDlgItemMessage(hwndDlg, IDC_SCUSTOM, CB_GETCURSEL, 0, 0), 0)); g_plugin.setByte("ledsmsg", trillianLedsMsg); @@ -948,9 +948,9 @@ static INT_PTR CALLBACK DlgProcEffectOptions(HWND hwndDlg, UINT msg, WPARAM wPar g_plugin.setWord("sdelay", (WORD)SendDlgItemMessage(hwndDlg, IDC_DELAYSPIN, UDM_GETPOS, 0, 0)); - g_plugin.setByte("speed", (BYTE)SendDlgItemMessage(hwndDlg, IDC_SPEED, TBM_GETPOS, 0, 0)); + g_plugin.setByte("speed", (uint8_t)SendDlgItemMessage(hwndDlg, IDC_SPEED, TBM_GETPOS, 0, 0)); - g_plugin.setByte("keypresses", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_KEYPRESSES) == BST_CHECKED ? 1 : 0)); + g_plugin.setByte("keypresses", (uint8_t)(IsDlgButtonChecked(hwndDlg, IDC_KEYPRESSES) == BST_CHECKED ? 1 : 0)); LoadSettings(); @@ -1242,7 +1242,7 @@ static INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wPara // Still updating here the the Flashing tab's controls SendDlgItemMessage(hwndEffect, IDC_SCUSTOM, CB_SETCURSEL, (WPARAM)wCustomTheme, 0); - g_plugin.setByte("override", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_OVERRIDE) == BST_CHECKED ? 1 : 0)); + g_plugin.setByte("override", (uint8_t)(IsDlgButtonChecked(hwndDlg, IDC_OVERRIDE) == BST_CHECKED ? 1 : 0)); return TRUE; } // switch code diff --git a/plugins/MenuItemEx/src/images.cpp b/plugins/MenuItemEx/src/images.cpp index 4d2189a8d9..aa1b7ab5bb 100644 --- a/plugins/MenuItemEx/src/images.cpp +++ b/plugins/MenuItemEx/src/images.cpp @@ -7,7 +7,7 @@ void HalfBitmap32Alpha(HBITMAP hBitmap) {
BITMAP bmp;
DWORD dwLen;
- BYTE *p;
+ uint8_t *p;
int x, y;
GetObject(hBitmap, sizeof(bmp), &bmp);
@@ -16,7 +16,7 @@ void HalfBitmap32Alpha(HBITMAP hBitmap) return;
dwLen = bmp.bmWidth * bmp.bmHeight * (bmp.bmBitsPixel / 8);
- p = (BYTE *)malloc(dwLen);
+ p = (uint8_t *)malloc(dwLen);
if (p == nullptr)
return;
memset(p, 0, dwLen);
@@ -24,7 +24,7 @@ void HalfBitmap32Alpha(HBITMAP hBitmap) GetBitmapBits(hBitmap, dwLen, p);
for (y = 0; y < bmp.bmHeight; ++y) {
- BYTE *px = p + bmp.bmWidth * 4 * y;
+ uint8_t *px = p + bmp.bmWidth * 4 * y;
for (x = 0; x < bmp.bmWidth; ++x)
{
@@ -44,7 +44,7 @@ void HalfBitmap32Alpha(HBITMAP hBitmap) //{
// BITMAP bmp;
// DWORD dwLen;
-// BYTE *p;
+// uint8_t *p;
//
// GetObject(hBitmap, sizeof(bmp), &bmp);
//
@@ -52,7 +52,7 @@ void HalfBitmap32Alpha(HBITMAP hBitmap) // return;
//
// dwLen = bmp.bmWidth * bmp.bmHeight * (bmp.bmBitsPixel / 8);
-// p = (BYTE *)malloc(dwLen);
+// p = (uint8_t *)malloc(dwLen);
// if (p == NULL)
// return;
//
@@ -68,7 +68,7 @@ void CorrectBitmap32Alpha(HBITMAP hBitmap, BOOL force) {
BITMAP bmp;
DWORD dwLen;
- BYTE *p;
+ uint8_t *p;
int x, y;
BOOL fixIt;
@@ -78,7 +78,7 @@ void CorrectBitmap32Alpha(HBITMAP hBitmap, BOOL force) return;
dwLen = bmp.bmWidth * bmp.bmHeight * (bmp.bmBitsPixel / 8);
- p = (BYTE *)malloc(dwLen);
+ p = (uint8_t *)malloc(dwLen);
if (p == nullptr)
return;
memset(p, 0, dwLen);
@@ -87,7 +87,7 @@ void CorrectBitmap32Alpha(HBITMAP hBitmap, BOOL force) fixIt = TRUE;
for (y = 0; fixIt && y < bmp.bmHeight; ++y) {
- BYTE *px = p + bmp.bmWidth * 4 * y;
+ uint8_t *px = p + bmp.bmWidth * 4 * y;
for (x = 0; fixIt && x < bmp.bmWidth; ++x)
{
@@ -114,16 +114,16 @@ void CorrectBitmap32Alpha(HBITMAP hBitmap, BOOL force) HBITMAP CopyBitmapTo32(HBITMAP hBitmap)
{
- BYTE * ptPixels;
+ uint8_t * ptPixels;
BITMAP bmp;
DWORD dwLen;
- BYTE *p;
+ uint8_t *p;
GetObject(hBitmap, sizeof(bmp), &bmp);
dwLen = bmp.bmWidth * bmp.bmHeight * 4;
- p = (BYTE *)malloc(dwLen);
+ p = (uint8_t *)malloc(dwLen);
if (p == nullptr)
return nullptr;
@@ -219,8 +219,8 @@ BOOL MakeBitmap32(HBITMAP *hBitmap) //BOOL MakeGrayscale(HBITMAP *hBitmap)
//{
-// BYTE *p = NULL;
-// BYTE *p1;
+// uint8_t *p = NULL;
+// uint8_t *p1;
// DWORD dwLen;
// int width, height, x, y;
// BITMAP bmp;
@@ -230,7 +230,7 @@ BOOL MakeBitmap32(HBITMAP *hBitmap) // height = bmp.bmHeight;
//
// dwLen = width * height * 4;
-// p = (BYTE *)malloc(dwLen);
+// p = (uint8_t *)malloc(dwLen);
// if (p == NULL)
// {
// return FALSE;
diff --git a/plugins/MenuItemEx/src/main.cpp b/plugins/MenuItemEx/src/main.cpp index 34dd3e21d9..36070f45b1 100644 --- a/plugins/MenuItemEx/src/main.cpp +++ b/plugins/MenuItemEx/src/main.cpp @@ -95,7 +95,7 @@ CMPlugin::CMPlugin() : struct ModSetLinkLinkItem
{ // code from dbe++ plugin by Bio
char *name;
- BYTE *next; //struct ModSetLinkLinkItem
+ uint8_t *next; //struct ModSetLinkLinkItem
};
struct ModuleSettingLL
@@ -122,7 +122,7 @@ static int enumModulesSettingsProc(const char *szName, void *lParam) else {
struct ModSetLinkLinkItem *item = (struct ModSetLinkLinkItem *)malloc(sizeof(struct ModSetLinkLinkItem));
if (!item) return 1;
- msll->last->next = (BYTE*)item;
+ msll->last->next = (uint8_t*)item;
msll->last = (struct ModSetLinkLinkItem *)item;
item->name = _strdup(szName);
item->next = nullptr;
diff --git a/plugins/MirFox/src/MirandaOptions.cpp b/plugins/MirFox/src/MirandaOptions.cpp index 7e709e65f7..ea3ba9e8ec 100644 --- a/plugins/MirFox/src/MirandaOptions.cpp +++ b/plugins/MirFox/src/MirandaOptions.cpp @@ -622,7 +622,7 @@ INT_PTR CALLBACK DlgProcOpts_Tab3(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM ListView_GetItem(hList, &lvItem);
char * accountId ((char *)lvItem.lParam);
- BYTE accountStateB = (BYTE)ListView_GetCheckState(hList, lvItem.iItem);
+ uint8_t accountStateB = (uint8_t)ListView_GetCheckState(hList, lvItem.iItem);
MFENUM_MIRANDAACCOUNT_STATE accountState;
if (accountStateB == 0){
diff --git a/plugins/MirLua/Modules/WinAPI/src/winapi.cpp b/plugins/MirLua/Modules/WinAPI/src/winapi.cpp index 8ef0708d7d..9078149efe 100755 --- a/plugins/MirLua/Modules/WinAPI/src/winapi.cpp +++ b/plugins/MirLua/Modules/WinAPI/src/winapi.cpp @@ -207,12 +207,12 @@ static int lua_GetRegValue(lua_State *L) DWORD type = 0;
DWORD length = 1024;
- BYTE* value = (BYTE*)mir_alloc(length);
+ uint8_t* value = (uint8_t*)mir_alloc(length);
res = ::RegQueryValueEx(hKey, valueName, nullptr, &type, (LPBYTE)value, &length);
while (res == ERROR_MORE_DATA)
{
length += length;
- value = (BYTE*)mir_realloc(value, length);
+ value = (uint8_t*)mir_realloc(value, length);
res = ::RegQueryValueEx(hKey, valueName, nullptr, &type, (LPBYTE)value, &length);
}
@@ -268,7 +268,7 @@ static int lua_SetRegValue(lua_State *L) DWORD type = 0;
DWORD length = 0;
- BYTE* value = nullptr;
+ uint8_t* value = nullptr;
switch (lua_type(L, 4))
{
case LUA_TNUMBER:
@@ -276,21 +276,21 @@ static int lua_SetRegValue(lua_State *L) {
type = REG_DWORD;
length = sizeof(DWORD);
- value = (BYTE*)lua_tointeger(L, 4);
+ value = (uint8_t*)lua_tointeger(L, 4);
}
else
{
type = REG_QWORD;
length = sizeof(DWORD) * 2;
lua_Number num = lua_tonumber(L, 4);
- value = (BYTE*)#
+ value = (uint8_t*)#
}
break;
case LUA_TSTRING:
type = REG_SZ;
length = mir_strlen(lua_tostring(L, 4)) * sizeof(wchar_t);
- value = (BYTE*)mir_utf8decodeW(lua_tostring(L, 4));
+ value = (uint8_t*)mir_utf8decodeW(lua_tostring(L, 4));
break;
default:
@@ -1216,9 +1216,9 @@ static int global_RegSetValueEx(lua_State *L) { rv = RegCreateKeyExA(hkey, subkey, 0, "", REG_OPTION_NON_VOLATILE, KEY_WRITE, nullptr, &hsk, nullptr);
if (rv == ERROR_SUCCESS) {
if (szdata == nullptr)
- rv = RegSetValueExA(hsk, valuename, 0, type, (CONST BYTE *) &dwdata, sizeof(dwdata));
+ rv = RegSetValueExA(hsk, valuename, 0, type, (CONST uint8_t *) &dwdata, sizeof(dwdata));
else
- rv = RegSetValueExA(hsk, valuename, 0, type, (CONST BYTE *) szdata, len + 1);
+ rv = RegSetValueExA(hsk, valuename, 0, type, (CONST uint8_t *) szdata, len + 1);
lua_pushboolean(L, rv == ERROR_SUCCESS);
RegCloseKey(hsk);
}
diff --git a/plugins/MirLua/src/Modules/m_database.cpp b/plugins/MirLua/src/Modules/m_database.cpp index 538f7682a3..9708a3caea 100644 --- a/plugins/MirLua/src/Modules/m_database.cpp +++ b/plugins/MirLua/src/Modules/m_database.cpp @@ -305,7 +305,7 @@ void MakeDbEvent(lua_State *L, DBEVENTINFO &dbei) switch (lua_type(L, -1)) { case LUA_TTABLE: dbei.cbBlob = (DWORD)lua_rawlen(L, 4); - dbei.pBlob = (BYTE*)mir_calloc(dbei.cbBlob); + dbei.pBlob = (uint8_t*)mir_calloc(dbei.cbBlob); for (DWORD i = 0; i < dbei.cbBlob; i++) { lua_geti(L, 4, i + 1); dbei.pBlob[i] = lua_tointeger(L, -1); @@ -316,7 +316,7 @@ void MakeDbEvent(lua_State *L, DBEVENTINFO &dbei) size_t nLen; const char *str = lua_tolstring(L, -1, &nLen); dbei.cbBlob = (DWORD)nLen; - dbei.pBlob = (BYTE*)mir_alloc(nLen); + dbei.pBlob = (uint8_t*)mir_alloc(nLen); memcpy(dbei.pBlob, str, nLen); break; } @@ -539,7 +539,7 @@ static int db_WriteSetting(lua_State *L) case DBVT_BLOB: { dbv.cpbVal = (WORD)lua_rawlen(L, 4); - dbv.pbVal = (BYTE*)mir_calloc(dbv.cpbVal); + dbv.pbVal = (uint8_t*)mir_calloc(dbv.cpbVal); for (int i = 0; i < dbv.cpbVal; i++) { lua_geti(L, 4, i + 1); dbv.pbVal[i] = lua_tointeger(L, -1); diff --git a/plugins/MirOTR/Libgcrypt/random/rndw32.c b/plugins/MirOTR/Libgcrypt/random/rndw32.c index 2ca69f16b3..d50fa22215 100644 --- a/plugins/MirOTR/Libgcrypt/random/rndw32.c +++ b/plugins/MirOTR/Libgcrypt/random/rndw32.c @@ -146,7 +146,7 @@ typedef BOOL (WINAPI *CRYPTACQUIRECONTEXT)(HCRYPTPROV *phProv, DWORD dwProvType, DWORD dwFlags); typedef BOOL (WINAPI *CRYPTGENRANDOM)(HCRYPTPROV hProv, DWORD dwLen, - BYTE *pbBuffer); + uint8_t *pbBuffer); typedef BOOL (WINAPI *CRYPTRELEASECONTEXT)(HCRYPTPROV hProv, DWORD dwFlags); /* Somewhat alternative functionality available as a direct call, for @@ -298,7 +298,7 @@ static void read_system_rng (void (*add)(const void*, size_t, enum random_origins), enum random_origins requester) { - BYTE buffer[ SYSTEMRNG_BYTES + 8 ]; + uint8_t buffer[ SYSTEMRNG_BYTES + 8 ]; int quality = 0; if (!system_rng_available) @@ -505,7 +505,7 @@ slow_gatherer ( void (*add)(const void*, size_t, enum random_origins), "SYSTEM\\CurrentControlSet\\Control\\ProductOptions", 0, KEY_READ, &hKey) == ERROR_SUCCESS) { - BYTE szValue[32 + 8]; + uint8_t szValue[32 + 8]; dwSize = 32; if ( debug_me ) diff --git a/plugins/MirOTR/src/dbfilter.cpp b/plugins/MirOTR/src/dbfilter.cpp index 29b774dff9..1ef670ca47 100644 --- a/plugins/MirOTR/src/dbfilter.cpp +++ b/plugins/MirOTR/src/dbfilter.cpp @@ -97,7 +97,7 @@ int OnDatabaseEventPreAdd(WPARAM hContact, LPARAM lParam) buf.Append(msg + msgLen + 1, datalen); } - my_dbei.pBlob = (BYTE*)buf.GetBuffer(); + my_dbei.pBlob = (uint8_t*)buf.GetBuffer(); my_dbei.cbBlob = (int)buf.GetLength(); my_dbei.flags |= DBEF_OTR_PREFIXED; db_event_add(hContact, &my_dbei); diff --git a/plugins/MirOTR/src/dialogs.cpp b/plugins/MirOTR/src/dialogs.cpp index b1c62a0c6b..552448c4d6 100644 --- a/plugins/MirOTR/src/dialogs.cpp +++ b/plugins/MirOTR/src/dialogs.cpp @@ -494,7 +494,7 @@ static INT_PTR CALLBACK DlgProcSMPInitProc(HWND hwndDlg, UINT msg, WPARAM wParam SetDlgItemText(hwndDlg, IDC_STC_SMP_INFO, buff); unsigned char hash[20]; - BYTE *ret; + uint8_t *ret; { mir_cslock lck(lib_cs); ret = otrl_privkey_fingerprint_raw(otr_user_state, hash, context->accountname, context->protocol); diff --git a/plugins/MirandaG15/src/LCDFramework/CLCDConnectionLogitech.cpp b/plugins/MirandaG15/src/LCDFramework/CLCDConnectionLogitech.cpp index 890f1b9bb0..33ed23a2e9 100644 --- a/plugins/MirandaG15/src/LCDFramework/CLCDConnectionLogitech.cpp +++ b/plugins/MirandaG15/src/LCDFramework/CLCDConnectionLogitech.cpp @@ -323,11 +323,11 @@ bool CLCDConnectionLogitech::Shutdown() //************************************************************************
// Reads data from the keyboard HID device
//************************************************************************
-bool CLCDConnectionLogitech::HIDReadData(BYTE* data)
+bool CLCDConnectionLogitech::HIDReadData(uint8_t* data)
{
static OVERLAPPED olRead;
static HANDLE hReadEvent = CreateEvent(nullptr, false, true, L"ReadEvent");
- static BYTE privateBuffer[9];
+ static uint8_t privateBuffer[9];
DWORD TransBytes;
if (!m_bConnected) {
@@ -339,7 +339,7 @@ bool CLCDConnectionLogitech::HIDReadData(BYTE* data) if (dwRes == WAIT_OBJECT_0) {
bool bRes = false;
if (GetOverlappedResult(m_hHIDDeviceHandle, &olRead, &TransBytes, false)) {
- memcpy(data, privateBuffer, 9 * sizeof(BYTE));
+ memcpy(data, privateBuffer, 9 * sizeof(uint8_t));
bRes = true;
}
@@ -427,7 +427,7 @@ bool CLCDConnectionLogitech::Update() }
}
- BYTE buffer[9];
+ uint8_t buffer[9];
if (HIDReadData(buffer)) {
int button = 0;
// mr key
@@ -892,7 +892,7 @@ SG15LightStatus CLCDConnectionLogitech::GetLightStatus() m_pConnectedDevice->GetIndex() != LGLCD_DEVICE_BW) //m_lcdDeviceDesc.deviceFamilyId != LGLCD_DEVICE_FAMILY_KEYBOARD_G15)
return status;
- BYTE *data = new BYTE[m_HIDCapabilities.FeatureReportByteLength];
+ uint8_t *data = new uint8_t[m_HIDCapabilities.FeatureReportByteLength];
data[0] = 0x02;
data[1] = 0x02;
@@ -936,7 +936,7 @@ void CLCDConnectionLogitech::SetMKeyLight(bool bM1, bool bM2, bool bM3, bool bMR m_pConnectedDevice->GetIndex() != LGLCD_DEVICE_BW) //m_lcdDeviceDesc.deviceFamilyId != LGLCD_DEVICE_FAMILY_KEYBOARD_G15)
return;
- BYTE *data = new BYTE[m_HIDCapabilities.FeatureReportByteLength];
+ uint8_t *data = new uint8_t[m_HIDCapabilities.FeatureReportByteLength];
data[0] = 0x02;
data[1] = 0x04;
data[2] = 0x00;
@@ -962,7 +962,7 @@ void CLCDConnectionLogitech::SetLCDBacklight(ELCDBrightness eBrightness) m_pConnectedDevice->GetIndex() != LGLCD_DEVICE_BW) //m_lcdDeviceDesc.deviceFamilyId != LGLCD_DEVICE_FAMILY_KEYBOARD_G15)
return;
- BYTE *data = new BYTE[m_HIDCapabilities.FeatureReportByteLength];
+ uint8_t *data = new uint8_t[m_HIDCapabilities.FeatureReportByteLength];
data[0] = 0x02;
data[1] = 0x02;
@@ -980,7 +980,7 @@ void CLCDConnectionLogitech::SetKBDBacklight(EKBDBrightness eBrightness) m_pConnectedDevice->GetIndex() != LGLCD_DEVICE_BW) //m_lcdDeviceDesc.deviceFamilyId != LGLCD_DEVICE_FAMILY_KEYBOARD_G15)
return;
- BYTE *data = new BYTE[m_HIDCapabilities.FeatureReportByteLength];
+ uint8_t *data = new uint8_t[m_HIDCapabilities.FeatureReportByteLength];
data[0] = 0x02;
data[1] = 0x01;
diff --git a/plugins/MirandaG15/src/LCDFramework/CLCDConnectionLogitech.h b/plugins/MirandaG15/src/LCDFramework/CLCDConnectionLogitech.h index c3bf9f78c5..916b0f9110 100644 --- a/plugins/MirandaG15/src/LCDFramework/CLCDConnectionLogitech.h +++ b/plugins/MirandaG15/src/LCDFramework/CLCDConnectionLogitech.h @@ -114,7 +114,7 @@ private: // HID functions
bool HIDInit();
bool HIDDeInit();
- bool HIDReadData(BYTE* data);
+ bool HIDReadData(uint8_t* data);
// Keyboard hook
HHOOK m_hKeyboardHook;
@@ -131,7 +131,7 @@ private: tstring m_strAppletName;
bool m_bConnected;
lgLcdBitmap m_lcdBitmap;
- BYTE *m_pPixels;
+ uint8_t *m_pPixels;
int m_iPixels;
int m_hDevice;
int m_hConnection;
diff --git a/plugins/MirandaG15/src/LCDFramework/CLCDGfx.cpp b/plugins/MirandaG15/src/LCDFramework/CLCDGfx.cpp index 241ddddd30..7d994666a7 100644 --- a/plugins/MirandaG15/src/LCDFramework/CLCDGfx.cpp +++ b/plugins/MirandaG15/src/LCDFramework/CLCDGfx.cpp @@ -65,7 +65,7 @@ bool CLCDGfx::Initialize(int nWidth, int nHeight, int nBPP, uint8_t *pLcdBitmapB }
int nBMISize = sizeof(BITMAPINFO) + 256 * sizeof(RGBQUAD);
- m_pBitmapInfo = (BITMAPINFO *) new BYTE[nBMISize];
+ m_pBitmapInfo = (BITMAPINFO *) new uint8_t[nBMISize];
if (nullptr == m_pBitmapInfo) {
TRACE(L"CLCDGfx::Initialize(): failed to allocate bitmap info.\n");
Shutdown();
@@ -87,9 +87,9 @@ bool CLCDGfx::Initialize(int nWidth, int nHeight, int nBPP, uint8_t *pLcdBitmapB if (m_nBPP == 1) {
for (int nColor = 0; nColor < 256; ++nColor) {
- m_pBitmapInfo->bmiColors[nColor].rgbRed = (BYTE)((nColor > 128) ? 255 : 0);
- m_pBitmapInfo->bmiColors[nColor].rgbGreen = (BYTE)((nColor > 128) ? 255 : 0);
- m_pBitmapInfo->bmiColors[nColor].rgbBlue = (BYTE)((nColor > 128) ? 255 : 0);
+ m_pBitmapInfo->bmiColors[nColor].rgbRed = (uint8_t)((nColor > 128) ? 255 : 0);
+ m_pBitmapInfo->bmiColors[nColor].rgbGreen = (uint8_t)((nColor > 128) ? 255 : 0);
+ m_pBitmapInfo->bmiColors[nColor].rgbBlue = (uint8_t)((nColor > 128) ? 255 : 0);
m_pBitmapInfo->bmiColors[nColor].rgbReserved = 0;
}
}
@@ -217,7 +217,7 @@ void CLCDGfx::SetPixel(int nX, int nY, COLORREF color) ::SetPixel(m_hDC, nX, nY, color);
}
-void CLCDGfx::SetPixel(int nX, int nY, BYTE r, BYTE g, BYTE b)
+void CLCDGfx::SetPixel(int nX, int nY, uint8_t r, uint8_t g, uint8_t b)
{
COLORREF ref;
if (m_nBPP == 1) {
@@ -721,13 +721,13 @@ void CLCDGfx::StartTransition(ETransitionType eType, LPRECT rect) if (m_bTransition) {
EndTransition();
- memcpy(m_pBitmapBits, m_pLcdBitmapBits, sizeof(BYTE)*m_nWidth*m_nHeight*m_nBPP);
+ memcpy(m_pBitmapBits, m_pLcdBitmapBits, sizeof(uint8_t)*m_nWidth*m_nHeight*m_nBPP);
}
if (m_pSavedBitmapBits == nullptr)
- m_pSavedBitmapBits = (BYTE*)malloc(sizeof(BYTE)*m_nWidth*m_nHeight*m_nBPP);
+ m_pSavedBitmapBits = (uint8_t*)malloc(sizeof(uint8_t)*m_nWidth*m_nHeight*m_nBPP);
- memcpy(m_pSavedBitmapBits, m_pBitmapBits, sizeof(BYTE)* m_nWidth * m_nHeight * m_nBPP);
+ memcpy(m_pSavedBitmapBits, m_pBitmapBits, sizeof(uint8_t)* m_nWidth * m_nHeight * m_nBPP);
m_dwTransitionStart = 0;
diff --git a/plugins/MirandaG15/src/LCDFramework/CLCDGfx.h b/plugins/MirandaG15/src/LCDFramework/CLCDGfx.h index b4e7c3c8e0..2246064e43 100644 --- a/plugins/MirandaG15/src/LCDFramework/CLCDGfx.h +++ b/plugins/MirandaG15/src/LCDFramework/CLCDGfx.h @@ -26,7 +26,7 @@ public: void ClearScreen(void);
COLORREF GetPixel(int nX, int nY);
void SetPixel(int nX, int nY, COLORREF color);
- void SetPixel(int nX, int nY, BYTE r, BYTE g, BYTE b);
+ void SetPixel(int nX, int nY, uint8_t r, uint8_t g, uint8_t b);
void DrawLine(int nX1, int nY1, int nX2, int nY2);
void DrawFilledRect(int nX, int nY, int nWidth, int nHeight);
void DrawRect(int iX, int iY, int iWidth, int iHeight);
diff --git a/plugins/MirandaG15/src/LCDFramework/CLCDInput.h b/plugins/MirandaG15/src/LCDFramework/CLCDInput.h index 9fa746ff42..d580658cfd 100644 --- a/plugins/MirandaG15/src/LCDFramework/CLCDInput.h +++ b/plugins/MirandaG15/src/LCDFramework/CLCDInput.h @@ -97,7 +97,7 @@ protected: // Input variables
static CLCDInput* m_pInput;
HHOOK m_hKBHook = nullptr;
- BYTE m_acKeyboardState[256];
+ uint8_t m_acKeyboardState[256];
// Scrollbar
CLCDBar *m_pScrollbar = nullptr;
diff --git a/plugins/Msg_Export/src/FileViewer.cpp b/plugins/Msg_Export/src/FileViewer.cpp index eeb31963ab..55e99279ff 100755 --- a/plugins/Msg_Export/src/FileViewer.cpp +++ b/plugins/Msg_Export/src/FileViewer.cpp @@ -148,7 +148,7 @@ private: // buffer size supplyed on win XP 4092 byte when streamin in
// optimal size it to fully use this buffer but we can guess
// how may bytes need converting in the file we are reading.
- BYTE abBuf[3300];
+ uint8_t abBuf[3300];
char szMyNick[100];
int nNickLen;
static int nOptimalReadLen;
@@ -763,7 +763,7 @@ static INT_PTR CALLBACK DlgProcFileViewer(HWND hwndDlg, UINT msg, WPARAM wParam, InsertMenu(hSysMenu, 0, MF_STRING | MF_BYPOSITION, ID_FV_SAVE_AS_RTF, LPGENW("Save as RTF"));
InsertMenu(hSysMenu, 0, MF_SEPARATOR | MF_BYPOSITION, 0, nullptr);
- BYTE bUseCC = (BYTE)g_plugin.getByte(szFileViewDB "UseCC", 0);
+ uint8_t bUseCC = (uint8_t)g_plugin.getByte(szFileViewDB "UseCC", 0);
InsertMenu(hSysMenu, 0, MF_STRING | MF_BYPOSITION | (bUseCC ? MF_CHECKED : 0), ID_FV_COLOR, LPGENW("Color..."));
if (bUseCC)
@@ -868,7 +868,7 @@ static INT_PTR CALLBACK DlgProcFileViewer(HWND hwndDlg, UINT msg, WPARAM wParam, }
if ((wParam & 0xFFF0) == ID_FV_COLOR) {
- BYTE bUseCC = !g_plugin.getByte(szFileViewDB "UseCC", 0);
+ uint8_t bUseCC = !g_plugin.getByte(szFileViewDB "UseCC", 0);
if (bUseCC) {
CHOOSECOLOR cc = { 0 };
cc.lStructSize = sizeof(cc);
diff --git a/plugins/Msg_Export/src/options.cpp b/plugins/Msg_Export/src/options.cpp index 33b999466c..b4707a0920 100755 --- a/plugins/Msg_Export/src/options.cpp +++ b/plugins/Msg_Export/src/options.cpp @@ -876,7 +876,7 @@ public: g_enRenameAction = eDAAutomatic;
else if (chkFcNothing.GetState() == BST_CHECKED)
g_enRenameAction = eDANothing;
- g_plugin.setByte("RenameAction", (BYTE)g_enRenameAction);
+ g_plugin.setByte("RenameAction", (uint8_t)g_enRenameAction);
if (chkFdPrompt.GetState() == BST_CHECKED)
g_enDeleteAction = eDAPromptUser;
@@ -884,7 +884,7 @@ public: g_enDeleteAction = eDAAutomatic;
else if (chkFdNothing.GetState() == BST_CHECKED)
g_enDeleteAction = eDANothing;
- g_plugin.setByte("DeleteAction", (BYTE)g_enDeleteAction);
+ g_plugin.setByte("DeleteAction", (uint8_t)g_enDeleteAction);
int nCount = listProtos.GetItemCount();
for (int nCur = 0; nCur < nCount; nCur++) {
diff --git a/plugins/Msg_Export/src/utils.cpp b/plugins/Msg_Export/src/utils.cpp index ec199a5005..479723781c 100755 --- a/plugins/Msg_Export/src/utils.cpp +++ b/plugins/Msg_Export/src/utils.cpp @@ -66,7 +66,7 @@ bool g_bUseUtf8InNewFiles; bool g_bUseJson;
const char szUtf8ByteOrderHeader[] = "\xEF\xBB\xBF";
-bool bIsUtf8Header(BYTE * pucByteOrder)
+bool bIsUtf8Header(uint8_t * pucByteOrder)
{
return memcmp(pucByteOrder, szUtf8ByteOrderHeader, 3) == 0;
}
@@ -269,7 +269,7 @@ bool bWriteNewLine(HANDLE hFile, DWORD dwIndent) bool bWriteHexToFile(HANDLE hFile, void * pData, int nSize)
{
char cBuf[10];
- BYTE *p = (BYTE*)pData;
+ uint8_t *p = (uint8_t*)pData;
for (int n = 0; n < nSize; n++) {
mir_snprintf(cBuf, "%.2X ", p[n]);
if (!bWriteToFile(hFile, cBuf, 3))
@@ -670,7 +670,7 @@ static bool ExportDBEventInfo(MCONTACT hContact, HANDLE hFile, const wstring &sF DWORD dwLowSize = GetFileSize(hFile, &dwHighSize);
if (dwLowSize == INVALID_FILE_SIZE || dwLowSize != 0 || dwHighSize != 0) {
DWORD dwDataRead = 0;
- BYTE ucByteOrder[3];
+ uint8_t ucByteOrder[3];
if (ReadFile(hFile, ucByteOrder, 3, &dwDataRead, nullptr))
bWriteUTF8Format = bIsUtf8Header(ucByteOrder);
diff --git a/plugins/Msg_Export/src/utils.h b/plugins/Msg_Export/src/utils.h index d4f9e1e93b..7db695bbd9 100755 --- a/plugins/Msg_Export/src/utils.h +++ b/plugins/Msg_Export/src/utils.h @@ -67,6 +67,6 @@ void ReplaceTimeVariables(wstring &sRet); bool bWriteIndentedToFile(HANDLE hFile, int nIndent, const wchar_t *pszSrc, bool bUtf8File);
bool bWriteNewLine(HANDLE hFile, DWORD dwIndent);
-bool bIsUtf8Header(BYTE *pucByteOrder);
+bool bIsUtf8Header(uint8_t *pucByteOrder);
#endif
diff --git a/plugins/MyDetails/src/frame.cpp b/plugins/MyDetails/src/frame.cpp index b4954723fd..779b71327a 100644 --- a/plugins/MyDetails/src/frame.cpp +++ b/plugins/MyDetails/src/frame.cpp @@ -70,7 +70,7 @@ COLORREF font_colour[NUM_FONTS]; char *font_settings[] = { "NicknameFont", "AccountFont", "StatusFont", "StatusMessageFont", "ListeningToFont" };
wchar_t *font_names[] = { LPGENW("Nickname"), LPGENW("Account"), LPGENW("Status"), LPGENW("Status message"), LPGENW("Listening to") };
char font_sizes[] = { 13, 8, 8, 8, 8 };
-BYTE font_styles[] = { DBFONTF_BOLD, 0, 0, DBFONTF_ITALIC, DBFONTF_ITALIC };
+uint8_t font_styles[] = { DBFONTF_BOLD, 0, 0, DBFONTF_ITALIC, DBFONTF_ITALIC };
COLORREF font_colors[] = { RGB(0, 0, 0), RGB(0, 0, 0), RGB(0, 0, 0), RGB(150, 150, 150), RGB(150, 150, 150) };
static ColourID bg_colour, av_colour;
diff --git a/plugins/MyDetails/src/options.cpp b/plugins/MyDetails/src/options.cpp index 31e4617665..ef10efc834 100644 --- a/plugins/MyDetails/src/options.cpp +++ b/plugins/MyDetails/src/options.cpp @@ -27,29 +27,29 @@ Options opts; // Functions //////////////////////////////////////////////////////////////////////////////////////
static OptPageControl pageControls[] = {
- { &opts.cycle_through_protocols, CONTROL_CHECKBOX, IDC_CYCLE_THROUGH_PROTOS, "CicleThroughtProtocols", (BYTE)1 },
+ { &opts.cycle_through_protocols, CONTROL_CHECKBOX, IDC_CYCLE_THROUGH_PROTOS, "CicleThroughtProtocols", (uint8_t)1 },
{ &opts.seconds_to_show_protocol, CONTROL_SPIN, IDC_CYCLE_TIME, "CicleTime", (WORD)5, IDC_CYCLE_TIME_SPIN, (WORD)1, (WORD)255 },
- { &opts.draw_show_protocol_name, CONTROL_CHECKBOX, IDC_SHOW_PROTO_NAME, "ShowProtocolName", (BYTE)1 },
- { &opts.show_protocol_cycle_button, CONTROL_CHECKBOX, IDC_SHOW_CYCLE_PROTO_BUTTON, "ShowProtocolCycleButton", (BYTE)0 },
- { &opts.draw_text_rtl, CONTROL_CHECKBOX, IDC_TEXT_RTL, "TextRTL", (BYTE)0 },
- { &opts.draw_text_align_right, CONTROL_CHECKBOX, IDC_TEXT_ALIGN_RIGHT, "TextAlignRight", (BYTE)0 },
- { &opts.replace_smileys, CONTROL_CHECKBOX, IDC_REPLACE_SMILEYS, "ReplaceSmileys", (BYTE)1 },
- { &opts.resize_smileys, CONTROL_CHECKBOX, IDC_RESIZE_SMILEYS, "ResizeSmileys", (BYTE)0 },
- { &opts.use_contact_list_smileys, CONTROL_CHECKBOX, IDC_USE_CONTACT_LIST_SMILEYS, "UseContactListSmileys", (BYTE)0 },
- { &opts.global_on_avatar, CONTROL_CHECKBOX, IDC_GLOBAL_ON_AVATAR, "GlobalOnAvatar", (BYTE)0 },
- { &opts.global_on_nickname, CONTROL_CHECKBOX, IDC_GLOBAL_ON_NICKNAME, "GlobalOnNickname", (BYTE)0 },
- { &opts.global_on_status, CONTROL_CHECKBOX, IDC_GLOBAL_ON_STATUS, "GlobalOnStatus", (BYTE)0 },
- { &opts.global_on_status_message, CONTROL_CHECKBOX, IDC_GLOBAL_ON_STATUS_MESSAGE, "GlobalOnStatusMessage", (BYTE)0 },
- { &opts.draw_avatar_allow_to_grow, CONTROL_CHECKBOX, IDC_AVATAR_ALLOW_TO_GROW, "AvatarAllowToGrow", (BYTE)0 },
- { &opts.draw_avatar_custom_size, CONTROL_CHECKBOX, IDC_AVATAR_CUSTOM_SIZE_CHK, "AvatarCustomSize", (BYTE)0 },
+ { &opts.draw_show_protocol_name, CONTROL_CHECKBOX, IDC_SHOW_PROTO_NAME, "ShowProtocolName", (uint8_t)1 },
+ { &opts.show_protocol_cycle_button, CONTROL_CHECKBOX, IDC_SHOW_CYCLE_PROTO_BUTTON, "ShowProtocolCycleButton", (uint8_t)0 },
+ { &opts.draw_text_rtl, CONTROL_CHECKBOX, IDC_TEXT_RTL, "TextRTL", (uint8_t)0 },
+ { &opts.draw_text_align_right, CONTROL_CHECKBOX, IDC_TEXT_ALIGN_RIGHT, "TextAlignRight", (uint8_t)0 },
+ { &opts.replace_smileys, CONTROL_CHECKBOX, IDC_REPLACE_SMILEYS, "ReplaceSmileys", (uint8_t)1 },
+ { &opts.resize_smileys, CONTROL_CHECKBOX, IDC_RESIZE_SMILEYS, "ResizeSmileys", (uint8_t)0 },
+ { &opts.use_contact_list_smileys, CONTROL_CHECKBOX, IDC_USE_CONTACT_LIST_SMILEYS, "UseContactListSmileys", (uint8_t)0 },
+ { &opts.global_on_avatar, CONTROL_CHECKBOX, IDC_GLOBAL_ON_AVATAR, "GlobalOnAvatar", (uint8_t)0 },
+ { &opts.global_on_nickname, CONTROL_CHECKBOX, IDC_GLOBAL_ON_NICKNAME, "GlobalOnNickname", (uint8_t)0 },
+ { &opts.global_on_status, CONTROL_CHECKBOX, IDC_GLOBAL_ON_STATUS, "GlobalOnStatus", (uint8_t)0 },
+ { &opts.global_on_status_message, CONTROL_CHECKBOX, IDC_GLOBAL_ON_STATUS_MESSAGE, "GlobalOnStatusMessage", (uint8_t)0 },
+ { &opts.draw_avatar_allow_to_grow, CONTROL_CHECKBOX, IDC_AVATAR_ALLOW_TO_GROW, "AvatarAllowToGrow", (uint8_t)0 },
+ { &opts.draw_avatar_custom_size, CONTROL_CHECKBOX, IDC_AVATAR_CUSTOM_SIZE_CHK, "AvatarCustomSize", (uint8_t)0 },
{ &opts.draw_avatar_custom_size_pixels, CONTROL_SPIN, IDC_AVATAR_CUSTOM_SIZE, "AvatarCustomSizePixels", (WORD)30, IDC_AVATAR_CUSTOM_SIZE_SPIN, (WORD)1, (WORD)255 },
- { &opts.draw_avatar_border, CONTROL_CHECKBOX, IDC_AVATAR_DRAW_BORDER, "AvatarDrawBorders", (BYTE)0 },
- { &opts.draw_avatar_round_corner, CONTROL_CHECKBOX, IDC_AVATAR_ROUND_CORNERS, "AvatarRoundCorners", (BYTE)1 },
- { &opts.draw_avatar_use_custom_corner_size, CONTROL_CHECKBOX, IDC_AVATAR_CUSTOM_CORNER_SIZE_CHECK, "AvatarUseCustomCornerSize", (BYTE)0 },
+ { &opts.draw_avatar_border, CONTROL_CHECKBOX, IDC_AVATAR_DRAW_BORDER, "AvatarDrawBorders", (uint8_t)0 },
+ { &opts.draw_avatar_round_corner, CONTROL_CHECKBOX, IDC_AVATAR_ROUND_CORNERS, "AvatarRoundCorners", (uint8_t)1 },
+ { &opts.draw_avatar_use_custom_corner_size, CONTROL_CHECKBOX, IDC_AVATAR_CUSTOM_CORNER_SIZE_CHECK, "AvatarUseCustomCornerSize", (uint8_t)0 },
{ &opts.draw_avatar_custom_corner_size, CONTROL_SPIN, IDC_AVATAR_CUSTOM_CORNER_SIZE, "AvatarCustomCornerSize", (WORD)4, IDC_AVATAR_CUSTOM_CORNER_SIZE_SPIN, (WORD)1, (WORD)255 },
- { &opts.use_avatar_space_to_draw_text, CONTROL_CHECKBOX, IDC_AVATAR_USE_FREE_SPACE, "AvatarUseFreeSpaceToDrawText", (BYTE)1 },
- { &opts.resize_frame, CONTROL_CHECKBOX, IDC_RESIZE_FRAME, "ResizeFrame", (BYTE)0 },
- { &opts.use_skinning, CONTROL_CHECKBOX, IDC_USE_SKINNING, "UseSkinning", (BYTE)0 },
+ { &opts.use_avatar_space_to_draw_text, CONTROL_CHECKBOX, IDC_AVATAR_USE_FREE_SPACE, "AvatarUseFreeSpaceToDrawText", (uint8_t)1 },
+ { &opts.resize_frame, CONTROL_CHECKBOX, IDC_RESIZE_FRAME, "ResizeFrame", (uint8_t)0 },
+ { &opts.use_skinning, CONTROL_CHECKBOX, IDC_USE_SKINNING, "UseSkinning", (uint8_t)0 },
{ &opts.borders[RIGHT], CONTROL_SPIN, IDC_BORDER_RIGHT, "BorderRight", (WORD)8, IDC_BORDER_RIGHT_SPIN, (WORD)0, (WORD)255 },
{ &opts.borders[LEFT], CONTROL_SPIN, IDC_BORDER_LEFT, "BorderLeft", (WORD)8, IDC_BORDER_LEFT_SPIN, (WORD)0, (WORD)255 },
{ &opts.borders[TOP], CONTROL_SPIN, IDC_BORDER_TOP, "BorderTop", (WORD)8, IDC_BORDER_TOP_SPIN, (WORD)0, (WORD)255 },
diff --git a/plugins/MyDetails/src/services.cpp b/plugins/MyDetails/src/services.cpp index e6cd8d5dfa..5493a99508 100644 --- a/plugins/MyDetails/src/services.cpp +++ b/plugins/MyDetails/src/services.cpp @@ -408,7 +408,7 @@ INT_PTR PluginCommand_SetMyStatusMessageUI(WPARAM wParam, LPARAM lParam) INT_PTR PluginCommand_CycleThroughtProtocols(WPARAM wParam, LPARAM)
{
- db_set_b(0, "MyDetails", "CicleThroughtProtocols", (BYTE)wParam);
+ db_set_b(0, "MyDetails", "CicleThroughtProtocols", (uint8_t)wParam);
LoadOptions();
diff --git a/plugins/NewAwaySysMod/src/ContactList.cpp b/plugins/NewAwaySysMod/src/ContactList.cpp index 921aec7986..e10229465e 100644 --- a/plugins/NewAwaySysMod/src/ContactList.cpp +++ b/plugins/NewAwaySysMod/src/ContactList.cpp @@ -133,7 +133,7 @@ LRESULT CALLBACK CCList::ParentSubclassProc(HWND hWnd, UINT Msg, WPARAM wParam, RECT rc;
if (TreeView_GetItemRect(dat->hTreeView, (HTREEITEM)lpNMCD->nmcd.dwItemSpec, &rc, false)) {
for (int i = 0; i < MAXEXTRAICONS; i++) {
- BYTE nIndex = dat->Items[lpNMCD->nmcd.lItemlParam].ExtraIcons[i];
+ uint8_t nIndex = dat->Items[lpNMCD->nmcd.lItemlParam].ExtraIcons[i];
if (nIndex != CLC_EXTRAICON_EMPTY) {
ImageList_DrawEx(dat->ExtraImageList, nIndex, lpNMCD->nmcd.hdc, rc.right - EXTRAICON_XSTEP * (i + 1), rc.top, 0, 0, /*GetSysColor(COLOR_WINDOW)*/CLR_NONE, CLR_NONE, ILD_NORMAL);
}
diff --git a/plugins/NewAwaySysMod/src/ContactList.h b/plugins/NewAwaySysMod/src/ContactList.h index eb43e1c112..df629133ee 100644 --- a/plugins/NewAwaySysMod/src/ContactList.h +++ b/plugins/NewAwaySysMod/src/ContactList.h @@ -35,7 +35,7 @@ class CCLItemData // internal CCList's class public:
CCLItemData(MCONTACT hContact = INVALID_CONTACT_ID): hContact(hContact) {memset(ExtraIcons, CLC_EXTRAICON_EMPTY, sizeof(ExtraIcons));};
- BYTE ExtraIcons[MAXEXTRAICONS];
+ uint8_t ExtraIcons[MAXEXTRAICONS];
MCONTACT hContact;
LPARAM lParam;
};
diff --git a/plugins/NewAwaySysMod/src/stdafx.h b/plugins/NewAwaySysMod/src/stdafx.h index cf904867bb..949de5f317 100644 --- a/plugins/NewAwaySysMod/src/stdafx.h +++ b/plugins/NewAwaySysMod/src/stdafx.h @@ -243,7 +243,7 @@ struct DYNAMIC_NOTIFY_DATA struct PLUGIN_DATA
{
- BYTE PopupLClickAction, PopupRClickAction;
+ uint8_t PopupLClickAction, PopupRClickAction;
MCONTACT hContact;
HICON hStatusIcon; // needed here to destroy its handle on UM_FREEPLUGINDATA
};
diff --git a/plugins/NewEventNotify/src/options.cpp b/plugins/NewEventNotify/src/options.cpp index 9847c32859..a434392cfe 100644 --- a/plugins/NewEventNotify/src/options.cpp +++ b/plugins/NewEventNotify/src/options.cpp @@ -75,10 +75,10 @@ void CMPlugin::OptionsWrite(void) setDword(OPT_COLTEXT_FILE, colTextFile);
setDword(OPT_COLBACK_OTHERS, colBackOthers);
setDword(OPT_COLTEXT_OTHERS, colTextOthers);
- setByte(OPT_MASKNOTIFY, (BYTE)maskNotify);
- setByte(OPT_MASKACTL, (BYTE)maskActL);
- setByte(OPT_MASKACTR, (BYTE)maskActR);
- setByte(OPT_MASKACTTE, (BYTE)maskActTE);
+ setByte(OPT_MASKNOTIFY, (uint8_t)maskNotify);
+ setByte(OPT_MASKACTL, (uint8_t)maskActL);
+ setByte(OPT_MASKACTR, (uint8_t)maskActR);
+ setByte(OPT_MASKACTTE, (uint8_t)maskActTE);
setByte(OPT_MSGWINDOWCHECK, bMsgWindowCheck);
setByte(OPT_MSGREPLYWINDOW, bMsgReplyWindow);
setByte(OPT_MERGEPOPUP, bMergePopup);
@@ -88,7 +88,7 @@ void CMPlugin::OptionsWrite(void) setByte(OPT_SHOW_DATE, bShowDate);
setByte(OPT_SHOW_TIME, bShowTime);
setByte(OPT_SHOW_HEADERS, bShowHeaders);
- setByte(OPT_NUMBER_MSG, (BYTE)iNumberMsg);
+ setByte(OPT_NUMBER_MSG, (uint8_t)iNumberMsg);
setByte(OPT_SHOW_ON, bShowON);
setByte(OPT_HIDESEND, bHideSend);
setByte(OPT_NORSS, bNoRSS);
diff --git a/plugins/NewEventNotify/src/stdafx.h b/plugins/NewEventNotify/src/stdafx.h index f99ad18aa8..1938092f4c 100644 --- a/plugins/NewEventNotify/src/stdafx.h +++ b/plugins/NewEventNotify/src/stdafx.h @@ -173,7 +173,7 @@ struct CMPlugin : public PLUGIN<CMPlugin> BOOL bHideSend;
BOOL bNoRSS;
BOOL bReadCheck;
- BYTE iNumberMsg;
+ uint8_t iNumberMsg;
};
struct EVENT_DATA_EX
diff --git a/plugins/NewStory/src/history_array.cpp b/plugins/NewStory/src/history_array.cpp index dfa1da0064..3b289dc110 100644 --- a/plugins/NewStory/src/history_array.cpp +++ b/plugins/NewStory/src/history_array.cpp @@ -76,7 +76,7 @@ void ItemData::load(bool bFullLoad) return; dbe.cbBlob = db_event_getBlobSize(hEvent); - mir_ptr<BYTE> pData((BYTE *)mir_calloc(dbe.cbBlob + 1)); + mir_ptr<uint8_t> pData((uint8_t *)mir_calloc(dbe.cbBlob + 1)); dbe.pBlob = pData; if (!db_event_get(hEvent, &dbe)) { bLoaded = true; diff --git a/plugins/NewStory/src/history_control.cpp b/plugins/NewStory/src/history_control.cpp index 8f6cf3380f..9417843ffc 100644 --- a/plugins/NewStory/src/history_control.cpp +++ b/plugins/NewStory/src/history_control.cpp @@ -178,7 +178,7 @@ struct NewstoryListData : public MZeroedObject if (pItem->hContact && pItem->hEvent) { ptrA szUtf(mir_utf8encodeW(pItem->wtext)); pItem->dbe.cbBlob = (int)mir_strlen(szUtf) + 1; - pItem->dbe.pBlob = (BYTE *)szUtf.get(); + pItem->dbe.pBlob = (uint8_t *)szUtf.get(); db_event_edit(pItem->hContact, pItem->hEvent, &pItem->dbe); if (auto *ppro = Proto_GetInstance(pItem->hContact)) diff --git a/plugins/NewStory/src/options.cpp b/plugins/NewStory/src/options.cpp index e63d4ac88f..1daf9e065e 100644 --- a/plugins/NewStory/src/options.cpp +++ b/plugins/NewStory/src/options.cpp @@ -89,7 +89,7 @@ public: db_set_ws(m_hContact, META_PROTO, "Nick", TranslateT("Test contact")); DBEVENTINFO dbei = {}; - dbei.pBlob = (BYTE *)"The quick brown fox jumps over the lazy dog"; + dbei.pBlob = (uint8_t *)"The quick brown fox jumps over the lazy dog"; dbei.cbBlob = (DWORD)strlen((char *)dbei.pBlob); dbei.flags = DBEF_TEMPORARY; dbei.eventType = EVENTTYPE_MESSAGE; diff --git a/plugins/NewXstatusNotify/src/indsnd.cpp b/plugins/NewXstatusNotify/src/indsnd.cpp index 3c196a4d4e..8b5fe47e8f 100644 --- a/plugins/NewXstatusNotify/src/indsnd.cpp +++ b/plugins/NewXstatusNotify/src/indsnd.cpp @@ -299,7 +299,7 @@ __inline void SetExtraImage(HWND hwndList, HANDLE hItem, int column, int imageID void SetAllContactsIcons(HWND hwndList)
{
- BYTE EnableSounds, EnablePopups, EnableXStatus, EnableXLogging, EnableStatusMsg, EnableSMsgLogging;
+ uint8_t EnableSounds, EnablePopups, EnableXStatus, EnableXLogging, EnableStatusMsg, EnableSMsgLogging;
for (auto &hContact : Contacts()) {
HANDLE hItem = (HANDLE)SendMessage(hwndList, CLM_FINDCONTACT, hContact, 0);
diff --git a/plugins/NewXstatusNotify/src/main.cpp b/plugins/NewXstatusNotify/src/main.cpp index 8e6c22d078..461d1477ca 100644 --- a/plugins/NewXstatusNotify/src/main.cpp +++ b/plugins/NewXstatusNotify/src/main.cpp @@ -77,7 +77,7 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_USERON /////////////////////////////////////////////////////////////////////////////////////////
-BYTE GetGender(MCONTACT hContact)
+uint8_t GetGender(MCONTACT hContact)
{
char *szProto = Proto_GetBaseAccountName(hContact);
if (szProto) {
@@ -803,7 +803,7 @@ int StatusModeChanged(WPARAM wParam, LPARAM lParam) if (opt.DisablePopupGlobally) {
char szSetting[12];
mir_snprintf(szSetting, "p%d", wParam);
- BYTE hlpDisablePopup = g_plugin.getByte(szSetting, 0);
+ uint8_t hlpDisablePopup = g_plugin.getByte(szSetting, 0);
if (hlpDisablePopup != opt.PopupAutoDisabled) {
bool hlpPopupStatus = Popup_Enabled();
@@ -821,10 +821,10 @@ int StatusModeChanged(WPARAM wParam, LPARAM lParam) if (opt.DisableSoundGlobally) {
char szSetting[12];
mir_snprintf(szSetting, "s%d", wParam);
- BYTE hlpDisableSound = g_plugin.getByte(szSetting, 0);
+ uint8_t hlpDisableSound = g_plugin.getByte(szSetting, 0);
if (hlpDisableSound != opt.SoundAutoDisabled) {
- BYTE hlpUseSound = db_get_b(0, "Skin", "UseSound", 1);
+ uint8_t hlpUseSound = db_get_b(0, "Skin", "UseSound", 1);
opt.SoundAutoDisabled = hlpDisableSound;
if (hlpDisableSound) {
diff --git a/plugins/NewXstatusNotify/src/options.cpp b/plugins/NewXstatusNotify/src/options.cpp index ea88177e06..c3339b35f9 100644 --- a/plugins/NewXstatusNotify/src/options.cpp +++ b/plugins/NewXstatusNotify/src/options.cpp @@ -285,7 +285,7 @@ INT_PTR CALLBACK DlgProcGeneralOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA for (int i = ID_STATUS_MIN; i <= ID_STATUS_MAX2; i++) {
char status[8];
mir_snprintf(status, "%d", i);
- g_plugin.setByte(status, (BYTE)IsDlgButtonChecked(hwndDlg, i));
+ g_plugin.setByte(status, (uint8_t)IsDlgButtonChecked(hwndDlg, i));
}
opt.FromOffline = IsDlgButtonChecked(hwndDlg, IDC_CHK_FROMOFFLINE);
@@ -439,8 +439,8 @@ INT_PTR CALLBACK DlgProcPopupOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM opt.ShowGroup = IsDlgButtonChecked(hwndDlg, IDC_SHOWGROUP);
opt.PopupTimeout = GetDlgItemInt(hwndDlg, IDC_TIMEOUT_VALUE, nullptr, TRUE);
opt.PopupConnectionTimeout = GetDlgItemInt(hwndDlg, IDC_CONNECTIONTIMEOUT_VALUE, nullptr, TRUE);
- opt.LeftClickAction = (BYTE)SendDlgItemMessage(hwndDlg, IDC_STATUS_LC, CB_GETCURSEL, 0, 0);
- opt.RightClickAction = (BYTE)SendDlgItemMessage(hwndDlg, IDC_STATUS_RC, CB_GETCURSEL, 0, 0);
+ opt.LeftClickAction = (uint8_t)SendDlgItemMessage(hwndDlg, IDC_STATUS_LC, CB_GETCURSEL, 0, 0);
+ opt.RightClickAction = (uint8_t)SendDlgItemMessage(hwndDlg, IDC_STATUS_RC, CB_GETCURSEL, 0, 0);
SaveOptions();
return TRUE;
@@ -830,7 +830,7 @@ INT_PTR CALLBACK DlgProcSMPopupOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA char dbSetting[128];
mir_snprintf(dbSetting, "%s_enabled", (char *)lvItem.lParam);
- g_plugin.setByte(dbSetting, (BYTE)ListView_GetCheckState(hList, lvItem.iItem));
+ g_plugin.setByte(dbSetting, (uint8_t)ListView_GetCheckState(hList, lvItem.iItem));
}
}
diff --git a/plugins/NewXstatusNotify/src/options.h b/plugins/NewXstatusNotify/src/options.h index adf561dd00..41c8c2db78 100644 --- a/plugins/NewXstatusNotify/src/options.h +++ b/plugins/NewXstatusNotify/src/options.h @@ -26,66 +26,66 @@ typedef struct tagOPTIONS {
// IDD_OPT_POPUP
- BYTE Colors;
- BYTE ShowGroup;
- BYTE ShowStatus;
- BYTE UseAlternativeText;
- BYTE ShowPreviousStatus;
- BYTE ReadAwayMsg;
+ uint8_t Colors;
+ uint8_t ShowGroup;
+ uint8_t ShowStatus;
+ uint8_t UseAlternativeText;
+ uint8_t ShowPreviousStatus;
+ uint8_t ReadAwayMsg;
int PopupTimeout;
UINT PopupConnectionTimeout;
- BYTE LeftClickAction;
- BYTE RightClickAction;
+ uint8_t LeftClickAction;
+ uint8_t RightClickAction;
// IDD_OPT_XPOPUP
- BYTE PXOnConnect;
- BYTE PXDisableForMusic;
- BYTE PXMsgTruncate;
+ uint8_t PXOnConnect;
+ uint8_t PXDisableForMusic;
+ uint8_t PXMsgTruncate;
DWORD PXMsgLen;
// IDD_OPT_GENERAL
- BYTE FromOffline;
- BYTE AutoDisable;
- BYTE HiddenContactsToo;
- BYTE UseIndSnd;
- BYTE BlinkIcon;
- BYTE BlinkIcon_Status;
- BYTE BlinkIcon_ForMsgs;
+ uint8_t FromOffline;
+ uint8_t AutoDisable;
+ uint8_t HiddenContactsToo;
+ uint8_t UseIndSnd;
+ uint8_t BlinkIcon;
+ uint8_t BlinkIcon_Status;
+ uint8_t BlinkIcon_ForMsgs;
wchar_t LogFilePath[MAX_PATH];
// IDD_AUTODISABLE
- BYTE OnlyGlobalChanges;
- BYTE DisableSoundGlobally;
- BYTE DisablePopupGlobally;
+ uint8_t OnlyGlobalChanges;
+ uint8_t DisableSoundGlobally;
+ uint8_t DisablePopupGlobally;
// IDD_OPT_LOG
- BYTE LogToFile;
- BYTE LogToDB;
- BYTE LogToDB_WinOpen;
- BYTE LogToDB_Remove;
- BYTE LogPrevious;
- BYTE SMsgLogToFile;
- BYTE SMsgLogToDB;
- BYTE SMsgLogToDB_WinOpen;
- BYTE SMsgLogToDB_Remove;
+ uint8_t LogToFile;
+ uint8_t LogToDB;
+ uint8_t LogToDB_WinOpen;
+ uint8_t LogToDB_Remove;
+ uint8_t LogPrevious;
+ uint8_t SMsgLogToFile;
+ uint8_t SMsgLogToDB;
+ uint8_t SMsgLogToDB_WinOpen;
+ uint8_t SMsgLogToDB_Remove;
// IDD_OPT_XLOG
- BYTE XLogToFile;
- BYTE XLogToDB;
- BYTE XLogToDB_WinOpen;
- BYTE XLogToDB_Remove;
- BYTE XLogDisableForMusic;
+ uint8_t XLogToFile;
+ uint8_t XLogToDB;
+ uint8_t XLogToDB_WinOpen;
+ uint8_t XLogToDB_Remove;
+ uint8_t XLogDisableForMusic;
// IDD_OPT_SMPOPUP
- BYTE PSMsgOnConnect;
- BYTE PSMsgTruncate;
+ uint8_t PSMsgOnConnect;
+ uint8_t PSMsgTruncate;
DWORD PSMsgLen;
// OTHER
- BYTE TempDisabled;
- BYTE PopupAutoDisabled;
- BYTE SoundAutoDisabled;
- BYTE EnableLastSeen;
+ uint8_t TempDisabled;
+ uint8_t PopupAutoDisabled;
+ uint8_t SoundAutoDisabled;
+ uint8_t EnableLastSeen;
} OPTIONS;
typedef struct tagTEMPLATES {
- BYTE PopupXFlags;
- BYTE PopupSMsgFlags;
- BYTE LogXFlags;
- BYTE LogSMsgFlags;
+ uint8_t PopupXFlags;
+ uint8_t PopupSMsgFlags;
+ uint8_t LogXFlags;
+ uint8_t LogSMsgFlags;
wchar_t PopupXstatusChanged[256];
wchar_t PopupXstatusRemoved[256];
wchar_t PopupXMsgChanged[256];
diff --git a/plugins/NewXstatusNotify/src/popup.cpp b/plugins/NewXstatusNotify/src/popup.cpp index 08cb6dfd39..d9f651bc13 100644 --- a/plugins/NewXstatusNotify/src/popup.cpp +++ b/plugins/NewXstatusNotify/src/popup.cpp @@ -110,7 +110,7 @@ void QueryAwayMessage(HWND hWnd, PLUGINDATA *pdp) }
}
-void PopupAction(HWND hWnd, BYTE action)
+void PopupAction(HWND hWnd, uint8_t action)
{
MCONTACT hContact = PUGetContact(hWnd);
if (hContact && hContact != INVALID_CONTACT_ID) {
diff --git a/plugins/New_GPG/src/utilities.cpp b/plugins/New_GPG/src/utilities.cpp index 4b39a37edd..e8f3ad030e 100755 --- a/plugins/New_GPG/src/utilities.cpp +++ b/plugins/New_GPG/src/utilities.cpp @@ -118,7 +118,7 @@ INT_PTR SendKey(WPARAM w, LPARAM) szMessage = g_plugin.getMStringA("GPGPubKey"); //try to get default key as fallback in any way if (!szMessage.IsEmpty()) { - BYTE enc = g_plugin.getByte(hContact, "GPGEncryption", 0); + uint8_t enc = g_plugin.getByte(hContact, "GPGEncryption", 0); g_plugin.setByte(hContact, "GPGEncryption", 0); ProtoChainSend(hContact, PSS_MESSAGE, 0, (LPARAM)szMessage.c_str()); std::string msg = "Public key "; @@ -138,7 +138,7 @@ INT_PTR SendKey(WPARAM w, LPARAM) INT_PTR ToggleEncryption(WPARAM w, LPARAM) { MCONTACT hContact = (MCONTACT)w; - BYTE enc; + uint8_t enc; if (db_mc_isMeta(hContact)) { enc = g_plugin.getByte(metaGetMostOnline(hContact), "GPGEncryption"); if (MessageBox(nullptr, TranslateT("Do you want to toggle encryption for all subcontacts?"), TranslateT("Metacontact detected"), MB_YESNO) == IDYES) { @@ -784,7 +784,7 @@ void RemoveHandlers() bool isContactSecured(MCONTACT hContact) { - BYTE gpg_enc = g_plugin.getByte(hContact, "GPGEncryption", 0); + uint8_t gpg_enc = g_plugin.getByte(hContact, "GPGEncryption", 0); if (!gpg_enc) { if (globals.debuglog) globals.debuglog << "encryption is turned off for " + toUTF8(Clist_GetContactDisplayName(hContact)); @@ -1210,7 +1210,7 @@ void SendErrorMessage(MCONTACT hContact) if (!g_plugin.bSendErrorMessages) return; - BYTE enc = g_plugin.getByte(hContact, "GPGEncryption", 0); + uint8_t enc = g_plugin.getByte(hContact, "GPGEncryption", 0); g_plugin.setByte(hContact, "GPGEncryption", 0); ProtoChainSend(hContact, PSS_MESSAGE, 0, (LPARAM)"Unable to decrypt PGP encrypted message"); HistoryLog(hContact, "Error message sent", DBEF_SENT); diff --git a/plugins/NotesAndReminders/src/notes.cpp b/plugins/NotesAndReminders/src/notes.cpp index c547994008..c267e4c3f7 100644 --- a/plugins/NotesAndReminders/src/notes.cpp +++ b/plugins/NotesAndReminders/src/notes.cpp @@ -63,8 +63,8 @@ struct STICKYNOTEFONT : public MZeroedObject { HFONT hFont; char size; - BYTE style; // see the DBFONTF_* flags - BYTE charset; + uint8_t style; // see the DBFONTF_* flags + uint8_t charset; wchar_t szFace[LF_FACESIZE]; }; @@ -1128,7 +1128,7 @@ static STICKYNOTE* NewNoteEx(int Ax, int Ay, int Aw, int Ah, const wchar_t *pwsz TSN->SNHwnd = CreateWindowEx(L1, NOTE_WND_CLASS, L"StickyNote", L2, Ax, Ay, Aw, Ah, nullptr, nullptr, hmiranda, TSN); if (g_Transparency < 255) - SetLayeredWindowAttributes(TSN->SNHwnd, 0, (BYTE)g_Transparency, LWA_ALPHA); + SetLayeredWindowAttributes(TSN->SNHwnd, 0, (uint8_t)g_Transparency, LWA_ALPHA); // ensure that window is not placed off-screen (if previous session had different monitor count or resolution) // NOTE: SetWindowPlacement should do this, but it's extremly flakey @@ -1290,8 +1290,8 @@ static void LoadNote(char *Value, bool bIsStartup) pCustomFont = (STICKYNOTEFONT*)malloc(sizeof(STICKYNOTEFONT)); pCustomFont->size = (char)fsize; - pCustomFont->style = (BYTE)fstyle; - pCustomFont->charset = (BYTE)fcharset; + pCustomFont->style = (uint8_t)fstyle; + pCustomFont->charset = (uint8_t)fcharset; wcsncpy_s(pCustomFont->szFace, _A2T(TVal2), _TRUNCATE); pCustomFont->hFont = nullptr; diff --git a/plugins/NotesAndReminders/src/options.cpp b/plugins/NotesAndReminders/src/options.cpp index dd198455e2..3142a15eb9 100644 --- a/plugins/NotesAndReminders/src/options.cpp +++ b/plugins/NotesAndReminders/src/options.cpp @@ -62,7 +62,7 @@ struct FontOptionsList wchar_t *szDescr;
COLORREF defColour;
wchar_t *szDefFace;
- BYTE defStyle;
+ uint8_t defStyle;
int defSize;
wchar_t *szBkgName;
}
diff --git a/plugins/NotesAndReminders/src/stdafx.h b/plugins/NotesAndReminders/src/stdafx.h index f0a8a2bf7f..7c0dde05f2 100644 --- a/plugins/NotesAndReminders/src/stdafx.h +++ b/plugins/NotesAndReminders/src/stdafx.h @@ -39,8 +39,8 @@ struct CMPlugin : public PLUGIN<CMPlugin> { CMPlugin(); - CMOption<BYTE> bShowNotesAtStart, bShowScrollbar, bShowNoteButtons; - CMOption<BYTE> bCloseAfterAddReminder, bUseMSI; + CMOption<uint8_t> bShowNotesAtStart, bShowScrollbar, bShowNoteButtons; + CMOption<uint8_t> bCloseAfterAddReminder, bUseMSI; int Load() override; int Unload() override; diff --git a/plugins/PackUpdater/Src/Notifications.cpp b/plugins/PackUpdater/Src/Notifications.cpp index 9d2a55284f..c5391c329a 100644 --- a/plugins/PackUpdater/Src/Notifications.cpp +++ b/plugins/PackUpdater/Src/Notifications.cpp @@ -22,7 +22,7 @@ Boston, MA 02111-1307, USA. HWND hDlgDld = nullptr;
INT UpdatesCount = 0;
-void PopupAction(HWND hWnd, BYTE action)
+void PopupAction(HWND hWnd, uint8_t action)
{
switch (action) {
case PCA_CLOSEPOPUP:
diff --git a/plugins/PackUpdater/Src/Notifications.h b/plugins/PackUpdater/Src/Notifications.h index f04a10f937..a204abc6da 100644 --- a/plugins/PackUpdater/Src/Notifications.h +++ b/plugins/PackUpdater/Src/Notifications.h @@ -59,9 +59,9 @@ MSGPOPUPDATA, *LPMSGPOPUPDATA; //===== Options flags
typedef struct tagMYOPTIONS {
- BYTE DefColors;
- BYTE LeftClickAction;
- BYTE RightClickAction;
+ uint8_t DefColors;
+ uint8_t LeftClickAction;
+ uint8_t RightClickAction;
int Timeout;
} MYOPTIONS;
diff --git a/plugins/PackUpdater/Src/Options.cpp b/plugins/PackUpdater/Src/Options.cpp index 8f8698e023..64635b6008 100644 --- a/plugins/PackUpdater/Src/Options.cpp +++ b/plugins/PackUpdater/Src/Options.cpp @@ -223,9 +223,9 @@ INT_PTR CALLBACK DlgPopupOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam) }
if (HIWORD(wParam) == CBN_SELCHANGE) {
if (idCtrl == IDC_LC)
- MyOptions.LeftClickAction = (BYTE)SendDlgItemMessage(hdlg, IDC_LC, CB_GETCURSEL, 0, 0);
+ MyOptions.LeftClickAction = (uint8_t)SendDlgItemMessage(hdlg, IDC_LC, CB_GETCURSEL, 0, 0);
else if (idCtrl == IDC_RC)
- MyOptions.RightClickAction = (BYTE)SendDlgItemMessage(hdlg, IDC_RC, CB_GETCURSEL, 0, 0);
+ MyOptions.RightClickAction = (uint8_t)SendDlgItemMessage(hdlg, IDC_RC, CB_GETCURSEL, 0, 0);
SendMessage(GetParent(hdlg), PSM_CHANGED, 0, 0);
return TRUE;
@@ -352,9 +352,9 @@ INT_PTR CALLBACK DlgPopupOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam) //Notified popups
for (i = 0; i < POPUPS; i++) {
mir_snprintf(str, "Popups%d", i);
- g_plugin.setByte(str, (BYTE)(IsDlgButtonChecked(hdlg, (i + 40071))));
+ g_plugin.setByte(str, (uint8_t)(IsDlgButtonChecked(hdlg, (i + 40071))));
mir_snprintf(str2, "Popups%dM", i);
- g_plugin.setByte(str2, (BYTE)(IsDlgButtonChecked(hdlg, (i + 1024))));
+ g_plugin.setByte(str2, (uint8_t)(IsDlgButtonChecked(hdlg, (i + 1024))));
}
return TRUE;
}
diff --git a/plugins/PackUpdater/Src/Utils.cpp b/plugins/PackUpdater/Src/Utils.cpp index 33c28584f1..f6302454e5 100644 --- a/plugins/PackUpdater/Src/Utils.cpp +++ b/plugins/PackUpdater/Src/Utils.cpp @@ -22,7 +22,7 @@ Boston, MA 02111-1307, USA. vector<FILEINFO> Files;
BOOL DlgDld;
INT FileCount = 0, CurrentFile = 0, Number = 0;
-BYTE Reminder, UpdateOnStartup, UpdateOnPeriod, OnlyOnceADay, PeriodMeasure;
+uint8_t Reminder, UpdateOnStartup, UpdateOnPeriod, OnlyOnceADay, PeriodMeasure;
INT Period;
wchar_t tszDialogMsg[2048] = { 0 };
FILEINFO* pFileInfo = nullptr;
@@ -380,7 +380,7 @@ BOOL AllowUpdateOnStartup() return TRUE;
}
-LONG PeriodToMilliseconds(const INT period, BYTE& periodMeasure)
+LONG PeriodToMilliseconds(const INT period, uint8_t& periodMeasure)
{
LONG result = period * 1000;
switch (periodMeasure) {
diff --git a/plugins/PackUpdater/Src/stdafx.h b/plugins/PackUpdater/Src/stdafx.h index 1561d42f87..713411b233 100644 --- a/plugins/PackUpdater/Src/stdafx.h +++ b/plugins/PackUpdater/Src/stdafx.h @@ -77,9 +77,9 @@ struct FILEINFO wchar_t tszDescr[256];
FILEURL File;
BOOL enabled;
- BYTE FileType;
+ uint8_t FileType;
INT FileNum;
- BYTE Force;
+ uint8_t Force;
};
#define DEFAULT_REMINDER 1
@@ -100,7 +100,7 @@ using namespace std; extern INT FileCount, CurrentFile, Number, UpdatesCount, Period;
extern BOOL Silent, DlgDld;
-extern BYTE Reminder, UpdateOnStartup, UpdateOnPeriod, OnlyOnceADay, PeriodMeasure;
+extern uint8_t Reminder, UpdateOnStartup, UpdateOnPeriod, OnlyOnceADay, PeriodMeasure;
extern wchar_t tszRoot[MAX_PATH], tszDialogMsg[2048];
extern FILEINFO* pFileInfo;
extern FILEURL* pFileUrl;
diff --git a/plugins/PasteIt/src/PasteToWeb.cpp b/plugins/PasteIt/src/PasteToWeb.cpp index 738394efdf..a819d2ef66 100644 --- a/plugins/PasteIt/src/PasteToWeb.cpp +++ b/plugins/PasteIt/src/PasteToWeb.cpp @@ -259,7 +259,7 @@ void PasteToWeb::FromClipboard() isFile = 1;
if (df->fWide) {
// Unicode
- wchar_t* file = (wchar_t*)((BYTE*)obj + df->pFiles);
+ wchar_t* file = (wchar_t*)((uint8_t*)obj + df->pFiles);
size_t len = mir_wstrlen(file);
if (*(file + len + 1) == L'\0') {
str.append(file, file + len);
diff --git a/plugins/Ping/src/ping.cpp b/plugins/Ping/src/ping.cpp index 7ae9fadf9b..1cf633c8d9 100644 --- a/plugins/Ping/src/ping.cpp +++ b/plugins/Ping/src/ping.cpp @@ -119,7 +119,7 @@ static IconItem iconList[] = int CMPlugin::Load()
{
use_raw_ping = false;
- g_plugin.setByte("UsingRawSockets", (BYTE)use_raw_ping);
+ g_plugin.setByte("UsingRawSockets", (uint8_t)use_raw_ping);
hWakeEvent = CreateEvent(nullptr, FALSE, FALSE, L"Local\\ThreadWaitEvent");
diff --git a/plugins/Ping/src/pingthread.cpp b/plugins/Ping/src/pingthread.cpp index 9921eff5d2..cef01fc117 100644 --- a/plugins/Ping/src/pingthread.cpp +++ b/plugins/Ping/src/pingthread.cpp @@ -467,7 +467,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar SetWindowLongPtr(hwnd, GWL_EXSTYLE, GetWindowLongPtr(hwnd, GWL_EXSTYLE) | WS_EX_LAYERED);
#endif
#ifdef LWA_ALPHA
- SetLayeredWindowAttributes(hwnd, RGB(0, 0, 0), (BYTE)db_get_b(0, "CList", "Alpha", SETTING_ALPHA_DEFAULT), LWA_ALPHA);
+ SetLayeredWindowAttributes(hwnd, RGB(0, 0, 0), (uint8_t)db_get_b(0, "CList", "Alpha", SETTING_ALPHA_DEFAULT), LWA_ALPHA);
#endif
}
}
@@ -490,7 +490,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar if (db_get_b(0, "CList", "Transparent", SETTING_TRANSPARENT_DEFAULT)) {
KillTimer(hwnd, TM_AUTOALPHA);
#ifdef LWA_ALPHA
- SetLayeredWindowAttributes(hwnd, RGB(0, 0, 0), (BYTE)db_get_b(0, "CList", "Alpha", SETTING_ALPHA_DEFAULT), LWA_ALPHA);
+ SetLayeredWindowAttributes(hwnd, RGB(0, 0, 0), (uint8_t)db_get_b(0, "CList", "Alpha", SETTING_ALPHA_DEFAULT), LWA_ALPHA);
#endif
transparentFocus = 1;
}
@@ -501,7 +501,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar if (db_get_b(0, "CList", "Transparent", SETTING_TRANSPARENT_DEFAULT)) {
if (!transparentFocus && GetForegroundWindow() != hwnd) {
#ifdef LWA_ALPHA
- SetLayeredWindowAttributes(hwnd, RGB(0, 0, 0), (BYTE)db_get_b(0, "CList", "Alpha", SETTING_ALPHA_DEFAULT), LWA_ALPHA);
+ SetLayeredWindowAttributes(hwnd, RGB(0, 0, 0), (uint8_t)db_get_b(0, "CList", "Alpha", SETTING_ALPHA_DEFAULT), LWA_ALPHA);
#endif
transparentFocus = 1;
SetTimer(hwnd, TM_AUTOALPHA, 250, nullptr);
@@ -528,8 +528,8 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar if (inwnd != transparentFocus) { //change
transparentFocus = inwnd;
#ifdef LWA_ALPHA
- if (transparentFocus) SetLayeredWindowAttributes(hwnd, RGB(0, 0, 0), (BYTE)db_get_b(0, "CList", "Alpha", SETTING_ALPHA_DEFAULT), LWA_ALPHA);
- else SetLayeredWindowAttributes(hwnd, RGB(0, 0, 0), (BYTE)db_get_b(0, "CList", "AutoAlpha", SETTING_AUTOALPHA_DEFAULT), LWA_ALPHA);
+ if (transparentFocus) SetLayeredWindowAttributes(hwnd, RGB(0, 0, 0), (uint8_t)db_get_b(0, "CList", "Alpha", SETTING_ALPHA_DEFAULT), LWA_ALPHA);
+ else SetLayeredWindowAttributes(hwnd, RGB(0, 0, 0), (uint8_t)db_get_b(0, "CList", "AutoAlpha", SETTING_AUTOALPHA_DEFAULT), LWA_ALPHA);
#endif
}
if (!transparentFocus) KillTimer(hwnd, TM_AUTOALPHA);
@@ -550,7 +550,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar int sourceAlpha, destAlpha;
if (wParam) {
sourceAlpha = 0;
- destAlpha = (BYTE)db_get_b(0, "CList", "Alpha", SETTING_AUTOALPHA_DEFAULT);
+ destAlpha = (uint8_t)db_get_b(0, "CList", "Alpha", SETTING_AUTOALPHA_DEFAULT);
#ifdef LWA_ALPHA
SetLayeredWindowAttributes(hwnd, RGB(0, 0, 0), 0, LWA_ALPHA);
#endif
@@ -559,18 +559,18 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar noRecurse = 0;
}
else {
- sourceAlpha = (BYTE)db_get_b(0, "CList", "Alpha", SETTING_AUTOALPHA_DEFAULT);
+ sourceAlpha = (uint8_t)db_get_b(0, "CList", "Alpha", SETTING_AUTOALPHA_DEFAULT);
destAlpha = 0;
}
for (startTick = GetTickCount();;) {
thisTick = GetTickCount();
if (thisTick >= startTick + 200) break;
#ifdef LWA_ALPHA
- SetLayeredWindowAttributes(hwnd, RGB(0, 0, 0), (BYTE)(sourceAlpha + (destAlpha - sourceAlpha)*(int)(thisTick - startTick) / 200), LWA_ALPHA);
+ SetLayeredWindowAttributes(hwnd, RGB(0, 0, 0), (uint8_t)(sourceAlpha + (destAlpha - sourceAlpha)*(int)(thisTick - startTick) / 200), LWA_ALPHA);
#endif
}
#ifdef LWA_ALPHA
- SetLayeredWindowAttributes(hwnd, RGB(0, 0, 0), (BYTE)destAlpha, LWA_ALPHA);
+ SetLayeredWindowAttributes(hwnd, RGB(0, 0, 0), (uint8_t)destAlpha, LWA_ALPHA);
#endif
}
else AnimateWindow(hwnd, 200, AW_BLEND | (wParam ? 0 : AW_HIDE));
diff --git a/plugins/Ping/src/rawping.h b/plugins/Ping/src/rawping.h index 59751d8c7a..23aee401cf 100644 --- a/plugins/Ping/src/rawping.h +++ b/plugins/Ping/src/rawping.h @@ -20,14 +20,14 @@ // The IP header
struct IPHeader {
- BYTE h_len : 4; // Length of the header in dwords
- BYTE version : 4; // Version of IP
- BYTE tos; // Type of service
+ uint8_t h_len : 4; // Length of the header in dwords
+ uint8_t version : 4; // Version of IP
+ uint8_t tos; // Type of service
USHORT total_len; // Length of the packet in dwords
USHORT ident; // unique identifier
USHORT flags; // Flags
- BYTE ttl; // Time to live
- BYTE proto; // Protocol number (TCP, UDP etc)
+ uint8_t ttl; // Time to live
+ uint8_t proto; // Protocol number (TCP, UDP etc)
USHORT checksum; // IP checksum
ULONG source_ip;
ULONG dest_ip;
@@ -35,8 +35,8 @@ struct IPHeader { // ICMP header
struct ICMPHeader {
- BYTE type; // ICMP packet type
- BYTE code; // Type sub code
+ uint8_t type; // ICMP packet type
+ uint8_t code; // Type sub code
USHORT checksum;
USHORT id;
USHORT seq;
diff --git a/plugins/PluginUpdater/pu_stub/src/pu_stub.cpp b/plugins/PluginUpdater/pu_stub/src/pu_stub.cpp index c3cd302482..84362caad6 100644 --- a/plugins/PluginUpdater/pu_stub/src/pu_stub.cpp +++ b/plugins/PluginUpdater/pu_stub/src/pu_stub.cpp @@ -92,7 +92,7 @@ int APIENTRY wWinMain(HINSTANCE /*hInstance*/, HINSTANCE, LPTSTR lpCmdLine, int) log(L"Entering the reading cycle..."); - BYTE szReadBuffer[1024] = { 0 }; + uint8_t szReadBuffer[1024] = { 0 }; DWORD dwBytes; while (ReadFile(hPipe, szReadBuffer, sizeof(szReadBuffer), &dwBytes, nullptr)) { DWORD dwAction = *(DWORD*)szReadBuffer; diff --git a/plugins/PluginUpdater/pu_stub/src/stdafx.h b/plugins/PluginUpdater/pu_stub/src/stdafx.h index 7ad5b19462..7310035e7a 100644 --- a/plugins/PluginUpdater/pu_stub/src/stdafx.h +++ b/plugins/PluginUpdater/pu_stub/src/stdafx.h @@ -26,6 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // C RunTime Header Files #include <stdlib.h> +#include <stdint.h> #include <malloc.h> #include <memory.h> #include <varargs.h> diff --git a/plugins/PluginUpdater/src/Notifications.cpp b/plugins/PluginUpdater/src/Notifications.cpp index 92488184d3..24471f507d 100644 --- a/plugins/PluginUpdater/src/Notifications.cpp +++ b/plugins/PluginUpdater/src/Notifications.cpp @@ -38,7 +38,7 @@ void InitPopupList() PopupsList[2].colorText = g_plugin.getDword("Popups2Tx", COLOR_TX_DEFAULT);
}
-static void PopupAction(HWND hPopup, BYTE action)
+static void PopupAction(HWND hPopup, uint8_t action)
{
switch (action) {
case PCA_CLOSEPOPUP:
diff --git a/plugins/PluginUpdater/src/Options.cpp b/plugins/PluginUpdater/src/Options.cpp index b03bad8cd2..87e195a920 100644 --- a/plugins/PluginUpdater/src/Options.cpp +++ b/plugins/PluginUpdater/src/Options.cpp @@ -440,7 +440,7 @@ public: int i = int(&it - PopupsList);
char szSetting[20] = { 0 };
mir_snprintf(szSetting, "Popups%d", i);
- g_plugin.setByte(szSetting, (BYTE)(IsDlgButtonChecked(m_hwnd, it.ctrl1)));
+ g_plugin.setByte(szSetting, (uint8_t)(IsDlgButtonChecked(m_hwnd, it.ctrl1)));
mir_snprintf(szSetting, "Popups%iTx", i);
g_plugin.setDword(szSetting, it.colorText = SendDlgItemMessage(m_hwnd, it.ctrl2, CPM_GETCOLOUR, 0, 0));
@@ -450,8 +450,8 @@ public: }
g_plugin.PopupTimeout = GetDlgItemInt(m_hwnd, IDC_TIMEOUT_VALUE, nullptr, TRUE);
- g_plugin.PopupLeftClickAction = (BYTE)SendDlgItemMessage(m_hwnd, IDC_LC, CB_GETCURSEL, 0, 0);
- g_plugin.PopupRightClickAction = (BYTE)SendDlgItemMessage(m_hwnd, IDC_RC, CB_GETCURSEL, 0, 0);
+ g_plugin.PopupLeftClickAction = (uint8_t)SendDlgItemMessage(m_hwnd, IDC_LC, CB_GETCURSEL, 0, 0);
+ g_plugin.PopupRightClickAction = (uint8_t)SendDlgItemMessage(m_hwnd, IDC_RC, CB_GETCURSEL, 0, 0);
if (chkWinColors.GetState())
g_plugin.PopupDefColors = byCOLOR_OWN;
diff --git a/plugins/PluginUpdater/src/checksum.cpp b/plugins/PluginUpdater/src/checksum.cpp index 69df01eafd..3e98cc82a7 100644 --- a/plugins/PluginUpdater/src/checksum.cpp +++ b/plugins/PluginUpdater/src/checksum.cpp @@ -258,7 +258,7 @@ LBL_NotPE: }
}
- BYTE digest[16];
+ uint8_t digest[16];
mir_md5_finish(&pms, digest);
bin2hex(digest, sizeof(digest), szDest);
return RESULT_OK;
diff --git a/plugins/PluginUpdater/src/stdafx.h b/plugins/PluginUpdater/src/stdafx.h index a654e0997b..f4a4416b73 100644 --- a/plugins/PluginUpdater/src/stdafx.h +++ b/plugins/PluginUpdater/src/stdafx.h @@ -185,7 +185,7 @@ struct CMPlugin : public PLUGIN<CMPlugin> CMOption<DWORD> dwLastUpdate;
// popup options
- CMOption<BYTE> PopupDefColors, PopupLeftClickAction, PopupRightClickAction;
+ CMOption<uint8_t> PopupDefColors, PopupLeftClickAction, PopupRightClickAction;
CMOption<DWORD> PopupTimeout;
};
diff --git a/plugins/Popup/src/bitmap_funcs.cpp b/plugins/Popup/src/bitmap_funcs.cpp index 9f20a65aa6..6fba66ad66 100644 --- a/plugins/Popup/src/bitmap_funcs.cpp +++ b/plugins/Popup/src/bitmap_funcs.cpp @@ -560,14 +560,14 @@ void MyBitmap::DrawIcon(HICON hic, int x, int y, int w, int h) DestroyIcon(hicTmp);
}
- BYTE *cbit = new BYTE[bmpColor.bmWidthBytes*bmpColor.bmHeight];
- BYTE *mbit = new BYTE[bmpMask.bmWidthBytes*bmpMask.bmHeight];
+ uint8_t *cbit = new uint8_t[bmpColor.bmWidthBytes*bmpColor.bmHeight];
+ uint8_t *mbit = new uint8_t[bmpMask.bmWidthBytes*bmpMask.bmHeight];
GetBitmapBits(info.hbmColor, bmpColor.bmWidthBytes*bmpColor.bmHeight, cbit);
GetBitmapBits(info.hbmMask, bmpMask.bmWidthBytes*bmpMask.bmHeight, mbit);
for (int i = 0; i < bmpColor.bmHeight; i++) {
for (int j = 0; j < bmpColor.bmWidth; j++) {
- BYTE *pixel = cbit + i*bmpColor.bmWidthBytes + j * 4;
+ uint8_t *pixel = cbit + i*bmpColor.bmWidthBytes + j * 4;
if (!pixel[3])
pixel[3] = (*(mbit + i*bmpMask.bmWidthBytes + j*bmpMask.bmBitsPixel / 8) & (1 << (7 - j % 8))) ? 0 : 255;
@@ -612,7 +612,7 @@ HRGN MyBitmap::buildOpaqueRgn(int level, bool opaque) const int addRectsCount = 64;
int rectsCount = addRectsCount;
- PRGNDATA pRgnData = (PRGNDATA)(new BYTE[sizeof(RGNDATAHEADER) + (rectsCount)*sizeof(RECT)]);
+ PRGNDATA pRgnData = (PRGNDATA)(new uint8_t[sizeof(RGNDATAHEADER) + (rectsCount)*sizeof(RECT)]);
LPRECT pRects = (LPRECT)(&pRgnData->Buffer);
memset(pRgnData, 0, sizeof(RGNDATAHEADER) + (rectsCount)*sizeof(RECT));
@@ -631,7 +631,7 @@ HRGN MyBitmap::buildOpaqueRgn(int level, bool opaque) SetRect(&pRects[pRgnData->rdh.nCount++], first, i, j, i + 1);
if (pRgnData->rdh.nCount >= (DWORD)rectsCount) {
rectsCount += addRectsCount;
- LPRGNDATA pRgnDataNew = (LPRGNDATA)(new BYTE[sizeof(RGNDATAHEADER) + (rectsCount)*sizeof(RECT)]);
+ LPRGNDATA pRgnDataNew = (LPRGNDATA)(new uint8_t[sizeof(RGNDATAHEADER) + (rectsCount)*sizeof(RECT)]);
memcpy(pRgnDataNew, pRgnData, sizeof(RGNDATAHEADER) + pRgnData->rdh.nCount * sizeof(RECT));
delete[] pRgnData;
pRgnData = pRgnDataNew;
@@ -650,7 +650,7 @@ HRGN MyBitmap::buildOpaqueRgn(int level, bool opaque) SetRect(&pRects[pRgnData->rdh.nCount++], first, i, j, i + 1);
if (pRgnData->rdh.nCount >= (DWORD)rectsCount) {
rectsCount += addRectsCount;
- LPRGNDATA pRgnDataNew = (LPRGNDATA)(new BYTE[sizeof(RGNDATAHEADER) + (rectsCount)*sizeof(RECT)]);
+ LPRGNDATA pRgnDataNew = (LPRGNDATA)(new uint8_t[sizeof(RGNDATAHEADER) + (rectsCount)*sizeof(RECT)]);
memcpy(pRgnDataNew, pRgnData, sizeof(RGNDATAHEADER) + pRgnData->rdh.nCount * sizeof(RECT));
delete[] pRgnData;
pRgnData = pRgnDataNew;
diff --git a/plugins/Popup/src/config.h b/plugins/Popup/src/config.h index 888b7624f5..aef2844d67 100644 --- a/plugins/Popup/src/config.h +++ b/plugins/Popup/src/config.h @@ -27,14 +27,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. typedef struct tagPOPUPOPTIONS {
//==Page General====
//Timeout
- BYTE InfiniteDelay;
+ uint8_t InfiniteDelay;
int Seconds;
- BYTE LeaveHovered;
+ uint8_t LeaveHovered;
//Size&Position
- BYTE DynamicResize;
- BYTE UseMinimumWidth;
+ uint8_t DynamicResize;
+ uint8_t UseMinimumWidth;
WORD MinimumWidth;
- BYTE UseMaximumWidth;
+ uint8_t UseMaximumWidth;
WORD MaximumWidth;
int Position;
int Spreading;
@@ -45,20 +45,20 @@ typedef struct tagPOPUPOPTIONS { int gapRight;
int spacing;
//Miscellaneous
- BYTE ReorderPopups;
- BYTE ReorderPopupsWarning;
+ uint8_t ReorderPopups;
+ uint8_t ReorderPopupsWarning;
//Disable when
- BYTE DisableWhenFullscreen;
+ uint8_t DisableWhenFullscreen;
//others
- BYTE debug;
+ uint8_t debug;
//==Page Skins====
LPTSTR SkinPack;
- BYTE DisplayTime;
- BYTE DropShadow;
- BYTE EnableFreeformShadows;
- BYTE EnableAeroGlass;
- BYTE UseWinColors;
- BYTE UseMText;
+ uint8_t DisplayTime;
+ uint8_t DropShadow;
+ uint8_t EnableFreeformShadows;
+ uint8_t EnableAeroGlass;
+ uint8_t UseWinColors;
+ uint8_t UseMText;
//==Page Actions====
DWORD actions;
//Mouse Override
@@ -67,24 +67,24 @@ typedef struct tagPOPUPOPTIONS { int overrideMiddle;
//==Page Advanced====
//History
- BYTE EnableHistory;
+ uint8_t EnableHistory;
WORD HistorySize;
- BYTE UseHppHistoryLog;
+ uint8_t UseHppHistoryLog;
//Avatars
- BYTE avatarBorders;
- BYTE avatarPNGBorders;
- BYTE avatarRadius;
+ uint8_t avatarBorders;
+ uint8_t avatarPNGBorders;
+ uint8_t avatarRadius;
WORD avatarSize;
- BYTE EnableAvatarUpdates;
+ uint8_t EnableAvatarUpdates;
//Monitor
- BYTE Monitor;
+ uint8_t Monitor;
//Transparency
- BYTE UseTransparency;
- BYTE Alpha;
- BYTE OpaqueOnHover;
+ uint8_t UseTransparency;
+ uint8_t Alpha;
+ uint8_t OpaqueOnHover;
//Effect
- BYTE UseAnimations;
- BYTE UseEffect;
+ uint8_t UseAnimations;
+ uint8_t UseEffect;
LPTSTR Effect;
DWORD FadeIn;
DWORD FadeOut;
diff --git a/plugins/Popup/src/notifications.cpp b/plugins/Popup/src/notifications.cpp index c6a507893a..5876781cb9 100644 --- a/plugins/Popup/src/notifications.cpp +++ b/plugins/Popup/src/notifications.cpp @@ -209,7 +209,7 @@ HANDLE RegisterNotification(POPUPNOTIFICATION *notification) return (HANDLE)ptd;
}
-HANDLE FindTreeData(LPTSTR group, LPTSTR name, BYTE typ)
+HANDLE FindTreeData(LPTSTR group, LPTSTR name, uint8_t typ)
{
for (auto &p : gTreeData)
if (p->typ == typ && (!group || (mir_wstrcmp(p->pszTreeRoot, group) == 0)) && (!name || (mir_wstrcmp(p->pszDescription, name) == 0)))
diff --git a/plugins/Popup/src/notifications.h b/plugins/Popup/src/notifications.h index 041a83d78c..3a56992b33 100644 --- a/plugins/Popup/src/notifications.h +++ b/plugins/Popup/src/notifications.h @@ -30,12 +30,12 @@ struct POPUPTREEDATA DWORD signature;
LPTSTR pszTreeRoot;
LPTSTR pszDescription;
- BYTE typ;
+ uint8_t typ;
union {
POPUPNOTIFICATION notification;
POPUPCLASS pupClass;
};
- BYTE enabled;
+ uint8_t enabled;
DWORD disableWhen;
int timeoutValue;
char leftAction[MAXMODULELABELLENGTH];
@@ -49,7 +49,7 @@ extern LIST<POPUPTREEDATA> gTreeData; extern HANDLE g_hntfError, g_hntfWarning, g_hntfNotification;
int TreeDataSortFunc(const POPUPTREEDATA *p1, const POPUPTREEDATA *p2);
-HANDLE FindTreeData(LPTSTR group, LPTSTR name, BYTE typ);
+HANDLE FindTreeData(LPTSTR group, LPTSTR name, uint8_t typ);
void FreePopupClass(POPUPTREEDATA *ptd);
void UnloadTreeData();
diff --git a/plugins/Popup/src/opt_adv.cpp b/plugins/Popup/src/opt_adv.cpp index a6bb89eacd..8b8b056d9e 100644 --- a/plugins/Popup/src/opt_adv.cpp +++ b/plugins/Popup/src/opt_adv.cpp @@ -235,7 +235,7 @@ INT_PTR CALLBACK DlgProcPopupAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM break;
case IDC_TRANS_SLIDER:
- PopupOptions.Alpha = (BYTE)SendDlgItemMessage(hwnd, IDC_TRANS_SLIDER, TBM_GETPOS, 0, 0);
+ PopupOptions.Alpha = (uint8_t)SendDlgItemMessage(hwnd, IDC_TRANS_SLIDER, TBM_GETPOS, 0, 0);
mir_snwprintf(tstr, TranslateT("%d%%"), Byte2Percentile(PopupOptions.Alpha));
SetDlgItemText(hwnd, IDC_TRANS_PERCENT, tstr);
SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
@@ -492,7 +492,7 @@ INT_PTR CALLBACK DlgProcPopupAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM case PSN_APPLY:
// History
- g_plugin.setByte("EnableHistory", (BYTE)PopupOptions.EnableHistory);
+ g_plugin.setByte("EnableHistory", (uint8_t)PopupOptions.EnableHistory);
g_plugin.setWord("HistorySize", PopupOptions.HistorySize);
PopupHistoryResize();
g_plugin.setByte("UseHppHistoryLog", PopupOptions.UseHppHistoryLog);
@@ -516,7 +516,7 @@ INT_PTR CALLBACK DlgProcPopupAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM g_plugin.setDword("FadeInTime", PopupOptions.FadeIn);
g_plugin.setDword("FadeOutTime", PopupOptions.FadeOut);
// other old stuff
- g_plugin.setWord("MaxPopups", (BYTE)PopupOptions.MaxPopups);
+ g_plugin.setWord("MaxPopups", (uint8_t)PopupOptions.MaxPopups);
}
return TRUE;
}
@@ -551,7 +551,7 @@ LRESULT CALLBACK AvatarTrackBarWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA tme.hwndTrack = hwnd;
_TrackMouseEvent(&tme);
- int newVal = (BYTE)SendMessage(hwnd, TBM_GETPOS, 0, 0);
+ int newVal = (uint8_t)SendMessage(hwnd, TBM_GETPOS, 0, 0);
if (oldVal != newVal) {
if (oldVal < 0)
SetWindowLongPtr(hwndBox, GWLP_USERDATA, 0);
@@ -600,7 +600,7 @@ LRESULT CALLBACK AlphaTrackBarWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM tme.hwndTrack = hwnd;
_TrackMouseEvent(&tme);
- int newVal = (BYTE)SendMessage(hwnd, TBM_GETPOS, 0, 0);
+ int newVal = (uint8_t)SendMessage(hwnd, TBM_GETPOS, 0, 0);
if (oldVal != newVal)
{
diff --git a/plugins/Popup/src/opt_class.cpp b/plugins/Popup/src/opt_class.cpp index 5297481083..30376308f9 100644 --- a/plugins/Popup/src/opt_class.cpp +++ b/plugins/Popup/src/opt_class.cpp @@ -41,9 +41,9 @@ int ComboBox_SelectItem(HWND hwndCtl, char *data) { struct {
UINT idCtrl;
- BYTE onTyp0;
- BYTE onTyp1;
- BYTE onTyp2;
+ uint8_t onTyp0;
+ uint8_t onTyp1;
+ uint8_t onTyp2;
}
static ctrlsAll[] = {
{ IDC_TXT_TITLE1, 0, 1, 1 },
@@ -319,7 +319,7 @@ INT_PTR CALLBACK DlgProcOptsClasses(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l case BN_CLICKED: // Button controls
switch (idCtrl) {
case IDC_ENABLE:
- ptd->enabled = (BYTE)Button_GetCheck((HWND)lParam);
+ ptd->enabled = (uint8_t)Button_GetCheck((HWND)lParam);
for (auto &it : ctrlsEnable)
EnableWindow(GetDlgItem(hwnd, it), ptd->enabled);
SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
diff --git a/plugins/Popup/src/opt_gen.cpp b/plugins/Popup/src/opt_gen.cpp index 7c74a26041..d81747ae06 100644 --- a/plugins/Popup/src/opt_gen.cpp +++ b/plugins/Popup/src/opt_gen.cpp @@ -495,7 +495,7 @@ INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM g_plugin.setWord("MaximumWidth", PopupOptions.MaximumWidth);
// Position
- g_plugin.setByte("Position", (BYTE)PopupOptions.Position);
+ g_plugin.setByte("Position", (uint8_t)PopupOptions.Position);
// Configure popup area
g_plugin.setWord("gapTop", (WORD)PopupOptions.gapTop);
@@ -505,7 +505,7 @@ INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM g_plugin.setWord("spacing", (WORD)PopupOptions.spacing);
// Spreading
- g_plugin.setByte("Spreading", (BYTE)PopupOptions.Spreading);
+ g_plugin.setByte("Spreading", (uint8_t)PopupOptions.Spreading);
// miscellaneous
Check_ReorderPopups(hwnd); // this save also PopupOptions.ReorderPopups
diff --git a/plugins/Popup/src/popup_wnd2.cpp b/plugins/Popup/src/popup_wnd2.cpp index fcb0b56b78..bd0b9ad530 100644 --- a/plugins/Popup/src/popup_wnd2.cpp +++ b/plugins/Popup/src/popup_wnd2.cpp @@ -179,7 +179,7 @@ void PopupWnd2::create() update();
}
-void PopupWnd2::updateLayered(BYTE opacity)
+void PopupWnd2::updateLayered(uint8_t opacity)
{
if (!m_hwnd) return;
diff --git a/plugins/Popup/src/popup_wnd2.h b/plugins/Popup/src/popup_wnd2.h index 45b940fbb6..3f4632f5d8 100644 --- a/plugins/Popup/src/popup_wnd2.h +++ b/plugins/Popup/src/popup_wnd2.h @@ -86,7 +86,7 @@ private: // show & hide
bool m_bFade;
- BYTE m_btAlpha0, m_btAlpha1;
+ uint8_t m_btAlpha0, m_btAlpha1;
bool m_bSlide;
POINT m_ptPosition0, m_ptPosition1;
bool m_bDestroy;
@@ -113,7 +113,7 @@ public: void startThread();
void create();
- void updateLayered(BYTE opacity);
+ void updateLayered(uint8_t opacity);
SIZE measure();
void update();
void animate();
diff --git a/plugins/Popup/src/services.cpp b/plugins/Popup/src/services.cpp index 4692274bcf..a089a10a0c 100644 --- a/plugins/Popup/src/services.cpp +++ b/plugins/Popup/src/services.cpp @@ -123,7 +123,7 @@ INT_PTR Popup_AddPopup2(WPARAM wParam, LPARAM lParam) if (ppd->lchContact)
proto = Proto_GetBaseAccountName(ppd->lchContact);
- BYTE bShowMode = proto ? db_get_b(ppd->lchContact, MODULENAME, "ShowMode", PU_SHOWMODE_AUTO) : PU_SHOWMODE_AUTO;
+ uint8_t bShowMode = proto ? db_get_b(ppd->lchContact, MODULENAME, "ShowMode", PU_SHOWMODE_AUTO) : PU_SHOWMODE_AUTO;
if (bShowMode == PU_SHOWMODE_BLOCK)
return -1;
diff --git a/plugins/ProxySwitch/src/opt.cpp b/plugins/ProxySwitch/src/opt.cpp index 4f2b5927f0..c02bee1a57 100644 --- a/plugins/ProxySwitch/src/opt.cpp +++ b/plugins/ProxySwitch/src/opt.cpp @@ -173,13 +173,13 @@ void SaveSettings(void) g_plugin.setWString("UseProxyIPNets", opt_useProxy); g_plugin.setWString("NoProxyIPNets", opt_noProxy); g_plugin.setWString("HideInterfaces", opt_hideIntf); - g_plugin.setByte("ManageMirandaProxy", (BYTE)opt_miranda); - g_plugin.setByte("ManageIEProxy", (BYTE)opt_ie); - g_plugin.setByte("ManageFirefoxProxy", (BYTE)opt_firefox); - g_plugin.setByte("AlwaysReconnect", (BYTE)opt_alwayReconnect); - g_plugin.setByte("PopupEnabled", (BYTE)opt_popups); - g_plugin.setByte("PopupDefaultColors", (BYTE)opt_defaultColors); - g_plugin.setByte("ShowProxyStatus", (BYTE)opt_showProxyState); + g_plugin.setByte("ManageMirandaProxy", (uint8_t)opt_miranda); + g_plugin.setByte("ManageIEProxy", (uint8_t)opt_ie); + g_plugin.setByte("ManageFirefoxProxy", (uint8_t)opt_firefox); + g_plugin.setByte("AlwaysReconnect", (uint8_t)opt_alwayReconnect); + g_plugin.setByte("PopupEnabled", (uint8_t)opt_popups); + g_plugin.setByte("PopupDefaultColors", (uint8_t)opt_defaultColors); + g_plugin.setByte("ShowProxyStatus", (uint8_t)opt_showProxyState); g_plugin.setDword("PopupBgColor", (DWORD)opt_bgColor); g_plugin.setDword("PopupTxtColor", (DWORD)opt_txtColor); } diff --git a/plugins/QuickContacts/src/options.cpp b/plugins/QuickContacts/src/options.cpp index 43cb95c914..a061f7e396 100644 --- a/plugins/QuickContacts/src/options.cpp +++ b/plugins/QuickContacts/src/options.cpp @@ -42,16 +42,16 @@ void LoadOptions() // Options page
static OptPageControl controls[] = {
- { nullptr, CONTROL_CHECKBOX, IDC_LASTSENTTO, "EnableLastSentTo", (BYTE)TRUE },
+ { nullptr, CONTROL_CHECKBOX, IDC_LASTSENTTO, "EnableLastSentTo", (uint8_t)TRUE },
{ nullptr, CONTROL_RADIO, IDC_GLOBAL, "MsgTypeRec", (WORD)TYPE_GLOBAL, TYPE_GLOBAL },
{ nullptr, CONTROL_RADIO, IDC_LOCAL, "MsgTypeRec", (WORD)TYPE_GLOBAL, TYPE_LOCAL },
- { nullptr, CONTROL_PROTOCOL_LIST, IDC_PROTOCOLS, "ShowOffline%s", (BYTE)FALSE },
- { nullptr, CONTROL_CHECKBOX, IDC_HIDE_OFFLINE, "HideOfflineFromOfflineProto", (BYTE)TRUE },
- { nullptr, CONTROL_CHECKBOX, IDC_APPEND_GROUP, "AppendGroupName", (BYTE)FALSE },
- { nullptr, CONTROL_CHECKBOX, IDC_GROUP_COLUMN, "GroupColumn", (BYTE)FALSE },
- { nullptr, CONTROL_CHECKBOX, IDC_GROUP_LEFT, "GroupColumnLeft", (BYTE)FALSE },
- { nullptr, CONTROL_CHECKBOX, IDC_SUBCONTACTS, "HideSubcontacts", (BYTE)TRUE },
- { nullptr, CONTROL_CHECKBOX, IDC_KEEP_OFFLINE, "KeepSubcontactsFromOffline", (BYTE)TRUE }
+ { nullptr, CONTROL_PROTOCOL_LIST, IDC_PROTOCOLS, "ShowOffline%s", (uint8_t)FALSE },
+ { nullptr, CONTROL_CHECKBOX, IDC_HIDE_OFFLINE, "HideOfflineFromOfflineProto", (uint8_t)TRUE },
+ { nullptr, CONTROL_CHECKBOX, IDC_APPEND_GROUP, "AppendGroupName", (uint8_t)FALSE },
+ { nullptr, CONTROL_CHECKBOX, IDC_GROUP_COLUMN, "GroupColumn", (uint8_t)FALSE },
+ { nullptr, CONTROL_CHECKBOX, IDC_GROUP_LEFT, "GroupColumnLeft", (uint8_t)FALSE },
+ { nullptr, CONTROL_CHECKBOX, IDC_SUBCONTACTS, "HideSubcontacts", (uint8_t)TRUE },
+ { nullptr, CONTROL_CHECKBOX, IDC_KEEP_OFFLINE, "KeepSubcontactsFromOffline", (uint8_t)TRUE }
};
static INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
diff --git a/plugins/QuickMessages/src/Utils.cpp b/plugins/QuickMessages/src/Utils.cpp index 0305c08ebf..47f50d34b5 100644 --- a/plugins/QuickMessages/src/Utils.cpp +++ b/plugins/QuickMessages/src/Utils.cpp @@ -201,7 +201,7 @@ void CleanSettings(int buttonnum, int from) db_free(&dbv); } -BYTE getEntryByte(int buttonnum, int entrynum, BOOL mode) +uint8_t getEntryByte(int buttonnum, int entrynum, BOOL mode) { char szMEntry[256] = { '\0' }; @@ -270,7 +270,7 @@ void InitButtonsList() ListData* ld = nullptr; if (!(pszBName = getMenuEntry(i, 0, 3))) { g_iButtonsCount = i; - g_plugin.setByte("ButtonsCount", (BYTE)g_iButtonsCount); + g_plugin.setByte("ButtonsCount", (uint8_t)g_iButtonsCount); break; } @@ -328,7 +328,7 @@ void DestructButtonsList() } } -wchar_t* getMenuEntry(int buttonnum, int entrynum, BYTE mode) +wchar_t* getMenuEntry(int buttonnum, int entrynum, uint8_t mode) { wchar_t* buffer = nullptr; char szMEntry[256]; diff --git a/plugins/QuickMessages/src/Utils.h b/plugins/QuickMessages/src/Utils.h index c06902ad44..872d6e0b15 100644 --- a/plugins/QuickMessages/src/Utils.h +++ b/plugins/QuickMessages/src/Utils.h @@ -30,12 +30,12 @@ typedef struct _tagButtonData {
DWORD dwPos;
DWORD dwOPPos;
- BYTE fEntryType;
- BYTE fEntryOpType;
- BYTE bIsServName;
- BYTE bIsOpServName;
- BYTE bInQMenu;
- BYTE bOpInQMenu;
+ uint8_t fEntryType;
+ uint8_t fEntryOpType;
+ uint8_t bIsServName;
+ uint8_t bIsOpServName;
+ uint8_t bInQMenu;
+ uint8_t bOpInQMenu;
DWORD dwOPFlags;
wchar_t *pszName;
wchar_t *pszValue;
@@ -51,8 +51,8 @@ typedef struct _tagListData wchar_t* ptszQValue;
wchar_t* ptszOPQValue;
wchar_t* ptszButtonName;
- BYTE bIsServName;
- BYTE bIsOpServName;
+ uint8_t bIsServName;
+ uint8_t bIsOpServName;
DWORD dwOPFlags;
}ListData;
@@ -60,7 +60,7 @@ typedef struct _tagQuickData {
DWORD dwPos;
BOOL bIsService;
- BYTE fEntryType;
+ uint8_t fEntryType;
wchar_t* ptszValue;
wchar_t* ptszValueName;
}QuickData;
@@ -71,7 +71,7 @@ int sstSortButtons(const void * vmtbi1, const void * vmtbi2); int sstOpSortButtons(const void * vmtbi1, const void * vmtbi2);
int sstQuickSortButtons(const void * vmtbi1, const void * vmtbi2);
void li_ZeroQuickList(SortedList *pList);
-wchar_t* getMenuEntry(int entrynum,int buttonnum,BYTE mode) ;
+wchar_t* getMenuEntry(int entrynum,int buttonnum,uint8_t mode) ;
int RegisterCustomButton(WPARAM wParam,LPARAM lParam);
void RemoveMenuEntryNode(SortedList *pList, int index);
void DestroyButton(int listnum);
diff --git a/plugins/QuickMessages/src/options.cpp b/plugins/QuickMessages/src/options.cpp index ae950639ab..35bb822645 100644 --- a/plugins/QuickMessages/src/options.cpp +++ b/plugins/QuickMessages/src/options.cpp @@ -314,7 +314,7 @@ void SaveMenuTree() iBl++;
}
- g_plugin.setByte("ButtonsCount", (BYTE)g_iButtonsCount);
+ g_plugin.setByte("ButtonsCount", (uint8_t)g_iButtonsCount);
}
void RestoreModuleData()
@@ -567,7 +567,7 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam) ButtonData* bd = nullptr;
TVITEM tvi;
RECT rc;
- BYTE height;
+ uint8_t height;
BOOLEAN bAsChild = FALSE;
TreeView_SetInsertMark(hMenuTree, NULL, 0);
@@ -601,7 +601,7 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam) drag = 0;
break;
}
- height = (BYTE)(rc.bottom - rc.top);
+ height = (uint8_t)(rc.bottom - rc.top);
if (hti.pt.y - (height / 3) < rc.top) {
HTREEITEM hItem = hti.hItem;
@@ -655,7 +655,7 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam) if (hti.flags & (TVHT_ONITEM | TVHT_ONITEMRIGHT)) {
RECT rc;
if (TreeView_GetItemRect(hMenuTree, hti.hItem, &rc, FALSE)) {
- BYTE height = (BYTE)(rc.bottom - rc.top);
+ uint8_t height = (uint8_t)(rc.bottom - rc.top);
if (hti.pt.y - (height / 3) < rc.top) {
SetCursor(LoadCursor(nullptr, IDC_ARROW));
@@ -694,9 +694,9 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam) SetMenuEntryProperties(hdlg);
SaveMenuTree();
}
- g_plugin.setByte("RClickAuto", (BYTE)(g_bRClickAuto = IsDlgButtonChecked(hdlg, IDC_RAUTOSEND)));
- g_plugin.setByte("LClickAuto", (BYTE)(g_bLClickAuto = IsDlgButtonChecked(hdlg, IDC_LAUTOSEND)));
- g_plugin.setByte("QuickMenu", (BYTE)(g_bQuickMenu = IsDlgButtonChecked(hdlg, IDC_ENABLEQUICKMENU)));
+ g_plugin.setByte("RClickAuto", (uint8_t)(g_bRClickAuto = IsDlgButtonChecked(hdlg, IDC_RAUTOSEND)));
+ g_plugin.setByte("LClickAuto", (uint8_t)(g_bLClickAuto = IsDlgButtonChecked(hdlg, IDC_LAUTOSEND)));
+ g_plugin.setByte("QuickMenu", (uint8_t)(g_bQuickMenu = IsDlgButtonChecked(hdlg, IDC_ENABLEQUICKMENU)));
return 1;
}
else if (((LPNMHDR)lparam)->code == PSN_RESET) {
diff --git a/plugins/RecentContacts/src/RecentContacts.cpp b/plugins/RecentContacts/src/RecentContacts.cpp index 9f31886c71..6d75e6afc1 100644 --- a/plugins/RecentContacts/src/RecentContacts.cpp +++ b/plugins/RecentContacts/src/RecentContacts.cpp @@ -368,7 +368,7 @@ INT_PTR OnMenuCommandShowList(WPARAM, LPARAM) cmultimap *contacts = new cmultimap;
DBEVENTINFO dbe = {};
- BYTE buf[1];
+ uint8_t buf[1];
dbe.pBlob = buf;
for (auto &curContact : Contacts()) {
diff --git a/plugins/RecentContacts/src/options.cpp b/plugins/RecentContacts/src/options.cpp index 247c9a14ba..359f1fee7b 100644 --- a/plugins/RecentContacts/src/options.cpp +++ b/plugins/RecentContacts/src/options.cpp @@ -35,10 +35,10 @@ static INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LP LPNMHDR phdr = (LPNMHDR)(lParam);
if (phdr->idFrom == 0 && phdr->code == PSN_APPLY) {
LastUCOpt.HideOffline = (BOOL)IsDlgButtonChecked(hwndDlg, IDC_HIDEOFFLINE);
- g_plugin.setByte(dbLastUC_HideOfflineContacts, (BYTE)LastUCOpt.HideOffline);
+ g_plugin.setByte(dbLastUC_HideOfflineContacts, (uint8_t)LastUCOpt.HideOffline);
LastUCOpt.WindowAutoSize = (BOOL)IsDlgButtonChecked(hwndDlg, IDC_WINDOWAUTOSIZE);
- g_plugin.setByte(dbLastUC_WindowAutosize, (BYTE)LastUCOpt.WindowAutoSize);
+ g_plugin.setByte(dbLastUC_WindowAutosize, (uint8_t)LastUCOpt.WindowAutoSize);
GetDlgItemTextA(hwndDlg, IDC_SHOWNCONTACTS, str, _countof(str));
LastUCOpt.MaxShownContacts = atoi(str);
diff --git a/plugins/Scriver/src/chat_options.cpp b/plugins/Scriver/src/chat_options.cpp index b84b34ab5a..cfb17740ce 100644 --- a/plugins/Scriver/src/chat_options.cpp +++ b/plugins/Scriver/src/chat_options.cpp @@ -30,7 +30,7 @@ struct branch_t wchar_t *szDescr;
char *szDBName;
int iMode;
- BYTE bDefault;
+ uint8_t bDefault;
HTREEITEM hItem;
};
@@ -100,7 +100,7 @@ static void SaveBranch(HWND hwndTree, struct branch_t *branch, int nValues) for (int i = 0; i < nValues; i++) {
tvi.hItem = branch[i].hItem;
TreeView_GetItem(hwndTree, &tvi);
- BYTE bChecked = ((tvi.state&TVIS_STATEIMAGEMASK) >> 12 == 1) ? 0 : 1;
+ uint8_t bChecked = ((tvi.state&TVIS_STATEIMAGEMASK) >> 12 == 1) ? 0 : 1;
if (branch[i].iMode) {
if (bChecked)
iState |= branch[i].iMode;
@@ -256,7 +256,7 @@ static INT_PTR CALLBACK DlgProcOptions1(HWND hwndDlg, UINT uMsg, WPARAM wParam, iLen = SendDlgItemMessage(hwndDlg, IDC_CHAT_SPIN2, UDM_GETPOS, 0, 0);
if (iLen > 0)
- db_set_b(0, CHAT_MODULE, "NicklistRowDist", (BYTE)iLen);
+ db_set_b(0, CHAT_MODULE, "NicklistRowDist", (uint8_t)iLen);
else
db_unset(0, CHAT_MODULE, "NicklistRowDist");
SaveBranch(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), branch1, _countof(branch1));
@@ -266,7 +266,7 @@ static INT_PTR CALLBACK DlgProcOptions1(HWND hwndDlg, UINT uMsg, WPARAM wParam, break;
case WM_DESTROY:
- BYTE b = TreeView_GetItemState(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), hListHeading1, TVIS_EXPANDED)&TVIS_EXPANDED ? 1 : 0;
+ uint8_t b = TreeView_GetItemState(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), hListHeading1, TVIS_EXPANDED)&TVIS_EXPANDED ? 1 : 0;
db_set_b(0, CHAT_MODULE, "Branch1Exp", b);
break;
}
@@ -509,10 +509,10 @@ static INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, else db_unset(0, CHAT_MODULE, "HeaderOutgoing");
g_Settings.bHighlightEnabled = IsDlgButtonChecked(hwndDlg, IDC_CHAT_HIGHLIGHT) == BST_CHECKED ? TRUE : FALSE;
- db_set_b(0, CHAT_MODULE, "HighlightEnabled", (BYTE)g_Settings.bHighlightEnabled);
+ db_set_b(0, CHAT_MODULE, "HighlightEnabled", (uint8_t)g_Settings.bHighlightEnabled);
g_Settings.bLoggingEnabled = IsDlgButtonChecked(hwndDlg, IDC_CHAT_LOGGING) == BST_CHECKED ? TRUE : FALSE;
- db_set_b(0, CHAT_MODULE, "LoggingEnabled", (BYTE)g_Settings.bLoggingEnabled);
+ db_set_b(0, CHAT_MODULE, "LoggingEnabled", (uint8_t)g_Settings.bLoggingEnabled);
iLen = SendDlgItemMessage(hwndDlg, IDC_CHAT_SPIN2, UDM_GETPOS, 0, 0);
db_set_w(0, CHAT_MODULE, "LogLimit", (WORD)iLen);
@@ -547,7 +547,7 @@ static INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, hPathTip = nullptr;
}
- BYTE b = TreeView_GetItemState(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), hListHeading2, TVIS_EXPANDED) & TVIS_EXPANDED ? 1 : 0;
+ uint8_t b = TreeView_GetItemState(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), hListHeading2, TVIS_EXPANDED) & TVIS_EXPANDED ? 1 : 0;
db_set_b(0, CHAT_MODULE, "Branch2Exp", b);
break;
}
@@ -607,7 +607,7 @@ static INT_PTR CALLBACK DlgProcOptionsPopup(HWND hwndDlg, UINT uMsg, WPARAM wPar iLen = 1;
g_Settings.iPopupStyle = iLen;
- db_set_b(0, CHAT_MODULE, "PopupStyle", (BYTE)iLen);
+ db_set_b(0, CHAT_MODULE, "PopupStyle", (uint8_t)iLen);
iLen = SendDlgItemMessage(hwndDlg, IDC_CHAT_SPIN1, UDM_GETPOS, 0, 0);
g_Settings.iPopupTimeout = iLen;
diff --git a/plugins/Scriver/src/infobar.cpp b/plugins/Scriver/src/infobar.cpp index 2fb79a8d5c..1d1fda210b 100644 --- a/plugins/Scriver/src/infobar.cpp +++ b/plugins/Scriver/src/infobar.cpp @@ -72,7 +72,7 @@ void CMsgDialog::RefreshInfobar() ptrW szXStatusMsg(db_get_wsa(m_hContact, m_szProto, "XStatusMsg"));
HICON hIcon = nullptr;
- BYTE bXStatus = db_get_b(m_hContact, m_szProto, "XStatusId", 0);
+ uint8_t bXStatus = db_get_b(m_hContact, m_szProto, "XStatusId", 0);
if (bXStatus > 0)
hIcon = (HICON)CallProtoService(m_szProto, PS_GETCUSTOMSTATUSICON, bXStatus, 0);
diff --git a/plugins/Scriver/src/msgoptions.cpp b/plugins/Scriver/src/msgoptions.cpp index b095ef49ee..04aff9202f 100644 --- a/plugins/Scriver/src/msgoptions.cpp +++ b/plugins/Scriver/src/msgoptions.cpp @@ -31,7 +31,7 @@ struct const wchar_t *szDescr;
COLORREF defColour;
const wchar_t *szDefFace;
- BYTE defStyle;
+ uint8_t defStyle;
char defSize;
const wchar_t *szBkgName;
}
@@ -769,7 +769,7 @@ public: void onRebuildClist(CCtrlClc *)
{
- BYTE defType = g_plugin.bTypingNew;
+ uint8_t defType = g_plugin.bTypingNew;
if (hItemNew && defType)
m_list.SetCheck(hItemNew, 1);
diff --git a/plugins/Scriver/src/msgutils.cpp b/plugins/Scriver/src/msgutils.cpp index 3f2111f646..6764ff9598 100644 --- a/plugins/Scriver/src/msgutils.cpp +++ b/plugins/Scriver/src/msgutils.cpp @@ -300,8 +300,8 @@ void CMsgDialog::StopMessageSending() void CMsgDialog::SwitchTyping() { if (IsTypingNotificationSupported()) { - BYTE typingNotify = (g_plugin.getByte(m_hContact, SRMSGSET_TYPING, g_plugin.bTypingNew)); - g_plugin.setByte(m_hContact, SRMSGSET_TYPING, (BYTE)!typingNotify); + uint8_t typingNotify = (g_plugin.getByte(m_hContact, SRMSGSET_TYPING, g_plugin.bTypingNew)); + g_plugin.setByte(m_hContact, SRMSGSET_TYPING, (uint8_t)!typingNotify); Srmm_SetIconFlags(m_hContact, SRMM_MODULE, 1, typingNotify ? MBF_DISABLED : 0); } } diff --git a/plugins/Scriver/src/stdafx.h b/plugins/Scriver/src/stdafx.h index b439a70149..93afc9f910 100644 --- a/plugins/Scriver/src/stdafx.h +++ b/plugins/Scriver/src/stdafx.h @@ -71,14 +71,14 @@ struct CMPlugin : public PLUGIN<CMPlugin> {
HANDLE hLogger;
- CMOption<BYTE> bSavePerContact, bCascade, bStayMinimized, bAutoMin, bSaveDrafts, bDelTemp, bHideContainer, bAutoPopup;
- CMOption<BYTE> bUseTransparency, bTopmost, bAutoClose, bTypingNew, bTypingUnknown;
- CMOption<BYTE> bShowTitleBar, bShowStatusBar, bShowToolBar, bShowInfoBar;
- CMOption<BYTE> bShowAvatar, bShowProgress, bShowIcons, bShowTime, bShowSeconds, bShowDate, bLongDate, bRelativeDate;
- CMOption<BYTE> bGroupMessages, bMarkFollowups, bMsgOnNewline, bDrawLines, bHideNames, bIndentText;
- CMOption<BYTE> bUseTabs, bLimitTabs, bLimitChatTabs, bLimitNames, bSeparateChats, bTabCloseButton, bHideOneTab, bTabsAtBottom, bSwitchToActive;
- CMOption<BYTE> bShowTyping, bShowTypingWin, bShowTypingTray, bShowTypingClist, bShowTypingSwitch;
- CMOption<BYTE> iFlashCount, iHistoryMode;
+ CMOption<uint8_t> bSavePerContact, bCascade, bStayMinimized, bAutoMin, bSaveDrafts, bDelTemp, bHideContainer, bAutoPopup;
+ CMOption<uint8_t> bUseTransparency, bTopmost, bAutoClose, bTypingNew, bTypingUnknown;
+ CMOption<uint8_t> bShowTitleBar, bShowStatusBar, bShowToolBar, bShowInfoBar;
+ CMOption<uint8_t> bShowAvatar, bShowProgress, bShowIcons, bShowTime, bShowSeconds, bShowDate, bLongDate, bRelativeDate;
+ CMOption<uint8_t> bGroupMessages, bMarkFollowups, bMsgOnNewline, bDrawLines, bHideNames, bIndentText;
+ CMOption<uint8_t> bUseTabs, bLimitTabs, bLimitChatTabs, bLimitNames, bSeparateChats, bTabCloseButton, bHideOneTab, bTabsAtBottom, bSwitchToActive;
+ CMOption<uint8_t> bShowTyping, bShowTypingWin, bShowTypingTray, bShowTypingClist, bShowTypingSwitch;
+ CMOption<uint8_t> iFlashCount, iHistoryMode;
CMOption<WORD> iLimitNames, iLimitTabs, iLimitChatTabs, iLoadCount, iLoadTime, iIndentSize, iAutoResizeLines;
CMOption<DWORD> iPopFlags, iMsgTimeout, iActiveAlpha, iInactiveAlpha;
diff --git a/plugins/Scriver/src/tabs.cpp b/plugins/Scriver/src/tabs.cpp index e50c07cff4..2a138e80ee 100644 --- a/plugins/Scriver/src/tabs.cpp +++ b/plugins/Scriver/src/tabs.cpp @@ -342,7 +342,7 @@ void ParentWindowData::SetContainerWindowStyle() ws |= flags2.bUseTransparency ? WS_EX_LAYERED : 0;
SetWindowLongPtr(m_hwnd, GWL_EXSTYLE, ws);
if (flags2.bUseTransparency)
- SetLayeredWindowAttributes(m_hwnd, RGB(255, 255, 255), (BYTE)(255 - g_dat.inactiveAlpha), LWA_ALPHA);
+ SetLayeredWindowAttributes(m_hwnd, RGB(255, 255, 255), (uint8_t)(255 - g_dat.inactiveAlpha), LWA_ALPHA);
ws = GetWindowLongPtr(m_hwndTabs, GWL_STYLE) & ~(TCS_BOTTOM | 0x2000);
if (flags2.bTabsAtBottom)
@@ -1034,7 +1034,7 @@ static INT_PTR CALLBACK DlgProcParentWindow(HWND hwndDlg, UINT msg, WPARAM wPara ws |= dat->flags2.bUseTransparency ? WS_EX_LAYERED : 0;
SetWindowLongPtr(hwndDlg, GWL_EXSTYLE, ws);
if (dat->flags2.bUseTransparency)
- SetLayeredWindowAttributes(hwndDlg, RGB(255, 255, 255), (BYTE)(255 - g_dat.inactiveAlpha), LWA_ALPHA);
+ SetLayeredWindowAttributes(hwndDlg, RGB(255, 255, 255), (uint8_t)(255 - g_dat.inactiveAlpha), LWA_ALPHA);
break;
}
if (dat->m_hwndActive != nullptr) {
@@ -1053,7 +1053,7 @@ static INT_PTR CALLBACK DlgProcParentWindow(HWND hwndDlg, UINT msg, WPARAM wPara SetWindowLongPtr(hwndDlg, GWL_EXSTYLE, ws);
}
if (dat->flags2.bUseTransparency)
- SetLayeredWindowAttributes(hwndDlg, RGB(255, 255, 255), (BYTE)(255 - g_dat.activeAlpha), LWA_ALPHA);
+ SetLayeredWindowAttributes(hwndDlg, RGB(255, 255, 255), (uint8_t)(255 - g_dat.activeAlpha), LWA_ALPHA);
break;
case WM_LBUTTONDOWN:
diff --git a/plugins/SecureIM/src/commonheaders.cpp b/plugins/SecureIM/src/commonheaders.cpp index b0e258eadd..8355b59a75 100644 --- a/plugins/SecureIM/src/commonheaders.cpp +++ b/plugins/SecureIM/src/commonheaders.cpp @@ -18,7 +18,7 @@ int iBmpDepth; BOOL bPGPloaded = false, bPGPkeyrings = false, bUseKeyrings = false, bPGPprivkey = false;
BOOL bGPGloaded = false, bGPGkeyrings = false, bSavePass = false;
BOOL bSFT, bSOM, bASI, bMCD, bSCM, bDGP, bAIP, bNOL, bAAK, bMCM;
-BYTE bPGP, bGPG;
+uint8_t bPGP, bGPG;
mir_cs localQueueMutex;
LPSTR myDBGetStringDecode(MCONTACT hContact, const char *szModule, const char *szSetting)
diff --git a/plugins/SecureIM/src/commonheaders.h b/plugins/SecureIM/src/commonheaders.h index bbd2c7e47d..50c84cf18b 100644 --- a/plugins/SecureIM/src/commonheaders.h +++ b/plugins/SecureIM/src/commonheaders.h @@ -86,7 +86,7 @@ extern int iBmpDepth; extern BOOL bPGPloaded, bPGPkeyrings, bUseKeyrings, bPGPprivkey;
extern BOOL bGPGloaded, bGPGkeyrings, bSavePass;
extern BOOL bSFT, bSOM, bASI, bMCD, bSCM, bDGP, bAIP, bNOL, bAAK, bMCM;
-extern BYTE bPGP, bGPG;
+extern uint8_t bPGP, bGPG;
extern mir_cs localQueueMutex;
__forceinline int SendBroadcast(MCONTACT hContact, int type, int result, HANDLE hProcess, LPARAM lParam)
diff --git a/plugins/SecureIM/src/crypt.h b/plugins/SecureIM/src/crypt.h index a40d3c501c..f774dc9f44 100644 --- a/plugins/SecureIM/src/crypt.h +++ b/plugins/SecureIM/src/crypt.h @@ -42,8 +42,8 @@ struct UinKey MCONTACT hContact; // handle of contact
u_int header; // HEADER
pSupPro proto; // proto struct
- BYTE mode,tmode; // mode: Native,PGP,GPG,RSA/AES,RSA [0..4]
- BYTE status,tstatus; // status: Disabled,Enabled,AlwaysTry [0..2] for Native mode
+ uint8_t mode,tmode; // mode: Native,PGP,GPG,RSA/AES,RSA [0..4]
+ uint8_t status,tstatus; // status: Disabled,Enabled,AlwaysTry [0..2] for Native mode
LPSTR msgSplitted; // message to combine
pPM msgPart; // parts of message
pWM msgQueue; // last messages not sended or to resend;
@@ -56,8 +56,8 @@ struct UinKey BOOL decoded; // false on decode error
short features;
HANDLE cntx; // crypto context
- BYTE keyLoaded; // ( 1-PGP, 2-GPG ) | 1-RSA
- BYTE gpgMode,tgpgMode; // 0-UTF8, 1-ANSI
+ uint8_t keyLoaded; // ( 1-PGP, 2-GPG ) | 1-RSA
+ uint8_t gpgMode,tgpgMode; // 0-UTF8, 1-ANSI
char *lastFileRecv;
char *lastFileSend;
char **fileSend;
@@ -105,7 +105,7 @@ void getContactUinA(MCONTACT hContact, LPSTR szUIN); int getContactStatus(MCONTACT);
bool isSecureProtocol(MCONTACT hContact);
-BYTE isContactSecured(MCONTACT hContact);
+uint8_t isContactSecured(MCONTACT hContact);
bool isClientMiranda(pUinKey ptr, BOOL emptyMirverAsMiranda=FALSE);
bool isClientMiranda(MCONTACT hContact, BOOL emptyMirverAsMiranda=FALSE);
bool isProtoSmallPackets(MCONTACT);
@@ -144,7 +144,7 @@ void showPopupRM(MCONTACT); // crypt_dll.cpp
LPSTR InitKeyA(pUinKey, int);
int InitKeyB(pUinKey, LPCSTR);
-void InitKeyX(pUinKey, BYTE*);
+void InitKeyX(pUinKey, uint8_t*);
BOOL CalculateKeyX(pUinKey, MCONTACT);
LPSTR encodeMsg(pUinKey, LPARAM);
LPSTR decodeMsg(pUinKey, LPARAM, LPSTR);
diff --git a/plugins/SecureIM/src/crypt_check.cpp b/plugins/SecureIM/src/crypt_check.cpp index 1cf85abbff..802b82c32e 100644 --- a/plugins/SecureIM/src/crypt_check.cpp +++ b/plugins/SecureIM/src/crypt_check.cpp @@ -18,7 +18,7 @@ bool isSecureProtocol(MCONTACT hContact) return ptr->inspecting != 0;
}
-BYTE isContactSecured(MCONTACT hContact)
+uint8_t isContactSecured(MCONTACT hContact)
{
// нужна проверка на Offline и в этом случае другие статусы
if (!arClist.getCount()) return 0;
@@ -30,7 +30,7 @@ BYTE isContactSecured(MCONTACT hContact) if (!p || !p->proto || !p->proto->inspecting)
return false;
- BYTE res = p->mode;
+ uint8_t res = p->mode;
DBVARIANT dbv;
switch (p->mode) {
case MODE_NATIVE:
diff --git a/plugins/SecureIM/src/crypt_dll.cpp b/plugins/SecureIM/src/crypt_dll.cpp index 4c023ffe0a..dbf655111f 100644 --- a/plugins/SecureIM/src/crypt_dll.cpp +++ b/plugins/SecureIM/src/crypt_dll.cpp @@ -63,7 +63,7 @@ int InitKeyB(pUinKey ptr, LPCSTR key) // store KeyX into context
-void InitKeyX(pUinKey ptr, BYTE *key)
+void InitKeyX(pUinKey ptr, uint8_t *key)
{
if (!ptr->cntx)
ptr->cntx = cpp_create_context(isProtoSmallPackets(ptr->hContact) ? CPP_MODE_BASE64 : 0);
diff --git a/plugins/SecureIM/src/crypt_icons.cpp b/plugins/SecureIM/src/crypt_icons.cpp index bed0d48ad4..d660c51479 100644 --- a/plugins/SecureIM/src/crypt_icons.cpp +++ b/plugins/SecureIM/src/crypt_icons.cpp @@ -96,7 +96,7 @@ void ShowStatusIcon(MCONTACT hContact) void ShowStatusIconNotify(MCONTACT hContact)
{
- BYTE mode = isContactSecured(hContact);
+ uint8_t mode = isContactSecured(hContact);
NotifyEventHooks(g_hEvent[(mode&SECURED) != 0], hContact, 0);
ShowStatusIcon(hContact, mode);
}
diff --git a/plugins/SecureIM/src/images.cpp b/plugins/SecureIM/src/images.cpp index 60a1af63d1..acf8c3ac7c 100644 --- a/plugins/SecureIM/src/images.cpp +++ b/plugins/SecureIM/src/images.cpp @@ -8,7 +8,7 @@ void HalfBitmap32Alpha(HBITMAP hBitmap) return;
DWORD dwLen = bmp.bmWidth * bmp.bmHeight * (bmp.bmBitsPixel / 8);
- BYTE *p = (BYTE *)malloc(dwLen);
+ uint8_t *p = (uint8_t *)malloc(dwLen);
if (p == nullptr)
return;
memset(p, 0, dwLen);
@@ -16,7 +16,7 @@ void HalfBitmap32Alpha(HBITMAP hBitmap) GetBitmapBits(hBitmap, dwLen, p);
for (int y = 0; y < bmp.bmHeight; ++y) {
- BYTE *px = p + bmp.bmWidth * 4 * y;
+ uint8_t *px = p + bmp.bmWidth * 4 * y;
for (int x = 0; x < bmp.bmWidth; ++x) {
px[3] >>= 1;
@@ -38,7 +38,7 @@ void MakeBmpTransparent(HBITMAP hBitmap) return;
DWORD dwLen = bmp.bmWidth * bmp.bmHeight * (bmp.bmBitsPixel / 8);
- BYTE *p = (BYTE *)malloc(dwLen);
+ uint8_t *p = (uint8_t *)malloc(dwLen);
if (p == nullptr)
return;
@@ -53,7 +53,7 @@ void CorrectBitmap32Alpha(HBITMAP hBitmap, BOOL force) {
BITMAP bmp;
DWORD dwLen;
- BYTE *p;
+ uint8_t *p;
int x, y;
BOOL fixIt;
@@ -63,7 +63,7 @@ void CorrectBitmap32Alpha(HBITMAP hBitmap, BOOL force) return;
dwLen = bmp.bmWidth * bmp.bmHeight * (bmp.bmBitsPixel / 8);
- p = (BYTE *)malloc(dwLen);
+ p = (uint8_t *)malloc(dwLen);
if (p == nullptr)
return;
memset(p, 0, dwLen);
@@ -72,7 +72,7 @@ void CorrectBitmap32Alpha(HBITMAP hBitmap, BOOL force) fixIt = TRUE;
for (y = 0; fixIt && y < bmp.bmHeight; ++y) {
- BYTE *px = p + bmp.bmWidth * 4 * y;
+ uint8_t *px = p + bmp.bmWidth * 4 * y;
for (x = 0; fixIt && x < bmp.bmWidth; ++x) {
if (px[3] != 0 && !force) {
@@ -96,16 +96,16 @@ void CorrectBitmap32Alpha(HBITMAP hBitmap, BOOL force) HBITMAP CopyBitmapTo32(HBITMAP hBitmap)
{
- BYTE * ptPixels;
+ uint8_t * ptPixels;
BITMAP bmp;
DWORD dwLen;
- BYTE *p;
+ uint8_t *p;
GetObject(hBitmap, sizeof(bmp), &bmp);
dwLen = bmp.bmWidth * bmp.bmHeight * 4;
- p = (BYTE *)malloc(dwLen);
+ p = (uint8_t *)malloc(dwLen);
if (p == nullptr)
return nullptr;
@@ -197,8 +197,8 @@ BOOL MakeBitmap32(HBITMAP *hBitmap) BOOL MakeGrayscale(HBITMAP *hBitmap)
{
- BYTE *p = nullptr;
- BYTE *p1;
+ uint8_t *p = nullptr;
+ uint8_t *p1;
DWORD dwLen;
int width, height, x, y;
BITMAP bmp;
@@ -208,7 +208,7 @@ BOOL MakeGrayscale(HBITMAP *hBitmap) height = bmp.bmHeight;
dwLen = width * height * 4;
- p = (BYTE *)malloc(dwLen);
+ p = (uint8_t *)malloc(dwLen);
if (p == nullptr) {
return FALSE;
}
diff --git a/plugins/SecureIM/src/loadicons.cpp b/plugins/SecureIM/src/loadicons.cpp index 5a1eea67a3..3ab3b30c77 100644 --- a/plugins/SecureIM/src/loadicons.cpp +++ b/plugins/SecureIM/src/loadicons.cpp @@ -3,8 +3,8 @@ struct
{
int key; // Resource ID
- BYTE tbl; // Table NUM
- BYTE idx; // Table IDX
+ uint8_t tbl; // Table NUM
+ uint8_t idx; // Table IDX
char *section;
char *name;
char *text;
diff --git a/plugins/SecureIM/src/loadlib.h b/plugins/SecureIM/src/loadlib.h index bed84c019d..cbdab9789a 100644 --- a/plugins/SecureIM/src/loadlib.h +++ b/plugins/SecureIM/src/loadlib.h @@ -22,11 +22,11 @@ typedef int (__cdecl * _cpp_get_features) (HANDLE); typedef int (__cdecl * _cpp_get_error) (HANDLE);
typedef int (__cdecl * _cpp_get_version) (void);
typedef int (__cdecl * _cpp_size_keyx) (void);
-typedef void (__cdecl * _cpp_get_keyx) (HANDLE,BYTE*);
-typedef void (__cdecl * _cpp_set_keyx) (HANDLE,BYTE*);
+typedef void (__cdecl * _cpp_get_keyx) (HANDLE,uint8_t*);
+typedef void (__cdecl * _cpp_set_keyx) (HANDLE,uint8_t*);
typedef int (__cdecl * _cpp_size_keyp) (void);
-typedef void (__cdecl * _cpp_get_keyp) (HANDLE,BYTE*);
-typedef void (__cdecl * _cpp_set_keyp) (HANDLE,BYTE*);
+typedef void (__cdecl * _cpp_get_keyp) (HANDLE,uint8_t*);
+typedef void (__cdecl * _cpp_set_keyp) (HANDLE,uint8_t*);
typedef int (__cdecl * _cpp_keya) (HANDLE);
typedef int (__cdecl * _cpp_keyb) (HANDLE);
typedef int (__cdecl * _cpp_keyx) (HANDLE);
diff --git a/plugins/SecureIM/src/options.cpp b/plugins/SecureIM/src/options.cpp index c0b2880147..a4d6312d95 100644 --- a/plugins/SecureIM/src/options.cpp +++ b/plugins/SecureIM/src/options.cpp @@ -255,7 +255,7 @@ void ListView_Sort(HWND hLV, LPARAM lParamSort) if ((lParamSort & 0x0F) == 0)
lParamSort = (int)g_plugin.getByte(t, lParamSort + 1);
- g_plugin.setByte(t, (BYTE)lParamSort);
+ g_plugin.setByte(t, (uint8_t)lParamSort);
// restore sort order
mir_snprintf(t, "os%02x", (UINT)lParamSort);
@@ -979,7 +979,7 @@ static void RefreshProtoDlg(HWND hDlg) EnableWindow(GetDlgItem(hDlg, IDC_SPLITON), false);
EnableWindow(GetDlgItem(hDlg, IDC_SPLITOFF), false);
- BYTE sha[64]; int len; mir_exp->rsa_get_keyhash(CPP_MODE_RSA, nullptr, nullptr, (uint8_t*)&sha, &len);
+ uint8_t sha[64]; int len; mir_exp->rsa_get_keyhash(CPP_MODE_RSA, nullptr, nullptr, (uint8_t*)&sha, &len);
LPSTR txt = mir_strdup(to_hex(sha, len));
SetDlgItemText(hDlg, IDC_RSA_SHA, txt);
mir_free(txt);
diff --git a/plugins/SecureIM/src/popupOptions.cpp b/plugins/SecureIM/src/popupOptions.cpp index 2091d6294c..5d66fb436f 100644 --- a/plugins/SecureIM/src/popupOptions.cpp +++ b/plugins/SecureIM/src/popupOptions.cpp @@ -108,27 +108,27 @@ INT_PTR CALLBACK PopOptionsDlgProc(HWND hDlg, UINT wMsg, WPARAM wParam, LPARAM l break;
case IDC_EC:
//set ec checkbox value
- g_plugin.setByte("ec", (BYTE)(SendMessage(hec, BM_GETCHECK, 0L, 0L) == BST_CHECKED));
+ g_plugin.setByte("ec", (uint8_t)(SendMessage(hec, BM_GETCHECK, 0L, 0L) == BST_CHECKED));
break;
case IDC_DC:
//set dc checkbox value
- g_plugin.setByte("dc", (BYTE)(SendMessage(hdc, BM_GETCHECK, 0L, 0L) == BST_CHECKED));
+ g_plugin.setByte("dc", (uint8_t)(SendMessage(hdc, BM_GETCHECK, 0L, 0L) == BST_CHECKED));
break;
case IDC_SS:
//set ss checkbox value
- g_plugin.setByte("ss", (BYTE)(SendMessage(hss, BM_GETCHECK, 0L, 0L) == BST_CHECKED));
+ g_plugin.setByte("ss", (uint8_t)(SendMessage(hss, BM_GETCHECK, 0L, 0L) == BST_CHECKED));
break;
case IDC_SR:
//set sr checkbox value
- g_plugin.setByte("sr", (BYTE)(SendMessage(hsr, BM_GETCHECK, 0L, 0L) == BST_CHECKED));
+ g_plugin.setByte("sr", (uint8_t)(SendMessage(hsr, BM_GETCHECK, 0L, 0L) == BST_CHECKED));
break;
case IDC_KS:
//set indicator checkbox value
- g_plugin.setByte("ks", (BYTE)(SendMessage(hks, BM_GETCHECK, 0L, 0L) == BST_CHECKED));
+ g_plugin.setByte("ks", (uint8_t)(SendMessage(hks, BM_GETCHECK, 0L, 0L) == BST_CHECKED));
break;
case IDC_KR:
//set indicator checkbox value
- g_plugin.setByte("kr", (BYTE)(SendMessage(hkr, BM_GETCHECK, 0L, 0L) == BST_CHECKED));
+ g_plugin.setByte("kr", (uint8_t)(SendMessage(hkr, BM_GETCHECK, 0L, 0L) == BST_CHECKED));
break;
case IDC_TIMEKEY:
//set timeout value
diff --git a/plugins/SecureIM/src/secureim.h b/plugins/SecureIM/src/secureim.h index 8962a4a058..41f9f40cad 100644 --- a/plugins/SecureIM/src/secureim.h +++ b/plugins/SecureIM/src/secureim.h @@ -37,7 +37,7 @@ struct SIG {
char *sig;
- BYTE len;
+ uint8_t len;
char key;
};
diff --git a/plugins/SecureIM/src/svcs_menu.cpp b/plugins/SecureIM/src/svcs_menu.cpp index b99b2409fb..ba11869bac 100644 --- a/plugins/SecureIM/src/svcs_menu.cpp +++ b/plugins/SecureIM/src/svcs_menu.cpp @@ -25,7 +25,7 @@ INT_PTR __cdecl Service_Status(WPARAM wParam, LPARAM lParam) case STATUS_ALWAYSTRY:
pUinKey ptr = getUinKey(wParam);
if (ptr) {
- ptr->status = ptr->tstatus = (BYTE)lParam;
+ ptr->status = ptr->tstatus = (uint8_t)lParam;
if (ptr->status == STATUS_ENABLED)
db_unset(ptr->hContact, MODULENAME, "StatusID");
else
@@ -165,8 +165,8 @@ INT_PTR __cdecl Service_Mode(WPARAM wParam, LPARAM lParam) ptr->cntx = nullptr;
ptr->keyLoaded = 0;
}
- ptr->mode = (BYTE)lParam;
- db_set_b(wParam, MODULENAME, "mode", (BYTE)lParam);
+ ptr->mode = (uint8_t)lParam;
+ db_set_b(wParam, MODULENAME, "mode", (uint8_t)lParam);
}
ShowStatusIcon(wParam);
break;
diff --git a/plugins/SecureIM/src/svcs_rsa.cpp b/plugins/SecureIM/src/svcs_rsa.cpp index dac6992713..abf697eee7 100644 --- a/plugins/SecureIM/src/svcs_rsa.cpp +++ b/plugins/SecureIM/src/svcs_rsa.cpp @@ -161,7 +161,7 @@ void sttGenerateRSA(LPVOID) }
// загружает паблик-ключ в RSA контекст
-BYTE loadRSAkey(pUinKey ptr)
+uint8_t loadRSAkey(pUinKey ptr)
{
if (!ptr->keyLoaded) {
DBVARIANT dbv;
diff --git a/plugins/SecureIM/src/svcs_rsa.h b/plugins/SecureIM/src/svcs_rsa.h index c6c84e4c20..5edb7b7af4 100644 --- a/plugins/SecureIM/src/svcs_rsa.h +++ b/plugins/SecureIM/src/svcs_rsa.h @@ -10,7 +10,7 @@ int __cdecl rsa_check_pub(HANDLE, uint8_t*, int, uint8_t*, int); void __cdecl rsa_notify(HANDLE, int);
void sttGenerateRSA(LPVOID);
-BYTE loadRSAkey(pUinKey);
+uint8_t loadRSAkey(pUinKey);
void createRSAcntx(pUinKey);
void resetRSAcntx(pUinKey);
void deleteRSAcntx(pUinKey);
diff --git a/plugins/SeenPlugin/src/history.cpp b/plugins/SeenPlugin/src/history.cpp index 6b88ee8e4a..03ed948e9a 100644 --- a/plugins/SeenPlugin/src/history.cpp +++ b/plugins/SeenPlugin/src/history.cpp @@ -274,7 +274,7 @@ INT_PTR CALLBACK HistoryDlgProc(HWND hwndDlg, UINT Message, WPARAM wparam, LPARA return FALSE;
}
-void ShowHistory(MCONTACT hContact, BYTE isAlert)
+void ShowHistory(MCONTACT hContact, uint8_t isAlert)
{
HWND hHistoryDlg = WindowList_Find(hWindowList, hContact);
if (hHistoryDlg == nullptr) {
diff --git a/plugins/SeenPlugin/src/stdafx.h b/plugins/SeenPlugin/src/stdafx.h index af9f7c8354..5c48418d44 100644 --- a/plugins/SeenPlugin/src/stdafx.h +++ b/plugins/SeenPlugin/src/stdafx.h @@ -101,7 +101,7 @@ struct CMPlugin : public PLUGIN<CMPlugin> typedef struct{
int count;
WPARAM wpcontact[1024];
- BYTE times[1024];
+ uint8_t times[1024];
} MISSEDCONTACTS;
int IsWatchedProtocol(const char* szProto);
@@ -115,7 +115,7 @@ int UpdateValues(WPARAM, LPARAM); int ModeChange(WPARAM,LPARAM);
int ModeChange_mo(WPARAM,LPARAM);
int CheckIfOnline(void);
-void ShowHistory(MCONTACT hContact, BYTE isAlert);
+void ShowHistory(MCONTACT hContact, uint8_t isAlert);
void InitFileOutput(void);
void UninitFileOutput(void);
diff --git a/plugins/SeenPlugin/src/utils.cpp b/plugins/SeenPlugin/src/utils.cpp index 0114ea022b..53014d3ef1 100644 --- a/plugins/SeenPlugin/src/utils.cpp +++ b/plugins/SeenPlugin/src/utils.cpp @@ -457,7 +457,7 @@ static void waitThread(logthread_info* infoParam) if (infoParam->currStatus != prevStatus) {
g_plugin.setWord(infoParam->hContact, "OldStatus", (WORD)(prevStatus | 0x8000));
if (includeIdle)
- g_plugin.setByte(infoParam->hContact, "OldIdle", (BYTE)((prevStatus & 0x8000) == 0));
+ g_plugin.setByte(infoParam->hContact, "OldIdle", (uint8_t)((prevStatus & 0x8000) == 0));
g_plugin.setWord(infoParam->hContact, "StatusTriger", infoParam->currStatus);
}
@@ -588,7 +588,7 @@ static void cleanThread(logthread_info* infoParam) if (db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE) == ID_STATUS_OFFLINE) {
g_plugin.setWord(hContact, "OldStatus", (WORD)(oldStatus | 0x8000));
if (includeIdle)
- g_plugin.setByte(hContact, "OldIdle", (BYTE)((oldStatus & 0x8000) ? 0 : 1));
+ g_plugin.setByte(hContact, "OldIdle", (uint8_t)((oldStatus & 0x8000) ? 0 : 1));
g_plugin.setWord(hContact, "StatusTriger", ID_STATUS_OFFLINE);
}
}
diff --git a/plugins/SendScreenshotPlus/src/CSend.h b/plugins/SendScreenshotPlus/src/CSend.h index 19c34447da..1f5d106bdd 100644 --- a/plugins/SendScreenshotPlus/src/CSend.h +++ b/plugins/SendScreenshotPlus/src/CSend.h @@ -65,7 +65,7 @@ public: void SetContact(MCONTACT hContact); const char* GetURL() { return m_URL; } const char* GetURLthumbnail() {return m_URLthumb; } - BYTE GetEnableItem() {return m_EnableItem;}; + uint8_t GetEnableItem() {return m_EnableItem;}; wchar_t* GetErrorMsg() {return m_ErrorMsg;}; bool m_bDeleteAfterSend; @@ -81,8 +81,8 @@ protected: wchar_t* m_pszSendTyp; // hold string for error mess char* m_pszProto; // Contact Proto Module MCONTACT m_hContact; // Contact handle - BYTE m_EnableItem; // hold flag for send type - BYTE m_ChatRoom; // is Contact chatroom + uint8_t m_EnableItem; // hold flag for send type + uint8_t m_ChatRoom; // is Contact chatroom void Error(LPCTSTR pszFormat, ...); void svcSendFileExit(); diff --git a/plugins/SendScreenshotPlus/src/UMainForm.cpp b/plugins/SendScreenshotPlus/src/UMainForm.cpp index 8f4be619cb..bf41b3a463 100644 --- a/plugins/SendScreenshotPlus/src/UMainForm.cpp +++ b/plugins/SendScreenshotPlus/src/UMainForm.cpp @@ -407,14 +407,14 @@ void TfrmMain::wmCommand(WPARAM wParam, LPARAM lParam) this->Close(); break; case ID_chkTimed: - m_opt_chkTimed = (BYTE)Button_GetCheck((HWND)lParam); + m_opt_chkTimed = (uint8_t)Button_GetCheck((HWND)lParam); TfrmMain::chkTimedClick(); break; case ID_chkIndirectCapture: - m_opt_chkIndirectCapture = (BYTE)Button_GetCheck((HWND)lParam); + m_opt_chkIndirectCapture = (uint8_t)Button_GetCheck((HWND)lParam); break; case ID_chkClientArea: - m_opt_chkClientArea = (BYTE)Button_GetCheck((HWND)lParam); + m_opt_chkClientArea = (uint8_t)Button_GetCheck((HWND)lParam); if (m_hTargetWindow) edtSizeUpdate(m_hTargetWindow, m_opt_chkClientArea, GetParent((HWND)lParam), ID_edtSize); break; @@ -454,7 +454,7 @@ void TfrmMain::wmCommand(WPARAM wParam, LPARAM lParam) case CBN_SELCHANGE: // ComboBox controls switch (IDControl) { // lParam = Handle to the control case ID_cboxFormat: // not finish - m_opt_cboxFormat = (BYTE)ComboBox_GetItemData((HWND)lParam, ComboBox_GetCurSel((HWND)lParam)); + m_opt_cboxFormat = (uint8_t)ComboBox_GetItemData((HWND)lParam, ComboBox_GetCurSel((HWND)lParam)); break; case ID_cboxSendBy: { @@ -465,7 +465,7 @@ void TfrmMain::wmCommand(WPARAM wParam, LPARAM lParam) break; case ID_edtCaption: // cboxDesktopChange - m_opt_cboxDesktop = (BYTE)ComboBox_GetItemData((HWND)lParam, ComboBox_GetCurSel((HWND)lParam)); + m_opt_cboxDesktop = (uint8_t)ComboBox_GetItemData((HWND)lParam, ComboBox_GetCurSel((HWND)lParam)); m_hTargetWindow = nullptr; if (m_opt_cboxDesktop > 0) { edtSizeUpdate(m_Monitors[m_opt_cboxDesktop - 1].rcMonitor, GetParent((HWND)lParam), ID_edtSize); @@ -480,10 +480,10 @@ void TfrmMain::wmCommand(WPARAM wParam, LPARAM lParam) case EN_CHANGE: // Edit controls switch (IDControl) { // lParam = Handle to the control case ID_edtQuality: - m_opt_edtQuality = (BYTE)GetDlgItemInt(m_hWnd, ID_edtQuality, nullptr, FALSE); + m_opt_edtQuality = (uint8_t)GetDlgItemInt(m_hWnd, ID_edtQuality, nullptr, FALSE); break; case ID_edtTimed: - m_opt_edtTimed = (BYTE)GetDlgItemInt(m_hWnd, ID_edtTimed, nullptr, FALSE); + m_opt_edtTimed = (uint8_t)GetDlgItemInt(m_hWnd, ID_edtTimed, nullptr, FALSE); break; } break; @@ -852,7 +852,7 @@ void TfrmMain::cboxSendByChange(void *param) { BOOL bState; HICON hIcon; - BYTE itemFlag = SS_DLG_DESCRIPTION; + uint8_t itemFlag = SS_DLG_DESCRIPTION; if (m_cSend) delete m_cSend; switch (m_opt_cboxSendBy) { diff --git a/plugins/SendScreenshotPlus/src/UMainForm.h b/plugins/SendScreenshotPlus/src/UMainForm.h index 373fc18f34..3f32a6c90a 100644 --- a/plugins/SendScreenshotPlus/src/UMainForm.h +++ b/plugins/SendScreenshotPlus/src/UMainForm.h @@ -41,11 +41,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. struct UPLOAD_INFO { - BYTE sendBy; //SS_* + uint8_t sendBy; //SS_* void *param; - UPLOAD_INFO(BYTE sb) : sendBy(sb), param(nullptr) { } - UPLOAD_INFO(BYTE sb, void *p) : sendBy(sb), param(p) { } + UPLOAD_INFO(uint8_t sb) : sendBy(sb), param(nullptr) { } + UPLOAD_INFO(uint8_t sb, void *p) : sendBy(sb), param(p) { } }; // Used for our own cheap TrackMouseEvent @@ -74,12 +74,12 @@ public: TfrmMain(); ~TfrmMain(); - BYTE m_opt_tabCapture; // capture tab page - BYTE m_opt_cboxDesktop; // TRadioButton *rbtnDesktop; - BYTE m_opt_chkTimed; // TCheckBox *chkTimed; - BYTE m_opt_cboxSendBy; // TComboBox *cboxSendBy; - BYTE m_opt_btnDesc; // TCheckBox *chkDesc; - BYTE m_opt_chkEditor; // TCheckBox *chkEditor; + uint8_t m_opt_tabCapture; // capture tab page + uint8_t m_opt_cboxDesktop; // TRadioButton *rbtnDesktop; + uint8_t m_opt_chkTimed; // TCheckBox *chkTimed; + uint8_t m_opt_cboxSendBy; // TComboBox *cboxSendBy; + uint8_t m_opt_btnDesc; // TCheckBox *chkDesc; + uint8_t m_opt_chkEditor; // TCheckBox *chkEditor; bool m_bOnExitSave; static void Unload(); @@ -116,13 +116,13 @@ protected: size_t m_MonitorCount; RECT m_VirtualScreen; - BYTE m_opt_chkOpenAgain; // TCheckBox *chkOpenAgain; - BYTE m_opt_chkIndirectCapture; // TCheckBox *chkIndirectCapture; - BYTE m_opt_chkClientArea; // TCheckBox *chkClientArea; - BYTE m_opt_edtQuality; // TLabeledEdit *edtQuality; + uint8_t m_opt_chkOpenAgain; // TCheckBox *chkOpenAgain; + uint8_t m_opt_chkIndirectCapture; // TCheckBox *chkIndirectCapture; + uint8_t m_opt_chkClientArea; // TCheckBox *chkClientArea; + uint8_t m_opt_edtQuality; // TLabeledEdit *edtQuality; bool m_opt_btnDeleteAfterSend; // TCheckBox *chkDeleteAfterSend; - BYTE m_opt_cboxFormat; // TComboBox *cboxFormat; - BYTE m_opt_edtTimed; // TLabeledEdit *edtTimed; + uint8_t m_opt_cboxFormat; // TComboBox *cboxFormat; + uint8_t m_opt_edtTimed; // TLabeledEdit *edtTimed; bool m_bCapture; // is capture active HWND m_hwndTab; // TabControl handle HWND m_hwndTabPage; // TabControl activ page handle diff --git a/plugins/SendScreenshotPlus/src/Utils.cpp b/plugins/SendScreenshotPlus/src/Utils.cpp index 6f1428d55d..27e095c424 100644 --- a/plugins/SendScreenshotPlus/src/Utils.cpp +++ b/plugins/SendScreenshotPlus/src/Utils.cpp @@ -213,7 +213,7 @@ FIBITMAP* CreateDIBFromDC(HDC hDC, const RECT* rect, HWND hCapture/*=NULL*/) HRGN hRgn = CreateRectRgn(0, 0, 0, 0); if (hCapture && GetWindowRgn(hCapture, hRgn) == ERROR) { if ((GetWindowLongPtr(hCapture, GWL_EXSTYLE)&WS_EX_LAYERED)) { - BYTE bAlpha = 0; + uint8_t bAlpha = 0; COLORREF crKey = 0x00000000; DWORD dwFlags = 0; if (GetLayeredWindowAttributes(hCapture, &crKey, &bAlpha, &dwFlags)) { diff --git a/plugins/SendScreenshotPlus/src/ctrl_button.cpp b/plugins/SendScreenshotPlus/src/ctrl_button.cpp index e36dfc347f..3cfb3a14ec 100644 --- a/plugins/SendScreenshotPlus/src/ctrl_button.cpp +++ b/plugins/SendScreenshotPlus/src/ctrl_button.cpp @@ -37,7 +37,7 @@ typedef struct TMBCtrl HFONT hFont; // font DWORD dwStyle; - BYTE bFocus; + uint8_t bFocus; int stateId; // button state int defbutton; // default button @@ -604,7 +604,7 @@ static LRESULT CALLBACK Button_WndProc(HWND hwndBtn, UINT uMsg, WPARAM wParam, L case WM_LBUTTONUP: if (bct->stateId != PBS_DISABLED) { // don't change states if disabled - BYTE bPressed = bct->stateId == PBS_PRESSED; + uint8_t bPressed = bct->stateId == PBS_PRESSED; if (bct->dwStyle & MBS_PUSHBUTTON) { if (bct->pbState) bct->pbState = 0; diff --git a/plugins/Sessions/Src/Options.cpp b/plugins/Sessions/Src/Options.cpp index 9188c7e817..1fb44c7f21 100644 --- a/plugins/Sessions/Src/Options.cpp +++ b/plugins/Sessions/Src/Options.cpp @@ -254,7 +254,7 @@ public: {
int iDelay = GetDlgItemInt(m_hwnd, IDC_STARTDELAY, nullptr, FALSE);
g_plugin.setWord("StartupModeDelay", (WORD)iDelay);
- g_plugin.setByte("TrackCount", (BYTE)(g_ses_limit = GetDlgItemInt(m_hwnd, IDC_TRACK, nullptr, FALSE)));
+ g_plugin.setByte("TrackCount", (uint8_t)(g_ses_limit = GetDlgItemInt(m_hwnd, IDC_TRACK, nullptr, FALSE)));
if (chkExitSave.IsChecked())
g_plugin.setByte("ShutdownMode", 2);
else if (IsDlgButtonChecked(m_hwnd, IDC_REXDSAVE))
@@ -273,10 +273,10 @@ public: else if (chkNothing.IsChecked())
g_plugin.setByte("StartupMode", 0);
- g_plugin.setByte("ExclHidden", (BYTE)(IsDlgButtonChecked(m_hwnd, IDC_EXCLHIDDEN) ? (g_bExclHidden = 1) : (g_bExclHidden = 0)));
- g_plugin.setByte("WarnOnHidden", (BYTE)(IsDlgButtonChecked(m_hwnd, IDC_LASTHIDDENWARN) ? (g_bWarnOnHidden = 1) : (g_bWarnOnHidden = 0)));
- g_plugin.setByte("OtherWarnings", (BYTE)(IsDlgButtonChecked(m_hwnd, IDC_WARNINGS) ? (g_bOtherWarnings = 1) : (g_bOtherWarnings = 0)));
- g_plugin.setByte("CrashRecovery", (BYTE)(IsDlgButtonChecked(m_hwnd, IDC_CRASHRECOVERY) ? (g_bCrashRecovery = 1) : (g_bCrashRecovery = 0)));
+ g_plugin.setByte("ExclHidden", (uint8_t)(IsDlgButtonChecked(m_hwnd, IDC_EXCLHIDDEN) ? (g_bExclHidden = 1) : (g_bExclHidden = 0)));
+ g_plugin.setByte("WarnOnHidden", (uint8_t)(IsDlgButtonChecked(m_hwnd, IDC_LASTHIDDENWARN) ? (g_bWarnOnHidden = 1) : (g_bWarnOnHidden = 0)));
+ g_plugin.setByte("OtherWarnings", (uint8_t)(IsDlgButtonChecked(m_hwnd, IDC_WARNINGS) ? (g_bOtherWarnings = 1) : (g_bOtherWarnings = 0)));
+ g_plugin.setByte("CrashRecovery", (uint8_t)(IsDlgButtonChecked(m_hwnd, IDC_CRASHRECOVERY) ? (g_bCrashRecovery = 1) : (g_bCrashRecovery = 0)));
return true;
}
@@ -376,7 +376,7 @@ public: void onClick_Save(CCtrlButton *)
{
for (auto &hContact : Contacts()) {
- BYTE res = m_clist.GetCheck(m_clist.FindContact(hContact));
+ uint8_t res = m_clist.GetCheck(m_clist.FindContact(hContact));
if (res) {
// !!!!!!!!!!!!!!!!!!!
}
diff --git a/plugins/Sessions/Src/SaveSessions.cpp b/plugins/Sessions/Src/SaveSessions.cpp index 457b224c21..75dd36ddb1 100644 --- a/plugins/Sessions/Src/SaveSessions.cpp +++ b/plugins/Sessions/Src/SaveSessions.cpp @@ -110,7 +110,7 @@ public: if (chkSelContacts.IsChecked() && bSC) { int i = 0; for (auto &hContact : Contacts()) { - BYTE res = m_clist.GetCheck(m_clist.FindContact(hContact)); + uint8_t res = m_clist.GetCheck(m_clist.FindContact(hContact)); if (res) { user_session_list[i] = hContact; i++; diff --git a/plugins/ShellExt/src/shlcom.h b/plugins/ShellExt/src/shlcom.h index f96465db96..0f441cc372 100644 --- a/plugins/ShellExt/src/shlcom.h +++ b/plugins/ShellExt/src/shlcom.h @@ -84,7 +84,7 @@ struct TSlotProtoIcons struct TSlotIPC
{
- BYTE cbSize;
+ uint8_t cbSize;
int fType; // a REQUEST_* type
TSlotIPC* Next;
MCONTACT hContact;
@@ -92,7 +92,7 @@ struct TSlotIPC UINT hGroup; // hash of the entire path (not defined for REQUEST_GROUPS slots)
WORD Status;
// only used for contacts -- can be STATUS_PROFILENAME -- but that is because returning the profile name is optional
- BYTE MRU; // if set, contact has been recently used
+ uint8_t MRU; // if set, contact has been recently used
int cbStrSection;
};
diff --git a/plugins/SimpleAR/src/Options.cpp b/plugins/SimpleAR/src/Options.cpp index 9ffef53047..3ee6c97ab5 100644 --- a/plugins/SimpleAR/src/Options.cpp +++ b/plugins/SimpleAR/src/Options.cpp @@ -80,7 +80,7 @@ INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara BOOL translated;
BOOL fEnabled = IsDlgButtonChecked(hwndDlg, IDC_ENABLEREPLIER) == 1;
- g_plugin.setByte(KEY_ENABLED, (BYTE)fEnabled);
+ g_plugin.setByte(KEY_ENABLED, (uint8_t)fEnabled);
if (fEnabled)
Menu_ModifyItem(hEnableMenu, LPGENW("Disable Auto&reply"), iconList[0].hIcolib);
diff --git a/plugins/SimpleStatusMsg/src/options.cpp b/plugins/SimpleStatusMsg/src/options.cpp index 37bb197a73..9ae0f1de41 100644 --- a/plugins/SimpleStatusMsg/src/options.cpp +++ b/plugins/SimpleStatusMsg/src/options.cpp @@ -870,7 +870,7 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l for (int i = ID_STATUS_ONLINE; i <= ID_STATUS_MAX; i++) {
if (accounts->statusMsgFlags & Proto_Status2Flag(i)) {
db_set_ws(0, "SRAway", StatusModeToDbSetting(i, "Default"), data->status_msg[0].msg[i - ID_STATUS_ONLINE]);
- g_plugin.setByte(StatusModeToDbSetting(i, "Flags"), (BYTE)data->status_msg[0].flags[i - ID_STATUS_ONLINE]);
+ g_plugin.setByte(StatusModeToDbSetting(i, "Flags"), (uint8_t)data->status_msg[0].flags[i - ID_STATUS_ONLINE]);
for (int j = 0; j < accounts->count; j++) {
auto *pa = accounts->pa[j];
@@ -885,16 +885,16 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l db_set_ws(0, "SRAway", StatusModeToDbSetting(i, szSetting), data->status_msg[j + 1].msg[i - ID_STATUS_ONLINE]);
mir_snprintf(szSetting, "%sFlags", pa->szModuleName);
- g_plugin.setByte(StatusModeToDbSetting(i, szSetting), (BYTE)data->status_msg[j + 1].flags[i - ID_STATUS_ONLINE]);
+ g_plugin.setByte(StatusModeToDbSetting(i, szSetting), (uint8_t)data->status_msg[j + 1].flags[i - ID_STATUS_ONLINE]);
}
}
}
}
- g_plugin.setByte("PutDefInList", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_COPTMSG2) == BST_CHECKED));
+ g_plugin.setByte("PutDefInList", (uint8_t)(IsDlgButtonChecked(hwndDlg, IDC_COPTMSG2) == BST_CHECKED));
if (data->proto_ok) {
- g_plugin.setByte("ProtoFlags", (BYTE)data->proto_msg[0].flags);
+ g_plugin.setByte("ProtoFlags", (uint8_t)data->proto_msg[0].flags);
for (int i = 0; i < accounts->count; i++) {
auto *pa = accounts->pa[i];
@@ -917,7 +917,7 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l g_plugin.setWord(szSetting, (WORD)data->proto_msg[i + 1].max_length);
mir_snprintf(szSetting, "Proto%sFlags", pa->szModuleName);
- g_plugin.setByte(szSetting, (BYTE)data->proto_msg[i + 1].flags);
+ g_plugin.setByte(szSetting, (uint8_t)data->proto_msg[i + 1].flags);
}
}
RebuildStatusMenu();
@@ -1011,19 +1011,19 @@ static INT_PTR CALLBACK DlgVariablesOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM g_plugin.setWord("UpdateMsgInt", (WORD)val);
if (IsDlgButtonChecked(hwndDlg, IDC_CUPDATEMSG) == BST_CHECKED && val) {
- g_plugin.setByte("UpdateMsgOn", (BYTE)1);
+ g_plugin.setByte("UpdateMsgOn", (uint8_t)1);
g_uUpdateMsgTimer = SetTimer(nullptr, 0, val * 1000, (TIMERPROC)UpdateMsgTimerProc);
}
else {
- g_plugin.setByte("UpdateMsgOn", (BYTE)0);
+ g_plugin.setByte("UpdateMsgOn", (uint8_t)0);
}
- g_plugin.setByte("NoUpdateOnIdle", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CNOIDLE) == BST_CHECKED));
- g_plugin.setByte("NoUpdateOnICQReq", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CNOICQREQ) == BST_CHECKED));
- g_plugin.setByte("AmpLeaveTitle", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CLEAVEWINAMP) == BST_CHECKED));
+ g_plugin.setByte("NoUpdateOnIdle", (uint8_t)(IsDlgButtonChecked(hwndDlg, IDC_CNOIDLE) == BST_CHECKED));
+ g_plugin.setByte("NoUpdateOnICQReq", (uint8_t)(IsDlgButtonChecked(hwndDlg, IDC_CNOICQREQ) == BST_CHECKED));
+ g_plugin.setByte("AmpLeaveTitle", (uint8_t)(IsDlgButtonChecked(hwndDlg, IDC_CLEAVEWINAMP) == BST_CHECKED));
if (ServiceExists(MS_VARS_FORMATSTRING)) {
- g_plugin.setByte("EnableVariables", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CVARIABLES) == BST_CHECKED));
- g_plugin.setByte("ExclDateToken", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CDATEPARSING) == BST_CHECKED));
+ g_plugin.setByte("EnableVariables", (uint8_t)(IsDlgButtonChecked(hwndDlg, IDC_CVARIABLES) == BST_CHECKED));
+ g_plugin.setByte("ExclDateToken", (uint8_t)(IsDlgButtonChecked(hwndDlg, IDC_CDATEPARSING) == BST_CHECKED));
}
return TRUE;
}
@@ -1249,14 +1249,14 @@ static INT_PTR CALLBACK DlgAdvancedOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM w if (curSel != CB_ERR)
flags |= SendDlgItemMessage(hwndDlg, IDC_CBOPTBUTTONS, CB_GETITEMDATA, (WPARAM)curSel, 0);
- g_plugin.setByte("DlgFlags", (BYTE)flags);
+ g_plugin.setByte("DlgFlags", (uint8_t)flags);
// Misc.
- g_plugin.setByte("MaxHist", (BYTE)GetDlgItemInt(hwndDlg, IDC_EMAXHIST, nullptr, FALSE));
- g_plugin.setByte("AutoClose", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CCLOSEWND) == BST_CHECKED));
- g_plugin.setByte("DlgTime", (BYTE)GetDlgItemInt(hwndDlg, IDC_ETIMEOUT, nullptr, FALSE));
- g_plugin.setByte("WinCentered", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CRPOSWND) != BST_CHECKED));
- g_plugin.setByte("RemoveCR", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CREMOVECR) == BST_CHECKED));
+ g_plugin.setByte("MaxHist", (uint8_t)GetDlgItemInt(hwndDlg, IDC_EMAXHIST, nullptr, FALSE));
+ g_plugin.setByte("AutoClose", (uint8_t)(IsDlgButtonChecked(hwndDlg, IDC_CCLOSEWND) == BST_CHECKED));
+ g_plugin.setByte("DlgTime", (uint8_t)GetDlgItemInt(hwndDlg, IDC_ETIMEOUT, nullptr, FALSE));
+ g_plugin.setByte("WinCentered", (uint8_t)(IsDlgButtonChecked(hwndDlg, IDC_CRPOSWND) != BST_CHECKED));
+ g_plugin.setByte("RemoveCR", (uint8_t)(IsDlgButtonChecked(hwndDlg, IDC_CREMOVECR) == BST_CHECKED));
RebuildStatusMenu();
return TRUE;
@@ -1465,8 +1465,8 @@ static INT_PTR CALLBACK DlgStatusOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wPa g_plugin.setWord(szSetting, (WORD)data->setdelay[i]);
}
g_plugin.setWord("SetStatusDelay", (WORD)data->setglobaldelay);
- g_plugin.setByte("GlobalStatusDelay", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_SPECSET) != BST_CHECKED));
- g_plugin.setByte("StartupPopupDlg", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_POPUPDLG) == BST_CHECKED));
+ g_plugin.setByte("GlobalStatusDelay", (uint8_t)(IsDlgButtonChecked(hwndDlg, IDC_SPECSET) != BST_CHECKED));
+ g_plugin.setByte("StartupPopupDlg", (uint8_t)(IsDlgButtonChecked(hwndDlg, IDC_POPUPDLG) == BST_CHECKED));
return TRUE;
}
break;
diff --git a/plugins/SmileyAdd/src/download.cpp b/plugins/SmileyAdd/src/download.cpp index 5834fae432..da89352913 100644 --- a/plugins/SmileyAdd/src/download.cpp +++ b/plugins/SmileyAdd/src/download.cpp @@ -156,8 +156,8 @@ void __cdecl SmileyDownloadThread(void*) bool GetSmileyFile(CMStringW &url, const CMStringW &packstr)
{
- BYTE hash[MIR_SHA1_HASH_SIZE];
- mir_sha1_hash((BYTE*)url.c_str(), url.GetLength() * sizeof(wchar_t), hash);
+ uint8_t hash[MIR_SHA1_HASH_SIZE];
+ mir_sha1_hash((uint8_t*)url.c_str(), url.GetLength() * sizeof(wchar_t), hash);
wchar_t wszHash[MIR_SHA1_HASH_SIZE * 2 + 1];
bin2hexW(hash, sizeof(hash), wszHash);
diff --git a/plugins/Spamotron/src/bayes.cpp b/plugins/Spamotron/src/bayes.cpp index 9b6c1874a7..b9a9fe376b 100644 --- a/plugins/Spamotron/src/bayes.cpp +++ b/plugins/Spamotron/src/bayes.cpp @@ -96,9 +96,9 @@ int OpenBayes() return 0;
}
-char *tokenhash(const char *token, BYTE *digest)
+char *tokenhash(const char *token, uint8_t *digest)
{
- mir_md5_hash((BYTE *)token, (int)mir_strlen(token), digest);
+ mir_md5_hash((uint8_t *)token, (int)mir_strlen(token), digest);
return (char*)digest;
}
@@ -160,7 +160,7 @@ int get_token_score(int type, char *token) {
char sql[200];
int score = 0;
- BYTE digest[16];
+ uint8_t digest[16];
sqlite3_stmt *stmt;
if (bayesdb == nullptr)
@@ -309,7 +309,7 @@ void dequeue_messages() void learn(int type, wchar_t *msg)
{
char *tok, *message;
- BYTE digest[16];
+ uint8_t digest[16];
char sql_select[200], sql_update[200], sql_insert[200], sql_counter[200];
sqlite3_stmt *stmt;
#ifdef _DEBUG
diff --git a/plugins/Spamotron/src/popups.cpp b/plugins/Spamotron/src/popups.cpp index c5cdcbe5f0..70336e9bd8 100644 --- a/plugins/Spamotron/src/popups.cpp +++ b/plugins/Spamotron/src/popups.cpp @@ -143,7 +143,7 @@ INT_PTR CALLBACK DlgProcOptionsPopups(HWND optDlg, UINT msg, WPARAM wParam, LPAR return FALSE;
}
-int ShowPopupPreview(HWND optDlg, BYTE popupType, wchar_t *line1, wchar_t *line2)
+int ShowPopupPreview(HWND optDlg, uint8_t popupType, wchar_t *line1, wchar_t *line2)
{
POPUPDATAW ppd;
switch (popupType)
@@ -191,7 +191,7 @@ int ShowPopupPreview(HWND optDlg, BYTE popupType, wchar_t *line1, wchar_t *line2 return (int)PUAddPopupW(&ppd);
}
-int ShowPopup(MCONTACT hContact, BYTE popupType, wchar_t *line1, wchar_t *line2)
+int ShowPopup(MCONTACT hContact, uint8_t popupType, wchar_t *line1, wchar_t *line2)
{
POPUPDATAW ppd;
switch (popupType)
diff --git a/plugins/Spamotron/src/stdafx.h b/plugins/Spamotron/src/stdafx.h index a046076b0e..98a18700c7 100644 --- a/plugins/Spamotron/src/stdafx.h +++ b/plugins/Spamotron/src/stdafx.h @@ -94,9 +94,9 @@ BOOL Contains(wchar_t* dst, wchar_t* src); BOOL isOneDay(DWORD timestamp1, DWORD timestamp2);
void MarkUnread(MCONTACT hContact);
-int ShowPopup(MCONTACT hContact, BYTE popupType, wchar_t *line1, wchar_t *line2);
-int ShowPopupPreview(HWND optDlg, BYTE popupType, wchar_t *line1, wchar_t *line2);
-int _notify(MCONTACT hContact, BYTE type, wchar_t *message, wchar_t *origmessage);
+int ShowPopup(MCONTACT hContact, uint8_t popupType, wchar_t *line1, wchar_t *line2);
+int ShowPopupPreview(HWND optDlg, uint8_t popupType, wchar_t *line1, wchar_t *line2);
+int _notify(MCONTACT hContact, uint8_t type, wchar_t *message, wchar_t *origmessage);
int LogToSystemHistory(char *message, char *origmessage);
#define POPUP_DEFAULT 0
#define POPUP_BLOCKED 1
diff --git a/plugins/Spamotron/src/utils.cpp b/plugins/Spamotron/src/utils.cpp index d34d7ee5f7..c29132d7b7 100644 --- a/plugins/Spamotron/src/utils.cpp +++ b/plugins/Spamotron/src/utils.cpp @@ -423,7 +423,7 @@ err_out: return dst; } -int _notify(MCONTACT hContact, BYTE type, wchar_t *message, wchar_t *origmessage) +int _notify(MCONTACT hContact, uint8_t type, wchar_t *message, wchar_t *origmessage) { char *tmp, *tmporig; wchar_t msg[MAX_BUFFER_LENGTH]; diff --git a/plugins/StartPosition/src/options.h b/plugins/StartPosition/src/options.h index f6fcea4324..f903e37580 100644 --- a/plugins/StartPosition/src/options.h +++ b/plugins/StartPosition/src/options.h @@ -19,13 +19,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include "stdafx.h" -enum ClistAlign : BYTE +enum ClistAlign : uint8_t { left, right }; -enum ClistState : BYTE +enum ClistState : uint8_t { hidden, minimized, @@ -34,8 +34,8 @@ enum ClistState : BYTE struct ClistOptions { - CMOption<BYTE> isDocked; - CMOption<BYTE> state; + CMOption<uint8_t> isDocked; + CMOption<uint8_t> state; CMOption<DWORD> x; CMOption<DWORD> y; @@ -54,13 +54,13 @@ struct ClistOptions struct StartPositionOptions { - CMOption<BYTE> setTopPosition; - CMOption<BYTE> setBottomPosition; - CMOption<BYTE> setSidePosition; - CMOption<BYTE> clistAlign; - CMOption<BYTE> setClistWidth; - CMOption<BYTE> setClistStartState; - CMOption<BYTE> clistState; + CMOption<uint8_t> setTopPosition; + CMOption<uint8_t> setBottomPosition; + CMOption<uint8_t> setSidePosition; + CMOption<uint8_t> clistAlign; + CMOption<uint8_t> setClistWidth; + CMOption<uint8_t> setClistStartState; + CMOption<uint8_t> clistState; CMOption<DWORD> pixelsFromTop; CMOption<DWORD> pixelsFromBottom; diff --git a/plugins/StartPosition/src/startposition.cpp b/plugins/StartPosition/src/startposition.cpp index 75f0634117..086ceab000 100644 --- a/plugins/StartPosition/src/startposition.cpp +++ b/plugins/StartPosition/src/startposition.cpp @@ -14,7 +14,7 @@ void CMPlugin::positionClist() ClistOptions clOptions; if (spOptions.setClistStartState) - clOptions.state = static_cast<BYTE>(spOptions.clistState); + clOptions.state = static_cast<uint8_t>(spOptions.clistState); if (spOptions.setClistWidth && spOptions.clistWidth > 0) clOptions.width = static_cast<DWORD>(spOptions.clistWidth); diff --git a/plugins/StartupSilence/src/main.cpp b/plugins/StartupSilence/src/main.cpp index 2b524c864d..e7faaeecee 100644 --- a/plugins/StartupSilence/src/main.cpp +++ b/plugins/StartupSilence/src/main.cpp @@ -29,16 +29,16 @@ CMPlugin g_plugin; HANDLE hTTBarloaded = nullptr;
HANDLE Buttons = nullptr;
-BYTE Enabled;
+uint8_t Enabled;
DWORD delay;
-BYTE PopUp;
+uint8_t PopUp;
DWORD PopUpTime;
-BYTE TTBButtons;
-BYTE DefSound;
-BYTE DefPopup;
-BYTE DefEnabled;
-BYTE NonStatusAllow;
-BYTE timer;
+uint8_t TTBButtons;
+uint8_t DefSound;
+uint8_t DefPopup;
+uint8_t DefEnabled;
+uint8_t NonStatusAllow;
+uint8_t timer;
char hostname[MAX_PATH] = "";
char EnabledComp[MAX_PATH] = "";
char DelayComp[MAX_PATH] = "";
@@ -218,7 +218,7 @@ static INT_PTR StartupSilenceEnabled(WPARAM, LPARAM) static INT_PTR SilenceConnection(WPARAM wParam, LPARAM)
{
- timer = (BYTE)wParam;
+ timer = (uint8_t)wParam;
return 0;
}
diff --git a/plugins/StatusChange/src/main.cpp b/plugins/StatusChange/src/main.cpp index cfe19ada93..e12160e3ca 100644 --- a/plugins/StatusChange/src/main.cpp +++ b/plugins/StatusChange/src/main.cpp @@ -239,19 +239,19 @@ static INT_PTR CALLBACK DlgProcStatusChangeOpts(HWND hwndDlg, UINT msg, WPARAM w return TRUE;
case PSN_APPLY:
- g_plugin.setByte("MessageRead", (BYTE)Options.MessageRead);
- g_plugin.setByte("MessageSend", (BYTE)Options.MessageSend);
- g_plugin.setByte("FileRead", (BYTE)Options.FileRead);
- g_plugin.setByte("FileSend", (BYTE)Options.FileSend);
+ g_plugin.setByte("MessageRead", (uint8_t)Options.MessageRead);
+ g_plugin.setByte("MessageSend", (uint8_t)Options.MessageSend);
+ g_plugin.setByte("FileRead", (uint8_t)Options.FileRead);
+ g_plugin.setByte("FileSend", (uint8_t)Options.FileSend);
g_plugin.setDword("ChangeTo", (DWORD)Options.ChangeTo);
- g_plugin.setByte("IfOffline", (BYTE)Options.IfOffline);
- g_plugin.setByte("IfOnline", (BYTE)Options.IfOnline);
- g_plugin.setByte("IfAway", (BYTE)Options.IfAway);
- g_plugin.setByte("IfNA", (BYTE)Options.IfNA);
- g_plugin.setByte("IfDND", (BYTE)Options.IfDND);
- g_plugin.setByte("IfOccupied", (BYTE)Options.IfOccupied);
- g_plugin.setByte("IfFreeforchat", (BYTE)Options.IfFreeforchat);
- g_plugin.setByte("IfInvisible", (BYTE)Options.IfInvisible);
+ g_plugin.setByte("IfOffline", (uint8_t)Options.IfOffline);
+ g_plugin.setByte("IfOnline", (uint8_t)Options.IfOnline);
+ g_plugin.setByte("IfAway", (uint8_t)Options.IfAway);
+ g_plugin.setByte("IfNA", (uint8_t)Options.IfNA);
+ g_plugin.setByte("IfDND", (uint8_t)Options.IfDND);
+ g_plugin.setByte("IfOccupied", (uint8_t)Options.IfOccupied);
+ g_plugin.setByte("IfFreeforchat", (uint8_t)Options.IfFreeforchat);
+ g_plugin.setByte("IfInvisible", (uint8_t)Options.IfInvisible);
return TRUE;
}
break;
diff --git a/plugins/StatusManager/src/aaa_options.cpp b/plugins/StatusManager/src/aaa_options.cpp index 0b6e5fc3a0..c8b7e511e5 100644 --- a/plugins/StatusManager/src/aaa_options.cpp +++ b/plugins/StatusManager/src/aaa_options.cpp @@ -169,7 +169,7 @@ INT_PTR CALLBACK DlgProcAutoAwayMsgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L case PSN_APPLY: SendMessage(hwndDlg, WM_COMMAND, MAKEWPARAM(IDC_STATUS, CBN_SELCHANGE), 0); for (int i = 0; i < count; i++) { - AAAPlugin.setByte(StatusModeToDbSetting(settings[i]->status, SETTING_MSGCUSTOM), (BYTE)settings[i]->useCustom); + AAAPlugin.setByte(StatusModeToDbSetting(settings[i]->status, SETTING_MSGCUSTOM), (uint8_t)settings[i]->useCustom); if ((settings[i]->useCustom) && (settings[i]->msg != nullptr) && (settings[i]->msg[0] != '\0')) AAAPlugin.setString(StatusModeToDbSetting(settings[i]->status, SETTING_STATUSMSG), settings[i]->msg); } @@ -580,14 +580,14 @@ static INT_PTR CALLBACK DlgProcAutoAwayGeneralOpts(HWND hwndDlg, UINT msg, WPARA break; case PSN_APPLY: - AAAPlugin.setByte(SETTING_IGNLOCK, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_IGNLOCK)); - AAAPlugin.setByte(SETTING_IGNSYSKEYS, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_IGNSYSKEYS)); - AAAPlugin.setByte(SETTING_IGNALTCOMBO, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_IGNALTCOMBO)); - AAAPlugin.setByte(SETTING_SAMESETTINGS, (BYTE)g_bAAASettingSame); + AAAPlugin.setByte(SETTING_IGNLOCK, (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_IGNLOCK)); + AAAPlugin.setByte(SETTING_IGNSYSKEYS, (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_IGNSYSKEYS)); + AAAPlugin.setByte(SETTING_IGNALTCOMBO, (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_IGNALTCOMBO)); + AAAPlugin.setByte(SETTING_SAMESETTINGS, (uint8_t)g_bAAASettingSame); AAAPlugin.setWord(SETTING_AWAYCHECKTIMEINSECS, (WORD)GetDlgItemInt(hwndDlg, IDC_AWAYCHECKTIMEINSECS, nullptr, FALSE)); AAAPlugin.setWord(SETTING_CONFIRMDELAY, (WORD)GetDlgItemInt(hwndDlg, IDC_CONFIRMDELAY, nullptr, FALSE)); - AAAPlugin.setByte(SETTING_MONITORMOUSE, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_MONITORMOUSE)); - AAAPlugin.setByte(SETTING_MONITORKEYBOARD, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_MONITORKEYBOARD)); + AAAPlugin.setByte(SETTING_MONITORMOUSE, (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_MONITORMOUSE)); + AAAPlugin.setByte(SETTING_MONITORKEYBOARD, (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_MONITORKEYBOARD)); } } break; diff --git a/plugins/StatusManager/src/ks_options.cpp b/plugins/StatusManager/src/ks_options.cpp index 767cb9f680..fcaae56b23 100644 --- a/plugins/StatusManager/src/ks_options.cpp +++ b/plugins/StatusManager/src/ks_options.cpp @@ -117,13 +117,13 @@ static INT_PTR CALLBACK DlgProcKSBasicOpts(HWND hwndDlg, UINT msg, WPARAM wParam break; case PSN_APPLY: - KSPlugin.setByte(SETTING_MAXRETRIES, (BYTE)GetDlgItemInt(hwndDlg, IDC_MAXRETRIES, nullptr, FALSE)); - KSPlugin.setByte(SETTING_CHECKCONNECTION, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_CHECKCONNECTION)); - KSPlugin.setByte(SETTING_SHOWCONNECTIONPOPUPS, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOWCONNECTIONPOPUPS)); + KSPlugin.setByte(SETTING_MAXRETRIES, (uint8_t)GetDlgItemInt(hwndDlg, IDC_MAXRETRIES, nullptr, FALSE)); + KSPlugin.setByte(SETTING_CHECKCONNECTION, (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_CHECKCONNECTION)); + KSPlugin.setByte(SETTING_SHOWCONNECTIONPOPUPS, (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_SHOWCONNECTIONPOPUPS)); KSPlugin.setDword(SETTING_INITDELAY, (DWORD)GetDlgItemInt(hwndDlg, IDC_INITDELAY, nullptr, FALSE)); - KSPlugin.setByte(SETTING_CHKINET, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_CHKINET)); - KSPlugin.setByte(SETTING_CONTCHECK, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_CONTCHECK)); - KSPlugin.setByte(SETTING_BYPING, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_BYPING)); + KSPlugin.setByte(SETTING_CHKINET, (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_CHKINET)); + KSPlugin.setByte(SETTING_CONTCHECK, (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_CONTCHECK)); + KSPlugin.setByte(SETTING_BYPING, (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_BYPING)); if (IsDlgButtonChecked(hwndDlg, IDC_BYPING)) { int len = SendDlgItemMessage(hwndDlg, IDC_PINGHOST, WM_GETTEXTLENGTH, 0, 0); if (len > 0) { @@ -143,7 +143,7 @@ static INT_PTR CALLBACK DlgProcKSBasicOpts(HWND hwndDlg, UINT msg, WPARAM wParam char dbSetting[128]; mir_snprintf(dbSetting, "%s_enabled", (char *)lvItem.lParam); - KSPlugin.setByte(dbSetting, (BYTE)ListView_GetCheckState(hList, lvItem.iItem)); + KSPlugin.setByte(dbSetting, (uint8_t)ListView_GetCheckState(hList, lvItem.iItem)); } } break; @@ -214,13 +214,13 @@ static INT_PTR CALLBACK DlgProcKSAdvOpts(HWND hwndDlg, UINT msg, WPARAM wParam, break; case PSN_APPLY: - KSPlugin.setByte(SETTING_INCREASEEXPONENTIAL, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_INCREASEEXPONENTIAL)); + KSPlugin.setByte(SETTING_INCREASEEXPONENTIAL, (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_INCREASEEXPONENTIAL)); KSPlugin.setDword(SETTING_MAXDELAY, (DWORD)GetDlgItemInt(hwndDlg, IDC_MAXDELAY, nullptr, FALSE)); KSPlugin.setDword(SETTING_MAXCONNECTINGTIME, (DWORD)GetDlgItemInt(hwndDlg, IDC_MAXCONNECTINGTIME, nullptr, FALSE)); - KSPlugin.setByte(SETTING_FIRSTOFFLINE, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_FIRSTOFFLINE)); - KSPlugin.setByte(SETTING_NOLOCKED, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_NOLOCKED)); - KSPlugin.setByte(SETTING_CNCOTHERLOC, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_CNCOTHERLOC)); - KSPlugin.setByte(SETTING_LOGINERR, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_LOGINERR)); + KSPlugin.setByte(SETTING_FIRSTOFFLINE, (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_FIRSTOFFLINE)); + KSPlugin.setByte(SETTING_NOLOCKED, (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_NOLOCKED)); + KSPlugin.setByte(SETTING_CNCOTHERLOC, (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_CNCOTHERLOC)); + KSPlugin.setByte(SETTING_LOGINERR, (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_LOGINERR)); if (IsDlgButtonChecked(hwndDlg, IDC_LOGINERR)) { if (IsDlgButtonChecked(hwndDlg, IDC_LOGINERR_SETDELAY)) { KSPlugin.setByte(SETTING_LOGINERR, LOGINERR_SETDELAY); @@ -230,7 +230,7 @@ static INT_PTR CALLBACK DlgProcKSAdvOpts(HWND hwndDlg, UINT msg, WPARAM wParam, } else KSPlugin.setByte(SETTING_LOGINERR, LOGINERR_NOTHING); - KSPlugin.setByte(SETTING_CHECKAPMRESUME, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_CHECKAPMRESUME)); + KSPlugin.setByte(SETTING_CHECKAPMRESUME, (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_CHECKAPMRESUME)); KSPlugin.setWord(SETTING_PINGCOUNT, (WORD)GetDlgItemInt(hwndDlg, IDC_PINGCOUNT, nullptr, FALSE)); KSPlugin.setDword(SETTING_CNTDELAY, (DWORD)GetDlgItemInt(hwndDlg, IDC_CNTDELAY, nullptr, FALSE) == 0 ? CHECKCONTIN_DELAY : GetDlgItemInt(hwndDlg, IDC_CNTDELAY, nullptr, FALSE)); } @@ -431,15 +431,15 @@ static INT_PTR CALLBACK PopupOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L // text color KSPlugin.setDword(SETTING_POPUP_TEXTCOLOR, SendDlgItemMessage(hwndDlg, IDC_TEXTCOLOR, CPM_GETCOLOUR, 0, 0)); // use win - KSPlugin.setByte(SETTING_POPUP_USEWINCOLORS, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_WINCOLORS)); + KSPlugin.setByte(SETTING_POPUP_USEWINCOLORS, (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_WINCOLORS)); // use def - KSPlugin.setByte(SETTING_POPUP_USEDEFCOLORS, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_DEFAULTCOLORS)); + KSPlugin.setByte(SETTING_POPUP_USEDEFCOLORS, (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_DEFAULTCOLORS)); // store types - KSPlugin.setByte(SETTING_PUCONNLOST, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_PUCONNLOST)); - KSPlugin.setByte(SETTING_PUOTHER, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_PUOTHER)); - KSPlugin.setByte(SETTING_PUCONNRETRY, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_PUCONNRETRY)); - KSPlugin.setByte(SETTING_PURESULT, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_PURESULT)); - KSPlugin.setByte(SETTING_PUSHOWEXTRA, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_PUSHOWEXTRA)); + KSPlugin.setByte(SETTING_PUCONNLOST, (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_PUCONNLOST)); + KSPlugin.setByte(SETTING_PUOTHER, (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_PUOTHER)); + KSPlugin.setByte(SETTING_PUCONNRETRY, (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_PUCONNRETRY)); + KSPlugin.setByte(SETTING_PURESULT, (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_PURESULT)); + KSPlugin.setByte(SETTING_PUSHOWEXTRA, (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_PUSHOWEXTRA)); } break; } diff --git a/plugins/StatusManager/src/ss_main.cpp b/plugins/StatusManager/src/ss_main.cpp index bd3e6cd630..e5118785a3 100644 --- a/plugins/StatusManager/src/ss_main.cpp +++ b/plugins/StatusManager/src/ss_main.cpp @@ -30,7 +30,7 @@ static HANDLE hProtoAckHook, hCSStatusChangeHook, hStatusChangeHook; static HWND hMessageWindow; -static BYTE showDialogOnStartup = 0; +static uint8_t showDialogOnStartup = 0; ///////////////////////////////////////////////////////////////////////////////////////// // command line options @@ -303,7 +303,7 @@ static int OnShutdown(WPARAM, LPARAM) int state = SSPlugin.getByte(SETTING_WINSTATE, SETTING_STATE_NORMAL); // set windowstate and docked for next startup if (SSPlugin.getByte(SETTING_SETWINSTATE, 0)) - db_set_b(0, MODULE_CLIST, SETTING_WINSTATE, (BYTE)state); + db_set_b(0, MODULE_CLIST, SETTING_WINSTATE, (uint8_t)state); if (hMessageWindow) DestroyWindow(hMessageWindow); @@ -434,7 +434,7 @@ void StartupStatusLoad() if (docked == DOCKED_LEFT || docked == DOCKED_RIGHT) docked = -docked; - db_set_b(0, MODULE_CLIST, SETTING_DOCKED, (BYTE)docked); + db_set_b(0, MODULE_CLIST, SETTING_DOCKED, (uint8_t)docked); } // Create service functions; the get functions are created here; they don't rely on commonstatus diff --git a/plugins/StatusManager/src/ss_options.cpp b/plugins/StatusManager/src/ss_options.cpp index b68398d1dc..244575feb5 100644 --- a/plugins/StatusManager/src/ss_options.cpp +++ b/plugins/StatusManager/src/ss_options.cpp @@ -366,7 +366,7 @@ public: if (bChecked || chkShowDialog.GetState()) SSPlugin.setWord(SETTING_DEFAULTPROFILE, (WORD)profiles.GetCurData()); - SSPlugin.setByte(SETTING_OVERRIDE, (BYTE)IsDlgButtonChecked(m_hwnd, IDC_OVERRIDE)); + SSPlugin.setByte(SETTING_OVERRIDE, (uint8_t)IsDlgButtonChecked(m_hwnd, IDC_OVERRIDE)); SSPlugin.setByte(SETTING_SHOWDIALOG, bChecked = chkShowDialog.GetState()); if (bChecked) SSPlugin.setDword(SETTING_DLGTIMEOUT, GetDlgItemInt(m_hwnd, IDC_DLGTIMEOUT, nullptr, FALSE)); @@ -374,13 +374,13 @@ public: SSPlugin.setByte(SETTING_SETWINSTATE, bChecked = chkSetWinState.GetState()); if (bChecked) { int val = (int)SendDlgItemMessage(m_hwnd, IDC_WINSTATE, CB_GETITEMDATA, SendDlgItemMessage(m_hwnd, IDC_WINSTATE, CB_GETCURSEL, 0, 0), 0); - SSPlugin.setByte(SETTING_WINSTATE, (BYTE)val); + SSPlugin.setByte(SETTING_WINSTATE, (uint8_t)val); } SSPlugin.setByte(SETTING_SETDOCKED, bChecked = chkSetDocked.GetState()); if (bChecked) { int val = (int)SendDlgItemMessage(m_hwnd, IDC_DOCKED, CB_GETITEMDATA, SendDlgItemMessage(m_hwnd, IDC_DOCKED, CB_GETCURSEL, 0, 0), 0); - SSPlugin.setByte(SETTING_DOCKED, (BYTE)val); + SSPlugin.setByte(SETTING_DOCKED, (uint8_t)val); } SSPlugin.setByte(SETTING_SETWINLOCATION, bChecked = chkSetWinLocation.GetState()); @@ -395,9 +395,9 @@ public: SSPlugin.setDword(SETTING_HEIGHT, GetDlgItemInt(m_hwnd, IDC_HEIGHT, nullptr, FALSE)); } - SSPlugin.setByte(SETTING_OFFLINECLOSE, (BYTE)IsDlgButtonChecked(m_hwnd, IDC_OFFLINECLOSE)); - SSPlugin.setByte(SETTING_AUTODIAL, (BYTE)IsDlgButtonChecked(m_hwnd, IDC_AUTODIAL)); - SSPlugin.setByte(SETTING_AUTOHANGUP, (BYTE)IsDlgButtonChecked(m_hwnd, IDC_AUTOHANGUP)); + SSPlugin.setByte(SETTING_OFFLINECLOSE, (uint8_t)IsDlgButtonChecked(m_hwnd, IDC_OFFLINECLOSE)); + SSPlugin.setByte(SETTING_AUTODIAL, (uint8_t)IsDlgButtonChecked(m_hwnd, IDC_AUTODIAL)); + SSPlugin.setByte(SETTING_AUTOHANGUP, (uint8_t)IsDlgButtonChecked(m_hwnd, IDC_AUTOHANGUP)); return true; } diff --git a/plugins/StopSpamMod/src/stopspam.cpp b/plugins/StopSpamMod/src/stopspam.cpp index f1e7ca9361..627536d182 100755 --- a/plugins/StopSpamMod/src/stopspam.cpp +++ b/plugins/StopSpamMod/src/stopspam.cpp @@ -44,7 +44,7 @@ int OnDbEventAdded(WPARAM hContact, LPARAM hDbEvent) Contact_Hide(hcntct); if (gbSpecialGroup) Clist_SetGroup(hcntct, gbSpammersGroup.c_str()); - BYTE msg = 1; + uint8_t msg = 1; if (gbIgnoreURL) { wchar_t* EventText = ReqGetText(&dbei); //else return NULL msg = !IsUrlContains(EventText); diff --git a/plugins/StopSpamMod/src/utilities.cpp b/plugins/StopSpamMod/src/utilities.cpp index 6197b79b35..eba39ebf02 100755 --- a/plugins/StopSpamMod/src/utilities.cpp +++ b/plugins/StopSpamMod/src/utilities.cpp @@ -67,7 +67,7 @@ bool ProtoInList(const char *szProto) void DeleteCListGroupsByName(wchar_t* szGroupName)
{
- BYTE ConfirmDelete = Clist::ConfirmDelete;
+ uint8_t ConfirmDelete = Clist::ConfirmDelete;
if (ConfirmDelete)
db_set_b(0, "CList", "ConfirmDelete", 0);
diff --git a/plugins/StopSpamPlus/src/services.cpp b/plugins/StopSpamPlus/src/services.cpp index c1e142f080..8e40075c64 100644 --- a/plugins/StopSpamPlus/src/services.cpp +++ b/plugins/StopSpamPlus/src/services.cpp @@ -51,7 +51,7 @@ INT_PTR RemoveTempContacts(WPARAM, LPARAM lParam) do {
group_name = Clist_GroupGetName(hGroup, nullptr);
if (group_name != nullptr && wcsstr(group_name, TranslateT("Not In List"))) {
- BYTE ConfirmDelete = Clist::ConfirmDelete;
+ uint8_t ConfirmDelete = Clist::ConfirmDelete;
if (ConfirmDelete)
db_set_b(0, "CList", "ConfirmDelete", 0);
diff --git a/plugins/TabSRMM/src/buttonsbar.cpp b/plugins/TabSRMM/src/buttonsbar.cpp index 106fb2cd66..11de4bfef8 100644 --- a/plugins/TabSRMM/src/buttonsbar.cpp +++ b/plugins/TabSRMM/src/buttonsbar.cpp @@ -141,7 +141,7 @@ static int CB_InitDefaultButtons(WPARAM, LPARAM) void CMsgDialog::BB_InitDlgButtons() { - BYTE gap = DPISCALEX_S(g_plugin.getByte("ButtonsBarGap", 1)); + uint8_t gap = DPISCALEX_S(g_plugin.getByte("ButtonsBarGap", 1)); RECT rcSplitter; GetWindowRect(GetDlgItem(m_hwnd, IDC_SPLITTERY), &rcSplitter); @@ -203,7 +203,7 @@ BOOL CMsgDialog::BB_SetButtonsPos() if (!m_hwnd || !IsWindowVisible(m_hwnd)) return 0; - BYTE gap = DPISCALEX_S(g_plugin.getByte("ButtonsBarGap", 1)); + uint8_t gap = DPISCALEX_S(g_plugin.getByte("ButtonsBarGap", 1)); bool showToolbar = !m_pContainer->m_flags.m_bHideToolbar; bool bBottomToolbar = m_pContainer->m_flags.m_bBottomToolbar; diff --git a/plugins/TabSRMM/src/chat_log.cpp b/plugins/TabSRMM/src/chat_log.cpp index 0dd7e49d4d..d7dd0eb440 100644 --- a/plugins/TabSRMM/src/chat_log.cpp +++ b/plugins/TabSRMM/src/chat_log.cpp @@ -69,7 +69,7 @@ static int EventToIndex(LOGINFO *lin) return 0;
}
-static BYTE EventToSymbol(LOGINFO *lin)
+static uint8_t EventToSymbol(LOGINFO *lin)
{
switch (lin->iType) {
case GC_EVENT_MESSAGE:
diff --git a/plugins/TabSRMM/src/chat_options.cpp b/plugins/TabSRMM/src/chat_options.cpp index 8521de32fa..7720be1954 100644 --- a/plugins/TabSRMM/src/chat_options.cpp +++ b/plugins/TabSRMM/src/chat_options.cpp @@ -36,11 +36,11 @@ struct FontOptionsList wchar_t *szDescr;
COLORREF defColour;
wchar_t *szDefFace;
- BYTE defCharset, defStyle;
+ uint8_t defCharset, defStyle;
char defSize;
COLORREF colour;
wchar_t szFace[LF_FACESIZE];
- BYTE charset, style;
+ uint8_t charset, style;
char size;
};
@@ -560,7 +560,7 @@ public: void OnDestroy() override
{
- BYTE b = treeCheck.GetItemState(hListHeading1, TVIS_EXPANDED) & TVIS_EXPANDED ? 1 : 0;
+ uint8_t b = treeCheck.GetItemState(hListHeading1, TVIS_EXPANDED) & TVIS_EXPANDED ? 1 : 0;
db_set_b(0, CHAT_MODULE, "Branch1Exp", b);
b = treeCheck.GetItemState(hListHeading2, TVIS_EXPANDED) & TVIS_EXPANDED ? 1 : 0;
@@ -681,7 +681,7 @@ public: iLen = SendDlgItemMessage(m_hwnd, IDC_CHAT_SPIN3, UDM_GETPOS, 0, 0);
if (iLen > 0)
- db_set_b(0, CHAT_MODULE, "NicklistRowDist", (BYTE)iLen);
+ db_set_b(0, CHAT_MODULE, "NicklistRowDist", (uint8_t)iLen);
else
db_unset(0, CHAT_MODULE, "NicklistRowDist");
@@ -881,7 +881,7 @@ public: db_set_ws(0, CHAT_MODULE, "HighlightNames", ptrW(edtNick.GetText()));
db_set_ws(0, CHAT_MODULE, "HighlightWords", ptrW(edtText.GetText()));
- BYTE dwFlags = (chkNick.GetState() ? CMUCHighlight::MATCH_NICKNAME : 0) | (chkText.GetState() ? CMUCHighlight::MATCH_TEXT : 0);
+ uint8_t dwFlags = (chkNick.GetState() ? CMUCHighlight::MATCH_NICKNAME : 0) | (chkText.GetState() ? CMUCHighlight::MATCH_TEXT : 0);
if (dwFlags & CMUCHighlight::MATCH_NICKNAME)
dwFlags |= (::IsDlgButtonChecked(m_hwnd, IDC_HIGHLIGHTNICKUID) ? CMUCHighlight::MATCH_UIN : 0);
diff --git a/plugins/TabSRMM/src/contactcache.h b/plugins/TabSRMM/src/contactcache.h index f686d6d592..0f3471e725 100644 --- a/plugins/TabSRMM/src/contactcache.h +++ b/plugins/TabSRMM/src/contactcache.h @@ -59,7 +59,7 @@ class CContactCache : public MZeroedObject wchar_t *m_szAccount;
wchar_t m_szNick[80], m_szUIN[80];
wchar_t *m_szStatusMsg, *m_xStatusMsg, *m_ListeningInfo;
- BYTE m_xStatus;
+ uint8_t m_xStatus;
DWORD m_idleTS;
bool m_isMeta;
bool m_isValid;
@@ -101,7 +101,7 @@ public: __forceinline LPCWSTR getStatusMsg() const { return m_szStatusMsg; }
__forceinline LPCWSTR getXStatusMsg() const { return m_xStatusMsg; }
__forceinline LPCWSTR getListeningInfo() const { return m_ListeningInfo; }
- __forceinline BYTE getXStatusId() const { return m_xStatus; }
+ __forceinline uint8_t getXStatusId() const { return m_xStatus; }
__forceinline DWORD getSessionStart() const { return m_stats->started; }
__forceinline int getSessionMsgCount() const { return (int)m_stats->messageCount; }
diff --git a/plugins/TabSRMM/src/container.cpp b/plugins/TabSRMM/src/container.cpp index 32d3aba8da..3412bf1e33 100644 --- a/plugins/TabSRMM/src/container.cpp +++ b/plugins/TabSRMM/src/container.cpp @@ -247,7 +247,7 @@ void TContainerData::Configure() if (m_flags.m_bTransparent && fTransAllowed) {
DWORD trans = LOWORD(m_pSettings->dwTransparency);
- SetLayeredWindowAttributes(m_hwnd, Skin->getColorKey(), (BYTE)trans, (/* m_bSkinned ? LWA_COLORKEY : */ 0) | (m_flags.m_bTransparent ? LWA_ALPHA : 0));
+ SetLayeredWindowAttributes(m_hwnd, Skin->getColorKey(), (uint8_t)trans, (/* m_bSkinned ? LWA_COLORKEY : */ 0) | (m_flags.m_bTransparent ? LWA_ALPHA : 0));
}
HMENU hSysmenu = GetSystemMenu(m_hwnd, FALSE);
@@ -1806,7 +1806,7 @@ panel_found: BOOL fTransAllowed = !CSkin::m_skinEnabled || IsWinVerVistaPlus();
if (pContainer->m_flags.m_bTransparent && fTransAllowed) {
- SetLayeredWindowAttributes(hwndDlg, Skin->getColorKey(), (BYTE)HIWORD(pContainer->m_pSettings->dwTransparency), (pContainer->m_flags.m_bTransparent ? LWA_ALPHA : 0));
+ SetLayeredWindowAttributes(hwndDlg, Skin->getColorKey(), (uint8_t)HIWORD(pContainer->m_pSettings->dwTransparency), (pContainer->m_flags.m_bTransparent ? LWA_ALPHA : 0));
}
}
pContainer->m_hwndSaved = nullptr;
@@ -1840,7 +1840,7 @@ panel_found: if (pContainer->m_flags.m_bTransparent && fTransAllowed) {
DWORD trans = LOWORD(pContainer->m_pSettings->dwTransparency);
- SetLayeredWindowAttributes(hwndDlg, Skin->getColorKey(), (BYTE)trans, (pContainer->m_flags.m_bTransparent ? LWA_ALPHA : 0));
+ SetLayeredWindowAttributes(hwndDlg, Skin->getColorKey(), (uint8_t)trans, (pContainer->m_flags.m_bTransparent ? LWA_ALPHA : 0));
}
if (pContainer->m_flags.m_bNeedsUpdateTitle) {
pContainer->m_flags.m_bNeedsUpdateTitle = false;
@@ -2077,7 +2077,7 @@ panel_found: if (pContainer->m_isCloned && pContainer->m_hContactFrom != 0) {
HWND hDlg = GetTabWindow(pContainer->m_hwndTabs, TabCtrl_GetCurSel(pContainer->m_hwndTabs));
SendMessage(hDlg, DM_QUERYHCONTACT, 0, (LPARAM)&hContact);
- db_set_b(hContact, SRMSGMOD_T, "splitmax", (BYTE)((wp.showCmd == SW_SHOWMAXIMIZED) ? 1 : 0));
+ db_set_b(hContact, SRMSGMOD_T, "splitmax", (uint8_t)((wp.showCmd == SW_SHOWMAXIMIZED) ? 1 : 0));
for (int i = 0; i < TabCtrl_GetItemCount(pContainer->m_hwndTabs); i++) {
if (hDlg = GetTabWindow(pContainer->m_hwndTabs, i)) {
@@ -2100,7 +2100,7 @@ panel_found: mir_snprintf(szCName, "%s%dheight", CONTAINER_PREFIX, pContainer->m_iContainerIndex);
db_set_dw(0, SRMSGMOD_T, szCName, wp.rcNormalPosition.bottom - wp.rcNormalPosition.top);
- db_set_b(0, SRMSGMOD_T, "splitmax", (BYTE)((wp.showCmd == SW_SHOWMAXIMIZED) ? 1 : 0));
+ db_set_b(0, SRMSGMOD_T, "splitmax", (uint8_t)((wp.showCmd == SW_SHOWMAXIMIZED) ? 1 : 0));
}
}
}
diff --git a/plugins/TabSRMM/src/eventpopups.cpp b/plugins/TabSRMM/src/eventpopups.cpp index c69982526f..975d3fa5d4 100644 --- a/plugins/TabSRMM/src/eventpopups.cpp +++ b/plugins/TabSRMM/src/eventpopups.cpp @@ -88,10 +88,10 @@ int TSAPI NEN_ReadOptions(NEN_OPTIONS *options) options->iDelayOthers = db_get_dw(0, MODULE, OPT_DELAY_OTHERS, DEFAULT_DELAY);
options->iDelayErr = db_get_dw(0, MODULE, OPT_DELAY_ERR, DEFAULT_DELAY);
options->iDelayDefault = (int)DBGetContactSettingRangedWord(0, "Popup", "Seconds", SETTING_LIFETIME_DEFAULT, SETTING_LIFETIME_MIN, SETTING_LIFETIME_MAX);
- options->bShowHeaders = (BYTE)db_get_b(0, MODULE, OPT_SHOW_HEADERS, FALSE);
+ options->bShowHeaders = (uint8_t)db_get_b(0, MODULE, OPT_SHOW_HEADERS, FALSE);
options->bNoRSS = (BOOL)db_get_b(0, MODULE, OPT_NORSS, FALSE);
- options->iDisable = (BYTE)db_get_b(0, MODULE, OPT_DISABLE, 0);
- options->iMUCDisable = (BYTE)db_get_b(0, MODULE, OPT_MUCDISABLE, 0);
+ options->iDisable = (uint8_t)db_get_b(0, MODULE, OPT_DISABLE, 0);
+ options->iMUCDisable = (uint8_t)db_get_b(0, MODULE, OPT_MUCDISABLE, 0);
options->dwStatusMask = db_get_dw(0, MODULE, "statusmask", (DWORD)-1);
options->bWindowCheck = (BOOL)db_get_b(0, MODULE, OPT_WINDOWCHECK, 0);
options->bNoRSS = (BOOL)db_get_b(0, MODULE, OPT_NORSS, 0);
@@ -106,28 +106,28 @@ int TSAPI NEN_ReadOptions(NEN_OPTIONS *options) int TSAPI NEN_WriteOptions(NEN_OPTIONS *options)
{
- db_set_b(0, MODULE, OPT_PREVIEW, (BYTE)options->bPreview);
- db_set_b(0, MODULE, OPT_COLDEFAULT_MESSAGE, (BYTE)options->bDefaultColorMsg);
- db_set_b(0, MODULE, OPT_COLDEFAULT_OTHERS, (BYTE)options->bDefaultColorOthers);
- db_set_b(0, MODULE, OPT_COLDEFAULT_ERR, (BYTE)options->bDefaultColorErr);
+ db_set_b(0, MODULE, OPT_PREVIEW, (uint8_t)options->bPreview);
+ db_set_b(0, MODULE, OPT_COLDEFAULT_MESSAGE, (uint8_t)options->bDefaultColorMsg);
+ db_set_b(0, MODULE, OPT_COLDEFAULT_OTHERS, (uint8_t)options->bDefaultColorOthers);
+ db_set_b(0, MODULE, OPT_COLDEFAULT_ERR, (uint8_t)options->bDefaultColorErr);
db_set_dw(0, MODULE, OPT_COLBACK_MESSAGE, (DWORD)options->colBackMsg);
db_set_dw(0, MODULE, OPT_COLTEXT_MESSAGE, (DWORD)options->colTextMsg);
db_set_dw(0, MODULE, OPT_COLBACK_OTHERS, (DWORD)options->colBackOthers);
db_set_dw(0, MODULE, OPT_COLTEXT_OTHERS, (DWORD)options->colTextOthers);
db_set_dw(0, MODULE, OPT_COLBACK_ERR, (DWORD)options->colBackErr);
db_set_dw(0, MODULE, OPT_COLTEXT_ERR, (DWORD)options->colTextErr);
- db_set_b(0, MODULE, OPT_MASKACTL, (BYTE)options->maskActL);
- db_set_b(0, MODULE, OPT_MASKACTR, (BYTE)options->maskActR);
- db_set_b(0, MODULE, OPT_MASKACTTE, (BYTE)options->maskActTE);
- db_set_b(0, MODULE, OPT_MERGEPOPUP, (BYTE)options->bMergePopup);
+ db_set_b(0, MODULE, OPT_MASKACTL, (uint8_t)options->maskActL);
+ db_set_b(0, MODULE, OPT_MASKACTR, (uint8_t)options->maskActR);
+ db_set_b(0, MODULE, OPT_MASKACTTE, (uint8_t)options->maskActTE);
+ db_set_b(0, MODULE, OPT_MERGEPOPUP, (uint8_t)options->bMergePopup);
db_set_dw(0, MODULE, OPT_DELAY_MESSAGE, (DWORD)options->iDelayMsg);
db_set_dw(0, MODULE, OPT_DELAY_OTHERS, (DWORD)options->iDelayOthers);
db_set_dw(0, MODULE, OPT_DELAY_ERR, (DWORD)options->iDelayErr);
- db_set_b(0, MODULE, OPT_SHOW_HEADERS, (BYTE)options->bShowHeaders);
- db_set_b(0, MODULE, OPT_DISABLE, (BYTE)options->iDisable);
- db_set_b(0, MODULE, OPT_MUCDISABLE, (BYTE)options->iMUCDisable);
- db_set_b(0, MODULE, OPT_WINDOWCHECK, (BYTE)options->bWindowCheck);
- db_set_b(0, MODULE, OPT_NORSS, (BYTE)options->bNoRSS);
+ db_set_b(0, MODULE, OPT_SHOW_HEADERS, (uint8_t)options->bShowHeaders);
+ db_set_b(0, MODULE, OPT_DISABLE, (uint8_t)options->iDisable);
+ db_set_b(0, MODULE, OPT_MUCDISABLE, (uint8_t)options->iMUCDisable);
+ db_set_b(0, MODULE, OPT_WINDOWCHECK, (uint8_t)options->bWindowCheck);
+ db_set_b(0, MODULE, OPT_NORSS, (uint8_t)options->bNoRSS);
db_set_dw(0, MODULE, OPT_LIMITPREVIEW, options->iLimitPreview);
db_set_dw(0, MODULE, OPT_REMOVEMASK, options->dwRemoveMask);
db_set_b(0, MODULE, "disablenonmessage", options->bDisableNonMessage);
@@ -599,7 +599,7 @@ public: // scan the tree view and obtain the options...
TreeViewToDB(eventOptions, lvItemsNEN, nullptr, nullptr);
- db_set_b(0, CHAT_MODULE, "PopupStyle", (BYTE)g_Settings.iPopupStyle);
+ db_set_b(0, CHAT_MODULE, "PopupStyle", (uint8_t)g_Settings.iPopupStyle);
db_set_w(0, CHAT_MODULE, "PopupTimeout", g_Settings.iPopupTimeout);
db_set_dw(0, CHAT_MODULE, "PopupColorBG", g_Settings.crPUBkgColour = mucBack.GetColor());
db_set_dw(0, CHAT_MODULE, "PopupColorText", g_Settings.crPUTextColour = mucText.GetColor());
diff --git a/plugins/TabSRMM/src/functions.h b/plugins/TabSRMM/src/functions.h index 2d30779208..7a2c9bde03 100644 --- a/plugins/TabSRMM/src/functions.h +++ b/plugins/TabSRMM/src/functions.h @@ -85,7 +85,7 @@ LRESULT CALLBACK HPPKFSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP * skinning engine
*/
void TSAPI DrawAlpha(HDC hdcwnd, PRECT rc, DWORD basecolor, int alpha, DWORD basecolor2,
- BYTE transparent, BYTE FLG_GRADIENT, BYTE FLG_CORNER, DWORD BORDERSTYLE, CImageItem *imageItem);
+ uint8_t transparent, uint8_t FLG_GRADIENT, uint8_t FLG_CORNER, DWORD BORDERSTYLE, CImageItem *imageItem);
// the cached message log icons
void TSAPI CacheMsgLogIcons();
diff --git a/plugins/TabSRMM/src/generic_msghandlers.cpp b/plugins/TabSRMM/src/generic_msghandlers.cpp index 8525ef002b..26ba257f8e 100644 --- a/plugins/TabSRMM/src/generic_msghandlers.cpp +++ b/plugins/TabSRMM/src/generic_msghandlers.cpp @@ -314,7 +314,7 @@ LRESULT CMsgDialog::DM_MsgWindowCmdHandler(UINT cmd, WPARAM wParam, LPARAM lPara db_set_dw(m_hContact, SRMSGMOD_T, "sendformat", iNewLocalFormat); if (PluginConfig.m_SendFormat != iOldGlobalSendFormat) - db_set_b(0, SRMSGMOD_T, "sendformat", (BYTE)PluginConfig.m_SendFormat); + db_set_b(0, SRMSGMOD_T, "sendformat", (uint8_t)PluginConfig.m_SendFormat); if (iNewLocalFormat != iLocalFormat || PluginConfig.m_SendFormat != iOldGlobalSendFormat) { m_SendFormat = M.GetDword(m_hContact, "sendformat", PluginConfig.m_SendFormat); if (m_SendFormat == -1) // per contact override to disable it.. @@ -376,7 +376,7 @@ LRESULT CMsgDialog::DM_MsgWindowCmdHandler(UINT cmd, WPARAM wParam, LPARAM lPara db_unset(m_hContact, SRMSGMOD_T, "no_ack"); break; } - db_set_b(m_hContact, SRMSGMOD_T, "no_ack", (BYTE)(m_sendMode & SMODE_NOACK ? 1 : 0)); + db_set_b(m_hContact, SRMSGMOD_T, "no_ack", (uint8_t)(m_sendMode & SMODE_NOACK ? 1 : 0)); SetWindowPos(m_message.GetHwnd(), nullptr, 0, 0, 0, 0, SWP_FRAMECHANGED | SWP_NOSIZE | SWP_NOMOVE); if (m_sendMode & SMODE_MULTIPLE || m_sendMode & SMODE_CONTAINER) { SetWindowPos(m_message.GetHwnd(), nullptr, 0, 0, 0, 0, SWP_DRAWFRAME | SWP_FRAMECHANGED | SWP_NOZORDER | @@ -480,7 +480,7 @@ LRESULT CMsgDialog::DM_MsgWindowCmdHandler(UINT cmd, WPARAM wParam, LPARAM lPara DM_NotifyTyping(PROTOTYPE_SELFTYPING_OFF); m_nTypeMode = PROTOTYPE_SELFTYPING_OFF; } - g_plugin.setByte(m_hContact, SRMSGSET_TYPING, (BYTE)!iCurrentTypingMode); + g_plugin.setByte(m_hContact, SRMSGSET_TYPING, (uint8_t)!iCurrentTypingMode); } break; diff --git a/plugins/TabSRMM/src/globals.h b/plugins/TabSRMM/src/globals.h index 6c48b3957f..9dababbc3e 100644 --- a/plugins/TabSRMM/src/globals.h +++ b/plugins/TabSRMM/src/globals.h @@ -115,7 +115,7 @@ public: BOOL bUnicodeBuild;
HFONT hFontCaption;
DWORD m_LangPackCP;
- BYTE m_SmileyButtonOverride;
+ uint8_t m_SmileyButtonOverride;
HICON m_AnimTrayIcons[4];
BOOL m_visualMessageSizeIndicator;
BOOL m_autoSplit;
@@ -127,7 +127,7 @@ public: COLORREF m_ipBackgroundGradientHigh;
COLORREF m_tbBackgroundHigh, m_tbBackgroundLow, m_fillColor, m_cRichBorders, m_genericTxtColor;
HGENMENU m_hMenuItem;
- BYTE m_useAeroPeek;
+ uint8_t m_useAeroPeek;
WINDOWPLACEMENT m_GlobalContainerWpos;
NONCLIENTMETRICS m_ncm;
diff --git a/plugins/TabSRMM/src/infopanel.cpp b/plugins/TabSRMM/src/infopanel.cpp index bc2c0cd206..7eee42f021 100644 --- a/plugins/TabSRMM/src/infopanel.cpp +++ b/plugins/TabSRMM/src/infopanel.cpp @@ -74,7 +74,7 @@ void CInfoPanel::setActive(const int newActive) void CInfoPanel::loadHeight()
{
- BYTE bSync = M.GetByte("syncAllPanels", 0); // sync muc <> im panels
+ uint8_t bSync = M.GetByte("syncAllPanels", 0); // sync muc <> im panels
m_height = M.GetDword(m_dat->m_hContact, "panelheight", -1);
@@ -101,7 +101,7 @@ void CInfoPanel::loadHeight() void CInfoPanel::saveHeight(bool fFlush)
{
- BYTE bSync = M.GetByte("syncAllPanels", 0);
+ uint8_t bSync = M.GetByte("syncAllPanels", 0);
if (m_height < 110 && m_height >= MIN_PANELHEIGHT) { // only save valid panel splitter positions
if (!m_fPrivateHeight) {
@@ -218,10 +218,10 @@ void CInfoPanel::showHide() const bool CInfoPanel::getVisibility()
{
- BYTE bDefault = (m_dat->m_pContainer->m_flags.m_bInfoPanel) ? 1 : 0;
- BYTE bContact = M.GetByte(m_dat->m_hContact, "infopanel", 0);
+ uint8_t bDefault = (m_dat->m_pContainer->m_flags.m_bInfoPanel) ? 1 : 0;
+ uint8_t bContact = M.GetByte(m_dat->m_hContact, "infopanel", 0);
- BYTE visible = (bContact == 0 ? bDefault : (bContact == (BYTE)-1 ? 0 : 1));
+ uint8_t visible = (bContact == 0 ? bDefault : (bContact == (uint8_t)-1 ? 0 : 1));
setActive(visible);
return m_active;
}
@@ -879,7 +879,7 @@ void CInfoPanel::showTip(UINT ctrlId, const wchar_t *pwszTip) m_dat->m_cache->getStatusMsg() ? m_dat->m_cache->getStatusMsg() : TranslateT("No status message"));
DBVARIANT dbv = { 0 };
- if (BYTE xStatus = m_dat->m_cache->getXStatusId()) {
+ if (uint8_t xStatus = m_dat->m_cache->getXStatusId()) {
wchar_t *tszXStatusName = nullptr;
if (0 == db_get_ws(m_dat->m_cache->getContact(), m_dat->m_cache->getProto(), "XStatusName", &dbv))
tszXStatusName = dbv.pwszVal;
@@ -1063,8 +1063,8 @@ INT_PTR CALLBACK CInfoPanel::ConfigDlgProc(HWND hwnd, UINT msg, WPARAM wParam, L ::SendDlgItemMessage(hwnd, IDC_PANELVISIBILITY, CB_INSERTSTRING, -1, (LPARAM)TranslateT("Always off"));
::SendDlgItemMessage(hwnd, IDC_PANELVISIBILITY, CB_INSERTSTRING, -1, (LPARAM)TranslateT("Always on"));
- BYTE v = M.GetByte(m_dat->m_hContact, "infopanel", 0);
- ::SendDlgItemMessage(hwnd, IDC_PANELVISIBILITY, CB_SETCURSEL, (WPARAM)(v == 0 ? 0 : (v == (BYTE)-1 ? 1 : 2)), 0);
+ uint8_t v = M.GetByte(m_dat->m_hContact, "infopanel", 0);
+ ::SendDlgItemMessage(hwnd, IDC_PANELVISIBILITY, CB_SETCURSEL, (WPARAM)(v == 0 ? 0 : (v == (uint8_t)-1 ? 1 : 2)), 0);
::SendDlgItemMessage(hwnd, IDC_PANELSIZE, CB_INSERTSTRING, -1, (LPARAM)TranslateT("Use default size"));
::SendDlgItemMessage(hwnd, IDC_PANELSIZE, CB_INSERTSTRING, -1, (LPARAM)TranslateT("Use private size"));
@@ -1080,7 +1080,7 @@ INT_PTR CALLBACK CInfoPanel::ConfigDlgProc(HWND hwnd, UINT msg, WPARAM wParam, L ::SendDlgItemMessage(hwnd, IDC_PANELPICTUREVIS, CB_INSERTSTRING, -1, (LPARAM)TranslateT("Use global setting"));
::SendDlgItemMessage(hwnd, IDC_PANELPICTUREVIS, CB_INSERTSTRING, -1, (LPARAM)TranslateT("Show always (if present)"));
::SendDlgItemMessage(hwnd, IDC_PANELPICTUREVIS, CB_INSERTSTRING, -1, (LPARAM)TranslateT("Never show it at all"));
- ::SendDlgItemMessage(hwnd, IDC_PANELPICTUREVIS, CB_SETCURSEL, (v == (BYTE)-1 ? 0 : (v == 1 ? 1 : 2)), 0);
+ ::SendDlgItemMessage(hwnd, IDC_PANELPICTUREVIS, CB_SETCURSEL, (v == (uint8_t)-1 ? 0 : (v == 1 ? 1 : 2)), 0);
}
else Utils::enableDlgControl(hwnd, IDC_PANELPICTUREVIS, false);
}
@@ -1141,12 +1141,12 @@ INT_PTR CALLBACK CInfoPanel::ConfigDlgProc(HWND hwnd, UINT msg, WPARAM wParam, L case IDC_PANELPICTUREVIS:
{
- BYTE vOld = db_get_b(m_dat->m_hContact, SRMSGMOD_T, "hideavatar", -1);
+ uint8_t vOld = db_get_b(m_dat->m_hContact, SRMSGMOD_T, "hideavatar", -1);
LRESULT iResult = ::SendDlgItemMessage(hwnd, IDC_PANELPICTUREVIS, CB_GETCURSEL, 0, 0);
- BYTE vNew = (iResult == 0 ? (BYTE)-1 : (iResult == 1 ? 1 : 0));
+ uint8_t vNew = (iResult == 0 ? (uint8_t)-1 : (iResult == 1 ? 1 : 0));
if (vNew != vOld) {
- if (vNew == (BYTE)-1)
+ if (vNew == (uint8_t)-1)
db_unset(m_dat->m_hContact, SRMSGMOD_T, "hideavatar");
else
db_set_b(m_dat->m_hContact, SRMSGMOD_T, "hideavatar", vNew);
@@ -1160,10 +1160,10 @@ INT_PTR CALLBACK CInfoPanel::ConfigDlgProc(HWND hwnd, UINT msg, WPARAM wParam, L case IDC_PANELVISIBILITY:
{
- BYTE vOld = db_get_b(m_dat->m_hContact, SRMSGMOD_T, "infopanel", 0);
+ uint8_t vOld = db_get_b(m_dat->m_hContact, SRMSGMOD_T, "infopanel", 0);
LRESULT iResult = ::SendDlgItemMessage(hwnd, IDC_PANELVISIBILITY, CB_GETCURSEL, 0, 0);
- BYTE vNew = (iResult == 0 ? 0 : (iResult == 1 ? (BYTE)-1 : 1));
+ uint8_t vNew = (iResult == 0 ? 0 : (iResult == 1 ? (uint8_t)-1 : 1));
if (vNew != vOld) {
db_set_b(m_dat->m_hContact, SRMSGMOD_T, "infopanel", vNew);
getVisibility();
diff --git a/plugins/TabSRMM/src/mim.h b/plugins/TabSRMM/src/mim.h index c2d85f00b4..84765e9945 100644 --- a/plugins/TabSRMM/src/mim.h +++ b/plugins/TabSRMM/src/mim.h @@ -54,7 +54,7 @@ typedef HANDLE(WINAPI *BBP)(HDC, RECT *, BP_BUFFERFORMAT, BP_PAINTPARAMS *, HDC typedef HRESULT(WINAPI *EBP)(HANDLE, BOOL);
typedef HRESULT(WINAPI *BPI)(void);
typedef HRESULT(WINAPI *BPU)(void);
-typedef HRESULT(WINAPI *BPSA)(HANDLE, const RECT *, BYTE);
+typedef HRESULT(WINAPI *BPSA)(HANDLE, const RECT *, uint8_t);
//kernel32
typedef int (WINAPI *GLIX)(LPCWSTR, LCTYPE, LPCWSTR, int);
diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp index 5e73f4b7fa..cf7c408d2e 100644 --- a/plugins/TabSRMM/src/msgdialog.cpp +++ b/plugins/TabSRMM/src/msgdialog.cpp @@ -93,7 +93,7 @@ LRESULT CALLBACK HPPKFSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP wParam != VK_UP && wParam != VK_DOWN && wParam != VK_LEFT &&
wParam != VK_RIGHT && wParam != VK_TAB && wParam != VK_SPACE) {
SetFocus(GetDlgItem(mwdat->GetHwnd(), IDC_SRMM_MESSAGE));
- keybd_event((BYTE)wParam, (BYTE)MapVirtualKey(wParam, 0), KEYEVENTF_EXTENDEDKEY | 0, 0);
+ keybd_event((uint8_t)wParam, (uint8_t)MapVirtualKey(wParam, 0), KEYEVENTF_EXTENDEDKEY | 0, 0);
return 0;
}
break;
@@ -943,7 +943,7 @@ void CMsgDialog::onClick_Quote(CCtrlButton*) DBEVENTINFO dbei = {};
dbei.cbBlob = db_event_getBlobSize(hDBEvent);
wchar_t *szText = (wchar_t*)mir_alloc((dbei.cbBlob + 1) * sizeof(wchar_t)); // URLs are made one char bigger for crlf
- dbei.pBlob = (BYTE*)szText;
+ dbei.pBlob = (uint8_t*)szText;
db_event_get(hDBEvent, &dbei);
int iSize = int(mir_strlen((char*)dbei.pBlob)) + 1;
@@ -1964,13 +1964,13 @@ LRESULT CMsgDialog::WndProc_Message(UINT msg, WPARAM wParam, LPARAM lParam) KbdState(isShift, isCtrl, isAlt);
if ((wParam >= '0' && wParam <= '9') && isAlt) { // ALT-1 -> ALT-0 direct tab selection
- BYTE bChar = (BYTE)wParam;
+ uint8_t bChar = (uint8_t)wParam;
int iIndex;
if (bChar == '0')
iIndex = 10;
else
- iIndex = bChar - (BYTE)'0';
+ iIndex = bChar - (uint8_t)'0';
m_pContainer->SelectTab(DM_SELECT_BY_INDEX, iIndex);
return 0;
}
diff --git a/plugins/TabSRMM/src/msgdlgother.cpp b/plugins/TabSRMM/src/msgdlgother.cpp index e1e16473fe..e23e5e8858 100644 --- a/plugins/TabSRMM/src/msgdlgother.cpp +++ b/plugins/TabSRMM/src/msgdlgother.cpp @@ -560,8 +560,8 @@ void CMsgDialog::FlashTab(bool bInvertMode) bool CMsgDialog::GetAvatarVisibility() { - BYTE bAvatarMode = m_pContainer->m_avatarMode; - BYTE bOwnAvatarMode = m_pContainer->m_ownAvatarMode; + uint8_t bAvatarMode = m_pContainer->m_avatarMode; + uint8_t bOwnAvatarMode = m_pContainer->m_ownAvatarMode; char hideOverride = (char)M.GetByte(m_hContact, "hideavatar", -1); // infopanel visible, consider own avatar display @@ -722,7 +722,7 @@ void CMsgDialog::GetSendFormat() HICON CMsgDialog::GetXStatusIcon() const { - BYTE xStatus = m_cache->getXStatusId(); + uint8_t xStatus = m_cache->getXStatusId(); if (xStatus == 0) return nullptr; @@ -1126,7 +1126,7 @@ int CMsgDialog::MsgWindowMenuHandler(int selection, int menuId) case ID_VISIBILITY_HIDDENFORTHISCONTACT: case ID_VISIBILITY_VISIBLEFORTHISCONTACT: { - BYTE avOverrideMode; + uint8_t avOverrideMode; if (selection == ID_VISIBILITY_DEFAULT) avOverrideMode = -1; else if (selection == ID_VISIBILITY_VISIBLEFORTHISCONTACT) @@ -1143,7 +1143,7 @@ int CMsgDialog::MsgWindowMenuHandler(int selection, int menuId) case ID_PICMENU_ALWAYSKEEPTHEBUTTONBARATFULLWIDTH: PluginConfig.m_bAlwaysFullToolbarWidth = !PluginConfig.m_bAlwaysFullToolbarWidth; - db_set_b(0, SRMSGMOD_T, "alwaysfulltoolbar", (BYTE)PluginConfig.m_bAlwaysFullToolbarWidth); + db_set_b(0, SRMSGMOD_T, "alwaysfulltoolbar", (uint8_t)PluginConfig.m_bAlwaysFullToolbarWidth); Srmm_Broadcast(DM_CONFIGURETOOLBAR, 0, 1); break; @@ -1713,7 +1713,7 @@ void CMsgDialog::ShowPopupMenu(const CCtrlBase &pCtrl, POINT pt) break; case ID_EDITOR_SHOWMESSAGELENGTHINDICATOR: PluginConfig.m_visualMessageSizeIndicator = !PluginConfig.m_visualMessageSizeIndicator; - db_set_b(0, SRMSGMOD_T, "msgsizebar", (BYTE)PluginConfig.m_visualMessageSizeIndicator); + db_set_b(0, SRMSGMOD_T, "msgsizebar", (uint8_t)PluginConfig.m_visualMessageSizeIndicator); Srmm_Broadcast(DM_CONFIGURETOOLBAR, 0, 0); Resize(); if (m_pContainer->m_hwndStatus) @@ -2358,7 +2358,7 @@ void CMsgDialog::UpdateWindowState(UINT msg) if (msg == WM_ACTIVATE) { if (m_pContainer->m_flags.m_bTransparent) { DWORD trans = LOWORD(m_pContainer->m_pSettings->dwTransparency); - SetLayeredWindowAttributes(m_pContainer->m_hwnd, CSkin::m_ContainerColorKey, (BYTE)trans, (m_pContainer->m_flags.m_bTransparent ? LWA_ALPHA : 0)); + SetLayeredWindowAttributes(m_pContainer->m_hwnd, CSkin::m_ContainerColorKey, (uint8_t)trans, (m_pContainer->m_flags.m_bTransparent ? LWA_ALPHA : 0)); } } diff --git a/plugins/TabSRMM/src/msgoptions.cpp b/plugins/TabSRMM/src/msgoptions.cpp index 90614c249f..41ad17acfc 100644 --- a/plugins/TabSRMM/src/msgoptions.cpp +++ b/plugins/TabSRMM/src/msgoptions.cpp @@ -732,7 +732,7 @@ public: dbei.eventType = (iIndex == 7) ? EVENTTYPE_ERRMSG : dbei.eventType;
if (dbei.eventType == EVENTTYPE_ERRMSG)
dbei.szModule = (char *)L"Sample error message";
- dbei.pBlob = (iIndex == 6) ? (BYTE *)"is now offline (was online)" : (BYTE *)"The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog.";
+ dbei.pBlob = (iIndex == 6) ? (uint8_t *)"is now offline (was online)" : (uint8_t *)"The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog.";
dbei.cbBlob = (int)mir_strlen((char *)dbei.pBlob) + 1;
dbei.flags = (iIndex == 1 || iIndex == 3 || iIndex == 5) ? DBEF_SENT : 0;
dbei.flags |= (m_bRtl ? DBEF_RTL : 0);
@@ -1017,7 +1017,7 @@ class COptTypingDlg : public CDlgBase void RebuildList(CCtrlClc* = nullptr)
{
- BYTE defType = g_plugin.getByte(SRMSGSET_TYPINGNEW, SRMSGDEFSET_TYPINGNEW);
+ uint8_t defType = g_plugin.getByte(SRMSGSET_TYPINGNEW, SRMSGDEFSET_TYPINGNEW);
if (hItemNew && defType)
m_clist.SetCheck(hItemNew, true);
@@ -1104,14 +1104,14 @@ public: bool OnApply() override
{
SaveList();
- g_plugin.setByte(SRMSGSET_SHOWTYPING, (BYTE)IsDlgButtonChecked(m_hwnd, IDC_SHOWNOTIFY));
- g_plugin.setByte(SRMSGSET_SHOWTYPINGWINFLASH, (BYTE)IsDlgButtonChecked(m_hwnd, IDC_TYPEFLASHWIN));
- g_plugin.setByte(SRMSGSET_SHOWTYPINGNOWINOPEN, (BYTE)IsDlgButtonChecked(m_hwnd, IDC_TYPENOWIN));
- g_plugin.setByte(SRMSGSET_SHOWTYPINGWINOPEN, (BYTE)IsDlgButtonChecked(m_hwnd, IDC_TYPEWIN));
- g_plugin.setByte(SRMSGSET_SHOWTYPINGCLIST, (BYTE)IsDlgButtonChecked(m_hwnd, IDC_NOTIFYTRAY));
- g_plugin.setByte("ShowTypingBalloon", (BYTE)IsDlgButtonChecked(m_hwnd, IDC_NOTIFYBALLOON));
- g_plugin.setByte("ShowTypingPopup", (BYTE)IsDlgButtonChecked(m_hwnd, IDC_NOTIFYPOPUP));
- db_set_b(0, SRMSGMOD_T, "MTN_PopupMode", (BYTE)SendDlgItemMessage(m_hwnd, IDC_MTN_POPUPMODE, CB_GETCURSEL, 0, 0));
+ g_plugin.setByte(SRMSGSET_SHOWTYPING, (uint8_t)IsDlgButtonChecked(m_hwnd, IDC_SHOWNOTIFY));
+ g_plugin.setByte(SRMSGSET_SHOWTYPINGWINFLASH, (uint8_t)IsDlgButtonChecked(m_hwnd, IDC_TYPEFLASHWIN));
+ g_plugin.setByte(SRMSGSET_SHOWTYPINGNOWINOPEN, (uint8_t)IsDlgButtonChecked(m_hwnd, IDC_TYPENOWIN));
+ g_plugin.setByte(SRMSGSET_SHOWTYPINGWINOPEN, (uint8_t)IsDlgButtonChecked(m_hwnd, IDC_TYPEWIN));
+ g_plugin.setByte(SRMSGSET_SHOWTYPINGCLIST, (uint8_t)IsDlgButtonChecked(m_hwnd, IDC_NOTIFYTRAY));
+ g_plugin.setByte("ShowTypingBalloon", (uint8_t)IsDlgButtonChecked(m_hwnd, IDC_NOTIFYBALLOON));
+ g_plugin.setByte("ShowTypingPopup", (uint8_t)IsDlgButtonChecked(m_hwnd, IDC_NOTIFYPOPUP));
+ db_set_b(0, SRMSGMOD_T, "MTN_PopupMode", (uint8_t)SendDlgItemMessage(m_hwnd, IDC_MTN_POPUPMODE, CB_GETCURSEL, 0, 0));
PluginConfig.reloadSettings();
return true;
}
@@ -1420,11 +1420,11 @@ public: struct
{
- BYTE sameAsFlags, sameAs;
+ uint8_t sameAsFlags, sameAs;
COLORREF colour;
char size;
- BYTE style;
- BYTE charset;
+ uint8_t style;
+ uint8_t charset;
char szFace[LF_FACESIZE];
}
static fontSettings[MSGDLGFONTCOUNT + 1];
@@ -1450,18 +1450,18 @@ struct OptCheckBox DWORD defValue; // should be full combined value for masked items!
DWORD dwBit;
- BYTE dbType;
+ uint8_t dbType;
char *dbModule;
char *dbSetting;
- BYTE valueType;
+ uint8_t valueType;
union
{
void *pValue;
char *charValue;
int *intValue;
- BYTE *byteValue;
+ uint8_t *byteValue;
DWORD *dwordValue;
BOOL *boolValue;
};
@@ -1514,7 +1514,7 @@ void OptCheckBox_Save(HWND hwnd, OptCheckBox *cb) switch (cb->dbType) {
case DBVT_BYTE:
- db_set_b(0, cb->dbModule, cb->dbSetting, (BYTE)value);
+ db_set_b(0, cb->dbModule, cb->dbSetting, (uint8_t)value);
break;
case DBVT_WORD:
db_set_w(0, cb->dbModule, cb->dbSetting, (WORD)value);
@@ -1532,7 +1532,7 @@ void OptCheckBox_Save(HWND hwnd, OptCheckBox *cb) *cb->intValue = (int)value;
break;
case CBVT_BYTE:
- *cb->byteValue = (BYTE)value;
+ *cb->byteValue = (uint8_t)value;
break;
case CBVT_DWORD:
*cb->dwordValue = (DWORD)value;
diff --git a/plugins/TabSRMM/src/msgs.h b/plugins/TabSRMM/src/msgs.h index 78fb6bfda9..e1d57835c1 100644 --- a/plugins/TabSRMM/src/msgs.h +++ b/plugins/TabSRMM/src/msgs.h @@ -325,7 +325,7 @@ struct TContainerData : public MZeroedObject SIZE m_szOldToolbarSize;
SIZE m_oldSize, m_preSIZE;
WORD m_avatarMode, m_ownAvatarMode;
- BYTE m_bTBRenderingMode;
+ uint8_t m_bTBRenderingMode;
TLogTheme m_theme;
CMenuBar *m_pMenuBar;
CSideBar *m_pSideBar;
@@ -483,7 +483,7 @@ class CMsgDialog : public CSrmmBaseDialog HICON m_hSmileyIcon;
HWND m_hwndContactPic, m_hwndPanelPic, m_hwndPanelPicParent;
UINT m_bbLSideWidth, m_bbRSideWidth;
- BYTE kstate[256];
+ uint8_t kstate[256];
RECT m_rcNick, m_rcUIN, m_rcStatus, m_rcPic;
int m_originalSplitterY;
diff --git a/plugins/TabSRMM/src/sendlater.cpp b/plugins/TabSRMM/src/sendlater.cpp index ed73a491b9..a9ec1ba160 100644 --- a/plugins/TabSRMM/src/sendlater.cpp +++ b/plugins/TabSRMM/src/sendlater.cpp @@ -62,7 +62,7 @@ struct CSendLaterJob : public MZeroedObject DWORD dwFlags;
int iSendCount; // # of times we tried to send it...
bool fSuccess, fFailed;
- BYTE bCode; // error/progress code (for the UI)
+ uint8_t bCode; // error/progress code (for the UI)
// returns true if this job is persistent (saved to the database).
// such a job will survive a restart of Miranda
@@ -472,7 +472,7 @@ public: LVITEM lvItem = { 0 };
- BYTE bCode = '-';
+ uint8_t bCode = '-';
unsigned uIndex = 0;
for (auto &p : g_sendLaterJobList) {
CContactCache *c = CContactCache::getContactCache(p->hContact);
diff --git a/plugins/TabSRMM/src/sendqueue.cpp b/plugins/TabSRMM/src/sendqueue.cpp index cb52ecc8a8..0860d7e54d 100644 --- a/plugins/TabSRMM/src/sendqueue.cpp +++ b/plugins/TabSRMM/src/sendqueue.cpp @@ -346,7 +346,7 @@ void SendQueue::logError(CMsgDialog *dat, int iSendJobIndex, const wchar_t *szEr DBEVENTINFO dbei = {}; dbei.eventType = EVENTTYPE_ERRMSG; if (iSendJobIndex >= 0) { - dbei.pBlob = (BYTE *)m_jobs[iSendJobIndex].szSendBuffer; + dbei.pBlob = (uint8_t *)m_jobs[iSendJobIndex].szSendBuffer; iMsgLen = mir_strlen(m_jobs[iSendJobIndex].szSendBuffer) + 1; } else { diff --git a/plugins/TabSRMM/src/stdafx.h b/plugins/TabSRMM/src/stdafx.h index 4299063adc..a419b2f617 100644 --- a/plugins/TabSRMM/src/stdafx.h +++ b/plugins/TabSRMM/src/stdafx.h @@ -107,7 +107,7 @@ typedef struct _DWM_THUMBNAIL_PROPERTIES DWORD dwFlags;
RECT rcDestination;
RECT rcSource;
- BYTE opacity;
+ uint8_t opacity;
BOOL fVisible;
BOOL fSourceClientAreaOnly;
} DWM_THUMBNAIL_PROPERTIES, *PDWM_THUMBNAIL_PROPERTIES;
diff --git a/plugins/TabSRMM/src/tabctrl.cpp b/plugins/TabSRMM/src/tabctrl.cpp index 5c9de4d029..bb8b9e3c2e 100644 --- a/plugins/TabSRMM/src/tabctrl.cpp +++ b/plugins/TabSRMM/src/tabctrl.cpp @@ -540,7 +540,7 @@ static void DrawThemesXpTabItem(HDC pDC, RECT *rcItem, UINT uiFlag, TabControlDa // to "flip" the tab item.
BitBlt(dcMem, 0, 0, szBmp.cx, szBmp.cy, pDC, rcItem->left, rcItem->top, SRCCOPY);
- BYTE *pcImg1 = (BYTE*)mir_alloc(nSzBuffPS);
+ uint8_t *pcImg1 = (uint8_t*)mir_alloc(nSzBuffPS);
if (pcImg1) {
GetDIBits(pDC, bmpMem, nStart, szBmp.cy - nLenSub, pcImg1, &biOut, DIB_RGB_COLORS);
bihOut->biHeight = -szBmp.cy; // to mirror bitmap is eough to use negative height between Get/SetDIBits
@@ -569,7 +569,7 @@ static void DrawThemesXpTabItem(HDC pDC, RECT *rcItem, UINT uiFlag, TabControlDa CSkin::FillBack(hdcTemp, &rcTemp);
DrawThemesPart(tabdat, hdcTemp, 9, 0, &rcTemp); // TABP_PANE id = 9
- pcImg = (BYTE *)mir_alloc(nSzBuffPS);
+ pcImg = (uint8_t *)mir_alloc(nSzBuffPS);
if (pcImg) { // get bits:
GetDIBits(hdcTemp, hbmTemp, nStart, 50 - nLenSub, pcImg, &biOut, DIB_RGB_COLORS);
bihOut->biHeight = -50;
@@ -599,7 +599,7 @@ static void DrawThemesXpTabItem(HDC pDC, RECT *rcItem, UINT uiFlag, TabControlDa }
bihOut->biHeight = szBmp.cy;
- pcImg = (BYTE *)mir_alloc(nSzBuffPS);
+ pcImg = (uint8_t *)mir_alloc(nSzBuffPS);
if (pcImg) { // get bits:
GetDIBits(pDC, bmpMem, nStart, szBmp.cy - nLenSub, pcImg, &biOut, DIB_RGB_COLORS);
diff --git a/plugins/TabSRMM/src/themeio.cpp b/plugins/TabSRMM/src/themeio.cpp index a7437e1a62..864ce0cfed 100644 --- a/plugins/TabSRMM/src/themeio.cpp +++ b/plugins/TabSRMM/src/themeio.cpp @@ -130,7 +130,7 @@ static void TSAPI LoadLogfontFromINI(int i, char *szKey, LOGFONTW *lf, COLORREF if (i == MSGFONTID_SYMBOLS_IN || i == MSGFONTID_SYMBOLS_OUT)
lf->lfCharSet = SYMBOL_CHARSET;
else
- lf->lfCharSet = (BYTE)GetPrivateProfileIntA(szKey, "Set", DEFAULT_CHARSET, szIniFilename);
+ lf->lfCharSet = (uint8_t)GetPrivateProfileIntA(szKey, "Set", DEFAULT_CHARSET, szIniFilename);
lf->lfOutPrecision = OUT_DEFAULT_PRECIS;
lf->lfClipPrecision = CLIP_DEFAULT_PRECIS;
lf->lfQuality = DEFAULT_QUALITY;
@@ -282,7 +282,7 @@ void TSAPI ReadThemeFromINI(const wchar_t *szIniFilenameT, TContainerData *dat, db_set_dw(0, szModule, szTemp, GetPrivateProfileIntA(szAppname, "Color", GetSysColor(COLOR_WINDOWTEXT), szIniFilename));
mir_snprintf(szTemp, "Font%dSty", firstIndex + i);
- db_set_b(0, szModule, szTemp, (BYTE)(GetPrivateProfileIntA(szAppname, "Style", 0, szIniFilename)));
+ db_set_b(0, szModule, szTemp, (uint8_t)(GetPrivateProfileIntA(szAppname, "Style", 0, szIniFilename)));
mir_snprintf(szTemp, "Font%dSize", firstIndex + i);
bSize = (char)GetPrivateProfileIntA(szAppname, "Size", -10, szIniFilename);
@@ -294,7 +294,7 @@ void TSAPI ReadThemeFromINI(const wchar_t *szIniFilenameT, TContainerData *dat, charset = GetPrivateProfileIntA(szAppname, "Set", 0, szIniFilename);
if (i == MSGFONTID_SYMBOLS_IN || i == MSGFONTID_SYMBOLS_OUT)
charset = 0;
- db_set_b(0, szModule, szTemp, (BYTE)charset);
+ db_set_b(0, szModule, szTemp, (uint8_t)charset);
}
n++;
}
@@ -311,8 +311,8 @@ void TSAPI ReadThemeFromINI(const wchar_t *szIniFilenameT, TContainerData *dat, for (auto &it : _extSettings_v5)
db_set_dw(0, it.szDbModule, it.szDbSetting, GetPrivateProfileIntA(it.szIniSection, it.szIniName, it.dwDef, szIniFilename));
- db_set_b(0, SRMSGMOD_T, "wantvgrid", (BYTE)(GetPrivateProfileIntA("Message Log", "VGrid", 0, szIniFilename)));
- db_set_b(0, SRMSGMOD_T, "extramicrolf", (BYTE)(GetPrivateProfileIntA("Message Log", "ExtraMicroLF", 0, szIniFilename)));
+ db_set_b(0, SRMSGMOD_T, "wantvgrid", (uint8_t)(GetPrivateProfileIntA("Message Log", "VGrid", 0, szIniFilename)));
+ db_set_b(0, SRMSGMOD_T, "extramicrolf", (uint8_t)(GetPrivateProfileIntA("Message Log", "ExtraMicroLF", 0, szIniFilename)));
for (i = 0; i < CUSTOM_COLORS; i++) {
mir_snprintf(szTemp, "cc%d", i + 1);
@@ -353,8 +353,8 @@ void TSAPI ReadThemeFromINI(const wchar_t *szIniFilenameT, TContainerData *dat, dat->m_theme.inputbg = GetPrivateProfileIntA("Message Log", "InputBG", RGB(224, 224, 224), szIniFilename);
dat->m_theme.hgrid = GetPrivateProfileIntA("Message Log", "HgridColor", RGB(224, 224, 224), szIniFilename);
dat->m_theme.dwFlags = GetPrivateProfileIntA("Message Log", "DWFlags", MWF_LOG_DEFAULT, szIniFilename);
- db_set_b(0, SRMSGMOD_T, "wantvgrid", (BYTE)(GetPrivateProfileIntA("Message Log", "VGrid", 0, szIniFilename)));
- db_set_b(0, SRMSGMOD_T, "extramicrolf", (BYTE)(GetPrivateProfileIntA("Message Log", "ExtraMicroLF", 0, szIniFilename)));
+ db_set_b(0, SRMSGMOD_T, "wantvgrid", (uint8_t)(GetPrivateProfileIntA("Message Log", "VGrid", 0, szIniFilename)));
+ db_set_b(0, SRMSGMOD_T, "extramicrolf", (uint8_t)(GetPrivateProfileIntA("Message Log", "ExtraMicroLF", 0, szIniFilename)));
dat->m_theme.left_indent = GetPrivateProfileIntA("Message Log", "LeftIndent", 0, szIniFilename);
dat->m_theme.right_indent = GetPrivateProfileIntA("Message Log", "RightIndent", 0, szIniFilename);
diff --git a/plugins/TabSRMM/src/themes.cpp b/plugins/TabSRMM/src/themes.cpp index fa055305d7..b7c79b2421 100644 --- a/plugins/TabSRMM/src/themes.cpp +++ b/plugins/TabSRMM/src/themes.cpp @@ -315,9 +315,9 @@ static CSkinItem _defInfoPanel = { CLCDEFAULT_MRGN_TOP, CLCDEFAULT_MRGN_RIGHT, CLCDEFAULT_MRGN_BOTTOM, CLCDEFAULT_IGNORE, 0, nullptr
};
-static BYTE __inline percent_to_byte(UINT32 percent)
+static uint8_t __inline percent_to_byte(UINT32 percent)
{
- return(BYTE)((FLOAT)(((FLOAT)percent) / 100) * 255);
+ return(uint8_t)((FLOAT)(((FLOAT)percent) / 100) * 255);
}
static COLORREF __inline revcolref(COLORREF colref)
@@ -327,11 +327,11 @@ static COLORREF __inline revcolref(COLORREF colref) static DWORD __inline argb_from_cola(COLORREF col, UINT32 alpha)
{
- return((BYTE)percent_to_byte(alpha) << 24 | col);
+ return((uint8_t)percent_to_byte(alpha) << 24 | col);
}
-void TSAPI DrawAlpha(HDC hDC, PRECT rc, DWORD clr_base, int alpha, DWORD clr_dest, BYTE clr_dest_trans, BYTE bGradient,
- BYTE bCorner, DWORD dwRadius, CImageItem *imageItem)
+void TSAPI DrawAlpha(HDC hDC, PRECT rc, DWORD clr_base, int alpha, DWORD clr_dest, uint8_t clr_dest_trans, uint8_t bGradient,
+ uint8_t bCorner, DWORD dwRadius, CImageItem *imageItem)
{
if (rc == nullptr)
return;
@@ -637,7 +637,7 @@ void __inline gradientVertical(UCHAR *ubRedFinal, UCHAR *ubGreenFinal, UCHAR *ub void __fastcall CImageItem::Render(const HDC hdc, const RECT *rc, bool fIgnoreGlyph) const
{
- BYTE l = m_bLeft, r = m_bRight, t = m_bTop, b = m_bBottom;
+ uint8_t l = m_bLeft, r = m_bRight, t = m_bTop, b = m_bBottom;
LONG width = rc->right - rc->left;
LONG height = rc->bottom - rc->top;
BOOL isGlyph = ((m_dwFlags & IMAGE_GLYPH) && Skin->haveGlyphItem());
@@ -838,7 +838,7 @@ wchar_t* CImageItem::Read(const wchar_t *szFilename) }
m_alpha = GetPrivateProfileInt(m_szName, L"Alpha", 100, szFilename);
m_alpha = min(m_alpha, 100);
- m_alpha = (BYTE)((FLOAT)(((FLOAT)m_alpha) / 100) * 255);
+ m_alpha = (uint8_t)((FLOAT)(((FLOAT)m_alpha) / 100) * 255);
m_bf.SourceConstantAlpha = m_alpha;
m_bLeft = GetPrivateProfileInt(m_szName, L"Left", 0, szFilename);
m_bRight = GetPrivateProfileInt(m_szName, L"Right", 0, szFilename);
@@ -920,7 +920,7 @@ void CImageItem::Free() // @param bAlpha new alpha value (0 -> fully transparent, 255 -> opaque)
// default value is 255
-void CImageItem::SetBitmap32Alpha(HBITMAP hBitmap, BYTE bAlpha)
+void CImageItem::SetBitmap32Alpha(HBITMAP hBitmap, uint8_t bAlpha)
{
BITMAP bmp;
GetObject(hBitmap, sizeof(bmp), &bmp);
@@ -928,7 +928,7 @@ void CImageItem::SetBitmap32Alpha(HBITMAP hBitmap, BYTE bAlpha) return;
DWORD dwLen = bmp.bmWidth * bmp.bmHeight * (bmp.bmBitsPixel / 8);
- BYTE *p = (BYTE *)mir_alloc(dwLen);
+ uint8_t *p = (uint8_t *)mir_alloc(dwLen);
if (p == nullptr)
return;
memset(p, 0, dwLen);
@@ -936,7 +936,7 @@ void CImageItem::SetBitmap32Alpha(HBITMAP hBitmap, BYTE bAlpha) GetBitmapBits(hBitmap, dwLen, p);
for (int y = 0; y < bmp.bmHeight; ++y) {
- BYTE *px = p + bmp.bmWidth * 4 * y;
+ uint8_t *px = p + bmp.bmWidth * 4 * y;
for (int x = 0; x < bmp.bmWidth; ++x) {
px[3] = bAlpha;
@@ -955,15 +955,15 @@ void CImageItem::PreMultiply(HBITMAP hBitmap, int mode) int width = bmp.bmWidth;
int height = bmp.bmHeight;
DWORD dwLen = width * height * 4;
- BYTE *p = (BYTE *)mir_alloc(dwLen);
+ uint8_t *p = (uint8_t *)mir_alloc(dwLen);
if (p) {
::GetBitmapBits(hBitmap, dwLen, p);
for (int y = 0; y < height; ++y) {
- BYTE *px = p + width * 4 * y;
+ uint8_t *px = p + width * 4 * y;
for (int x = 0; x < width; ++x) {
if (mode) {
- BYTE alpha = px[3];
+ uint8_t alpha = px[3];
px[0] = px[0] * alpha / 255;
px[1] = px[1] * alpha / 255;
px[2] = px[2] * alpha / 255;
@@ -978,7 +978,7 @@ void CImageItem::PreMultiply(HBITMAP hBitmap, int mode) }
}
-void CImageItem::Colorize(HBITMAP hBitmap, BYTE dr, BYTE dg, BYTE db, BYTE alpha)
+void CImageItem::Colorize(HBITMAP hBitmap, uint8_t dr, uint8_t dg, uint8_t db, uint8_t alpha)
{
float r = (float)dr / 2.55;
float g = (float)dg / 2.55;
@@ -990,11 +990,11 @@ void CImageItem::Colorize(HBITMAP hBitmap, BYTE dr, BYTE dg, BYTE db, BYTE alpha int width = bmp.bmWidth;
int height = bmp.bmHeight;
int dwLen = width * height * 4;
- BYTE *p = (BYTE *)mir_alloc(dwLen);
+ uint8_t *p = (uint8_t *)mir_alloc(dwLen);
if (p) {
::GetBitmapBits(hBitmap, dwLen, p);
for (int y = 0; y < height; ++y) {
- BYTE *px = p + width * 4 * y;
+ uint8_t *px = p + width * 4 * y;
for (int x = 0; x < width; ++x) {
px[0] = (int)(px[0] + b) > 255 ? 255 : px[0] + b;
@@ -1249,7 +1249,7 @@ void CSkin::ReadItem(const int id, const wchar_t *szItem) GetPrivateProfileString(szItem, L"Color2", def_color, buffer, 400, m_tszFileName);
this_item->COLOR2 = HexStringToLong(buffer);
- this_item->COLOR2_TRANSPARENT = (BYTE)GetPrivateProfileInt(szItem, L"COLOR2_TRANSPARENT", defaults->COLOR2_TRANSPARENT, m_tszFileName);
+ this_item->COLOR2_TRANSPARENT = (uint8_t)GetPrivateProfileInt(szItem, L"COLOR2_TRANSPARENT", defaults->COLOR2_TRANSPARENT, m_tszFileName);
this_item->CORNER = defaults->CORNER & CORNER_ACTIVE ? defaults->CORNER : 0;
GetPrivateProfileString(szItem, L"Corner", L"None", buffer, 400, m_tszFileName);
@@ -1384,7 +1384,7 @@ void CSkin::Load(void) _tagSettings[i].defaultval, m_tszFileName);
switch (_tagSettings[i].size) {
case 1:
- db_set_b(0, SRMSGMOD_T, _tagSettings[i].szSetting, (BYTE)data);
+ db_set_b(0, SRMSGMOD_T, _tagSettings[i].szSetting, (uint8_t)data);
break;
case 4:
db_set_dw(0, SRMSGMOD_T, _tagSettings[i].szSetting, data);
@@ -1465,7 +1465,7 @@ void CSkin::Load(void) m_bClipBorder = GetPrivateProfileInt(L"WindowFrame", L"ClipFrame", 0, m_tszFileName) ? true : false;
- BYTE radius_tl, radius_tr, radius_bl, radius_br;
+ uint8_t radius_tl, radius_tr, radius_bl, radius_br;
wchar_t szFinalName[MAX_PATH];
wchar_t szDrive[MAX_PATH], szPath[MAX_PATH];
@@ -1701,7 +1701,7 @@ void CSkin::setupAeroSkins() float fr = (float)((m_dwmColor & 0x00ff0000) >> 16);
float fg = (float)((m_dwmColor & 0x0000ff00) >> 8);
float fb = (float)((m_dwmColor & 0x000000ff));
- BYTE alphafactor = 255 - ((m_dwmColor & 0xff000000) >> 24);
+ uint8_t alphafactor = 255 - ((m_dwmColor & 0xff000000) >> 24);
/*
* a bit tricky, because for low alpha settings (high DWM transparency), the dwm
@@ -1735,7 +1735,7 @@ void CSkin::setupAeroSkins() }
}
- m_dwmColorRGB = RGB((BYTE)fr, (BYTE)fg, (BYTE)fb);
+ m_dwmColorRGB = RGB((uint8_t)fr, (uint8_t)fg, (uint8_t)fb);
FIBITMAP *fib = (FIBITMAP *)Image_Load(tszFilename, IMGL_RETURNDIB);
@@ -1906,7 +1906,7 @@ void CSkin::SkinDrawBGFromDC(HWND hwndClient, HWND hwnd, RECT *rcClient, HDC hdc /////////////////////////////////////////////////////////////////////////////////////////
// draw an icon "Dimmed" (small amount of transparency applied)
-void CSkin::DrawDimmedIcon(HDC hdc, LONG left, LONG top, LONG dx, LONG dy, HICON hIcon, BYTE alpha)
+void CSkin::DrawDimmedIcon(HDC hdc, LONG left, LONG top, LONG dx, LONG dy, HICON hIcon, uint8_t alpha)
{
HDC dcMem = ::CreateCompatibleDC(hdc);
HBITMAP hbm = ::CreateCompatibleBitmap(hdc, dx, dy), hbmOld = nullptr;
@@ -2162,7 +2162,7 @@ void CMsgDialog::RenderToolbarBG(HDC hdc, const RECT &rcWindow) const bool bAero = M.isAero();
bool fTbColorsValid = PluginConfig.m_tbBackgroundHigh && PluginConfig.m_tbBackgroundLow;
- BYTE bAlphaOffset = 0;
+ uint8_t bAlphaOffset = 0;
BOOL fMustDrawNonThemed = ((bAero || fTbColorsValid) && !db_get_b(0, SRMSGMOD_T, "forceThemedToolbar", 0));
RECT rc, rcToolbar;
POINT pt;
@@ -2298,7 +2298,7 @@ void CSkin::AeroEffectCallback_Milk(const HDC hdc, const RECT *rc, int iEffectAr int alpha = (iEffectArea == AERO_EFFECT_AREA_INFOPANEL) ? m_pCurrentAeroEffect->m_baseAlpha : 40;
if (iEffectArea == AERO_EFFECT_AREA_MENUBAR)
alpha = 90;
- BYTE color2_trans = (iEffectArea == AERO_EFFECT_AREA_MENUBAR) ? 0 : 1;
+ uint8_t color2_trans = (iEffectArea == AERO_EFFECT_AREA_MENUBAR) ? 0 : 1;
DWORD corner = (iEffectArea == AERO_EFFECT_AREA_INFOPANEL) ? m_pCurrentAeroEffect->m_cornerRadius : 6;
DrawAlpha(hdc, const_cast<RECT *>(rc), m_pCurrentAeroEffect->m_baseColor, alpha, m_pCurrentAeroEffect->m_gradientColor,
@@ -2327,7 +2327,7 @@ void CSkin::AeroEffectCallback_Solid(const HDC hdc, const RECT *rc, int iEffectA m_pCurrentAeroEffect->m_cornerType, m_pCurrentAeroEffect->m_cornerRadius, nullptr);
}
else {
- BYTE bGradient = (iEffectArea & AERO_EFFECT_AREA_TAB_BOTTOM ? GRADIENT_BT : GRADIENT_TB) + 1;
+ uint8_t bGradient = (iEffectArea & AERO_EFFECT_AREA_TAB_BOTTOM ? GRADIENT_BT : GRADIENT_TB) + 1;
::DrawAlpha(hdc, const_cast<RECT *>(rc), m_pCurrentAeroEffect->m_baseColor, 70,
m_pCurrentAeroEffect->m_gradientColor, 1, bGradient,
m_pCurrentAeroEffect->m_cornerType, m_pCurrentAeroEffect->m_cornerRadius, nullptr);
diff --git a/plugins/TabSRMM/src/themes.h b/plugins/TabSRMM/src/themes.h index 5a99146da6..67a187567e 100644 --- a/plugins/TabSRMM/src/themes.h +++ b/plugins/TabSRMM/src/themes.h @@ -121,10 +121,10 @@ struct AeroEffect wchar_t tszName[40];
DWORD m_baseColor;
DWORD m_gradientColor;
- BYTE m_baseAlpha;
- BYTE m_finalAlpha;
- BYTE m_cornerType;
- BYTE m_gradientType;
+ uint8_t m_baseAlpha;
+ uint8_t m_finalAlpha;
+ uint8_t m_cornerType;
+ uint8_t m_gradientType;
DWORD m_cornerRadius;
DWORD m_glowSize;
COLORREF m_clrBack, m_clrToolbar, m_clrToolbar2;
@@ -155,8 +155,8 @@ public: m_szName[39] = 0;
}
- CImageItem(BYTE bottom, BYTE left, BYTE top, BYTE right, HDC hdc, HBITMAP hbm, DWORD dwFlags,
- HBRUSH brush, BYTE alpha, LONG inner_height, LONG inner_width, LONG height, LONG width)
+ CImageItem(uint8_t bottom, uint8_t left, uint8_t top, uint8_t right, HDC hdc, HBITMAP hbm, DWORD dwFlags,
+ HBRUSH brush, uint8_t alpha, LONG inner_height, LONG inner_width, LONG height, LONG width)
{
m_bBottom = bottom;
m_bLeft = left;
@@ -192,7 +192,7 @@ public: m_hbm = hbm;
}
- void setAlphaFormat(const BYTE bFormat, const BYTE bConstantAlpha)
+ void setAlphaFormat(const uint8_t bFormat, const uint8_t bConstantAlpha)
{
m_bf.AlphaFormat = bFormat;
m_bf.SourceConstantAlpha = bConstantAlpha;
@@ -225,23 +225,23 @@ public: void Create(const wchar_t *szImageFile);
void __fastcall Render(const HDC hdc, const RECT *rc, bool fIgnoreGlyph) const;
static void TSAPI PreMultiply(HBITMAP hBitmap, int mode);
- static void TSAPI SetBitmap32Alpha(HBITMAP hBitmap, BYTE bAlpha = 255);
- static void TSAPI Colorize(HBITMAP hBitmap, BYTE dr, BYTE dg, BYTE db, BYTE alpha = 0);
+ static void TSAPI SetBitmap32Alpha(HBITMAP hBitmap, uint8_t bAlpha = 255);
+ static void TSAPI Colorize(HBITMAP hBitmap, uint8_t dr, uint8_t dg, uint8_t db, uint8_t alpha = 0);
public:
bool m_fValid; // verified item, indicates that all parameters are valid
private:
wchar_t m_szName[40]; // everything wants a name, an image item doesn't need one though
HBITMAP m_hbm; // the bitmap handle
- BYTE m_bLeft, m_bRight, m_bTop, m_bBottom; // sizing margins for the outer 8 image parts
- BYTE m_alpha; // constant alpha for the entire image, applied via m_bf. sums with perpixel alpha
+ uint8_t m_bLeft, m_bRight, m_bTop, m_bBottom; // sizing margins for the outer 8 image parts
+ uint8_t m_alpha; // constant alpha for the entire image, applied via m_bf. sums with perpixel alpha
DWORD m_dwFlags; // flags
HDC m_hdc; // *can* hold a pre-created hdc to speed up rendering
HBITMAP m_hbmOld; // old bitmap, needs to be selected into m_hdc before destroying it
LONG m_inner_height, m_inner_width; // dimensions of the inner image part
LONG m_width, m_height; // width and height of the image, in pixels
BLENDFUNCTION m_bf; // for AlphaBlend()
- BYTE m_bStretch; // stretch mode (unused in tabSRMM
+ uint8_t m_bStretch; // stretch mode (unused in tabSRMM
HBRUSH m_fillBrush; // brush to fill the inner part (faster) dwFlags & IMAGE_FILLSOLID must be set
LONG m_glyphMetrics[4]; // these coordinates point into the glyph image (if IMAGE_GLYPH is set)
CImageItem* m_nextItem; // next item in a set of image items (usually the skin set)
@@ -253,13 +253,13 @@ struct CSkinItem { char szDBname[40];
int statusID;
- BYTE GRADIENT;
- BYTE CORNER;
+ uint8_t GRADIENT;
+ uint8_t CORNER;
DWORD COLOR;
DWORD COLOR2;
- BYTE COLOR2_TRANSPARENT;
+ uint8_t COLOR2_TRANSPARENT;
DWORD TEXTCOLOR;
@@ -269,7 +269,7 @@ struct CSkinItem { int MARGIN_TOP;
int MARGIN_RIGHT;
int MARGIN_BOTTOM;
- BYTE IGNORED;
+ uint8_t IGNORED;
DWORD BORDERSTYLE;
CImageItem *imageItem;
};
@@ -369,7 +369,7 @@ public: */
static void TSAPI SkinDrawBGFromDC(HWND hwndClient, HWND hwnd, RECT *rcClient, HDC hdcTarget);
static void TSAPI SkinDrawBG(HWND hwndClient, HWND hwnd, TContainerData *pContainer, RECT *rcClient, HDC hdcTarget);
- static void TSAPI DrawDimmedIcon(HDC hdc, LONG left, LONG top, LONG dx, LONG dy, HICON hIcon, BYTE alpha);
+ static void TSAPI DrawDimmedIcon(HDC hdc, LONG left, LONG top, LONG dx, LONG dy, HICON hIcon, uint8_t alpha);
static DWORD TSAPI HexStringToLong(const wchar_t *szSource);
static UINT TSAPI DrawRichEditFrame(HWND hwnd, const CMsgDialog *mwdat, UINT skinID, UINT msg, WPARAM wParam, LPARAM lParam, WNDPROC OldWndProc);
static UINT TSAPI NcCalcRichEditFrame(HWND hwnd, const CMsgDialog *mwdat, UINT skinID, UINT msg, WPARAM wParam, LPARAM lParam, WNDPROC OldWndProc);
@@ -465,7 +465,7 @@ struct ButtonItem { wchar_t szTip[256];
char szService[256];
char szModule[256], szSetting[256];
- BYTE bValuePush[256], bValueRelease[256];
+ uint8_t bValuePush[256], bValueRelease[256];
DWORD type;
void(*pfnAction)(ButtonItem *item, HWND hwndDlg, CMsgDialog *dat, HWND hwndItem);
void(*pfnCallback)(ButtonItem *item, HWND hwndDlg, CMsgDialog *dat, HWND hwndItem);
diff --git a/plugins/TabSRMM/src/typingnotify.cpp b/plugins/TabSRMM/src/typingnotify.cpp index 5314e2d912..82338386cc 100644 --- a/plugins/TabSRMM/src/typingnotify.cpp +++ b/plugins/TabSRMM/src/typingnotify.cpp @@ -4,21 +4,21 @@ static HGENMENU hDisableMenu = nullptr; static MWindowList hPopupsList = nullptr;
-static BYTE OnePopup;
-static BYTE ShowMenu;
-static BYTE StartDisabled;
-static BYTE StopDisabled;
-static BYTE Disabled;
-static BYTE ColorMode;
-static BYTE TimeoutMode;
-static BYTE TimeoutMode2;
+static uint8_t OnePopup;
+static uint8_t ShowMenu;
+static uint8_t StartDisabled;
+static uint8_t StopDisabled;
+static uint8_t Disabled;
+static uint8_t ColorMode;
+static uint8_t TimeoutMode;
+static uint8_t TimeoutMode2;
static int Timeout;
static int Timeout2;
static int newTimeout;
static int newTimeout2;
-static BYTE newTimeoutMode;
-static BYTE newTimeoutMode2;
-static BYTE newColorMode;
+static uint8_t newTimeoutMode;
+static uint8_t newTimeoutMode2;
+static uint8_t newColorMode;
static HANDLE hntfStarted = nullptr;
static HANDLE hntfStopped = nullptr;
@@ -465,12 +465,12 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA db_set_b(0, TypigModule, SET_ONEPOPUP, OnePopup);
db_set_b(0, TypigModule, SET_SHOWDISABLEMENU, ShowMenu);
- db_set_b(0, TypigModule, SET_DISABLED, (BYTE)(StartDisabled | StopDisabled));
+ db_set_b(0, TypigModule, SET_DISABLED, (uint8_t)(StartDisabled | StopDisabled));
db_set_b(0, TypigModule, SET_COLOR_MODE, ColorMode);
db_set_b(0, TypigModule, SET_TIMEOUT_MODE, TimeoutMode);
- db_set_b(0, TypigModule, SET_TIMEOUT, (BYTE)Timeout);
+ db_set_b(0, TypigModule, SET_TIMEOUT, (uint8_t)Timeout);
db_set_b(0, TypigModule, SET_TIMEOUT_MODE2, TimeoutMode2);
- db_set_b(0, TypigModule, SET_TIMEOUT2, (BYTE)Timeout2);
+ db_set_b(0, TypigModule, SET_TIMEOUT2, (uint8_t)Timeout2);
return TRUE;
}
}
@@ -532,6 +532,6 @@ int TN_ModuleInit() int TN_ModuleDeInit()
{
WindowList_Destroy(hPopupsList);
- db_set_b(0, TypigModule, SET_DISABLED, (BYTE)(Disabled | StartDisabled | StopDisabled));
+ db_set_b(0, TypigModule, SET_DISABLED, (uint8_t)(Disabled | StartDisabled | StopDisabled));
return 0;
}
diff --git a/plugins/TabSRMM/src/userprefs.cpp b/plugins/TabSRMM/src/userprefs.cpp index 56cc73e770..3a8660e028 100644 --- a/plugins/TabSRMM/src/userprefs.cpp +++ b/plugins/TabSRMM/src/userprefs.cpp @@ -60,9 +60,9 @@ public: {
DWORD maxhist = M.GetDword(m_hContact, "maxhist", 0);
int iLocalFormat = M.GetDword(m_hContact, "sendformat", 0);
- BYTE bSplit = M.GetByte(m_hContact, "splitoverride", 0);
- BYTE bInfoPanel = M.GetByte(m_hContact, "infopanel", 0);
- BYTE bAvatarVisible = M.GetByte(m_hContact, "hideavatar", -1);
+ uint8_t bSplit = M.GetByte(m_hContact, "splitoverride", 0);
+ uint8_t bInfoPanel = M.GetByte(m_hContact, "infopanel", 0);
+ uint8_t bAvatarVisible = M.GetByte(m_hContact, "hideavatar", -1);
cmbPanel.AddString(TranslateT("Use global setting"));
cmbPanel.AddString(TranslateT("Always on"));
@@ -99,7 +99,7 @@ public: bool OnApply() override
{
CMsgDialog *dat = Srmm_FindDialog(m_hContact);
- BYTE bOldInfoPanel = M.GetByte(m_hContact, "infopanel", 0);
+ uint8_t bOldInfoPanel = M.GetByte(m_hContact, "infopanel", 0);
int iIndex = SendDlgItemMessage(m_hwnd, IDC_TEXTFORMATTING, CB_GETCURSEL, 0, 0);
if (iIndex != CB_ERR) {
@@ -109,20 +109,20 @@ public: db_set_dw(m_hContact, SRMSGMOD_T, "sendformat", iIndex == 2 ? -1 : 1);
}
- db_set_b(m_hContact, SRMSGMOD_T, "splitoverride", (BYTE)(IsDlgButtonChecked(m_hwnd, IDC_PRIVATESPLITTER) ? 1 : 0));
+ db_set_b(m_hContact, SRMSGMOD_T, "splitoverride", (uint8_t)(IsDlgButtonChecked(m_hwnd, IDC_PRIVATESPLITTER) ? 1 : 0));
- db_set_b(m_hContact, TEMPLATES_MODULE, "enabled", (BYTE)(IsDlgButtonChecked(m_hwnd, IDC_TEMPLOVERRIDE)));
- db_set_b(m_hContact, RTLTEMPLATES_MODULE, "enabled", (BYTE)(IsDlgButtonChecked(m_hwnd, IDC_RTLTEMPLOVERRIDE)));
+ db_set_b(m_hContact, TEMPLATES_MODULE, "enabled", (uint8_t)(IsDlgButtonChecked(m_hwnd, IDC_TEMPLOVERRIDE)));
+ db_set_b(m_hContact, RTLTEMPLATES_MODULE, "enabled", (uint8_t)(IsDlgButtonChecked(m_hwnd, IDC_RTLTEMPLOVERRIDE)));
- BYTE bAvatarVisible = (BYTE)SendDlgItemMessage(m_hwnd, IDC_SHOWAVATAR, CB_GETCURSEL, 0, 0);
+ uint8_t bAvatarVisible = (uint8_t)SendDlgItemMessage(m_hwnd, IDC_SHOWAVATAR, CB_GETCURSEL, 0, 0);
if (bAvatarVisible == 0)
db_unset(m_hContact, SRMSGMOD_T, "hideavatar");
else
- db_set_b(m_hContact, SRMSGMOD_T, "hideavatar", (BYTE)(bAvatarVisible == 1 ? 1 : 0));
+ db_set_b(m_hContact, SRMSGMOD_T, "hideavatar", (uint8_t)(bAvatarVisible == 1 ? 1 : 0));
- BYTE bInfoPanel = (BYTE)SendDlgItemMessage(m_hwnd, IDC_INFOPANEL, CB_GETCURSEL, 0, 0);
+ uint8_t bInfoPanel = (uint8_t)SendDlgItemMessage(m_hwnd, IDC_INFOPANEL, CB_GETCURSEL, 0, 0);
if (bInfoPanel != bOldInfoPanel) {
- db_set_b(m_hContact, SRMSGMOD_T, "infopanel", (BYTE)(bInfoPanel == 0 ? 0 : (bInfoPanel == 1 ? 1 : -1)));
+ db_set_b(m_hContact, SRMSGMOD_T, "infopanel", (uint8_t)(bInfoPanel == 0 ? 0 : (bInfoPanel == 1 ? 1 : -1)));
if (dat)
SendMessage(dat->GetHwnd(), DM_SETINFOPANEL, 0, 0);
}
@@ -284,7 +284,7 @@ public: int state = IsDlgButtonChecked(m_hwnd, IDC_UPREFS_LOGSTATUS);
if (state != BST_INDETERMINATE)
- db_set_b(m_hContact, SRMSGMOD_T, "logstatuschanges", (BYTE)state);
+ db_set_b(m_hContact, SRMSGMOD_T, "logstatuschanges", (uint8_t)state);
if (dwMask) {
db_set_dw(m_hContact, SRMSGMOD_T, "mwmask", dwMask);
diff --git a/plugins/TabSRMM/src/utils.cpp b/plugins/TabSRMM/src/utils.cpp index ee26508526..f9ccd23e20 100644 --- a/plugins/TabSRMM/src/utils.cpp +++ b/plugins/TabSRMM/src/utils.cpp @@ -261,7 +261,7 @@ bool CMsgDialog::FormatTitleBar(const wchar_t *szFormat, CMStringW &dest) case 'x':
{
- BYTE xStatus = m_cache->getXStatusId();
+ uint8_t xStatus = m_cache->getXStatusId();
if (m_wStatus != ID_STATUS_OFFLINE && xStatus > 0 && xStatus <= 31) {
ptrW szXStatus(db_get_wsa(m_hContact, m_szProto, "XStatusName"));
dest.Append((szXStatus != nullptr) ? Trunc500(szXStatus) : xStatusDescr[xStatus - 1]);
@@ -271,7 +271,7 @@ bool CMsgDialog::FormatTitleBar(const wchar_t *szFormat, CMStringW &dest) case 'm':
{
- BYTE xStatus = m_cache->getXStatusId();
+ uint8_t xStatus = m_cache->getXStatusId();
if (m_wStatus != ID_STATUS_OFFLINE && xStatus > 0 && xStatus <= 31) {
ptrW szXStatus(db_get_wsa(m_hContact, m_szProto, "XStatusName"));
dest.Append((szXStatus != nullptr) ? Trunc500(szXStatus) : xStatusDescr[xStatus - 1]);
@@ -477,7 +477,7 @@ struct TOldContainerSettings WORD avatarMode;
WORD ownAvatarMode;
WORD autoCloseSeconds;
- BYTE reserved[10];
+ uint8_t reserved[10];
};
int Utils::ReadContainerSettingsFromDB(const MCONTACT hContact, TContainerSettings *cs, const char *szKey)
diff --git a/plugins/TipperYM/src/bitmap_func.cpp b/plugins/TipperYM/src/bitmap_func.cpp index d10a95c460..3915087916 100644 --- a/plugins/TipperYM/src/bitmap_func.cpp +++ b/plugins/TipperYM/src/bitmap_func.cpp @@ -429,7 +429,7 @@ COLOR32* SaveAlpha(LPRECT lpRect) return res;
}
-void RestoreAlpha(LPRECT lpRect, COLOR32 *pBits, BYTE alpha)
+void RestoreAlpha(LPRECT lpRect, COLOR32 *pBits, uint8_t alpha)
{
GdiFlush();
@@ -461,14 +461,14 @@ BOOL IsAlphaTransparent(HBITMAP hBitmap) return FALSE;
DWORD dwLen = bmp.bmWidth * bmp.bmHeight * (bmp.bmBitsPixel / 8);
- BYTE *p = (BYTE *)mir_calloc(dwLen);
+ uint8_t *p = (uint8_t *)mir_calloc(dwLen);
if (p == nullptr)
return FALSE;
GetBitmapBits(hBitmap, dwLen, p);
for (int y = 0; y < bmp.bmHeight; y++) {
- BYTE *px = p + bmp.bmWidth * 4 * y;
+ uint8_t *px = p + bmp.bmWidth * 4 * y;
for (int x = 0; x < bmp.bmWidth; x++) {
if (px[3] != 0) {
mir_free(p);
@@ -601,7 +601,7 @@ void ColorizeBitmap() }
// code from Clist Modern by FYR
-HRGN CreateOpaqueRgn(BYTE level, bool bOpaque)
+HRGN CreateOpaqueRgn(uint8_t level, bool bOpaque)
{
if (!skin.colBits)
return nullptr;
diff --git a/plugins/TipperYM/src/bitmap_func.h b/plugins/TipperYM/src/bitmap_func.h index 96d5c7a29f..205d7ead75 100644 --- a/plugins/TipperYM/src/bitmap_func.h +++ b/plugins/TipperYM/src/bitmap_func.h @@ -64,9 +64,9 @@ void DestroySkinBitmap(); int DrawTextAlpha(HDC hdc, LPCTSTR lpString, int nCount, LPRECT lpRect, UINT uFormat);
void DrawIconExAlpha(HDC hdc, int xLeft, int yTop, HICON hIcon, int cxWidth, int cyWidth, UINT istepIfAniCur, HBRUSH hbrFlickerFreeDraw, UINT diFlags, bool bIsSmiley);
COLOR32* SaveAlpha(LPRECT lpRect);
-void RestoreAlpha(LPRECT lpRect, COLOR32 *pBits, BYTE alpha = 0xff);
+void RestoreAlpha(LPRECT lpRect, COLOR32 *pBits, uint8_t alpha = 0xff);
void PremultipleChannels();
void ColorizeBitmap();
-HRGN CreateOpaqueRgn(BYTE level, bool bOpaque);
+HRGN CreateOpaqueRgn(uint8_t level, bool bOpaque);
#endif
diff --git a/plugins/TipperYM/src/options.cpp b/plugins/TipperYM/src/options.cpp index 2548b4be14..594d282921 100644 --- a/plugins/TipperYM/src/options.cpp +++ b/plugins/TipperYM/src/options.cpp @@ -181,7 +181,7 @@ void SaveDS(DISPLAYSUBST *ds, int index) mir_snprintf(setting, "Name%d", index);
db_set_ws(0, MODULE_ITEMS, setting, ds->swzName);
mir_snprintf(setting, "Type%d", index);
- db_set_b(0, MODULE_ITEMS, setting, (BYTE)ds->type);
+ db_set_b(0, MODULE_ITEMS, setting, (uint8_t)ds->type);
mir_snprintf(setting, "Module%d", index);
db_set_s(0, MODULE_ITEMS, setting, ds->szModuleName);
mir_snprintf(setting, "Setting%d", index);
@@ -245,7 +245,7 @@ void SaveDI(DISPLAYITEM *di, int index) }
mir_snprintf(setting, "DIType%d", index);
- db_set_b(0, MODULE_ITEMS, setting, (BYTE)di->type);
+ db_set_b(0, MODULE_ITEMS, setting, (uint8_t)di->type);
mir_snprintf(setting, "DILineAbove%d", index);
db_set_b(0, MODULE_ITEMS, setting, di->bLineAbove ? 1 : 0);
mir_snprintf(setting, "DIValNewline%d", index);
@@ -260,12 +260,12 @@ void SaveOptions() {
g_plugin.setDword("MaxWidth", opt.iWinWidth);
g_plugin.setDword("MaxHeight", opt.iWinMaxHeight);
- g_plugin.setByte("AvatarOpacity", (BYTE)opt.iAvatarOpacity);
+ g_plugin.setByte("AvatarOpacity", (uint8_t)opt.iAvatarOpacity);
g_plugin.setByte("AvatarRoundCorners", (opt.bAvatarRound ? 1 : 0));
- g_plugin.setByte("TitleIconLayout", (BYTE)opt.titleIconLayout);
+ g_plugin.setByte("TitleIconLayout", (uint8_t)opt.titleIconLayout);
g_plugin.setByte("TitleShow", (opt.bShowTitle ? 1 : 0));
if (ServiceExists(MS_AV_DRAWAVATAR))
- g_plugin.setByte("AVLayout", (BYTE)opt.avatarLayout);
+ g_plugin.setByte("AVLayout", (uint8_t)opt.avatarLayout);
opt.bWaitForAvatar = (opt.avatarLayout == PAV_NONE) ? false : true;
g_plugin.setDword("AVSize", opt.iAvatarSize);
@@ -281,11 +281,11 @@ void SaveOptions() g_plugin.setWord("OuterAvatarPadding", opt.iOuterAvatarPadding);
g_plugin.setWord("InnerAvatarPadding", opt.iInnerAvatarPadding);
g_plugin.setWord("TextPadding", opt.iTextPadding);
- g_plugin.setByte("Position", (BYTE)opt.pos);
+ g_plugin.setByte("Position", (uint8_t)opt.pos);
g_plugin.setDword("MinWidth", (DWORD)opt.iMinWidth);
g_plugin.setDword("MinHeight", (DWORD)opt.iMinHeight);
g_plugin.setDword("SidebarWidth", (DWORD)opt.iSidebarWidth);
- g_plugin.setByte("MouseTollerance", (BYTE)opt.iMouseTollerance);
+ g_plugin.setByte("MouseTollerance", (uint8_t)opt.iMouseTollerance);
g_plugin.setByte("SBarTips", (opt.bStatusBarTips ? 1 : 0));
g_plugin.setWord("LabelVAlign", opt.iLabelValign);
@@ -329,9 +329,9 @@ void SaveSkinOptions() g_plugin.setByte("DropShadow", (opt.bDropShadow ? 1 : 0));
g_plugin.setByte("RoundCorners", (opt.bRound ? 1 : 0));
g_plugin.setByte("AeroGlass", (opt.bAeroGlass ? 1 : 0));
- g_plugin.setByte("Opacity", (BYTE)opt.iOpacity);
- g_plugin.setByte("ShowEffect", (BYTE)opt.showEffect);
- g_plugin.setByte("ShowEffectSpeed", (BYTE)opt.iAnimateSpeed);
+ g_plugin.setByte("Opacity", (uint8_t)opt.iOpacity);
+ g_plugin.setByte("ShowEffect", (uint8_t)opt.showEffect);
+ g_plugin.setByte("ShowEffectSpeed", (uint8_t)opt.iAnimateSpeed);
g_plugin.setByte("LoadFonts", (opt.bLoadFonts ? 1 : 0));
g_plugin.setByte("LoadProportions", (opt.bLoadProportions ? 1 : 0));
g_plugin.setDword("EnableColoring", opt.iEnableColoring);
@@ -367,7 +367,7 @@ void LoadOptions() opt.iAvatarOpacity = g_plugin.getByte("AvatarOpacity", 100);
if (opt.iAvatarOpacity > 100) opt.iAvatarOpacity = 100;
opt.bAvatarRound = (g_plugin.getByte("AvatarRoundCorners", opt.bRound ? 1 : 0) == 1);
- opt.titleIconLayout = (PopupIconTitleLayout)g_plugin.getByte("TitleIconLayout", (BYTE)PTL_LEFTICON);
+ opt.titleIconLayout = (PopupIconTitleLayout)g_plugin.getByte("TitleIconLayout", (uint8_t)PTL_LEFTICON);
opt.bShowTitle = (g_plugin.getByte("TitleShow", 1) == 1);
if (ServiceExists(MS_AV_DRAWAVATAR))
opt.avatarLayout = (PopupAvLayout)g_plugin.getByte("AVLayout", PAV_RIGHT);
@@ -422,11 +422,11 @@ void LoadOptions() opt.iOuterAvatarPadding = g_plugin.getWord("OuterAvatarPadding", 6);
opt.iInnerAvatarPadding = g_plugin.getWord("InnerAvatarPadding", 10);
opt.iTextPadding = g_plugin.getWord("TextPadding", 4);
- opt.pos = (PopupPosition)g_plugin.getByte("Position", (BYTE)PP_BOTTOMRIGHT);
+ opt.pos = (PopupPosition)g_plugin.getByte("Position", (uint8_t)PP_BOTTOMRIGHT);
opt.iMinWidth = g_plugin.getDword("MinWidth", 0);
opt.iMinHeight = g_plugin.getDword("MinHeight", 0);
- opt.iMouseTollerance = g_plugin.getByte("MouseTollerance", (BYTE)GetSystemMetrics(SM_CXSMICON));
+ opt.iMouseTollerance = g_plugin.getByte("MouseTollerance", (uint8_t)GetSystemMetrics(SM_CXSMICON));
opt.bStatusBarTips = (g_plugin.getByte("SBarTips", 1) == 1);
// convert defunct last message and status message options to new 'sys' items, and remove the old settings
@@ -533,7 +533,7 @@ void LoadOptions() opt.bDropShadow = g_plugin.getByte("DropShadow", 1) ? true : false;
opt.bRound = g_plugin.getByte("RoundCorners", 1) ? true : false;
opt.bAeroGlass = g_plugin.getByte("AeroGlass", 0) ? true : false;
- opt.showEffect = (PopupShowEffect)g_plugin.getByte("ShowEffect", (BYTE)PSE_FADE);
+ opt.showEffect = (PopupShowEffect)g_plugin.getByte("ShowEffect", (uint8_t)PSE_FADE);
opt.iAnimateSpeed = g_plugin.getByte("ShowEffectSpeed", 12);
if (opt.iAnimateSpeed < 1)
@@ -1893,13 +1893,13 @@ INT_PTR CALLBACK DlgProcFavouriteContacts(HWND hwndDlg, UINT msg, WPARAM wParam, switch (LOWORD(wParam)) {
case IDC_BTN_OK:
{
- BYTE isChecked;
+ uint8_t isChecked;
int count = 0;
for (auto &hContact : Contacts()) {
HANDLE hItem = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_FINDCONTACT, hContact, 0);
if (hItem) {
- isChecked = (BYTE)SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_GETCHECKMARK, (WPARAM)hItem, 0);
+ isChecked = (uint8_t)SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_GETCHECKMARK, (WPARAM)hItem, 0);
g_plugin.setByte(hContact, "FavouriteContact", isChecked);
if (isChecked)
count++;
diff --git a/plugins/TipperYM/src/options.h b/plugins/TipperYM/src/options.h index deccb7dd50..fe3a491f12 100644 --- a/plugins/TipperYM/src/options.h +++ b/plugins/TipperYM/src/options.h @@ -74,10 +74,10 @@ struct DIListNode struct MARGINS
{
- BYTE top;
- BYTE right;
- BYTE bottom;
- BYTE left;
+ uint8_t top;
+ uint8_t right;
+ uint8_t bottom;
+ uint8_t left;
};
struct EXTRAICONDATA
@@ -88,8 +88,8 @@ struct EXTRAICONDATA struct ICONSTATE
{
- BYTE order;
- BYTE vis;
+ uint8_t order;
+ uint8_t vis;
};
enum PopupAvLayout { PAV_NONE = 0, PAV_LEFT = 1, PAV_RIGHT = 2 };
@@ -158,8 +158,8 @@ struct OPTIONS bool bLimitMsg;
int iLimitCharCount;
int iSmileyAddFlags;
- BYTE exIconsOrder[EXICONS_COUNT];
- BYTE exIconsVis[EXICONS_COUNT];
+ uint8_t exIconsOrder[EXICONS_COUNT];
+ uint8_t exIconsVis[EXICONS_COUNT];
};
extern OPTIONS opt;
diff --git a/plugins/TipperYM/src/popwin.cpp b/plugins/TipperYM/src/popwin.cpp index 4b08036ac0..10e3744cfc 100644 --- a/plugins/TipperYM/src/popwin.cpp +++ b/plugins/TipperYM/src/popwin.cpp @@ -499,7 +499,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa HDC hdcMem = CreateCompatibleDC(hdc); SelectObject(hdcMem, hbmpAvatar); - blend.SourceConstantAlpha = (BYTE)(opt.iAvatarOpacity / 100.0 * 255); + blend.SourceConstantAlpha = (uint8_t)(opt.iAvatarOpacity / 100.0 * 255); AlphaBlend(hdc, rcAvatar.left, rcAvatar.top, bm.bmWidth, bm.bmHeight, hdcMem, 0, 0, bm.bmWidth, bm.bmHeight, blend); blend.SourceConstantAlpha = 255; @@ -512,7 +512,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa FrameRect(hdc, &rcAvatar, hbrBorder); DeleteObject(hbrBorder); - RestoreAlpha(&rcAvatar, pBits, (BYTE)(opt.iAvatarOpacity / 100.0 * 255)); + RestoreAlpha(&rcAvatar, pBits, (uint8_t)(opt.iAvatarOpacity / 100.0 * 255)); } if (hrgnAvatar) { diff --git a/plugins/TipperYM/src/skin_parser.cpp b/plugins/TipperYM/src/skin_parser.cpp index 971dce8e12..fa0e439a25 100644 --- a/plugins/TipperYM/src/skin_parser.cpp +++ b/plugins/TipperYM/src/skin_parser.cpp @@ -194,13 +194,13 @@ void ParseFontPart(FILE *fp, wchar_t *buff) }
else if (wcsstr(buff, L"color")) {
if (GetSettingName(buff, "Col", szSetting, sizeof(szSetting) - 1)) {
- BYTE r = _wtoi(pch);
+ uint8_t r = _wtoi(pch);
pch = wcschr(pch, ' ');
if (++pch) {
- BYTE g = _wtoi(pch);
+ uint8_t g = _wtoi(pch);
pch = wcschr(pch, ' ');
if (++pch) {
- BYTE b = _wtoi(pch);
+ uint8_t b = _wtoi(pch);
COLORREF color = RGB(r, g, b);
g_plugin.setDword(szSetting, color);
}
@@ -211,13 +211,13 @@ void ParseFontPart(FILE *fp, wchar_t *buff) if (GetSettingName(buff, "Size", szSetting, sizeof(szSetting) - 1)) {
HDC hdc = GetDC(nullptr);
int size = -MulDiv(_wtoi(pch), GetDeviceCaps(hdc, LOGPIXELSY), 72);
- g_plugin.setByte(szSetting, (BYTE)size);
+ g_plugin.setByte(szSetting, (uint8_t)size);
ReleaseDC(nullptr, hdc);
}
}
else if (wcsstr(buff, L"effect")) {
if (GetSettingName(buff, "Sty", szSetting, sizeof(szSetting) - 1)) {
- BYTE effect = 0;
+ uint8_t effect = 0;
if (wcsstr(pch, L"font_bold"))
effect |= DBFONTF_BOLD;
if (wcsstr(pch, L"font_italic"))
diff --git a/plugins/TipperYM/src/subst.cpp b/plugins/TipperYM/src/subst.cpp index 68de205802..920de10718 100644 --- a/plugins/TipperYM/src/subst.cpp +++ b/plugins/TipperYM/src/subst.cpp @@ -168,7 +168,7 @@ wchar_t* GetLastMessageText(MCONTACT hContact, bool received) DBEVENTINFO dbei = {}; db_event_get(hDbEvent, &dbei); if (dbei.eventType == EVENTTYPE_MESSAGE && !(dbei.flags & DBEF_SENT) == received) { - dbei.pBlob = (BYTE *)alloca(dbei.cbBlob); + dbei.pBlob = (uint8_t *)alloca(dbei.cbBlob); db_event_get(hDbEvent, &dbei); if (dbei.cbBlob == 0 || dbei.pBlob == nullptr) return nullptr; diff --git a/plugins/TipperYM/src/translations.cpp b/plugins/TipperYM/src/translations.cpp index 3f506ac7c8..7fc31e59b4 100644 --- a/plugins/TipperYM/src/translations.cpp +++ b/plugins/TipperYM/src/translations.cpp @@ -254,7 +254,7 @@ wchar_t *ByteToYesNo(MCONTACT hContact, const char *szModuleName, const char *sz wchar_t *ByteToGender(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen)
{
- BYTE val = (BYTE)db_get_b(hContact, szModuleName, szSettingName, 0);
+ uint8_t val = (uint8_t)db_get_b(hContact, szModuleName, szSettingName, 0);
if (val == 'F')
wcsncpy(buff, TranslateT("Female"), bufflen);
else if (val == 'M')
@@ -720,8 +720,8 @@ static DBVTranslation internalTranslations[] = { WordToStatusDesc, LPGENW("WORD to status description") },
{ TimestampToTime, LPGENW("DWORD timestamp to time") },
{ TimestampToTimeDifference, LPGENW("DWORD timestamp to time difference") },
- { ByteToYesNo, LPGENW("BYTE to Yes/No") },
- { ByteToGender, LPGENW("BYTE to Male/Female (ICQ)") },
+ { ByteToYesNo, LPGENW("uint8_t to Yes/No") },
+ { ByteToGender, LPGENW("uint8_t to Male/Female (ICQ)") },
{ WordToCountry, LPGENW("WORD to country name") },
{ DwordToIp, LPGENW("DWORD to IP address") },
{ DayMonthYearToDate, LPGENW("<prefix>Day|Month|Year to date") },
@@ -735,10 +735,10 @@ static DBVTranslation internalTranslations[] = { TimestampToLongDate, LPGENW("DWORD timestamp to date (long)") },
{ EmptyXStatusToDefaultName, LPGENW("xStatus: empty xStatus name to default name") },
{ SecondsToTimeDifference, LPGENW("DWORD seconds to time difference") },
- { TimezoneToTime, LPGENW("BYTE timezone to time") },
+ { TimezoneToTime, LPGENW("uint8_t timezone to time") },
{ ByteToDay, LPGENW("WORD to name of a day (0..6, 0 is Sunday)") },
{ ByteToMonth, LPGENW("WORD to name of a month (1..12, 1 is January)") },
- { ByteToLanguage, LPGENW("BYTE to language (ICQ)") },
+ { ByteToLanguage, LPGENW("uint8_t to language (ICQ)") },
};
void InitTranslations()
diff --git a/plugins/TooltipNotify/src/Tooltip.cpp b/plugins/TooltipNotify/src/Tooltip.cpp index 014802da07..a05a2a7632 100644 --- a/plugins/TooltipNotify/src/Tooltip.cpp +++ b/plugins/TooltipNotify/src/Tooltip.cpp @@ -167,7 +167,7 @@ void CTooltip::Hide() -void CTooltip::set_Translucency(BYTE bAlpha)
+void CTooltip::set_Translucency(uint8_t bAlpha)
{
if (SetWindowLongPtr(m_hWnd, GWL_EXSTYLE, GetWindowLongPtr(m_hWnd, GWL_EXSTYLE) | WS_EX_LAYERED) != 0)
SetLayeredWindowAttributes(m_hWnd, RGB(0,0,0), bAlpha, LWA_ALPHA);
diff --git a/plugins/TooltipNotify/src/Tooltip.h b/plugins/TooltipNotify/src/Tooltip.h index 1767e0d3a3..b451316705 100644 --- a/plugins/TooltipNotify/src/Tooltip.h +++ b/plugins/TooltipNotify/src/Tooltip.h @@ -20,7 +20,7 @@ public: void set_Position(INT x, INT y);
void get_Rect(RECT *Rect) const;
void set_TransparentInput(BOOL bOnOff);
- void set_Translucency(BYTE bAlpha);
+ void set_Translucency(uint8_t bAlpha);
void set_Text(const wchar_t* szText);
void set_Font(const LOGFONT& Font) { m_lfFont = Font; }
void set_TextColor(DWORD TextColor) { m_dwTextColor = TextColor; }
@@ -46,9 +46,9 @@ private: DWORD m_dwBgColor;
LOGFONT m_lfFont;
wchar_t *m_szText;
- BYTE m_bAlpha;
+ uint8_t m_bAlpha;
BOOL m_bTranspInput;
- BYTE m_bLDblClick;
+ uint8_t m_bLDblClick;
CTooltipNotify *m_pTooltipNotify;
static const wchar_t *s_szTooltipClass;
diff --git a/plugins/TooltipNotify/src/TooltipNotify.cpp b/plugins/TooltipNotify/src/TooltipNotify.cpp index 6fff571a35..8aae437349 100644 --- a/plugins/TooltipNotify/src/TooltipNotify.cpp +++ b/plugins/TooltipNotify/src/TooltipNotify.cpp @@ -174,7 +174,7 @@ int CTooltipNotify::ProtoAck(WPARAM, LPARAM lParam) char *szProtocol = (char *)ack->szModule;
if (wNewStatus == ID_STATUS_OFFLINE) {
- BYTE bProtoActive = g_plugin.getByte(szProtocol, ProtoUserBit | ProtoIntBit);
+ uint8_t bProtoActive = g_plugin.getByte(szProtocol, ProtoUserBit | ProtoIntBit);
bProtoActive &= ~ProtoIntBit;
g_plugin.setByte(szProtocol, bProtoActive);
}
@@ -354,7 +354,7 @@ void CTooltipNotify::OnConnectionTimer(HWND, UINT, UINT_PTR idEvent, DWORD) MapTimerIdProtoIter iter = FindProtoByTimer(idEvent);
assert(iter != m_mapTimerIdProto.end());
- BYTE bProtoActive = g_plugin.getByte(iter->proto, ProtoUserBit | ProtoIntBit);
+ uint8_t bProtoActive = g_plugin.getByte(iter->proto, ProtoUserBit | ProtoIntBit);
bProtoActive |= ProtoIntBit;
g_plugin.setByte(iter->proto, bProtoActive);
@@ -445,20 +445,20 @@ void CTooltipNotify::SaveSettings() void CTooltipNotify::ReadSettingsFromDlg(HWND hDlg)
{
- m_sOptions.bOffline = (BYTE)(IsDlgButtonChecked(hDlg, IDC_OFFLINE) == BST_CHECKED ? 1 : 0);
- m_sOptions.bOnline = (BYTE)(IsDlgButtonChecked(hDlg, IDC_ONLINE) == BST_CHECKED ? 1 : 0);
- m_sOptions.bOther = (BYTE)(IsDlgButtonChecked(hDlg, IDC_OTHER) == BST_CHECKED ? 1 : 0);
- m_sOptions.bTyping = (BYTE)(IsDlgButtonChecked(hDlg, IDC_TYPING) == BST_CHECKED ? 1 : 0);
- m_sOptions.bIdle = (BYTE)(IsDlgButtonChecked(hDlg, IDC_IDLE) == BST_CHECKED ? 1 : 0);
- m_sOptions.bX2 = (BYTE)(IsDlgButtonChecked(hDlg, IDC_X2) == BST_CHECKED ? 1 : 0);
- m_sOptions.bConjSOLN = (BYTE)(IsDlgButtonChecked(hDlg, IDC_CONJSOLN) == BST_CHECKED ? 1 : 0);
- m_sOptions.bAutoPos = (BYTE)(IsDlgButtonChecked(hDlg, IDC_AUTOPOS) == BST_CHECKED ? 1 : 0);
- m_sOptions.bBallonTip = (BYTE)(IsDlgButtonChecked(hDlg, IDC_BALLONTIP) == BST_CHECKED ? 1 : 0);
- m_sOptions.bTransp = (BYTE)(IsDlgButtonChecked(hDlg, IDC_TRANSPARENCY) == BST_CHECKED ? 1 : 0);
- m_sOptions.bAlpha = (BYTE)SendDlgItemMessage(hDlg, IDC_TRANSPARENCY_SLIDER, TBM_GETPOS, 0, 0);
- m_sOptions.bTranspInput = (BYTE)(IsDlgButtonChecked(hDlg, IDC_TRANSP_INPUT) == BST_CHECKED ? 1 : 0);
- m_sOptions.bPrefixProto = (BYTE)(IsDlgButtonChecked(hDlg, IDC_PREFIX_PROTO) == BST_CHECKED ? 1 : 0);
- m_sOptions.bLDblClick = (BYTE)(IsDlgButtonChecked(hDlg, IDC_RB_CLIST) == BST_CHECKED) ? SHOW_HIDE_CLIST : OPEN_MSGDLG;
+ m_sOptions.bOffline = (uint8_t)(IsDlgButtonChecked(hDlg, IDC_OFFLINE) == BST_CHECKED ? 1 : 0);
+ m_sOptions.bOnline = (uint8_t)(IsDlgButtonChecked(hDlg, IDC_ONLINE) == BST_CHECKED ? 1 : 0);
+ m_sOptions.bOther = (uint8_t)(IsDlgButtonChecked(hDlg, IDC_OTHER) == BST_CHECKED ? 1 : 0);
+ m_sOptions.bTyping = (uint8_t)(IsDlgButtonChecked(hDlg, IDC_TYPING) == BST_CHECKED ? 1 : 0);
+ m_sOptions.bIdle = (uint8_t)(IsDlgButtonChecked(hDlg, IDC_IDLE) == BST_CHECKED ? 1 : 0);
+ m_sOptions.bX2 = (uint8_t)(IsDlgButtonChecked(hDlg, IDC_X2) == BST_CHECKED ? 1 : 0);
+ m_sOptions.bConjSOLN = (uint8_t)(IsDlgButtonChecked(hDlg, IDC_CONJSOLN) == BST_CHECKED ? 1 : 0);
+ m_sOptions.bAutoPos = (uint8_t)(IsDlgButtonChecked(hDlg, IDC_AUTOPOS) == BST_CHECKED ? 1 : 0);
+ m_sOptions.bBallonTip = (uint8_t)(IsDlgButtonChecked(hDlg, IDC_BALLONTIP) == BST_CHECKED ? 1 : 0);
+ m_sOptions.bTransp = (uint8_t)(IsDlgButtonChecked(hDlg, IDC_TRANSPARENCY) == BST_CHECKED ? 1 : 0);
+ m_sOptions.bAlpha = (uint8_t)SendDlgItemMessage(hDlg, IDC_TRANSPARENCY_SLIDER, TBM_GETPOS, 0, 0);
+ m_sOptions.bTranspInput = (uint8_t)(IsDlgButtonChecked(hDlg, IDC_TRANSP_INPUT) == BST_CHECKED ? 1 : 0);
+ m_sOptions.bPrefixProto = (uint8_t)(IsDlgButtonChecked(hDlg, IDC_PREFIX_PROTO) == BST_CHECKED ? 1 : 0);
+ m_sOptions.bLDblClick = (uint8_t)(IsDlgButtonChecked(hDlg, IDC_RB_CLIST) == BST_CHECKED) ? SHOW_HIDE_CLIST : OPEN_MSGDLG;
m_sOptions.wDuration = LOWORD(SendDlgItemMessage(hDlg, IDC_DURATIONSPIN, UDM_GETPOS, 0, 0));
m_sOptions.wStartupDelay = LOWORD(SendDlgItemMessage(hDlg, IDC_DELAYONCONNSPIN, UDM_GETPOS, 0, 0));
}
@@ -639,7 +639,7 @@ BOOL CTooltipNotify::ProtosDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM) ListView_InsertItem(GetDlgItem(hDlg, IDC_PROTOS), &lvi);
- BYTE bProtoState = g_plugin.getByte(pa->szModuleName, ProtoUserBit | ProtoIntBit);
+ uint8_t bProtoState = g_plugin.getByte(pa->szModuleName, ProtoUserBit | ProtoIntBit);
BOOL bProtoEnabled = (bProtoState & ProtoUserBit) != 0;
ListView_SetCheckState(GetDlgItem(hDlg, IDC_PROTOS), lvi.iItem, bProtoEnabled);
}
@@ -660,7 +660,7 @@ BOOL CTooltipNotify::ProtosDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM) szMultiByteProto, sizeof(szMultiByteProto), nullptr, nullptr);
szMultiByteProto[lLen] = '\0';
- BYTE bProtoState = g_plugin.getByte(szMultiByteProto, ProtoUserBit | ProtoIntBit);
+ uint8_t bProtoState = g_plugin.getByte(szMultiByteProto, ProtoUserBit | ProtoIntBit);
BOOL bProtoEnabled = ListView_GetCheckState(GetDlgItem(hDlg, IDC_PROTOS), i);
@@ -713,15 +713,15 @@ void CTooltipNotify::LoadList(HWND hwndDlg, HANDLE hItemNew, HANDLE hItemUnknown void CTooltipNotify::SaveList(HWND hwndDlg, HANDLE hItemNew, HANDLE hItemUnknown)
{
if (hItemNew)
- m_sOptions.bIgnoreNew = (BYTE)(SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_GETCHECKMARK, (WPARAM)hItemNew, 0) ? 0 : 1);
+ m_sOptions.bIgnoreNew = (uint8_t)(SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_GETCHECKMARK, (WPARAM)hItemNew, 0) ? 0 : 1);
if (hItemUnknown)
- m_sOptions.bIgnoreUnknown = (BYTE)(SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_GETCHECKMARK, (WPARAM)hItemUnknown, 0) ? 0 : 1);
+ m_sOptions.bIgnoreUnknown = (uint8_t)(SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_GETCHECKMARK, (WPARAM)hItemUnknown, 0) ? 0 : 1);
for (auto &hContact : Contacts()) {
HANDLE hItem = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_FINDCONTACT, hContact, 0);
if (hItem) {
- BYTE bChecked = (BYTE)(SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_GETCHECKMARK, (WPARAM)hItem, 0));
+ uint8_t bChecked = (uint8_t)(SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_GETCHECKMARK, (WPARAM)hItem, 0));
g_plugin.setByte(hContact, CONTACT_IGNORE_TTNOTIFY, bChecked ? 0 : 1);
}
}
diff --git a/plugins/TooltipNotify/src/TooltipNotify.h b/plugins/TooltipNotify/src/TooltipNotify.h index 149eacc870..03e955ce6c 100644 --- a/plugins/TooltipNotify/src/TooltipNotify.h +++ b/plugins/TooltipNotify/src/TooltipNotify.h @@ -37,25 +37,25 @@ private: static const char *s_szModuleNameOld;
struct SOptions {
- BYTE bFirstRun;
- BYTE bOffline;
- BYTE bOnline;
- BYTE bOther;
- BYTE bTyping;
- BYTE bIdle;
- BYTE bConjSOLN;
- BYTE bX2;
- BYTE bAutoPos;
- BYTE bBallonTip;
- BYTE bTransp;
- BYTE bTranspInput;
- BYTE bAlpha;
- BYTE bLDblClick;
- BYTE bPrefixProto;
+ uint8_t bFirstRun;
+ uint8_t bOffline;
+ uint8_t bOnline;
+ uint8_t bOther;
+ uint8_t bTyping;
+ uint8_t bIdle;
+ uint8_t bConjSOLN;
+ uint8_t bX2;
+ uint8_t bAutoPos;
+ uint8_t bBallonTip;
+ uint8_t bTransp;
+ uint8_t bTranspInput;
+ uint8_t bAlpha;
+ uint8_t bLDblClick;
+ uint8_t bPrefixProto;
WORD wDuration;
WORD wStartupDelay;
- BYTE bIgnoreNew;
- BYTE bIgnoreUnknown;
+ uint8_t bIgnoreNew;
+ uint8_t bIgnoreUnknown;
} m_sOptions;
struct STooltipData {
diff --git a/plugins/TopToolBar/src/InternalButtons.cpp b/plugins/TopToolBar/src/InternalButtons.cpp index 71b571f8df..305aee611e 100644 --- a/plugins/TopToolBar/src/InternalButtons.cpp +++ b/plugins/TopToolBar/src/InternalButtons.cpp @@ -53,7 +53,7 @@ INT_PTR TTBInternalStatusMenuButt(WPARAM, LPARAM) INT_PTR TTBInternalSoundsOnOff(WPARAM, LPARAM)
{
int newVal = !(db_get_b(0, "Skin", "UseSound", 1));
- db_set_b(0, "Skin", "UseSound", (BYTE)newVal);
+ db_set_b(0, "Skin", "UseSound", (uint8_t)newVal);
return 0;
}
diff --git a/plugins/TopToolBar/src/topbutton.cpp b/plugins/TopToolBar/src/topbutton.cpp index 9b5a9aa685..50b89aae5a 100644 --- a/plugins/TopToolBar/src/topbutton.cpp +++ b/plugins/TopToolBar/src/topbutton.cpp @@ -75,7 +75,7 @@ void TopButtonInt::LoadSettings() {
char buf[255];
- BYTE oldv = isVisible();
+ uint8_t oldv = isVisible();
dwFlags = dwFlags & (~TTBBF_VISIBLE);
if (dwFlags & TTBBF_ISSEPARATOR) {
diff --git a/plugins/TopToolBar/src/ttbopt.cpp b/plugins/TopToolBar/src/ttbopt.cpp index 6c9f76ef2a..3c6db1e5c4 100644 --- a/plugins/TopToolBar/src/ttbopt.cpp +++ b/plugins/TopToolBar/src/ttbopt.cpp @@ -375,9 +375,9 @@ static INT_PTR CALLBACK ButOrderOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR g_ctrl->nButtonWidth = GetDlgItemInt(hwndDlg, IDC_BUTTWIDTH, nullptr, FALSE);
g_ctrl->nButtonSpace = GetDlgItemInt(hwndDlg, IDC_BUTTGAP, nullptr, FALSE);
- g_ctrl->bFlatButtons = (BYTE)IsDlgButtonChecked(hwndDlg, IDC_USEFLAT);
- g_ctrl->bAutoSize = (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AUTORESIZE);
- g_ctrl->bSingleLine = (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SINGLELINE);
+ g_ctrl->bFlatButtons = (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_USEFLAT);
+ g_ctrl->bAutoSize = (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_AUTORESIZE);
+ g_ctrl->bSingleLine = (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_SINGLELINE);
g_plugin.setDword("BUTTHEIGHT", g_ctrl->nButtonHeight);
g_plugin.setDword("BUTTWIDTH", g_ctrl->nButtonWidth);
diff --git a/plugins/TrafficCounter/src/TrafficCounter.cpp b/plugins/TrafficCounter/src/TrafficCounter.cpp index b686c7e66a..ac81a147ee 100644 --- a/plugins/TrafficCounter/src/TrafficCounter.cpp +++ b/plugins/TrafficCounter/src/TrafficCounter.cpp @@ -76,7 +76,7 @@ HGENMENU hTrafficMainMenuItem = nullptr; /*-------------------------------------------------------------------------------------------------------------------*/
//TIME COUNTER
/*-------------------------------------------------------------------------------------------------------------------*/
-BYTE online_count = 0;
+uint8_t online_count = 0;
/*-------------------------------------------------------------------------------------------------------------------*/
//font service support
@@ -152,7 +152,7 @@ int ModuleLoad(WPARAM, LPARAM) return 0;
}
-void SaveSettings(BYTE OnlyCnt)
+void SaveSettings(uint8_t OnlyCnt)
{
unsigned short int i;
@@ -230,7 +230,7 @@ int TrafficCounter_Draw(HWND hwnd, HDC hDC) return 0;
}
-static void TC_AlphaText(HDC hDC, LPCTSTR lpString, RECT* lpRect, UINT format, BYTE ClistModernPresent)
+static void TC_AlphaText(HDC hDC, LPCTSTR lpString, RECT* lpRect, UINT format, uint8_t ClistModernPresent)
{
int nCount = (int)mir_wstrlen(lpString);
@@ -240,7 +240,7 @@ static void TC_AlphaText(HDC hDC, LPCTSTR lpString, RECT* lpRect, UINT format, B DrawText(hDC, lpString, nCount, lpRect, format);
}
-static void TC_DrawIconEx(HDC hdc, int xLeft, int yTop, HICON hIcon, HBRUSH hbrFlickerFreeDraw, BYTE ClistModernPresent)
+static void TC_DrawIconEx(HDC hdc, int xLeft, int yTop, HICON hIcon, HBRUSH hbrFlickerFreeDraw, uint8_t ClistModernPresent)
{
if (ClistModernPresent)
mod_DrawIconEx_helper(hdc, xLeft, yTop, hIcon, 16, 16, 0, hbrFlickerFreeDraw, DI_NORMAL);
@@ -254,7 +254,7 @@ int PaintTrafficCounterWindow(HWND hwnd, HDC hDC) BLENDFUNCTION aga = { AC_SRC_OVER, 0, 0xFF, AC_SRC_ALPHA };
DWORD SummarySession, SummaryTotal;
- BYTE ClistModernPresent = (GetModuleHandleA("clist_modern.dll") || GetModuleHandleA("clist_modern_dora.dll"))
+ uint8_t ClistModernPresent = (GetModuleHandleA("clist_modern.dll") || GetModuleHandleA("clist_modern_dora.dll"))
&& !db_get_b(0, "ModernData", "DisableEngine", 0)
&& db_get_b(0, "ModernData", "EnableLayering", 1);
diff --git a/plugins/TrafficCounter/src/TrafficCounter.h b/plugins/TrafficCounter/src/TrafficCounter.h index 17b6f1a7ff..6283719ff6 100644 --- a/plugins/TrafficCounter/src/TrafficCounter.h +++ b/plugins/TrafficCounter/src/TrafficCounter.h @@ -61,7 +61,7 @@ int TrafficSend(WPARAM wParam,LPARAM lParam); int TrafficCounterOptInitialise(WPARAM wParam,LPARAM lParam);
int TrafficCounterShutdown(WPARAM wParam,LPARAM lParam);
int ModuleLoad(WPARAM wParam, LPARAM lParam);
-void SaveSettings(BYTE);
+void SaveSettings(uint8_t);
void CreateTrafficWindow(HWND);
//popup
diff --git a/plugins/TrafficCounter/src/misc.cpp b/plugins/TrafficCounter/src/misc.cpp index 2ea49fbf10..83a53fc9b9 100644 --- a/plugins/TrafficCounter/src/misc.cpp +++ b/plugins/TrafficCounter/src/misc.cpp @@ -75,7 +75,7 @@ WORD GetRowItems(wchar_t *InputString, RowItemInfo **RowItemsList) }
/* Функция возвращает количество дней в указанном месяце указанного года. */
-BYTE DaysInMonth(BYTE Month, WORD Year)
+uint8_t DaysInMonth(uint8_t Month, WORD Year)
{
switch (Month) {
case 1:
@@ -89,14 +89,14 @@ BYTE DaysInMonth(BYTE Month, WORD Year) case 6:
case 9:
case 11: return 30;
- case 2: return 28 + (BYTE)!((Year % 4) && ((Year % 100) || !(Year % 400)));
+ case 2: return 28 + (uint8_t)!((Year % 4) && ((Year % 100) || !(Year % 400)));
}
return 0;
}
// Функция определяет день недели по дате
// 7 - ВС, 1 - ПН и т. д.
-BYTE DayOfWeek(BYTE Day, BYTE Month, WORD Year)
+uint8_t DayOfWeek(uint8_t Day, uint8_t Month, WORD Year)
{
WORD a, y, m;
@@ -118,7 +118,7 @@ Buffer - адрес строки для записи результата; Size - размер буфера.
Возвращаемое значение: требуемый размер буфера.
*/
-size_t GetFormattedTraffic(DWORD Value, BYTE Unit, wchar_t *Buffer, size_t Size)
+size_t GetFormattedTraffic(DWORD Value, uint8_t Unit, wchar_t *Buffer, size_t Size)
{
wchar_t Str1[32], szUnit[4] = { ' ', 0 };
DWORD Divider;
diff --git a/plugins/TrafficCounter/src/misc.h b/plugins/TrafficCounter/src/misc.h index fd3d18e990..672793b80f 100644 --- a/plugins/TrafficCounter/src/misc.h +++ b/plugins/TrafficCounter/src/misc.h @@ -15,11 +15,11 @@ RowItemsList - список найденных элементов. WORD GetRowItems(wchar_t *InputString, RowItemInfo **RowItemsList);
/* Функция возвращает количество дней в указанном месяце указанного года. */
-BYTE DaysInMonth(BYTE Month, WORD Year);
+uint8_t DaysInMonth(uint8_t Month, WORD Year);
// Функция определяет день недели по дате
// 7 - ВС, 1 - ПН и т. д.
-BYTE DayOfWeek(BYTE Day, BYTE Month, WORD Year);
+uint8_t DayOfWeek(uint8_t Day, uint8_t Month, WORD Year);
/* Аргументы:
Value - количество байт;
@@ -27,7 +27,7 @@ BYTE DayOfWeek(BYTE Day, BYTE Month, WORD Year); Buffer - адрес строки для записи результата;
Size - размер буфера.
Возвращаемое значение: требуемый размер буфера. */
-size_t GetFormattedTraffic(DWORD Value, BYTE Unit, wchar_t *Buffer, size_t Size);
+size_t GetFormattedTraffic(DWORD Value, uint8_t Unit, wchar_t *Buffer, size_t Size);
size_t GetDurationFormatM(DWORD Duration, wchar_t *Format, wchar_t *Buffer, size_t Size);
diff --git a/plugins/TrafficCounter/src/options.cpp b/plugins/TrafficCounter/src/options.cpp index c419323d75..51fa29203f 100644 --- a/plugins/TrafficCounter/src/options.cpp +++ b/plugins/TrafficCounter/src/options.cpp @@ -177,7 +177,7 @@ static INT_PTR CALLBACK DlgProcTCOptions(HWND hwndDlg, UINT msg, WPARAM wParam, {
WORD i, j;
BOOL result;
- static BYTE Initialized = 0;
+ static uint8_t Initialized = 0;
static WORD optionCount = 0;
if (!Initialized) {
@@ -305,7 +305,7 @@ static INT_PTR CALLBACK DlgProcTCOptions(HWND hwndDlg, UINT msg, WPARAM wParam, {
char buffer[32];
mir_strcpy(buffer, ProtoList[i].name);
- ProtoList[i].Visible = (BYTE)OptTree_GetOptions(hwndDlg, IDC_APPEARANCEOPTIONS, options, optionCount, buffer);
+ ProtoList[i].Visible = (uint8_t)OptTree_GetOptions(hwndDlg, IDC_APPEARANCEOPTIONS, options, optionCount, buffer);
}
unOptions.ShowOverall = OptTree_GetOptions(hwndDlg, IDC_APPEARANCEOPTIONS, options, optionCount, "ShowOverall");
diff --git a/plugins/TrafficCounter/src/statistics.cpp b/plugins/TrafficCounter/src/statistics.cpp index b97e34b7b1..09180f9162 100644 --- a/plugins/TrafficCounter/src/statistics.cpp +++ b/plugins/TrafficCounter/src/statistics.cpp @@ -103,7 +103,7 @@ INT_PTR CALLBACK DlgProcOptStatistics(HWND hwndDlg, UINT msg, WPARAM wParam, LPA case WM_COMMAND:
if ((HWND)lParam == hListAccs) {
DWORD SelItems[16];
- BYTE SelItemsCount;
+ uint8_t SelItemsCount;
if (HIWORD(wParam) == LBN_SELCHANGE) {
SelItemsCount = SendMessage(hListAccs, LB_GETSELCOUNT, 0, 0);
SendMessage(hListAccs,
@@ -174,7 +174,7 @@ INT_PTR CALLBACK DlgProcOptStatistics(HWND hwndDlg, UINT msg, WPARAM wParam, LPA DWORD Index, Value;
double vartime;
wchar_t szBufW[64];
- BYTE EldestAcc;
+ uint8_t EldestAcc;
if (!(pdi->item.mask & LVIF_TEXT)) return 0;
@@ -262,7 +262,7 @@ INT_PTR CALLBACK DlgProcOptStatistics(HWND hwndDlg, UINT msg, WPARAM wParam, LPA case CDDS_ITEMPREPAINT: // Перед началом рисования строки.
{
COLORREF Color;
- BYTE r, g, b;
+ uint8_t r, g, b;
if (lplvcd->nmcd.dwItemSpec & 0x01) {
Color = SendDlgItemMessage(hwndDlg, IDC_LIST_DATA, LVM_GETBKCOLOR, 0, 0);
@@ -453,7 +453,7 @@ void Stat_CheckStatistics(PROTOLIST &p) ItemNumber - номер строки в ListView (номер периода).
stReq - дата, соответствующая вычисленному индексу.
*/
-DWORD Stat_GetStartIndex(BYTE AccNum, BYTE Interval, int ItemNumber, SYSTEMTIME *stReq)
+DWORD Stat_GetStartIndex(uint8_t AccNum, uint8_t Interval, int ItemNumber, SYSTEMTIME *stReq)
{
int Left, Right, Probe; // Границы интервала для поиска (индексы статистики).
SYSTEMTIME stProbe = { 0 }; // Время тыка.
@@ -527,7 +527,7 @@ DWORD Stat_GetStartIndex(BYTE AccNum, BYTE Interval, int ItemNumber, SYSTEMTIME /* Функция устанавливает величину сдвига для заданного аккаунта,
то есть номер записи в статистике старейшего из выбранных аккаунтов,
дата которой соответствует началу статистики указанного аккаунта. */
-void Stat_SetAccShift(BYTE AccNum, BYTE EldestAccount)
+void Stat_SetAccShift(uint8_t AccNum, uint8_t EldestAccount)
{
DWORD Left, Right, Probe = 0; // Границы интервала для поиска (индексы статистики).
SYSTEMTIME stReq = { 0 }, stProbe;
@@ -571,13 +571,13 @@ Interval - выбранный интервал; ItemNum - номер строки в ListVew;
SubitemNum - номер колонки, определяет вид информации. */
-DWORD Stat_GetItemValue(WORD SelectedAccs, BYTE Interval, DWORD ItemNum, BYTE SubItemNum)
+DWORD Stat_GetItemValue(WORD SelectedAccs, uint8_t Interval, DWORD ItemNum, uint8_t SubItemNum)
{
DWORD Result = 0;
SYSTEMTIME st = { 0 };
int Index, IndexP, i;
signed long int IndexM;
- BYTE a, EldestAcc;
+ uint8_t a, EldestAcc;
EldestAcc = Stat_GetEldestAcc(SelectedAccs);
Index = Stat_GetStartIndex(EldestAcc, Interval, ItemNum, &st);
@@ -644,7 +644,7 @@ DWORD Stat_GetItemValue(WORD SelectedAccs, BYTE Interval, DWORD ItemNum, BYTE Su /* Функция возвращает количество записей в статистике для
заданного аккаунта и заданного интервала. */
-DWORD Stat_GetRecordsNumber(BYTE AccNum, BYTE Interval)
+DWORD Stat_GetRecordsNumber(uint8_t AccNum, uint8_t Interval)
{
DWORD Result, i;
@@ -683,9 +683,9 @@ DWORD Stat_GetRecordsNumber(BYTE AccNum, BYTE Interval) return Result;
}
-BYTE Stat_GetEldestAcc(WORD SelectedAccs)
+uint8_t Stat_GetEldestAcc(WORD SelectedAccs)
{
- BYTE Result, i;
+ uint8_t Result, i;
// Узнаём номер аккаунта из числа выбранных, имеющего самую старую первую запись.
// (Это аккаунт с максимальным количеством записей.)
diff --git a/plugins/TrafficCounter/src/statistics.h b/plugins/TrafficCounter/src/statistics.h index 7c034779c1..b4b1733362 100644 --- a/plugins/TrafficCounter/src/statistics.h +++ b/plugins/TrafficCounter/src/statistics.h @@ -36,10 +36,10 @@ void Stat_ReadFile(PROTOLIST &p); void Stat_Show(HWND);
void Stat_UpdateTotalTraffic(HWND, DWORD, DWORD);
void Stat_CheckStatistics(PROTOLIST &p);
-DWORD Stat_GetStartIndex(BYTE AccNum, BYTE Interval, int ItemNumber, SYSTEMTIME *st);
-void Stat_SetAccShift(BYTE AccNum, BYTE EldestAccount);
-DWORD Stat_GetItemValue(WORD SelectedAccs, BYTE Interval, DWORD ItemNum, BYTE SubitemNum);
-DWORD Stat_GetRecordsNumber(BYTE AccNum, BYTE Interval);
-BYTE Stat_GetEldestAcc(WORD SelectedAccs);
+DWORD Stat_GetStartIndex(uint8_t AccNum, uint8_t Interval, int ItemNumber, SYSTEMTIME *st);
+void Stat_SetAccShift(uint8_t AccNum, uint8_t EldestAccount);
+DWORD Stat_GetItemValue(WORD SelectedAccs, uint8_t Interval, DWORD ItemNum, uint8_t SubitemNum);
+DWORD Stat_GetRecordsNumber(uint8_t AccNum, uint8_t Interval);
+uint8_t Stat_GetEldestAcc(WORD SelectedAccs);
#endif // _statistics_h
\ No newline at end of file diff --git a/plugins/TrafficCounter/src/stdafx.h b/plugins/TrafficCounter/src/stdafx.h index 8b15e10c58..635dda7f1f 100644 --- a/plugins/TrafficCounter/src/stdafx.h +++ b/plugins/TrafficCounter/src/stdafx.h @@ -62,7 +62,7 @@ struct CMPlugin : public PLUGIN<CMPlugin> #pragma pack(1)
typedef struct
{
- BYTE Hour, Day, Month;
+ uint8_t Hour, Day, Month;
WORD Year;
DWORD Incoming, Outgoing;
WORD Time;
@@ -88,7 +88,7 @@ struct PROTOLIST CurrentSentTraffic;
union
{
- BYTE Flags;
+ uint8_t Flags;
struct
{
unsigned int Reserv0:1; // Активность потеряла смысл - статистика ведётся по всем аккаунтам.
diff --git a/plugins/TrafficCounter/src/vars.cpp b/plugins/TrafficCounter/src/vars.cpp index 1a9d3b4852..f0e52b825d 100644 --- a/plugins/TrafficCounter/src/vars.cpp +++ b/plugins/TrafficCounter/src/vars.cpp @@ -26,7 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. static wchar_t* GetTraffic(ARGUMENTSINFO *ai)
{
DWORD tmp, tmpsn = 0, tmprn = 0, tmpst = 0, tmprt = 0;
- BYTE ed;
+ uint8_t ed;
if (ai->argc != 5) return nullptr;
@@ -104,7 +104,7 @@ static wchar_t* GetTraffic(ARGUMENTSINFO *ai) static wchar_t* GetTime(ARGUMENTSINFO *ai)
{
- BYTE ed, flag;
+ uint8_t ed, flag;
DWORD Duration = 0;
if (ai->argc != 4) return nullptr;
diff --git a/plugins/TranslitSwitcher/src/Layoutproc.cpp b/plugins/TranslitSwitcher/src/Layoutproc.cpp index 33fe4c32a2..04a6c2f934 100644 --- a/plugins/TranslitSwitcher/src/Layoutproc.cpp +++ b/plugins/TranslitSwitcher/src/Layoutproc.cpp @@ -407,7 +407,7 @@ void SwitchLayout(bool lastword) for (size_t i = 0; i < slen; i++) {
SHORT vks;
- BYTE keys[256] = { 0 };
+ uint8_t keys[256] = { 0 };
vks = VkKeyScanEx(buf[i], hkl);
@@ -435,7 +435,7 @@ void SwitchLayout(bool lastword) else if (mir_wstrcmpi(szClassName, L"RichEdit50W") == 0) {
size_t i, start = 0, end = 0;
SHORT vks;
- BYTE keys[256] = { 0 };
+ uint8_t keys[256] = { 0 };
HKL hkl = GetKeyboardLayout(dwThreadID);
DWORD dwStart, dwEnd, dwFlags = SF_TEXT | SF_UNICODE;
@@ -652,7 +652,7 @@ int OnButtonPressed(WPARAM, LPARAM lParam) HWND hEdit = GetDlgItem(cbcd->hwndFrom, IDC_SRMM_MESSAGE);
- BYTE byKeybState[256];
+ uint8_t byKeybState[256];
GetKeyboardState(byKeybState);
byKeybState[VK_CONTROL] = 128;
SetKeyboardState(byKeybState);
@@ -683,7 +683,7 @@ int OnButtonPressed(WPARAM, LPARAM lParam) for (int i = 0; i < (int)slen; i++) {
wchar_t tchr;
- BYTE keys[256] = { 0 };
+ uint8_t keys[256] = { 0 };
SHORT vks = VkKeyScanEx(sel[i], hkl);
keys[VK_SHIFT] = (HIBYTE(vks) & 1) ? 0xFF : 0x00; // shift
diff --git a/plugins/UserInfoEx/src/Flags/svc_flagsicons.cpp b/plugins/UserInfoEx/src/Flags/svc_flagsicons.cpp index 25679f7c29..8dbf01f9ec 100644 --- a/plugins/UserInfoEx/src/Flags/svc_flagsicons.cpp +++ b/plugins/UserInfoEx/src/Flags/svc_flagsicons.cpp @@ -187,7 +187,7 @@ FIBITMAP *LoadResource(UINT ID, LPTSTR lpType) HRSRC hResInfo = FindResource(g_plugin.getInst(), MAKEINTRESOURCE(ID), lpType);
DWORD ResSize = SizeofResource(g_plugin.getInst(), hResInfo);
HGLOBAL hRes = LoadResource(g_plugin.getInst(), hResInfo);
- BYTE *buffer = (BYTE *)LockResource(hRes);
+ uint8_t *buffer = (uint8_t *)LockResource(hRes);
if (buffer) {
// attach the binary data to a memory stream
FIMEMORY *hmem = FreeImage_OpenMemory(buffer, ResSize);
@@ -307,7 +307,7 @@ void InitIcons() int bytespp = FreeImage_GetLine(dib_ico) / w;
// set alpha schannel
for (unsigned y = 0; y < h; y++) {
- BYTE *bits = FreeImage_GetScanLine(dib_ico, y);
+ uint8_t *bits = FreeImage_GetScanLine(dib_ico, y);
for (unsigned x = 0; x < w; x++) {
bits[FI_RGBA_ALPHA] = (y < t || y >= b) ? 0 : 255;
// jump to next pixel
diff --git a/plugins/UserInfoEx/src/classMAnnivDate.cpp b/plugins/UserInfoEx/src/classMAnnivDate.cpp index 1916ce8d35..adce05f464 100644 --- a/plugins/UserInfoEx/src/classMAnnivDate.cpp +++ b/plugins/UserInfoEx/src/classMAnnivDate.cpp @@ -106,7 +106,7 @@ void MAnnivDate::SetDate(const MAnnivDate &mda) * param: st - SYSTEMTIME to compare with
* return: number of days the st differs from the class value
**/
-__inline BYTE MAnnivDate::IsValid() const
+__inline uint8_t MAnnivDate::IsValid() const
{
return (
Month() > 0 && Month() < 13 &&
@@ -134,7 +134,7 @@ int MAnnivDate::CompareDays(MTime mt) const * param: st - SYSTEMTIME to compare with
* return: number of days the st differs from the class value
**/
-BYTE MAnnivDate::IsEqual(const SYSTEMTIME &st) const
+uint8_t MAnnivDate::IsEqual(const SYSTEMTIME &st) const
{
return (
Day() == st.wDay &&
@@ -378,8 +378,8 @@ int MAnnivDate::DBGetDate(MCONTACT hContact, LPCSTR pszModule, LPCSTR szDay, LPC int MAnnivDate::DBWriteDate(MCONTACT hContact, LPCSTR pszModule, LPCSTR szDay, LPCSTR szMonth, LPCSTR szYear)
{
return
- db_set_b(hContact, pszModule, szDay, (BYTE)Day()) ||
- db_set_b(hContact, pszModule, szMonth, (BYTE)Month()) ||
+ db_set_b(hContact, pszModule, szDay, (uint8_t)Day()) ||
+ db_set_b(hContact, pszModule, szMonth, (uint8_t)Month()) ||
db_set_w(hContact, pszModule, szYear, Year());
}
@@ -525,7 +525,7 @@ int MAnnivDate::DBGetBirthDate(MCONTACT hContact, LPSTR pszProto) * return: 0 on success, 1 otherwise
**/
-int MAnnivDate::DBMoveBirthDate(MCONTACT hContact, BYTE bOld, BYTE)
+int MAnnivDate::DBMoveBirthDate(MCONTACT hContact, uint8_t bOld, uint8_t)
{
Clear();
switch(bOld) {
@@ -710,7 +710,7 @@ static WORD AskUser(MCONTACT hContact, MAnnivDate *pOldCustomDate, MAnnivDate *p * return: 0 if backup was done, 1 otherwise
**/
-int MAnnivDate::BackupBirthday(MCONTACT hContact, LPSTR pszProto, const BYTE bDontIgnoreAnything, PWORD lastAnswer)
+int MAnnivDate::BackupBirthday(MCONTACT hContact, LPSTR pszProto, const uint8_t bDontIgnoreAnything, PWORD lastAnswer)
{
if (!hContact)
return 1;
@@ -731,14 +731,14 @@ int MAnnivDate::BackupBirthday(MCONTACT hContact, LPSTR pszProto, const BYTE bDo pszProto = Proto_GetBaseAccountName(hContact);
if (pszProto) {
- BYTE bIsMeta = DB::Module::IsMeta(pszProto);
- BYTE bIsMetaSub = !bIsMeta && db_mc_isSub(hContact);
+ uint8_t bIsMeta = DB::Module::IsMeta(pszProto);
+ uint8_t bIsMetaSub = !bIsMeta && db_mc_isSub(hContact);
MAnnivDate mdbNewProto;
MAnnivDate mdbIgnore;
const int nSubContactCount = (bIsMeta) ? db_mc_getSubCount(hContact) : 0;
- BYTE bWantBackup = !mdbNewProto.DBGetDate(hContact, pszProto, SET_CONTACT_BIRTHDAY, SET_CONTACT_BIRTHMONTH, SET_CONTACT_BIRTHYEAR)
+ uint8_t bWantBackup = !mdbNewProto.DBGetDate(hContact, pszProto, SET_CONTACT_BIRTHDAY, SET_CONTACT_BIRTHMONTH, SET_CONTACT_BIRTHYEAR)
&& !IsEqual(mdbNewProto.SystemTime())
&& (bDontIgnoreAnything || (db_get_dw(hContact, USERINFO, SET_REMIND_BIRTHDAY_IGNORED, 0) != mdbNewProto.DateStamp()))
&& !bIsMetaSub;
diff --git a/plugins/UserInfoEx/src/classMAnnivDate.h b/plugins/UserInfoEx/src/classMAnnivDate.h index 1dcfda6124..a4d0e1b04b 100644 --- a/plugins/UserInfoEx/src/classMAnnivDate.h +++ b/plugins/UserInfoEx/src/classMAnnivDate.h @@ -47,7 +47,7 @@ private: wstring _strDesc; // descripes the anniversary (e.g. birthday)
string _strModule; // the module the anniversary has been read from
WORD _wFlags; // the flags
- BYTE _bRemind; // per user setting for reminder (0 - disabled, 1 - use local offset, 2 - use global offset)
+ uint8_t _bRemind; // per user setting for reminder (0 - disabled, 1 - use local offset, 2 - use global offset)
WORD _wDaysEarlier; // number of days to the anniversary the user wants to be reminded of this anniversary
int DBWriteDate(MCONTACT hContact, LPCSTR pszModule, LPCSTR szDay, LPCSTR szMonth, LPCSTR szYear);
@@ -62,8 +62,8 @@ public: __inline void Description(LPCTSTR pszDesc) { if (pszDesc) _strDesc = pszDesc; };
__inline LPCSTR Module() const { return _strModule.c_str(); };
__inline void Module(LPCSTR pszModule) { if (pszModule) _strModule = pszModule; else _strModule.clear(); };
- __inline BYTE RemindOption() const { return _bRemind; };
- __inline void RemindOption(BYTE bRemind) { if (bRemind <= BST_INDETERMINATE) _bRemind = bRemind; };
+ __inline uint8_t RemindOption() const { return _bRemind; };
+ __inline void RemindOption(uint8_t bRemind) { if (bRemind <= BST_INDETERMINATE) _bRemind = bRemind; };
__inline WORD RemindOffset() const { return _wDaysEarlier; };
__inline void RemindOffset(WORD wOffset) { _wDaysEarlier = wOffset; };
__inline WORD Id() const { return _wID; };
@@ -73,11 +73,11 @@ public: void DateStamp(const DWORD dwStamp);
// basic checks
- __inline BYTE IsValid() const;
- __inline BYTE IsChanged() const { return (_wFlags & MADF_CHANGED); };
- __inline BYTE IsReminderChanged() const { return (_wFlags & MADF_REMINDER_CHANGED); };
- __inline BYTE IsEqual(const MAnnivDate &mda) const { return IsEqual(mda.SystemTime()); };
- BYTE IsEqual(const SYSTEMTIME &st) const;
+ __inline uint8_t IsValid() const;
+ __inline uint8_t IsChanged() const { return (_wFlags & MADF_CHANGED); };
+ __inline uint8_t IsReminderChanged() const { return (_wFlags & MADF_REMINDER_CHANGED); };
+ __inline uint8_t IsEqual(const MAnnivDate &mda) const { return IsEqual(mda.SystemTime()); };
+ uint8_t IsEqual(const SYSTEMTIME &st) const;
// handling flags
__inline WORD Flags() const { return _wFlags; };
@@ -108,15 +108,15 @@ public: // delete date from database
int DBDeleteBirthDate(MCONTACT hContact);
- int DBMoveBirthDate(MCONTACT hContact, BYTE bOld, BYTE bNew);
- int BackupBirthday (MCONTACT hContact, LPSTR pszProto = nullptr, const BYTE bDontIgnoreAnything = FALSE, PWORD lastAnswer = nullptr);
+ int DBMoveBirthDate(MCONTACT hContact, uint8_t bOld, uint8_t bNew);
+ int BackupBirthday (MCONTACT hContact, LPSTR pszProto = nullptr, const uint8_t bDontIgnoreAnything = FALSE, PWORD lastAnswer = nullptr);
// setting values
void SetDate(const SYSTEMTIME &st);
void SetDate(const MAnnivDate &mda);
- BYTE operator == (const SYSTEMTIME &st) { return IsEqual(st); };
- BYTE operator == (const MAnnivDate &mda) { return IsEqual(mda); };
+ uint8_t operator == (const SYSTEMTIME &st) { return IsEqual(st); };
+ uint8_t operator == (const MAnnivDate &mda) { return IsEqual(mda); };
void operator=(SYSTEMTIME &st) { SetDate(st); };
void operator=(MAnnivDate &mda) { SetDate(mda); };
diff --git a/plugins/UserInfoEx/src/classMTime.cpp b/plugins/UserInfoEx/src/classMTime.cpp index c1591cba80..f727c79b07 100644 --- a/plugins/UserInfoEx/src/classMTime.cpp +++ b/plugins/UserInfoEx/src/classMTime.cpp @@ -77,7 +77,7 @@ void MTime::ZeroDate() * validation / checks
*********************************************/
-BYTE MTime::IsValid() const
+uint8_t MTime::IsValid() const
{
return (
_SysTime.wYear > 1600 &&
@@ -88,7 +88,7 @@ BYTE MTime::IsValid() const _SysTime.wSecond < 60 );
}
-BYTE MTime::IsLeapYear() const
+uint8_t MTime::IsLeapYear() const
{
return (!(((_SysTime.wYear) % 4 != 0) || (((_SysTime.wYear) % 100 == 0) && ((_SysTime.wYear) % 400 != 0))));
}
@@ -295,7 +295,7 @@ WORD MTime::DaysInMonth(const WORD &wMonth) const return (IsLeapYear() && wMonth == 2) ? wDaysInMonth[wMonth] + 1 : wDaysInMonth[wMonth];
}
-WORD MTime::DaysInYear(BYTE bIgnoreLeap) const
+WORD MTime::DaysInYear(uint8_t bIgnoreLeap) const
{
return ((!bIgnoreLeap && IsLeapYear()) ? 366 : 365);
};
diff --git a/plugins/UserInfoEx/src/classMTime.h b/plugins/UserInfoEx/src/classMTime.h index eff510421a..19fb811cf3 100644 --- a/plugins/UserInfoEx/src/classMTime.h +++ b/plugins/UserInfoEx/src/classMTime.h @@ -38,8 +38,8 @@ public: // checks
__inline bool IsLocal() const { return _isLocal; }
- BYTE IsValid() const;
- BYTE IsLeapYear() const;
+ uint8_t IsValid() const;
+ uint8_t IsLeapYear() const;
// compare by seconds
LONG Compare(SYSTEMTIME st) const;
@@ -54,7 +54,7 @@ public: SYSTEMTIME SystemTime() const { return _SysTime; }
WORD DaysInMonth(const WORD &wMonth) const;
- WORD DaysInYear(BYTE bIgnoreLeap = FALSE) const;
+ WORD DaysInYear(uint8_t bIgnoreLeap = FALSE) const;
WORD DayOfYear() const;
WORD AdjustYear(const int nDiffDays);
diff --git a/plugins/UserInfoEx/src/classPsTree.cpp b/plugins/UserInfoEx/src/classPsTree.cpp index cd800ff5a2..3d809a064e 100644 --- a/plugins/UserInfoEx/src/classPsTree.cpp +++ b/plugins/UserInfoEx/src/classPsTree.cpp @@ -70,9 +70,9 @@ CPsTree::~CPsTree() * param: none * return: none **/ -BYTE CPsTree::Create(HWND hWndTree, CPsHdr* pPsh) +uint8_t CPsTree::Create(HWND hWndTree, CPsHdr* pPsh) { - BYTE rc; + uint8_t rc; if (hWndTree && pPsh->_hImages && pPsh->_pPages && pPsh->_numPages) { @@ -154,7 +154,7 @@ void CPsTree::Remove(HINSTANCE hInst) * param: needWidth - width to expand the tree by * return: TRUE if initialization is ok, FALSE otherwise **/ -BYTE CPsTree::InitTreeItems(LPWORD needWidth) +uint8_t CPsTree::InitTreeItems(LPWORD needWidth) { if (!_hWndTree || !_pages.getCount()) return FALSE; @@ -396,7 +396,7 @@ HTREEITEM CPsTree::ShowItem(const int iPageIndex, LPWORD needWidth) * bAsChild - tells, whether to try to add hItem as child of hInsertAfter or not * return: handle to new (moved) treeitem if successful or NULL otherwise **/ -HTREEITEM CPsTree::MoveItem(HTREEITEM hItem, HTREEITEM hInsertAfter, BYTE bAsChild) +HTREEITEM CPsTree::MoveItem(HTREEITEM hItem, HTREEITEM hInsertAfter, uint8_t bAsChild) { TVINSERTSTRUCT tvis; HTREEITEM hParent, hChild, hNewItem; @@ -658,7 +658,7 @@ int CPsTree::BeginLabelEdit(HTREEITEM hItem) * return: 0 **/ -int CPsTree::EndLabelEdit(const BYTE bSave) +int CPsTree::EndLabelEdit(const uint8_t bSave) { wchar_t szEdit[MAX_TINAME]; TVITEM tvi; @@ -808,10 +808,10 @@ void CPsTree::OnIconsChanged() * return: TRUE if any page holds changed information **/ -BYTE CPsTree::OnInfoChanged() +uint8_t CPsTree::OnInfoChanged() { PSHNOTIFY pshn; - BYTE bChanged = 0; + uint8_t bChanged = 0; pshn.hdr.idFrom = 0; pshn.hdr.code = PSN_INFOCHANGED; @@ -836,7 +836,7 @@ BYTE CPsTree::OnInfoChanged() * param: none * return: nothing **/ -BYTE CPsTree::OnSelChanging() +uint8_t CPsTree::OnSelChanging() { CPsTreeItem *pti = CurrentItem(); diff --git a/plugins/UserInfoEx/src/classPsTreeItem.cpp b/plugins/UserInfoEx/src/classPsTreeItem.cpp index fa09565ef9..7d3a5d2c9f 100644 --- a/plugins/UserInfoEx/src/classPsTreeItem.cpp +++ b/plugins/UserInfoEx/src/classPsTreeItem.cpp @@ -170,7 +170,7 @@ LPSTR CPsTreeItem::ParentItemName() * bIsUnicode - if TRUE the title is unicode
* return: 0 on success, 1 to 4 indicating the failed operation
**/
-int CPsTreeItem::Name(LPTSTR ptszTitle, const BYTE bIsUnicode)
+int CPsTreeItem::Name(LPTSTR ptszTitle, const uint8_t bIsUnicode)
{
// convert title to utf8
_pszName = (bIsUnicode) ? mir_utf8encodeW((LPWSTR)ptszTitle) : mir_utf8encode((LPSTR)ptszTitle);
@@ -196,7 +196,7 @@ int CPsTreeItem::Name(LPTSTR ptszTitle, const BYTE bIsUnicode) * params: pszName - the name to match the item with
* return: nothing
**/
-BYTE CPsTreeItem::HasName(const LPCSTR pszName) const
+uint8_t CPsTreeItem::HasName(const LPCSTR pszName) const
{
return !mir_strcmpi(_pszName, pszName);
};
@@ -236,7 +236,7 @@ void CPsTreeItem::Rename(const LPTSTR pszLabel) * param: pszName - uniquely identifiing string for a propertypage encoded with utf8 (e.g.: {group\item})
* return: Label in a newly allocated piece of memory
**/
-int CPsTreeItem::ItemLabel(const BYTE bReadDBValue)
+int CPsTreeItem::ItemLabel(const uint8_t bReadDBValue)
{
DBVARIANT dbv;
@@ -298,7 +298,7 @@ HICON CPsTreeItem::ProtoIcon() * hDefaultIcon - default icon to use
* return: nothing
**/
-int CPsTreeItem::Icon(HIMAGELIST hIml, OPTIONSDIALOGPAGE *odp, BYTE bInitIconsOnly)
+int CPsTreeItem::Icon(HIMAGELIST hIml, OPTIONSDIALOGPAGE *odp, uint8_t bInitIconsOnly)
{
// check parameter
if (!_pszName || !odp)
diff --git a/plugins/UserInfoEx/src/ctrl_annivedit.cpp b/plugins/UserInfoEx/src/ctrl_annivedit.cpp index a7fdec5079..b8ac49d503 100644 --- a/plugins/UserInfoEx/src/ctrl_annivedit.cpp +++ b/plugins/UserInfoEx/src/ctrl_annivedit.cpp @@ -93,7 +93,7 @@ void CAnnivEditCtrl::Release() * param: wIndex - index to desired item
* return: TRUE if item is valid, FALSE otherwise
**/
-BYTE CAnnivEditCtrl::ItemValid(WORD wIndex) const
+uint8_t CAnnivEditCtrl::ItemValid(WORD wIndex) const
{
return (_pDates != nullptr && wIndex < _numDates && _pDates[wIndex] != nullptr);
}
@@ -105,7 +105,7 @@ BYTE CAnnivEditCtrl::ItemValid(WORD wIndex) const * param: none
* return: TRUE if item is valid, FALSE otherwise
**/
-BYTE CAnnivEditCtrl::CurrentItemValid() const
+uint8_t CAnnivEditCtrl::CurrentItemValid() const
{
return ItemValid(_curDate);
}
@@ -117,7 +117,7 @@ BYTE CAnnivEditCtrl::CurrentItemValid() const * param: none
* return: TRUE if item is valid, FALSE otherwise
**/
-void CAnnivEditCtrl::EnableReminderCtrl(BYTE bEnabled)
+void CAnnivEditCtrl::EnableReminderCtrl(uint8_t bEnabled)
{
bEnabled &= _ReminderEnabled != REMIND_OFF;
EnableWindow(GetDlgItem(_hwndDlg, RADIO_REMIND1), bEnabled);
@@ -144,7 +144,7 @@ void CAnnivEditCtrl::EnableCurrentItem() PSGetContact(_hwndDlg, hContact);
- const BYTE bEnabled
+ const uint8_t bEnabled
= !hContact ||
(pCurrent->Flags() & CTRLF_HASCUSTOM) ||
!(pCurrent->Flags() & (CTRLF_HASPROTO|CTRLF_HASMETA)) ||
@@ -189,7 +189,7 @@ INT_PTR CAnnivEditCtrl::AddDate(MAnnivDate &mda) {
// if a date with wID exists, replace it
if (MAnnivDate *pmda = FindDateById(mda.Id())) {
- BYTE bChanged = pmda->IsChanged(),
+ uint8_t bChanged = pmda->IsChanged(),
bRemindChanged = pmda->IsReminderChanged();
if (!bChanged) {
@@ -293,7 +293,7 @@ INT_PTR CAnnivEditCtrl::DBGetAnniversaries(MCONTACT hContact) MAnnivDate mda;
WORD i;
- BYTE bChanged = FALSE;
+ uint8_t bChanged = FALSE;
for (i = 0; i < ANID_LAST && !mda.DBGetAnniversaryDate(hContact, i); i++) {
mda.DBGetReminderOpts(hContact);
@@ -383,7 +383,7 @@ INT_PTR CAnnivEditCtrl::DBWriteAnniversaries(MCONTACT hContact) **/
INT_PTR CAnnivEditCtrl::SetCurSel(WORD wIndex)
{
- BYTE bEnabled = ItemValid(wIndex);
+ uint8_t bEnabled = ItemValid(wIndex);
EnableWindow(_hwndDate, bEnabled);
EnableWindow(_hBtnEdit, bEnabled);
diff --git a/plugins/UserInfoEx/src/ctrl_annivedit.h b/plugins/UserInfoEx/src/ctrl_annivedit.h index f8656aefc3..520dd525db 100644 --- a/plugins/UserInfoEx/src/ctrl_annivedit.h +++ b/plugins/UserInfoEx/src/ctrl_annivedit.h @@ -33,14 +33,14 @@ class CAnnivEditCtrl : public CBaseCtrl HWND _hBtnAdd; // add anniversary button
HWND _hBtnDel; // delete anniversary button
- BYTE _ReminderEnabled;
+ uint8_t _ReminderEnabled;
MAnnivDate** _pDates;
WORD _numDates;
WORD _curDate;
- BYTE ItemValid(WORD wIndex) const;
- BYTE CurrentItemValid() const;
+ uint8_t ItemValid(WORD wIndex) const;
+ uint8_t CurrentItemValid() const;
INT_PTR DBGetBirthDay(MCONTACT hContact, LPCSTR pszProto);
INT_PTR DBWriteBirthDay(MCONTACT hContact);
@@ -56,12 +56,12 @@ public: MAnnivDate* Current() { return CurrentItemValid() ? _pDates[_curDate] : nullptr; };
WORD CurrentIndex() const { return _curDate; };
WORD NumDates() const { return _numDates; };
- BYTE ReminderEnabled() const { return _ReminderEnabled; };
+ uint8_t ReminderEnabled() const { return _ReminderEnabled; };
MAnnivDate* FindDateById(const WORD wId);
void EnableCurrentItem();
- void EnableReminderCtrl(BYTE bEnabled);
+ void EnableReminderCtrl(uint8_t bEnabled);
INT_PTR SetCurSel(WORD wIndex);
diff --git a/plugins/UserInfoEx/src/ctrl_base.h b/plugins/UserInfoEx/src/ctrl_base.h index 4d5fbe6139..fe9c7fe99f 100644 --- a/plugins/UserInfoEx/src/ctrl_base.h +++ b/plugins/UserInfoEx/src/ctrl_base.h @@ -42,7 +42,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define CTRL_LIST_ITEM 7
typedef struct TCtrlInfo {
- BYTE nType;
+ uint8_t nType;
WORD wFlags;
} CTRL, *LPCTRL;
diff --git a/plugins/UserInfoEx/src/ctrl_button.cpp b/plugins/UserInfoEx/src/ctrl_button.cpp index 4db6ec100a..a6028aa75a 100644 --- a/plugins/UserInfoEx/src/ctrl_button.cpp +++ b/plugins/UserInfoEx/src/ctrl_button.cpp @@ -36,7 +36,7 @@ typedef struct TMBCtrl{ HFONT hFont; // font
DWORD dwStyle;
- BYTE bFocus;
+ uint8_t bFocus;
int stateId; // button state
int defbutton; // default button
@@ -576,7 +576,7 @@ static LRESULT CALLBACK Button_WndProc(HWND hwndBtn, UINT uMsg, WPARAM wParam, L break;
case WM_LBUTTONUP:
if (bct->stateId != PBS_DISABLED) { // don't change states if disabled
- BYTE bPressed = bct->stateId == PBS_PRESSED;
+ uint8_t bPressed = bct->stateId == PBS_PRESSED;
if (bct->dwStyle & MBS_PUSHBUTTON) {
if (bct->pbState) bct->pbState = 0;
diff --git a/plugins/UserInfoEx/src/ctrl_combo.cpp b/plugins/UserInfoEx/src/ctrl_combo.cpp index 6c4d152a64..b686f41664 100644 --- a/plugins/UserInfoEx/src/ctrl_combo.cpp +++ b/plugins/UserInfoEx/src/ctrl_combo.cpp @@ -34,7 +34,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
* @return pointer of the newly created CCombo object.
**/
-CBaseCtrl* CCombo::CreateObj(HWND hDlg, WORD idCtrl, LPCSTR pszSetting, BYTE bDBDataType, LPIDSTRLIST pList, int nListCount)
+CBaseCtrl* CCombo::CreateObj(HWND hDlg, WORD idCtrl, LPCSTR pszSetting, uint8_t bDBDataType, LPIDSTRLIST pList, int nListCount)
{
return new CCombo(hDlg, idCtrl, pszSetting, bDBDataType, pList, nListCount);
}
@@ -51,7 +51,7 @@ CBaseCtrl* CCombo::CreateObj(HWND hDlg, WORD idCtrl, LPCSTR pszSetting, BYTE bDB *
* @return nothing
**/
-CCombo::CCombo(HWND hDlg, WORD idCtrl, LPCSTR pszSetting, BYTE bDBDataType, LPIDSTRLIST pList, int nListCount)
+CCombo::CCombo(HWND hDlg, WORD idCtrl, LPCSTR pszSetting, uint8_t bDBDataType, LPIDSTRLIST pList, int nListCount)
: CBaseCtrl(hDlg, idCtrl, pszSetting)
{
_curSel = CB_ERR;
diff --git a/plugins/UserInfoEx/src/ctrl_combo.h b/plugins/UserInfoEx/src/ctrl_combo.h index ad4aa1273b..9bb5bb5348 100644 --- a/plugins/UserInfoEx/src/ctrl_combo.h +++ b/plugins/UserInfoEx/src/ctrl_combo.h @@ -30,7 +30,7 @@ class CCombo : public CBaseCtrl int _curSel;
LPIDSTRLIST _pList;
int _nList;
- BYTE _bDataType;
+ uint8_t _bDataType;
/**
* Private constructure is to force to use static member 'Create'
@@ -40,7 +40,7 @@ class CCombo : public CBaseCtrl *
* @return nothing
**/
- CCombo(HWND hDlg, WORD idCtrl, LPCSTR pszSetting, BYTE bDBDataType, LPIDSTRLIST pList, int nListCount);
+ CCombo(HWND hDlg, WORD idCtrl, LPCSTR pszSetting, uint8_t bDBDataType, LPIDSTRLIST pList, int nListCount);
int Find(int nIndex) const;
int Find(LPTSTR ptszItemLabel) const;
@@ -58,7 +58,7 @@ public: static FORCEINLINE CCombo* GetObj(HWND hDlg, WORD idCtrl)
{ return GetObj(GetDlgItem(hDlg, idCtrl)); }
- static CBaseCtrl* CreateObj(HWND hDlg, WORD idCtrl, LPCSTR pszSetting, BYTE bDBDataType, LPIDSTRLIST pList, int nListCount);
+ static CBaseCtrl* CreateObj(HWND hDlg, WORD idCtrl, LPCSTR pszSetting, uint8_t bDBDataType, LPIDSTRLIST pList, int nListCount);
virtual void Release();
virtual BOOL OnInfoChanged(MCONTACT hContact, LPCSTR pszProto);
diff --git a/plugins/UserInfoEx/src/ctrl_contact.cpp b/plugins/UserInfoEx/src/ctrl_contact.cpp index 95abf7ae15..e5a970fe72 100644 --- a/plugins/UserInfoEx/src/ctrl_contact.cpp +++ b/plugins/UserInfoEx/src/ctrl_contact.cpp @@ -48,9 +48,9 @@ typedef struct TComboEx int numOther;
int iSelectedItem;
- BYTE bIsChanged;
- BYTE bLocked;
- BYTE bIsEditChanged;
+ uint8_t bIsChanged;
+ uint8_t bLocked;
+ uint8_t bIsEditChanged;
HINSTANCE hInstance;
HFONT hFont;
@@ -71,7 +71,7 @@ static int compareProc(LPCVOID cbi1, LPCVOID cbi2) static int CheckPhoneSyntax(LPTSTR pszSrc, LPTSTR szNumber, WORD cchNumber, int& errorPos)
{
int lenNum = 0;
- BYTE hasLeftBreaket = FALSE,
+ uint8_t hasLeftBreaket = FALSE,
hasRightBreaket = FALSE;
if (!szNumber || !pszSrc || !*pszSrc || !cchNumber) return 0;
@@ -1130,7 +1130,7 @@ static LRESULT CALLBACK CtrlContactWndProc(HWND hwnd, UINT msg, WPARAM wParam, L case CBEXM_ENABLEITEM:
if (cbex->iSelectedItem >= 0 && cbex->iSelectedItem < cbex->numItems) {
MCONTACT hContact;
- BYTE bEnabled;
+ uint8_t bEnabled;
PSGetContact(GetParent(hwnd), hContact);
@@ -1170,7 +1170,7 @@ static LRESULT CALLBACK CtrlContactWndProc(HWND hwnd, UINT msg, WPARAM wParam, L * name: CBEXM_SETCURSEL
* desc: selects a certain item
* param: wParam - index of the item to select
- * lParam - (BYTE)bValid - if TRUE, the next item with a value is selected
+ * lParam - (uint8_t)bValid - if TRUE, the next item with a value is selected
* return: always FALSE
**/
case CBEXM_SETCURSEL:
@@ -1181,7 +1181,7 @@ static LRESULT CALLBACK CtrlContactWndProc(HWND hwnd, UINT msg, WPARAM wParam, L if ((int)wParam < 0 || (int)wParam >= cbex->numItems) wParam = max(cbex->iSelectedItem, 0);
cbex->bLocked = 1;
- if ((BYTE)lParam == TRUE) {
+ if ((uint8_t)lParam == TRUE) {
i = (int)wParam;
cbex->iSelectedItem = (int)wParam;
diff --git a/plugins/UserInfoEx/src/ctrl_edit.cpp b/plugins/UserInfoEx/src/ctrl_edit.cpp index db9efe21ea..e0af506783 100644 --- a/plugins/UserInfoEx/src/ctrl_edit.cpp +++ b/plugins/UserInfoEx/src/ctrl_edit.cpp @@ -32,7 +32,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * @return This static method returns the pointer of the created object. **/ -CBaseCtrl* CEditCtrl::CreateObj(HWND hDlg, WORD idCtrl, LPCSTR pszSetting, BYTE dbType) +CBaseCtrl* CEditCtrl::CreateObj(HWND hDlg, WORD idCtrl, LPCSTR pszSetting, uint8_t dbType) { CEditCtrl *ctrl = new CEditCtrl(hDlg, idCtrl, USERINFO, pszSetting); if (ctrl) @@ -53,7 +53,7 @@ CBaseCtrl* CEditCtrl::CreateObj(HWND hDlg, WORD idCtrl, LPCSTR pszSetting, BYTE * @return This static method returns the pointer of the created object. **/ -CBaseCtrl* CEditCtrl::CreateObj(HWND hDlg, WORD idCtrl, LPCSTR pszModule, LPCSTR pszSetting, BYTE dbType) +CBaseCtrl* CEditCtrl::CreateObj(HWND hDlg, WORD idCtrl, LPCSTR pszModule, LPCSTR pszSetting, uint8_t dbType) { CEditCtrl *ctrl = new CEditCtrl(hDlg, idCtrl, pszModule, pszSetting); if (ctrl) @@ -179,7 +179,7 @@ void CEditCtrl::OnApply(MCONTACT hContact, LPCSTR pszProto) dbv.type = _dbType; switch (_dbType) { case DBVT_BYTE: - dbv.bVal = (BYTE)wcstol(val, nullptr, 10); + dbv.bVal = (uint8_t)wcstol(val, nullptr, 10); break; case DBVT_WORD: @@ -241,7 +241,7 @@ void CEditCtrl::OnChangedByUser(WORD wChangedMsg) _Flags.B.hasCustom = (cch > 0); if (!_Flags.B.hasChanged && _Flags.B.hasCustom) { - BYTE need_free = 0; + uint8_t need_free = 0; LPTSTR szText; __try { @@ -275,7 +275,7 @@ void CEditCtrl::OpenUrl() { int lenUrl = 1 + Edit_GetTextLength(_hwnd); LPTSTR szUrl; - BYTE need_free = 0; + uint8_t need_free = 0; __try { szUrl = (LPTSTR)alloca((8 + lenUrl) * sizeof(wchar_t)); @@ -306,7 +306,7 @@ LRESULT CEditCtrl::LinkNotificationHandler(ENLINK* lnk) case WM_LBUTTONUP: TEXTRANGE tr; - BYTE need_free = 0; + uint8_t need_free = 0; // do not call function if user selected some chars of the url string SendMessage(_hwnd, EM_EXGETSEL, NULL, (LPARAM)&tr.chrg); diff --git a/plugins/UserInfoEx/src/ctrl_edit.h b/plugins/UserInfoEx/src/ctrl_edit.h index 3a03956cf4..a384bafbe6 100644 --- a/plugins/UserInfoEx/src/ctrl_edit.h +++ b/plugins/UserInfoEx/src/ctrl_edit.h @@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. **/
class CEditCtrl : public CBaseCtrl
{
- BYTE _dbType;
+ uint8_t _dbType;
/**
* Private constructure is to force to use static member 'Create'
@@ -52,8 +52,8 @@ public: static FORCEINLINE CEditCtrl* GetObj(HWND hDlg, WORD idCtrl)
{ return GetObj(GetDlgItem(hDlg, idCtrl)); }
- static CBaseCtrl* CreateObj(HWND hDlg, WORD idCtrl, LPCSTR pszSetting, BYTE dbType);
- static CBaseCtrl* CreateObj(HWND hDlg, WORD idCtrl, LPCSTR pszModule, LPCSTR pszSetting, BYTE dbType);
+ static CBaseCtrl* CreateObj(HWND hDlg, WORD idCtrl, LPCSTR pszSetting, uint8_t dbType);
+ static CBaseCtrl* CreateObj(HWND hDlg, WORD idCtrl, LPCSTR pszModule, LPCSTR pszSetting, uint8_t dbType);
virtual void Release();
virtual void OnReset();
diff --git a/plugins/UserInfoEx/src/dlg_anniversarylist.cpp b/plugins/UserInfoEx/src/dlg_anniversarylist.cpp index 86817fcb89..86a6fe9dc1 100644 --- a/plugins/UserInfoEx/src/dlg_anniversarylist.cpp +++ b/plugins/UserInfoEx/src/dlg_anniversarylist.cpp @@ -49,7 +49,7 @@ class CAnnivList int _sortHeader;
int _curSel;
int _numRows;
- BYTE _bRemindEnable;
+ uint8_t _bRemindEnable;
HANDLE _mHookExit;
bool _wmINIT;
@@ -76,7 +76,7 @@ class CAnnivList struct CFilter
{
WORD wDaysBefore = (WORD)-1;
- BYTE bFilterIndex = 0;
+ uint8_t bFilterIndex = 0;
LPSTR pszProto = nullptr;
LPTSTR pszAnniv = nullptr;
} _filter;
@@ -86,7 +86,7 @@ class CAnnivList MCONTACT _hContact;
MAnnivDate _pDate;
WORD _wDaysBefore;
- BYTE _wReminderState;
+ uint8_t _wReminderState;
CItemData(MCONTACT hContact, MAnnivDate &date) :
_pDate(date)
@@ -421,7 +421,7 @@ class CAnnivList // enable/disable reminder checkbox is clicked
case CHECK_REMIND:
if (pDlg->_bRemindEnable && HIWORD(wParam) == BN_CLICKED) {
- BYTE checkState = Button_GetCheck((HWND)lParam);
+ uint8_t checkState = Button_GetCheck((HWND)lParam);
EnableWindow(GetDlgItem(hDlg, EDIT_REMIND), checkState == BST_CHECKED);
EnableWindow(GetDlgItem(hDlg, SPIN_REMIND), checkState == BST_CHECKED);
@@ -444,7 +444,7 @@ class CAnnivList // period of time is enabled/disabled
case CHECK_DAYS:
if (HIWORD(wParam) == BN_CLICKED) {
- BYTE isChecked = Button_GetCheck((HWND)lParam);
+ uint8_t isChecked = Button_GetCheck((HWND)lParam);
EnableWindow(GetDlgItem(hDlg, EDIT_DAYS), isChecked);
EnableWindow(GetDlgItem(hDlg, TXT_DAYS), isChecked);
pDlg->_filter.wDaysBefore = isChecked ? GetDlgItemInt(hDlg, EDIT_DAYS, nullptr, FALSE) : (WORD)-1;
@@ -569,7 +569,7 @@ class CAnnivList * @retval 0 if successful
* @retval 1 if failed
**/
- BYTE AddColumn(int iSubItem, LPCTSTR pszText, int defaultWidth)
+ uint8_t AddColumn(int iSubItem, LPCTSTR pszText, int defaultWidth)
{
LVCOLUMN lvc;
CHAR pszSetting[MAXSETTING];
@@ -592,7 +592,7 @@ class CAnnivList * @retval TRUE if successful
* @retval FALSE if failed
**/
- BYTE AddSubItem(int iItem, int iSubItem, LPTSTR pszText)
+ uint8_t AddSubItem(int iItem, int iSubItem, LPTSTR pszText)
{
LVITEM lvi;
if (iSubItem > 0) {
@@ -614,7 +614,7 @@ class CAnnivList * @retval TRUE if successful
* @retval FALSE if failed
**/
- BYTE AddItem(LPTSTR pszText, LPARAM lParam)
+ uint8_t AddItem(LPTSTR pszText, LPARAM lParam)
{
LVITEM lvi;
@@ -641,7 +641,7 @@ class CAnnivList * @retval TRUE if successful
* @retval FALSE if failed
**/
- BYTE AddRow(MCONTACT hContact, LPCSTR pszProto, MAnnivDate &ad, MTime &mtNow, int wDaysBefore)
+ uint8_t AddRow(MCONTACT hContact, LPCSTR pszProto, MAnnivDate &ad, MTime &mtNow, int wDaysBefore)
{
wchar_t szText[MAX_PATH];
int diff, iItem = -1;
@@ -811,8 +811,8 @@ class CAnnivList {
if (_hDlg) {
g_plugin.setWord(SET_ANNIVLIST_FILTER_DAYS, (WORD)GetDlgItemInt(_hDlg, EDIT_DAYS, nullptr, FALSE));
- g_plugin.setByte(SET_ANNIVLIST_FILTER_DAYSENABLED, (BYTE)Button_GetCheck(GetDlgItem(_hDlg, CHECK_DAYS)));
- g_plugin.setByte(SET_ANNIVLIST_FILTER_INDEX, (BYTE)ComboBox_GetCurSel(GetDlgItem(_hDlg, EDIT_DAYS)));
+ g_plugin.setByte(SET_ANNIVLIST_FILTER_DAYSENABLED, (uint8_t)Button_GetCheck(GetDlgItem(_hDlg, CHECK_DAYS)));
+ g_plugin.setByte(SET_ANNIVLIST_FILTER_INDEX, (uint8_t)ComboBox_GetCurSel(GetDlgItem(_hDlg, EDIT_DAYS)));
}
}
@@ -862,7 +862,7 @@ public: DeleteAllItems();
}
// remember popup setting
- g_plugin.setByte(SET_ANNIVLIST_POPUP, (BYTE)IsDlgButtonChecked(_hDlg, CHECK_POPUP));
+ g_plugin.setByte(SET_ANNIVLIST_POPUP, (uint8_t)IsDlgButtonChecked(_hDlg, CHECK_POPUP));
// save window position, size and column widths
Utils_SaveWindowPosition(_hDlg, NULL, MODULENAME, "AnnivDlg_");
SaveFilter();
diff --git a/plugins/UserInfoEx/src/dlg_propsheet.cpp b/plugins/UserInfoEx/src/dlg_propsheet.cpp index 4267b8ab0e..a1a1068f5f 100644 --- a/plugins/UserInfoEx/src/dlg_propsheet.cpp +++ b/plugins/UserInfoEx/src/dlg_propsheet.cpp @@ -56,7 +56,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /////////////////////////////////////////////////////////////////////////////////////////
// internal variables
-static BYTE bInitIcons = INIT_ICONS_NONE;
+static uint8_t bInitIcons = INIT_ICONS_NONE;
static MWindowList g_hWindowList = nullptr;
static HANDLE g_hDetailsInitEvent = nullptr;
@@ -98,7 +98,7 @@ public: private:
PROTOACCOUNT **_pPd;
int _numProto;
- BYTE _bExitAfterUploading;
+ uint8_t _bExitAfterUploading;
HANDLE _hUploading;
LPPS _pPs;
@@ -130,7 +130,7 @@ public: // @param pPs - the owning propertysheet
// @param bExitAfter - whether the dialog is to close after upload or not
- CPsUpload(LPPS pPs, BYTE bExitAfter)
+ CPsUpload(LPPS pPs, uint8_t bExitAfter)
{
_pPs = pPs;
_pPd = nullptr;
@@ -314,7 +314,7 @@ static INT_PTR AddPage(WPARAM wParam, LPARAM lParam) odp->flags = odp->flags > (ODPF_UNICODE | ODPF_BOLDGROUPS | ODPF_ICON | PSPF_PROTOPREPENDED) ? 0 : odp->flags;
if (pPsh->_dwFlags & (PSF_PROTOPAGESONLY | PSF_PROTOPAGESONLY_INIT)) {
- BYTE bIsUnicode = (odp->flags & ODPF_UNICODE) == ODPF_UNICODE;
+ uint8_t bIsUnicode = (odp->flags & ODPF_UNICODE) == ODPF_UNICODE;
wchar_t *ptszTitle = bIsUnicode ? mir_wstrdup(odp->szTitle.w) : mir_a2u(odp->szTitle.a);
// avoid adding pages for a meta subcontact, which have been added for a metacontact.
@@ -382,7 +382,7 @@ static int InitDetails(WPARAM wParam, LPARAM lParam) {
CPsHdr *pPsh = (CPsHdr *)wParam;
if (!(pPsh->_dwFlags & PSF_PROTOPAGESONLY)) {
- BYTE bChangeDetailsEnabled = myGlobals.CanChangeDetails && g_plugin.getByte(SET_PROPSHEET_CHANGEMYDETAILS, FALSE);
+ uint8_t bChangeDetailsEnabled = myGlobals.CanChangeDetails && g_plugin.getByte(SET_PROPSHEET_CHANGEMYDETAILS, FALSE);
if (lParam || bChangeDetailsEnabled) {
OPTIONSDIALOGPAGE odp = {};
odp.flags = ODPF_ICON | ODPF_UNICODE;
@@ -823,14 +823,14 @@ static INT_PTR CALLBACK DlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPar case PSM_ISLOCKED: // returns the lock state of the propertysheetpage
{
- BYTE bLocked = (pPs->dwFlags & PSF_LOCKED) == PSF_LOCKED;
+ uint8_t bLocked = (pPs->dwFlags & PSF_LOCKED) == PSF_LOCKED;
SetWindowLongPtr(hDlg, DWLP_MSGRESULT, bLocked);
return bLocked;
}
case PSM_FORCECHANGED: // force all propertysheetpages to update their controls with new values from the database
if (!(pPs->dwFlags & PSF_LOCKED)) {
- BYTE bChanged;
+ uint8_t bChanged;
pPs->dwFlags |= PSF_LOCKED;
if (bChanged = pPs->pTree->OnInfoChanged())
@@ -865,9 +865,9 @@ static INT_PTR CALLBACK DlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPar case PSM_ISAEROMODE:
{
- BYTE bIsAeroMode = IsAeroMode();
+ uint8_t bIsAeroMode = IsAeroMode();
if (lParam)
- *(BYTE *)lParam = bIsAeroMode;
+ *(uint8_t *)lParam = bIsAeroMode;
return (INT_PTR)bIsAeroMode;
}
@@ -1172,7 +1172,7 @@ static INT_PTR CALLBACK DlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPar // check where over the item, the pointer is
RECT rc;
if (TreeView_GetItemRect(pPs->pTree->Window(), hti.hItem, &rc, FALSE)) {
- BYTE height = (BYTE)(rc.bottom - rc.top);
+ uint8_t height = (uint8_t)(rc.bottom - rc.top);
if (hti.pt.y - (height / 3) < rc.top) {
SetCursor(LoadCursor(nullptr, IDC_ARROW));
@@ -1227,7 +1227,7 @@ static INT_PTR CALLBACK DlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPar pPs->pTree->EndDrag();
break;
}
- BYTE height = (BYTE)(rc.bottom - rc.top);
+ uint8_t height = (uint8_t)(rc.bottom - rc.top);
if (hti.pt.y - (height / 3) < rc.top) {
HTREEITEM hItem = hti.hItem;
@@ -1308,7 +1308,7 @@ static INT_PTR CALLBACK DlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPar }
if (pPs->nSubContacts != 0) {
- BYTE bDo = FALSE;
+ uint8_t bDo = FALSE;
// call the services
for (int i = 0; i < pPs->nSubContacts; i++)
diff --git a/plugins/UserInfoEx/src/dlg_propsheet.h b/plugins/UserInfoEx/src/dlg_propsheet.h index 7272ffa403..6e1c1735ae 100644 --- a/plugins/UserInfoEx/src/dlg_propsheet.h +++ b/plugins/UserInfoEx/src/dlg_propsheet.h @@ -47,15 +47,15 @@ class CPsTreeItem HTREEITEM _hItem; // handle to the treeview item if visible (NULL if this item is hidden)
int _iParent; // index of the owning tree item
int _iImage; // index of treeview item's image
- BYTE _bState; // initial state of this treeitem
+ uint8_t _bState; // initial state of this treeitem
LPSTR _pszName; // original name, given by plugin (not customized)
LPTSTR _ptszLabel; // string to setting in db holding information about this treeitem
LPCSTR GlobalName();
- int Icon(HIMAGELIST hIml, OPTIONSDIALOGPAGE *odp, BYTE bInitIconsOnly);
- int ItemLabel(const BYTE bReadDBValue);
- int Name(LPTSTR pszTitle, const BYTE bIsUnicode);
+ int Icon(HIMAGELIST hIml, OPTIONSDIALOGPAGE *odp, uint8_t bInitIconsOnly);
+ int ItemLabel(const uint8_t bReadDBValue);
+ int Name(LPTSTR pszTitle, const uint8_t bIsUnicode);
HICON ProtoIcon();
public:
@@ -76,7 +76,7 @@ public: __inline int Image() const { return _iImage; };
__inline int Pos() const { return _iPosition; };
- __inline BYTE State() const { return _bState; };
+ __inline uint8_t State() const { return _bState; };
__inline HTREEITEM Hti() const { return _hItem; };
__inline void Hti(HTREEITEM hti) { _hItem = hti; };
__inline int Parent() const { return _iParent; };
@@ -87,7 +87,7 @@ public: __inline void AddFlags(DWORD dwFlags) { _dwFlags |= dwFlags; };
__inline void RemoveFlags(DWORD dwFlags) { _dwFlags &= ~dwFlags; };
- BYTE HasName(const LPCSTR pszName) const;
+ uint8_t HasName(const LPCSTR pszName) const;
LPCSTR PropertyKey(LPCSTR pszProperty);
LPCSTR GlobalPropertyKey(LPCSTR pszProperty);
@@ -164,7 +164,7 @@ public: __inline int NumItems() const { return _pages.getCount(); }
__inline HWND Window() const { return _hWndTree; }
__inline HIMAGELIST ImageList() const { return _hImages; }
- __inline BYTE IsIndexValid(const int index) const { return (index >= 0 && index < _pages.getCount()); }
+ __inline uint8_t IsIndexValid(const int index) const { return (index >= 0 && index < _pages.getCount()); }
__inline CPsTreeItem* TreeItem(int index) const { return (IsIndexValid(index) ? &_pages[index] : nullptr); };
__inline HTREEITEM TreeItemHandle(int index) const { return (IsIndexValid(index) ? _pages[index].Hti() : nullptr); };
@@ -173,14 +173,14 @@ public: __inline CPsTreeItem* CurrentItem() const { return TreeItem(CurrentItemIndex()); };
int AddDummyItem(LPCSTR pszGroup);
- BYTE Create(HWND hWndTree, CPsHdr *pPsh);
- BYTE InitTreeItems(LPWORD needWidth);
+ uint8_t Create(HWND hWndTree, CPsHdr *pPsh);
+ uint8_t InitTreeItems(LPWORD needWidth);
void Remove(HINSTANCE);
void HideItem(const int iPageIndex);
HTREEITEM ShowItem(const int iPageIndex, LPWORD needWidth);
- HTREEITEM MoveItem(HTREEITEM hItem, HTREEITEM hInsertAfter, BYTE bAsChild = FALSE);
+ HTREEITEM MoveItem(HTREEITEM hItem, HTREEITEM hInsertAfter, uint8_t bAsChild = FALSE);
void SaveState();
void DBResetState();
@@ -193,12 +193,12 @@ public: CPsTreeItem *FindItemByResource(HINSTANCE hInst, int idDlg);
int BeginLabelEdit(HTREEITEM hItem);
- int EndLabelEdit(const BYTE bSave);
+ int EndLabelEdit(const uint8_t bSave);
void PopupMenu();
void OnIconsChanged();
- BYTE OnInfoChanged();
- BYTE OnSelChanging();
+ uint8_t OnInfoChanged();
+ uint8_t OnSelChanging();
void OnSelChanged(LPNMTREEVIEW lpnmtv);
void OnCancel();
int OnApply();
@@ -256,7 +256,7 @@ struct TPropSheet HFONT hCaptionFont;
HFONT hBoldFont;
RECT rcDisplay;
- BYTE updateAnimFrame;
+ uint8_t updateAnimFrame;
CHAR szUpdating[64];
DWORD dwFlags;
diff --git a/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp b/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp index f7a760cdff..429b4225ff 100644 --- a/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp +++ b/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp @@ -73,10 +73,10 @@ CExImContactBase::~CExImContactBase() * return: TRUE if successful or FALSE otherwise **/ -BYTE CExImContactBase::fromDB(MCONTACT hContact) +uint8_t CExImContactBase::fromDB(MCONTACT hContact) { - BYTE ret = FALSE; - BYTE isChatRoom = FALSE; + uint8_t ret = FALSE; + uint8_t isChatRoom = FALSE; LPSTR pszProto; LPCSTR uidSetting; DBVARIANT dbv; @@ -160,7 +160,7 @@ BYTE CExImContactBase::fromDB(MCONTACT hContact) * return: TRUE if successful or FALSE otherwise **/ -BYTE CExImContactBase::fromIni(LPSTR &row) +uint8_t CExImContactBase::fromIni(LPSTR &row) { LPSTR p1, p2 = nullptr; LPSTR pszUIDValue, pszUIDSetting, pszProto = nullptr; @@ -317,7 +317,7 @@ void CExImContactBase::toIni(FILE *file, int modCount) } } -BYTE CExImContactBase::compareUID(DBVARIANT *dbv) +uint8_t CExImContactBase::compareUID(DBVARIANT *dbv) { DWORD hash = 0; switch (dbv->type) { @@ -363,7 +363,7 @@ BYTE CExImContactBase::compareUID(DBVARIANT *dbv) return FALSE; } -LPSTR CExImContactBase::uid2String(BYTE bPrependType) +LPSTR CExImContactBase::uid2String(uint8_t bPrependType) { CHAR szUID[4096]; LPSTR ptr = szUID; @@ -437,7 +437,7 @@ LPSTR CExImContactBase::uid2String(BYTE bPrependType) memset(r, 0, baselen); ptr = r; for (SIZE_T j = 0; j < _dbvUID.cpbVal; j++, ptr += 3) { - mir_snprintf(ptr, ((r + baselen) - ptr), "%02X ", (BYTE)_dbvUID.pbVal[j]); + mir_snprintf(ptr, ((r + baselen) - ptr), "%02X ", (uint8_t)_dbvUID.pbVal[j]); } return r; } @@ -448,16 +448,16 @@ LPSTR CExImContactBase::uid2String(BYTE bPrependType) return mir_strdup(szUID); } -BYTE CExImContactBase::isMeta() const +uint8_t CExImContactBase::isMeta() const { return DB::Module::IsMeta(_pszProto); } -BYTE CExImContactBase::isHandle(MCONTACT hContact) +uint8_t CExImContactBase::isHandle(MCONTACT hContact) { LPCSTR pszProto; DBVARIANT dbv; - BYTE isEqual = FALSE; + uint8_t isEqual = FALSE; // owner contact ? if (!_pszProto) return hContact == NULL; diff --git a/plugins/UserInfoEx/src/ex_import/classExImContactBase.h b/plugins/UserInfoEx/src/ex_import/classExImContactBase.h index c681198129..8ac4701159 100644 --- a/plugins/UserInfoEx/src/ex_import/classExImContactBase.h +++ b/plugins/UserInfoEx/src/ex_import/classExImContactBase.h @@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. class CExImContactBase
{
- BYTE compareUID(DBVARIANT *dbv);
+ uint8_t compareUID(DBVARIANT *dbv);
protected:
LPSTR _pszNick; // utf8 encoded
@@ -36,7 +36,7 @@ protected: DWORD _dbvUIDHash;
DBVARIANT _dbvUID;
MCONTACT _hContact;
- BYTE _isNewContact; // is this contact a new one?
+ uint8_t _isNewContact; // is this contact a new one?
MCONTACT findHandle();
@@ -53,7 +53,7 @@ public: __inline void proto(LPCSTR val) { _pszProto = val ? mir_strdup(val) : nullptr; }
__inline void ampro(LPCSTR val) { _pszAMPro = val ? mir_strdup(val) : nullptr; }
__inline void uidk(LPCSTR val) { _pszUIDKey = val ? mir_strdup(val) : nullptr; }
- __inline void uid(BYTE val) { _dbvUID.type = DBVT_BYTE; _dbvUID.bVal = val; }
+ __inline void uid(uint8_t val) { _dbvUID.type = DBVT_BYTE; _dbvUID.bVal = val; }
__inline void uid(WORD val) { _dbvUID.type = DBVT_WORD; _dbvUID.wVal = val; }
__inline void uid(DWORD val) { _dbvUID.type = DBVT_DWORD; _dbvUID.dVal = val; }
__inline void uidn(uint8_t *val, DWORD len) { _dbvUID.type = DBVT_BLOB; _dbvUID.pbVal = val; _dbvUID.cpbVal = (WORD)len; }
@@ -70,16 +70,16 @@ public: mir_free(temp);
}
- BYTE isHandle(MCONTACT hContact);
- BYTE isMeta() const;
+ uint8_t isHandle(MCONTACT hContact);
+ uint8_t isMeta() const;
- LPSTR uid2String(BYTE bPrependType);
+ LPSTR uid2String(uint8_t bPrependType);
- BYTE fromDB(MCONTACT hContact);
- BYTE fromIni(LPSTR &row);
+ uint8_t fromDB(MCONTACT hContact);
+ uint8_t fromIni(LPSTR &row);
MCONTACT toDB();
void toIni(FILE *file, int modCount);
- BYTE operator=(MCONTACT hContact) { return fromDB(hContact); }
+ uint8_t operator=(MCONTACT hContact) { return fromDB(hContact); }
};
diff --git a/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp b/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp index 3bc587b868..c6abf8dc13 100644 --- a/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp +++ b/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp @@ -63,7 +63,7 @@ CExImContactXML::CExImContactXML(CFileXml *pXmlFile) * return: TRUE if pszKey is a valid contact information
**/
-BYTE CExImContactXML::IsContactInfo(LPCSTR pszKey)
+uint8_t CExImContactXML::IsContactInfo(LPCSTR pszKey)
{
// This is a sorted list of all hashvalues of the contact information.
// This is the same as the szCiKey[] array below but sorted
@@ -381,7 +381,7 @@ int CExImContactXML::ExportSetting(TiXmlElement *xmlModule, LPCSTR pszModule, LP * return: TRUE on success, FALSE otherwise
**/
-BYTE CExImContactXML::ExportEvents()
+uint8_t CExImContactXML::ExportEvents()
{
int dwNumEvents = db_event_count(_hContact);
if (dwNumEvents == 0)
@@ -525,7 +525,7 @@ int CExImContactXML::LoadXmlElement(const TiXmlElement *xContact) if (pUID != nullptr) {
switch (*(pUID++)) {
case 'b':
- uid((BYTE)atoi(pUID));
+ uid((uint8_t)atoi(pUID));
break;
case 'w':
uid((WORD)atoi(pUID));
@@ -636,7 +636,7 @@ int CExImContactXML::ImportNormalContact() * return: ERROR_OK on success or any other error number otherwise
**/
-int CExImContactXML::Import(BYTE keepMetaSubContact)
+int CExImContactXML::Import(uint8_t keepMetaSubContact)
{
// xml contact contains subcontacts?
const TiXmlElement *xContact = _xmlReader->FirstChildElement("CONTACT");
@@ -771,8 +771,8 @@ int CExImContactXML::ImportModule(const TiXmlElement *xmlModule) // import setting
if (!mir_strcmpi(xKey->Value(), XKEY_SET)) {
// check if the module to import is the contact's protocol module
- BYTE isProtoModule = !mir_strcmpi(pszModule, _pszProto)/* || DB::Module::IsMeta(pszModule)*/;
- BYTE isMetaModule = DB::Module::IsMeta(pszModule);
+ uint8_t isProtoModule = !mir_strcmpi(pszModule, _pszProto)/* || DB::Module::IsMeta(pszModule)*/;
+ uint8_t isMetaModule = DB::Module::IsMeta(pszModule);
// just ignore MetaModule on normal contact to avoid errors (only keys)
if (!isProtoModule && isMetaModule)
@@ -846,7 +846,7 @@ int CExImContactXML::ImportSetting(LPCSTR pszModule, const TiXmlElement *xmlEntr switch (value[0]) {
case 'b': //'b' bVal and cVal are valid
dbv.type = DBVT_BYTE;
- dbv.bVal = (BYTE)atoi(value + 1);
+ dbv.bVal = (uint8_t)atoi(value + 1);
break;
case 'w': //'w' wVal and sVal are valid
dbv.type = DBVT_WORD;
@@ -924,7 +924,7 @@ int CExImContactXML::ImportEvent(LPCSTR pszModule, const TiXmlElement *xmlEvent) return ERROR_INVALID_VALUE;
size_t baselen;
- mir_ptr<BYTE> tmpVal((uint8_t*)mir_base64_decode(tmp, &baselen));
+ mir_ptr<uint8_t> tmpVal((uint8_t*)mir_base64_decode(tmp, &baselen));
if (tmpVal != NULL) {
// event owning module
dbei.pBlob = tmpVal;
diff --git a/plugins/UserInfoEx/src/ex_import/classExImContactXML.h b/plugins/UserInfoEx/src/ex_import/classExImContactXML.h index 7ac1c98946..cd2343f967 100644 --- a/plugins/UserInfoEx/src/ex_import/classExImContactXML.h +++ b/plugins/UserInfoEx/src/ex_import/classExImContactXML.h @@ -58,7 +58,7 @@ class CExImContactXML : public CExImContactBase MEVENT _hEvent;
- BYTE IsContactInfo(LPCSTR pszKey);
+ uint8_t IsContactInfo(LPCSTR pszKey);
// private importing methods
int ImportModule(const TiXmlElement *xmlModule);
@@ -72,7 +72,7 @@ class CExImContactXML : public CExImContactBase // private exporting methods
int ExportModule(LPCSTR pszModule);
int ExportSetting(TiXmlElement *xmlModule, LPCSTR pszModule, LPCSTR pszSetting);
- BYTE ExportEvents();
+ uint8_t ExportEvents();
int ExportContact(DB::CEnumList *pModules);
int ExportSubContact(CExImContactXML *vMetaContact, DB::CEnumList *pModules);
@@ -86,7 +86,7 @@ public: // importing stuff
int LoadXmlElement(const TiXmlElement *xContact);
- int Import(BYTE keepMetaSubContact = FALSE);
+ int Import(uint8_t keepMetaSubContact = FALSE);
};
#endif /* _CLASS_EXIM_CONTACT_XML_INCLUDED_ */
diff --git a/plugins/UserInfoEx/src/ex_import/dlg_ExImModules.cpp b/plugins/UserInfoEx/src/ex_import/dlg_ExImModules.cpp index ec1cb4b629..105c770ddb 100644 --- a/plugins/UserInfoEx/src/ex_import/dlg_ExImModules.cpp +++ b/plugins/UserInfoEx/src/ex_import/dlg_ExImModules.cpp @@ -108,7 +108,7 @@ HTREEITEM ExportTree_FindItem(HWND hTree, HTREEITEM hParent, LPSTR pszText) * return: return handle to added treeitem
**/
-HTREEITEM ExportTree_AddItem(HWND hTree, HTREEITEM hParent, LPSTR pszDesc, BYTE bUseImages, BYTE bState)
+HTREEITEM ExportTree_AddItem(HWND hTree, HTREEITEM hParent, LPSTR pszDesc, uint8_t bUseImages, uint8_t bState)
{
TVINSERTSTRUCTA tvii;
HTREEITEM hItem = nullptr;
@@ -143,7 +143,7 @@ INT_PTR CALLBACK SelectModulesToExport_DlgProc(HWND hDlg, UINT uMsg, WPARAM wPar switch (uMsg) {
case WM_INITDIALOG:
{
- BYTE bImagesLoaded = 0;
+ uint8_t bImagesLoaded = 0;
// get tree handle and set treeview style
HWND hTree = GetDlgItem(hDlg, IDC_TREE);
diff --git a/plugins/UserInfoEx/src/ex_import/dlg_ExImProgress.cpp b/plugins/UserInfoEx/src/ex_import/dlg_ExImProgress.cpp index 6b25adda9a..f70df32bb6 100644 --- a/plugins/UserInfoEx/src/ex_import/dlg_ExImProgress.cpp +++ b/plugins/UserInfoEx/src/ex_import/dlg_ExImProgress.cpp @@ -161,7 +161,7 @@ void CProgress::Hide() * return: FALSE if user pressed cancel, TRUE otherwise
**/
-BYTE CProgress::Update()
+uint8_t CProgress::Update()
{
MSG msg;
@@ -189,7 +189,7 @@ BYTE CProgress::Update() * return: FALSE if user pressed cancel, TRUE otherwise
**/
-BYTE CProgress::UpdateContact(LPCTSTR pszFormat, ...)
+uint8_t CProgress::UpdateContact(LPCTSTR pszFormat, ...)
{
if (_hDlg != nullptr) {
HWND hProg = GetDlgItem(_hDlg, IDC_PROGRESS2);
@@ -216,7 +216,7 @@ BYTE CProgress::UpdateContact(LPCTSTR pszFormat, ...) * return: FALSE if user pressed cancel, TRUE otherwise
**/
-BYTE CProgress::UpdateSetting(LPCTSTR pszFormat, ...)
+uint8_t CProgress::UpdateSetting(LPCTSTR pszFormat, ...)
{
if (_hDlg != nullptr) {
HWND hProg = GetDlgItem(_hDlg, IDC_PROGRESS);
diff --git a/plugins/UserInfoEx/src/ex_import/dlg_ExImProgress.h b/plugins/UserInfoEx/src/ex_import/dlg_ExImProgress.h index fe4bc542b2..c6d72d2cb8 100644 --- a/plugins/UserInfoEx/src/ex_import/dlg_ExImProgress.h +++ b/plugins/UserInfoEx/src/ex_import/dlg_ExImProgress.h @@ -29,7 +29,7 @@ class CProgress HWND _hDlg;
DWORD _dwStartTime;
- BYTE Update();
+ uint8_t Update();
public:
CProgress();
@@ -40,8 +40,8 @@ public: void SetContactCount(DWORD numContacts);
void SetSettingsCount(DWORD numSettings);
- BYTE UpdateContact(LPCTSTR pszFormat, ...);
- BYTE UpdateSetting(LPCTSTR pszFormat, ...);
+ uint8_t UpdateContact(LPCTSTR pszFormat, ...);
+ uint8_t UpdateSetting(LPCTSTR pszFormat, ...);
};
#endif /* _DLG_EXIMPROGRESS_H_ */
diff --git a/plugins/UserInfoEx/src/ex_import/mir_rfcCodecs.h b/plugins/UserInfoEx/src/ex_import/mir_rfcCodecs.h index 644cb55e0f..8c131bc17b 100644 --- a/plugins/UserInfoEx/src/ex_import/mir_rfcCodecs.h +++ b/plugins/UserInfoEx/src/ex_import/mir_rfcCodecs.h @@ -49,14 +49,14 @@ inline INT_PTR QPDecodeGetRequiredLength(INT_PTR nSrcLen) return nSrcLen;
}
-inline BOOL QPEncode(BYTE *pbSrcData, INT_PTR nSrcLen, LPSTR szDest, INT_PTR *pnDestLen, BYTE *bEncoded, DWORD dwFlags = 0)
+inline BOOL QPEncode(uint8_t *pbSrcData, INT_PTR nSrcLen, LPSTR szDest, INT_PTR *pnDestLen, uint8_t *bEncoded, DWORD dwFlags = 0)
{
//The hexadecimal character set
static const CHAR s_chHexChars[16] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
'A', 'B', 'C', 'D', 'E', 'F' };
INT_PTR nRead = 0, nWritten = 0, nLineLen = 0;
CHAR ch;
- BYTE bChanged = FALSE;
+ uint8_t bChanged = FALSE;
if (!pbSrcData || !szDest || !pnDestLen)
@@ -111,7 +111,7 @@ inline BOOL QPEncode(BYTE *pbSrcData, INT_PTR nSrcLen, LPSTR szDest, INT_PTR *pn return TRUE;
}
-inline BOOL QPDecode(BYTE *pbSrcData, INT_PTR nSrcLen, LPSTR szDest, INT_PTR *pnDestLen, DWORD dwFlags = 0)
+inline BOOL QPDecode(uint8_t *pbSrcData, INT_PTR nSrcLen, LPSTR szDest, INT_PTR *pnDestLen, DWORD dwFlags = 0)
{
if (!pbSrcData || !szDest || !pnDestLen) {
return FALSE;
@@ -131,7 +131,7 @@ inline BOOL QPDecode(BYTE *pbSrcData, INT_PTR nSrcLen, LPSTR szDest, INT_PTR *pn szBuf[1] = *pbSrcData++;
szBuf[2] = '\0';
char *tmp = '\0';
- *szDest++ = (BYTE)strtoul(szBuf, &tmp, 16);
+ *szDest++ = (uint8_t)strtoul(szBuf, &tmp, 16);
nWritten++;
nRead += 2;
continue;
diff --git a/plugins/UserInfoEx/src/ex_import/svc_ExImINI.cpp b/plugins/UserInfoEx/src/ex_import/svc_ExImINI.cpp index b19edc5a4f..dfc3b85940 100644 --- a/plugins/UserInfoEx/src/ex_import/svc_ExImINI.cpp +++ b/plugins/UserInfoEx/src/ex_import/svc_ExImINI.cpp @@ -86,7 +86,7 @@ static void ExportModule(MCONTACT hContact, LPCSTR pszModule, FILE *file) case DBVT_BLOB: fprintf(file, "%s=n", it); for (WORD j = 0; j < dbv.cpbVal; j++) - fprintf(file, "%02X ", (BYTE)dbv.pbVal[j]); + fprintf(file, "%02X ", (uint8_t)dbv.pbVal[j]); fputc('\n', file); break; } @@ -104,7 +104,7 @@ static void ExportModule(MCONTACT hContact, LPCSTR pszModule, FILE *file) * file - ini file to write the contact to **/ -static BYTE ExportContact(MCONTACT hContact, DB::CEnumList *pModules, FILE *file) +static uint8_t ExportContact(MCONTACT hContact, DB::CEnumList *pModules, FILE *file) { CExImContactBase vcc; @@ -255,7 +255,7 @@ static DWORD ImportreadLine(FILE *file, LPSTR &str) * return: handle to the contact that matches the information or NULL if no match **/ -static MCONTACT ImportFindContact(MCONTACT, LPSTR &strBuf, BYTE bCanCreate) +static MCONTACT ImportFindContact(MCONTACT, LPSTR &strBuf, uint8_t bCanCreate) { CExImContactBase vcc; @@ -313,7 +313,7 @@ int ImportSetting(MCONTACT hContact, LPCSTR pszModule, LPSTR &strLine) if (size_t brk = strspn(value, "0123456789-")) *(value + brk) = 0; dbv.type = DBVT_BYTE; - dbv.bVal = (BYTE)atoi(value); + dbv.bVal = (uint8_t)atoi(value); break; case 'w': @@ -372,7 +372,7 @@ int ImportSetting(MCONTACT hContact, LPCSTR pszModule, LPSTR &strLine) for (dest = dbv.pbVal, value = strtok(value, " "); value && *value; value = strtok(nullptr, " ")) - *(dest++) = (BYTE)strtol(value, nullptr, 16); + *(dest++) = (uint8_t)strtol(value, nullptr, 16); *dest = 0; break; diff --git a/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.cpp b/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.cpp index 8a7eff65c8..b0272ff998 100644 --- a/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.cpp +++ b/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.cpp @@ -37,11 +37,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * return TRUE or FALSE
**/
-BYTE IsUSASCII(LPCSTR pBuffer, LPDWORD pcbBuffer)
+uint8_t IsUSASCII(LPCSTR pBuffer, LPDWORD pcbBuffer)
{
- BYTE c;
+ uint8_t c;
uint8_t *s = (uint8_t*)pBuffer;
- BYTE bIsUTF = 0;
+ uint8_t bIsUTF = 0;
if (s == nullptr) return 1;
while ((c = *s++) != 0) {
@@ -97,7 +97,7 @@ CLineBuffer::~CLineBuffer() * return: TRUE if reallocation successful or memoryblock is large enough, FALSE otherwise
**/
-BYTE CLineBuffer::_resizeBuf(const size_t cbReq)
+uint8_t CLineBuffer::_resizeBuf(const size_t cbReq)
{
if (cbReq > _cbVal - _cbUsed) {
if (!(_pVal = (uint8_t*)mir_realloc(_pVal, BLOCKSIZE + _cbVal + 1))) {
@@ -205,7 +205,7 @@ size_t CLineBuffer::operator + (const CHAR cVal) * return: length of the string, added
**/
-size_t CLineBuffer::operator + (const BYTE bVal)
+size_t CLineBuffer::operator + (const uint8_t bVal)
{
size_t cbLength = 3;
@@ -479,7 +479,7 @@ int CLineBuffer::fgetEncoded(FILE *inFile) case '=':
if (_resizeBuf(1)) {
fread(hex, 2, 1, inFile);
- *(_pVal + _cbUsed++) = (BYTE)strtol(hex, nullptr, 16);
+ *(_pVal + _cbUsed++) = (uint8_t)strtol(hex, nullptr, 16);
wAdd++;
}
break;
@@ -716,7 +716,7 @@ size_t CVCardFileVCF::packList(LPIDSTRLIST pList, UINT nList, int iID, size_t *c * return value type
**/
-BYTE CVCardFileVCF::GetSetting(const CHAR *pszModule, const CHAR *pszSetting, DBVARIANT *dbv)
+uint8_t CVCardFileVCF::GetSetting(const CHAR *pszModule, const CHAR *pszSetting, DBVARIANT *dbv)
{
int type = _useUtf8 ? DBVT_UTF8 : DBVT_ASCIIZ;
dbv->pszVal = nullptr;
@@ -779,7 +779,7 @@ size_t CVCardFileVCF::packDB(const CHAR *pszModule, const CHAR *pszSetting, size * return number of bytes, added to the linebuffer
**/
-size_t CVCardFileVCF::packDBList(const CHAR *pszModule, const CHAR *pszSetting, MIRANDASERVICE GetList, BYTE bSigned, size_t *cbRew)
+size_t CVCardFileVCF::packDBList(const CHAR *pszModule, const CHAR *pszSetting, MIRANDASERVICE GetList, uint8_t bSigned, size_t *cbRew)
{
DBVARIANT dbv;
UINT nList;
@@ -880,7 +880,7 @@ void CVCardFileVCF::writeLineEncoded(const CHAR *szSet, size_t *cbRew) * return TRUE or FALSE
**/
-BYTE CVCardFileVCF::Open(MCONTACT hContact, const wchar_t *pszFileName, const wchar_t *pszMode)
+uint8_t CVCardFileVCF::Open(MCONTACT hContact, const wchar_t *pszFileName, const wchar_t *pszMode)
{
if (!(_pFile = _wfopen(pszFileName, pszMode)))
return FALSE;
@@ -916,7 +916,7 @@ void CVCardFileVCF::Close(void) * return TRUE or FALSE
**/
-BYTE CVCardFileVCF::Export(BYTE bExportUtf)
+uint8_t CVCardFileVCF::Export(uint8_t bExportUtf)
{
size_t cbRew = 0;
@@ -1073,7 +1073,7 @@ BYTE CVCardFileVCF::Export(BYTE bExportUtf) // gender
//
{
- BYTE gender = db_get_b(_hContact, USERINFO, SET_CONTACT_GENDER, 0);
+ uint8_t gender = db_get_b(_hContact, USERINFO, SET_CONTACT_GENDER, 0);
if (!gender) gender = db_get_b(_hContact, _pszBaseProto, SET_CONTACT_GENDER, 0);
switch (gender) {
case 'F':
@@ -1171,12 +1171,12 @@ int CVCardFileVCF::readLine(LPSTR szVCFSetting, WORD cchSetting) * return: number of characters read from the file or EOF
**/
-BYTE CVCardFileVCF::Import()
+uint8_t CVCardFileVCF::Import()
{
CHAR szEnt[MAX_PATH];
LPSTR pszParam;
int cbLine;
- BYTE numEmails = 0;
+ uint8_t numEmails = 0;
while (EOF != (cbLine = readLine(szEnt, MAX_PATH))) {
@@ -1237,10 +1237,10 @@ BYTE CVCardFileVCF::Import() db_set_w(_hContact, MOD_MBIRTHDAY, SET_CONTACT_BIRTHYEAR, (WORD)strtol(buf, nullptr, 10));
memcpy(buf, _clVal.GetBuffer() + 4, 2);
buf[2] = 0;
- db_set_b(_hContact, MOD_MBIRTHDAY, SET_CONTACT_BIRTHMONTH, (BYTE)strtol(buf, nullptr, 10));
+ db_set_b(_hContact, MOD_MBIRTHDAY, SET_CONTACT_BIRTHMONTH, (uint8_t)strtol(buf, nullptr, 10));
memcpy(buf, _clVal.GetBuffer() + 6, 2);
buf[2] = 0;
- db_set_b(_hContact, MOD_MBIRTHDAY, SET_CONTACT_BIRTHDAY, (BYTE)strtol(buf, nullptr, 10));
+ db_set_b(_hContact, MOD_MBIRTHDAY, SET_CONTACT_BIRTHDAY, (uint8_t)strtol(buf, nullptr, 10));
}
}
continue;
diff --git a/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.h b/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.h index 090308b5fd..e2f833df48 100644 --- a/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.h +++ b/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.h @@ -29,7 +29,7 @@ private: size_t _cbVal;
size_t _cbUsed;
- BYTE _resizeBuf(const size_t cbReq);
+ uint8_t _resizeBuf(const size_t cbReq);
public:
CLineBuffer();
@@ -40,7 +40,7 @@ public: size_t operator + (const CHAR *szVal);
size_t operator + (const wchar_t *wszVal);
size_t operator + (const CHAR cVal);
- size_t operator + (const BYTE bVal);
+ size_t operator + (const uint8_t bVal);
size_t operator + (const SHORT sVal);
size_t operator + (const WORD wVal);
size_t operator + (const LONG lVal);
@@ -72,13 +72,13 @@ private: MCONTACT _hContact;
const CHAR* _pszBaseProto;
WORD _cbRew;
- BYTE _useUtf8;
+ uint8_t _useUtf8;
WORD _hasUtf8;
size_t packList(LPIDSTRLIST pList, UINT nList, int iID, size_t *cbRew = nullptr);
- BYTE GetSetting(const CHAR *pszModule, const CHAR *pszSetting, DBVARIANT *dbv);
+ uint8_t GetSetting(const CHAR *pszModule, const CHAR *pszSetting, DBVARIANT *dbv);
size_t packDB(const CHAR *pszModule, const CHAR *pszSetting, size_t *cbRew = nullptr);
- size_t packDBList(const CHAR *pszModule, const CHAR *pszSetting, MIRANDASERVICE GetList, BYTE bSigned = FALSE, size_t *cbRew = nullptr);
+ size_t packDBList(const CHAR *pszModule, const CHAR *pszSetting, MIRANDASERVICE GetList, uint8_t bSigned = FALSE, size_t *cbRew = nullptr);
void writeLine(const CHAR *szSet, size_t *cbRew = nullptr);
void writeLineEncoded(const CHAR *szSet, size_t *cbRew = nullptr);
@@ -87,8 +87,8 @@ private: public:
CVCardFileVCF();
- BYTE Open(MCONTACT hContact, const wchar_t *pszFileName, const wchar_t *pszMode);
+ uint8_t Open(MCONTACT hContact, const wchar_t *pszFileName, const wchar_t *pszMode);
void Close(void);
- BYTE Export(BYTE bExportUtf);
- BYTE Import();
+ uint8_t Export(uint8_t bExportUtf);
+ uint8_t Import();
};
diff --git a/plugins/UserInfoEx/src/ex_import/svc_ExImXML.h b/plugins/UserInfoEx/src/ex_import/svc_ExImXML.h index 390029db60..eb1bb6328c 100644 --- a/plugins/UserInfoEx/src/ex_import/svc_ExImXML.h +++ b/plugins/UserInfoEx/src/ex_import/svc_ExImXML.h @@ -49,9 +49,9 @@ class CFileXml { DWORD CountContacts(const TiXmlElement* xmlParent);
/*
- int ExportOwner(FILE *xmlfile, BYTE bExportEvents);
- int ExportContact(FILE *xmlfile, MCONTACT hContact, BYTE bExportEvents, LPENUMLIST pModules);
- int ExportSubContact(TiXmlElement *xContact, MCONTACT hContact, BYTE bExportEvents);
+ int ExportOwner(FILE *xmlfile, uint8_t bExportEvents);
+ int ExportContact(FILE *xmlfile, MCONTACT hContact, uint8_t bExportEvents, LPENUMLIST pModules);
+ int ExportSubContact(TiXmlElement *xContact, MCONTACT hContact, uint8_t bExportEvents);
*/
public:
diff --git a/plugins/UserInfoEx/src/ex_import/svc_ExImport.h b/plugins/UserInfoEx/src/ex_import/svc_ExImport.h index 0cf893fa03..c4f0b3ed3b 100644 --- a/plugins/UserInfoEx/src/ex_import/svc_ExImport.h +++ b/plugins/UserInfoEx/src/ex_import/svc_ExImport.h @@ -24,7 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. typedef struct
{
- BYTE Typ;
+ uint8_t Typ;
union {
MCONTACT hContact;
LPSTR pszName;
diff --git a/plugins/UserInfoEx/src/mir_db.cpp b/plugins/UserInfoEx/src/mir_db.cpp index 30ea296ae7..34f2050c52 100644 --- a/plugins/UserInfoEx/src/mir_db.cpp +++ b/plugins/UserInfoEx/src/mir_db.cpp @@ -134,10 +134,10 @@ namespace Setting { * @retval 1 - error
**/
-BYTE Get(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszSetting, DBVARIANT *dbv, const BYTE destType)
+uint8_t Get(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszSetting, DBVARIANT *dbv, const uint8_t destType)
{
// read value without translation to specific type
- BYTE result = db_get_s(hContact, pszModule, pszSetting, dbv, 0) != 0;
+ uint8_t result = db_get_s(hContact, pszModule, pszSetting, dbv, 0) != 0;
// Is value read successfully and destination type set?
if (!result && destType)
@@ -200,9 +200,9 @@ LPWSTR GetWString(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszSetting) * @retval 1 - error
**/
-BYTE GetEx(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszProto, LPCSTR pszSetting, DBVARIANT *dbv, const BYTE destType)
+uint8_t GetEx(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszProto, LPCSTR pszSetting, DBVARIANT *dbv, const uint8_t destType)
{
- BYTE result = !pszModule || Get(hContact, pszModule, pszSetting, dbv, destType);
+ uint8_t result = !pszModule || Get(hContact, pszModule, pszSetting, dbv, destType);
// try to read setting from the contact's protocol module
if (result && pszProto) {
result = Get(hContact, pszProto, pszSetting, dbv, destType) != 0;
@@ -245,7 +245,7 @@ BYTE GetEx(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszProto, LPCSTR pszSetti * @return This function returns the WORD which contains the source of information.
**/
-WORD GetCtrl(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszSubModule, LPCSTR pszProto, LPCSTR pszSetting, DBVARIANT *dbv, const BYTE destType)
+WORD GetCtrl(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszSubModule, LPCSTR pszProto, LPCSTR pszSetting, DBVARIANT *dbv, const uint8_t destType)
{
WORD wFlags = 0;
@@ -307,7 +307,7 @@ WORD GetCtrl(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszSubModule, LPCSTR ps * @retval FALSE - setting does not exist
**/
-BYTE Exists(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszSetting)
+uint8_t Exists(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszSetting)
{
if (pszModule && pszSetting) {
CHAR szDummy[1];
@@ -349,7 +349,7 @@ namespace Variant { * @retval 1 - error
**/
-BYTE ConvertString(DBVARIANT* dbv, const BYTE destType)
+uint8_t ConvertString(DBVARIANT* dbv, const uint8_t destType)
{
if (dbv == nullptr)
return 1;
@@ -421,7 +421,7 @@ BYTE ConvertString(DBVARIANT* dbv, const BYTE destType) /**
* This function completely converts a DBVARIANT to the destination string type.
-* It includes BYTE, WORD, DWORD and all string types
+* It includes uint8_t, WORD, DWORD and all string types
* @param dbv - pointer to DBVARIANT structure which is to manipulate
* @param destType - one of (DBVT_ASCIIZ, DBVT_UTF8 or DBVT_WCHAR)
*
@@ -429,7 +429,7 @@ BYTE ConvertString(DBVARIANT* dbv, const BYTE destType) * @retval 1 - error
**/
-BYTE dbv2String(DBVARIANT* dbv, const BYTE destType)
+uint8_t dbv2String(DBVARIANT* dbv, const uint8_t destType)
{
if (dbv == nullptr)
return 1;
diff --git a/plugins/UserInfoEx/src/mir_db.h b/plugins/UserInfoEx/src/mir_db.h index 3289d35405..ea2f1d00ad 100644 --- a/plugins/UserInfoEx/src/mir_db.h +++ b/plugins/UserInfoEx/src/mir_db.h @@ -45,22 +45,22 @@ namespace Module { **/
namespace Setting {
- BYTE Get(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszSetting, DBVARIANT *dbv, const BYTE nType);
- static FORCEINLINE BYTE GetAsIs(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszSetting, DBVARIANT *dbv)
+ uint8_t Get(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszSetting, DBVARIANT *dbv, const uint8_t nType);
+ static FORCEINLINE uint8_t GetAsIs(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszSetting, DBVARIANT *dbv)
{ return Get(hContact, pszModule, pszSetting, dbv, 0); }
- static FORCEINLINE BYTE GetAString(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszSetting, DBVARIANT *dbv)
+ static FORCEINLINE uint8_t GetAString(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszSetting, DBVARIANT *dbv)
{ return Get(hContact, pszModule, pszSetting, dbv, DBVT_ASCIIZ); }
LPSTR GetAString(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszSetting);
- static FORCEINLINE BYTE GetWString(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszSetting, DBVARIANT *dbv)
+ static FORCEINLINE uint8_t GetWString(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszSetting, DBVARIANT *dbv)
{ return Get(hContact, pszModule, pszSetting, dbv, DBVT_WCHAR); }
LPWSTR GetWString(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszSetting);
- static FORCEINLINE BYTE GetUString(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszSetting, DBVARIANT *dbv)
+ static FORCEINLINE uint8_t GetUString(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszSetting, DBVARIANT *dbv)
{ return Get(hContact, pszModule, pszSetting, dbv, DBVT_UTF8); }
- BYTE GetEx(MCONTACT hContact, LPCSTR pszModule, LPCSTR szProto, LPCSTR pszSetting, DBVARIANT *dbv, const BYTE nType);
- static FORCEINLINE BYTE GetAsIsEx(MCONTACT hContact, LPCSTR pszModule, LPCSTR szProto, LPCSTR pszSetting, DBVARIANT *dbv)
+ uint8_t GetEx(MCONTACT hContact, LPCSTR pszModule, LPCSTR szProto, LPCSTR pszSetting, DBVARIANT *dbv, const uint8_t nType);
+ static FORCEINLINE uint8_t GetAsIsEx(MCONTACT hContact, LPCSTR pszModule, LPCSTR szProto, LPCSTR pszSetting, DBVARIANT *dbv)
{ return GetEx(hContact, pszModule, szProto, pszSetting, dbv, 0); }
static FORCEINLINE LPSTR GetAStringEx(MCONTACT hContact, LPCSTR pszModule, LPCSTR szProto, LPCSTR pszSetting)
{ DBVARIANT dbv; return (!GetEx(hContact, pszModule, szProto, pszSetting, &dbv, DBVT_ASCIIZ) && dbv.type == DBVT_ASCIIZ) ? dbv.pszVal : nullptr; }
@@ -69,7 +69,7 @@ namespace Setting { static FORCEINLINE LPSTR GetUStringEx(MCONTACT hContact, LPCSTR pszModule, LPCSTR szProto, LPCSTR pszSetting)
{ DBVARIANT dbv; return (!GetEx(hContact, pszModule, szProto, pszSetting, &dbv, DBVT_UTF8) && dbv.type == DBVT_UTF8) ? dbv.pszVal : nullptr; }
- WORD GetCtrl(MCONTACT hContact, LPCSTR pszModule, LPCSTR szSubModule, LPCSTR szProto, LPCSTR pszSetting, DBVARIANT *dbv, const BYTE nType);
+ WORD GetCtrl(MCONTACT hContact, LPCSTR pszModule, LPCSTR szSubModule, LPCSTR szProto, LPCSTR pszSetting, DBVARIANT *dbv, const uint8_t nType);
static FORCEINLINE WORD GetAsIsCtrl(MCONTACT hContact, LPCSTR pszModule, LPCSTR szSubModule, LPCSTR szProto, LPCSTR pszSetting, DBVARIANT *dbv)
{ return GetCtrl(hContact, pszModule, szSubModule, szProto, pszSetting, dbv, 0); }
static FORCEINLINE WORD GetAStringCtrl(MCONTACT hContact, LPCSTR pszModule, LPCSTR szSubModule, LPCSTR szProto, LPCSTR pszSetting, DBVARIANT *dbv)
@@ -87,14 +87,14 @@ namespace Setting { /**
* misc operations
**/
- BYTE Exists(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszSetting);
+ uint8_t Exists(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszSetting);
void DeleteArray(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszFormat, int iStart);
} /* namespace Setting */
namespace Variant {
- BYTE ConvertString(DBVARIANT* dbv, const BYTE destType);
- BYTE dbv2String(DBVARIANT* dbv, const BYTE destType);
+ uint8_t ConvertString(DBVARIANT* dbv, const uint8_t destType);
+ uint8_t dbv2String(DBVARIANT* dbv, const uint8_t destType);
} /* namespace Variant */
namespace Event {
diff --git a/plugins/UserInfoEx/src/mir_icolib.cpp b/plugins/UserInfoEx/src/mir_icolib.cpp index 1e649580b7..941fd25a4c 100644 --- a/plugins/UserInfoEx/src/mir_icolib.cpp +++ b/plugins/UserInfoEx/src/mir_icolib.cpp @@ -178,7 +178,7 @@ static HINSTANCE IcoLib_CheckIconPackVersion(wchar_t *szIconPack) /////////////////////////////////////////////////////////////////////////////////////////
// Set the icon of each control in the list
-void IcoLib_SetCtrlIcons(HWND hDlg, const ICONCTRL *pCtrl, BYTE numCtrls)
+void IcoLib_SetCtrlIcons(HWND hDlg, const ICONCTRL *pCtrl, uint8_t numCtrls)
{
for (int i = 0; i < numCtrls; i++) {
HICON hIcon = g_plugin.getIcon(pCtrl[i].iIcon);
diff --git a/plugins/UserInfoEx/src/mir_icolib.h b/plugins/UserInfoEx/src/mir_icolib.h index e632d47394..3d1fc2d30e 100644 --- a/plugins/UserInfoEx/src/mir_icolib.h +++ b/plugins/UserInfoEx/src/mir_icolib.h @@ -42,7 +42,7 @@ struct ICONCTRL };
LPTSTR IcoLib_GetDefaultIconFileName();
-void IcoLib_SetCtrlIcons(HWND hDlg, const ICONCTRL* pCtrl, BYTE numCtrls);
+void IcoLib_SetCtrlIcons(HWND hDlg, const ICONCTRL* pCtrl, uint8_t numCtrls);
void IcoLib_LoadModule();
diff --git a/plugins/UserInfoEx/src/mir_menuitems.cpp b/plugins/UserInfoEx/src/mir_menuitems.cpp index f3c1c6200c..4e5544934f 100644 --- a/plugins/UserInfoEx/src/mir_menuitems.cpp +++ b/plugins/UserInfoEx/src/mir_menuitems.cpp @@ -159,7 +159,7 @@ void RebuildContact() **/
void RebuildMain()
{
- BYTE item = 0;
+ uint8_t item = 0;
HGENMENU mhRoot = nullptr;
HGENMENU mhExIm = nullptr;
@@ -239,7 +239,7 @@ void RebuildMain() // reminder
mi.root = mhRoot;
- const BYTE bRemindMenus =
+ const uint8_t bRemindMenus =
g_plugin.getByte(SET_REMIND_ENABLED, DEFVAL_REMIND_ENABLED) &&
g_plugin.getByte(SET_REMIND_MENUENABLED, DEFVAL_REMIND_MENUENABLED);
if (bRemindMenus) {
@@ -293,7 +293,7 @@ void RebuildMain() void RebuildGroup()
{
int flag = 0;
- BYTE item = 0;
+ uint8_t item = 0;
HGENMENU mhRoot = nullptr;
HGENMENU mhExIm = nullptr;
@@ -383,7 +383,7 @@ void RebuildGroup() void RebuildSubGroup()
{
int flag = 0;
- BYTE item = 0;
+ uint8_t item = 0;
GroupMenuParam gmp = { 0 };
HGENMENU mhRoot = nullptr;
@@ -484,8 +484,8 @@ INT_PTR RebuildAccount(WPARAM, LPARAM lParam) if (Miranda_IsTerminated())
return 0;
- const BYTE mItems = 3; // menuitems to create
- BYTE item = 0;
+ const uint8_t mItems = 3; // menuitems to create
+ uint8_t item = 0;
// on call by hook or first start
if (!lParam || !hMenuItemAccount) {
diff --git a/plugins/UserInfoEx/src/psp_contact.cpp b/plugins/UserInfoEx/src/psp_contact.cpp index 0a2f3c857e..f4e8b4ef65 100644 --- a/plugins/UserInfoEx/src/psp_contact.cpp +++ b/plugins/UserInfoEx/src/psp_contact.cpp @@ -77,7 +77,7 @@ INT_PTR CALLBACK PSPProcContactHome(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM switch (((LPNMHDR)lParam)->code) {
case PSN_INFOCHANGED:
{
- BYTE bChanged = 0;
+ uint8_t bChanged = 0;
if (!PSGetBaseProto(hDlg, pszProto) || *pszProto == 0)
break;
@@ -221,7 +221,7 @@ INT_PTR CALLBACK PSPProcContactWork(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM switch (((LPNMHDR)lParam)->code) {
case PSN_INFOCHANGED:
{
- BYTE bChanged = 0;
+ uint8_t bChanged = 0;
if (!PSGetBaseProto(hDlg, pszProto) || *pszProto == 0)
break;
diff --git a/plugins/UserInfoEx/src/psp_general.cpp b/plugins/UserInfoEx/src/psp_general.cpp index fbfc25c044..05c8d229fd 100644 --- a/plugins/UserInfoEx/src/psp_general.cpp +++ b/plugins/UserInfoEx/src/psp_general.cpp @@ -80,7 +80,7 @@ INT_PTR CALLBACK PSPProcGeneral(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPar switch (((LPNMHDR)lParam)->code) {
case PSN_INFOCHANGED:
{
- BYTE bEnable;
+ uint8_t bEnable;
DBVARIANT dbv;
CCtrlFlags Flags;
@@ -109,7 +109,7 @@ INT_PTR CALLBACK PSPProcGeneral(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPar // gender
{
- BYTE gender
+ uint8_t gender
= IsDlgButtonChecked(hDlg, RADIO_FEMALE)
? 'F'
: IsDlgButtonChecked(hDlg, RADIO_MALE)
diff --git a/plugins/UserInfoEx/src/psp_options.cpp b/plugins/UserInfoEx/src/psp_options.cpp index 439245a2c3..6cc3131c86 100644 --- a/plugins/UserInfoEx/src/psp_options.cpp +++ b/plugins/UserInfoEx/src/psp_options.cpp @@ -64,7 +64,7 @@ static void FORCEINLINE ComboBox_AddItemWithData(HWND hCombo, LPTSTR ptszText, L * @retval TRUE on success
* @retval FALSE on failure
**/
-static BYTE EnableDlgItem(HWND hDlg, const int idCtrl, BYTE bEnabled)
+static uint8_t EnableDlgItem(HWND hDlg, const int idCtrl, uint8_t bEnabled)
{
return EnableWindow(GetDlgItem(hDlg, idCtrl), bEnabled);
}
@@ -79,7 +79,7 @@ static BYTE EnableDlgItem(HWND hDlg, const int idCtrl, BYTE bEnabled) *
* @return bEnabled
**/
-static BYTE InitialEnableControls(HWND hDlg, const int *idCtrl, int countCtrl, BYTE bEnabled)
+static uint8_t InitialEnableControls(HWND hDlg, const int *idCtrl, int countCtrl, uint8_t bEnabled)
{
HWND hCtrl;
@@ -100,7 +100,7 @@ static BYTE InitialEnableControls(HWND hDlg, const int *idCtrl, int countCtrl, B *
* @return bEnabled
**/
-static BYTE EnableControls(HWND hDlg, const int *idCtrl, int countCtrl, BYTE bEnabled)
+static uint8_t EnableControls(HWND hDlg, const int *idCtrl, int countCtrl, uint8_t bEnabled)
{
while (countCtrl-- > 0)
EnableDlgItem(hDlg, idCtrl[countCtrl], bEnabled);
@@ -117,9 +117,9 @@ static BYTE EnableControls(HWND hDlg, const int *idCtrl, int countCtrl, BYTE bEn *
* @return This function returns the value from database or the default value.
**/
-static BYTE DBGetCheckBtn(HWND hDlg, const int idCtrl, LPCSTR pszSetting, BYTE bDefault)
+static uint8_t DBGetCheckBtn(HWND hDlg, const int idCtrl, LPCSTR pszSetting, uint8_t bDefault)
{
- BYTE val = (g_plugin.getByte(pszSetting, bDefault) & 1) == 1;
+ uint8_t val = (g_plugin.getByte(pszSetting, bDefault) & 1) == 1;
CheckDlgButton(hDlg, idCtrl, val ? BST_CHECKED : BST_UNCHECKED);
return val;
}
@@ -134,9 +134,9 @@ static BYTE DBGetCheckBtn(HWND hDlg, const int idCtrl, LPCSTR pszSetting, BYTE b *
* @return checkstate
**/
-static BYTE DBWriteCheckBtn(HWND hDlg, const int idCtrl, LPCSTR pszSetting)
+static uint8_t DBWriteCheckBtn(HWND hDlg, const int idCtrl, LPCSTR pszSetting)
{
- BYTE val = IsDlgButtonChecked(hDlg, idCtrl);
+ uint8_t val = IsDlgButtonChecked(hDlg, idCtrl);
int Temp = g_plugin.getByte(pszSetting, 0);
Temp &= ~1;
g_plugin.setByte(pszSetting, Temp |= val);
@@ -175,7 +175,7 @@ static void DBWriteColor(HWND hDlg, const int idCtrl, LPCSTR pszSetting) }
/**
- * This function writes a BYTE to database according to the value
+ * This function writes a uint8_t to database according to the value
* read from the edit control identified by 'idCtrl'.
*
* @param hWnd - the dialog's window handle
@@ -187,12 +187,12 @@ static void DBWriteColor(HWND hDlg, const int idCtrl, LPCSTR pszSetting) * @retval TRUE - the database value was updated
* @retval FALSE - no database update needed
**/
-static BYTE DBWriteEditByte(HWND hDlg, const int idCtrl, LPCSTR pszSetting, BYTE defVal)
+static uint8_t DBWriteEditByte(HWND hDlg, const int idCtrl, LPCSTR pszSetting, uint8_t defVal)
{
- BYTE v;
+ uint8_t v;
BOOL t;
- v = (BYTE)GetDlgItemInt(hDlg, idCtrl, &t, FALSE);
+ v = (uint8_t)GetDlgItemInt(hDlg, idCtrl, &t, FALSE);
if (t && (v != g_plugin.getByte(pszSetting, defVal))) {
g_plugin.setByte(pszSetting, v);
return true;
@@ -213,7 +213,7 @@ static BYTE DBWriteEditByte(HWND hDlg, const int idCtrl, LPCSTR pszSetting, BYTE * @retval TRUE - the database value was updated
* @retval FALSE - no database update needed
**/
-static BYTE DBWriteEditWord(HWND hDlg, const int idCtrl, LPCSTR pszSetting, WORD defVal)
+static uint8_t DBWriteEditWord(HWND hDlg, const int idCtrl, LPCSTR pszSetting, WORD defVal)
{
WORD v;
BOOL t;
@@ -227,7 +227,7 @@ static BYTE DBWriteEditWord(HWND hDlg, const int idCtrl, LPCSTR pszSetting, WORD }
/**
- * This function writes a BYTE to database according to the currently
+ * This function writes a uint8_t to database according to the currently
* selected item of a combobox identified by 'idCtrl'.
*
* @param hWnd - the dialog's window handle
@@ -239,11 +239,11 @@ static BYTE DBWriteEditWord(HWND hDlg, const int idCtrl, LPCSTR pszSetting, WORD * @retval TRUE - the database value was updated
* @retval FALSE - no database update needed
**/
-static BYTE DBWriteComboByte(HWND hDlg, const int idCtrl, LPCSTR pszSetting, BYTE defVal)
+static uint8_t DBWriteComboByte(HWND hDlg, const int idCtrl, LPCSTR pszSetting, uint8_t defVal)
{
- BYTE v;
+ uint8_t v;
- v = (BYTE)SendDlgItemMessage(hDlg, idCtrl, CB_GETCURSEL, NULL, NULL);
+ v = (uint8_t)SendDlgItemMessage(hDlg, idCtrl, CB_GETCURSEL, NULL, NULL);
if (v != g_plugin.getByte(pszSetting, defVal)) {
g_plugin.setByte(pszSetting, v);
return true;
@@ -253,7 +253,7 @@ static BYTE DBWriteComboByte(HWND hDlg, const int idCtrl, LPCSTR pszSetting, BYT static INT_PTR CALLBACK DlgProc_CommonOpts(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
- static BYTE bInitialized = 0;
+ static uint8_t bInitialized = 0;
switch (uMsg) {
case WM_INITDIALOG:
@@ -295,7 +295,7 @@ static INT_PTR CALLBACK DlgProc_CommonOpts(HWND hDlg, UINT uMsg, WPARAM wParam, flag |= IsDlgButtonChecked(hDlg, it.idNONE) ? 2 : 0;
flag |= IsDlgButtonChecked(hDlg, it.idALL) ? 4 : 0;
flag |= IsDlgButtonChecked(hDlg, it.idEXIMPORT) ? 8 : 0;
- g_plugin.setByte(it.pszKey, (BYTE)flag);
+ g_plugin.setByte(it.pszKey, (uint8_t)flag);
}
RebuildMenu();
@@ -323,7 +323,7 @@ static INT_PTR CALLBACK DlgProc_CommonOpts(HWND hDlg, UINT uMsg, WPARAM wParam, UpdateStatusIcons();
// misc
- BYTE bEnabled = IsDlgButtonChecked(hDlg, CHECK_OPT_ZODIACAVATAR);
+ uint8_t bEnabled = IsDlgButtonChecked(hDlg, CHECK_OPT_ZODIACAVATAR);
g_plugin.setByte(SET_ZODIAC_AVATARS, bEnabled);
NServices::NAvatar::Enable(bEnabled);
}
@@ -374,7 +374,7 @@ static INT_PTR CALLBACK DlgProc_CommonOpts(HWND hDlg, UINT uMsg, WPARAM wParam, static INT_PTR CALLBACK DlgProc_AdvancedOpts(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
- static BYTE bInitialized = 0;
+ static uint8_t bInitialized = 0;
switch (uMsg) {
case WM_INITDIALOG:
@@ -414,7 +414,7 @@ static INT_PTR CALLBACK DlgProc_AdvancedOpts(HWND hDlg, UINT uMsg, WPARAM wParam break;
case BTN_OPT_RESET:
- BYTE WantReset = MsgBox(hDlg,
+ uint8_t WantReset = MsgBox(hDlg,
MB_ICON_WARNING | MB_YESNO,
LPGENW("Question"),
LPGENW("Reset factory defaults"),
@@ -462,7 +462,7 @@ static INT_PTR CALLBACK DlgProc_AdvancedOpts(HWND hDlg, UINT uMsg, WPARAM wParam static INT_PTR CALLBACK DlgProc_DetailsDlgOpts(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
- static BYTE bInitialized = 0;
+ static uint8_t bInitialized = 0;
switch (uMsg) {
case WM_INITDIALOG:
@@ -542,7 +542,7 @@ static INT_PTR CALLBACK DlgProc_DetailsDlgOpts(HWND hDlg, UINT uMsg, WPARAM wPar static INT_PTR CALLBACK DlgProc_ReminderOpts(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
- static BYTE bInitialized = 0;
+ static uint8_t bInitialized = 0;
switch (uMsg) {
case WM_INITDIALOG:
@@ -574,7 +574,7 @@ static INT_PTR CALLBACK DlgProc_ReminderOpts(HWND hDlg, UINT uMsg, WPARAM wParam bInitialized = 0;
{
// set reminder options
- BYTE bEnabled = g_plugin.getByte(SET_REMIND_ENABLED, DEFVAL_REMIND_ENABLED);
+ uint8_t bEnabled = g_plugin.getByte(SET_REMIND_ENABLED, DEFVAL_REMIND_ENABLED);
SendDlgItemMessage(hDlg, EDIT_REMIND_ENABLED, CB_SETCURSEL, bEnabled, NULL);
DlgProc_ReminderOpts(hDlg, WM_COMMAND, MAKEWPARAM(EDIT_REMIND_ENABLED, CBN_SELCHANGE),
(LPARAM)GetDlgItem(hDlg, EDIT_REMIND_ENABLED));
@@ -607,7 +607,7 @@ static INT_PTR CALLBACK DlgProc_ReminderOpts(HWND hDlg, UINT uMsg, WPARAM wParam switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
{
- BYTE bReminderCheck = FALSE;
+ uint8_t bReminderCheck = FALSE;
// save checkbox options
DBWriteCheckBtn(hDlg, CHECK_REMIND_MI, SET_REMIND_MENUENABLED);
@@ -621,8 +621,8 @@ static INT_PTR CALLBACK DlgProc_ReminderOpts(HWND hDlg, UINT uMsg, WPARAM wParam bReminderCheck = DBWriteEditWord(hDlg, EDIT_REMIND, SET_REMIND_OFFSET, DEFVAL_REMIND_OFFSET);
// save primary birthday module
- BYTE bOld = g_plugin.getByte(SET_REMIND_BIRTHMODULE, DEFVAL_REMIND_BIRTHMODULE); // = 1
- BYTE bNew = (BYTE)ComboBox_GetCurSel(GetDlgItem(hDlg, EDIT_BIRTHMODULE));
+ uint8_t bOld = g_plugin.getByte(SET_REMIND_BIRTHMODULE, DEFVAL_REMIND_BIRTHMODULE); // = 1
+ uint8_t bNew = (uint8_t)ComboBox_GetCurSel(GetDlgItem(hDlg, EDIT_BIRTHMODULE));
if (bOld != bNew) {
// keep the database clean
DBWriteComboByte(hDlg, EDIT_BIRTHMODULE, SET_REMIND_BIRTHMODULE, DEFVAL_REMIND_BIRTHMODULE);
@@ -634,7 +634,7 @@ static INT_PTR CALLBACK DlgProc_ReminderOpts(HWND hDlg, UINT uMsg, WPARAM wParam }
// update current reminder state
- BYTE bNewVal = (BYTE)SendDlgItemMessage(hDlg, EDIT_REMIND_ENABLED, CB_GETCURSEL, NULL, NULL);
+ uint8_t bNewVal = (uint8_t)SendDlgItemMessage(hDlg, EDIT_REMIND_ENABLED, CB_GETCURSEL, NULL, NULL);
if (g_plugin.getByte(SET_REMIND_ENABLED, 1) != bNewVal) {
g_plugin.setByte(SET_REMIND_ENABLED, bNewVal);
if (bNewVal == REMIND_OFF) {
@@ -698,7 +698,7 @@ static INT_PTR CALLBACK DlgProc_ReminderOpts(HWND hDlg, UINT uMsg, WPARAM wParam case EDIT_REMIND_SOUNDOFFSET:
if (bInitialized && HIWORD(wParam) == EN_UPDATE) {
BOOL t;
- BYTE v = (BYTE)GetDlgItemInt(hDlg, LOWORD(wParam), &t, FALSE);
+ uint8_t v = (uint8_t)GetDlgItemInt(hDlg, LOWORD(wParam), &t, FALSE);
if (t && (v != g_plugin.getByte(SET_REMIND_SOUNDOFFSET, DEFVAL_REMIND_SOUNDOFFSET)))
NotifyParentOfChange(hDlg);
}
@@ -719,7 +719,7 @@ static INT_PTR CALLBACK DlgProc_ReminderOpts(HWND hDlg, UINT uMsg, WPARAM wParam static INT_PTR CALLBACK DlgProc_Popups(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
- static BYTE bInitialized = 0;
+ static uint8_t bInitialized = 0;
switch (uMsg) {
case WM_INITDIALOG:
@@ -733,7 +733,7 @@ static INT_PTR CALLBACK DlgProc_Popups(HWND hDlg, UINT uMsg, WPARAM wParam, LPAR EnableDlgItem(hDlg, CHECK_OPT_POPUP_MSGBOX, FALSE);
// enable/disable popups
- BYTE isEnabled = DBGetCheckBtn(hDlg, CHECK_OPT_POPUP_ENABLED, SET_POPUP_ENABLED, DEFVAL_POPUP_ENABLED);
+ uint8_t isEnabled = DBGetCheckBtn(hDlg, CHECK_OPT_POPUP_ENABLED, SET_POPUP_ENABLED, DEFVAL_POPUP_ENABLED);
SendMessage(hDlg, WM_COMMAND, MAKEWPARAM(CHECK_OPT_POPUP_ENABLED, BN_CLICKED), (LPARAM)GetDlgItem(hDlg, CHECK_OPT_POPUP_ENABLED));
// set colortype checkboxes and color controls
@@ -763,7 +763,7 @@ static INT_PTR CALLBACK DlgProc_Popups(HWND hDlg, UINT uMsg, WPARAM wParam, LPAR SendMessage(hDlg, WM_COMMAND, MAKEWPARAM(CHECK_OPT_POPUP_ADEFCLR, BN_CLICKED), NULL);
}
// set delay values
- BYTE bDelay = g_plugin.getByte(SET_POPUP_DELAY, 0);
+ uint8_t bDelay = g_plugin.getByte(SET_POPUP_DELAY, 0);
switch (bDelay) {
case 0:
CheckDlgButton(hDlg, RADIO_OPT_POPUP_DEFAULT, BST_CHECKED);
@@ -818,7 +818,7 @@ static INT_PTR CALLBACK DlgProc_Popups(HWND hDlg, UINT uMsg, WPARAM wParam, LPAR else if (IsDlgButtonChecked(hDlg, RADIO_OPT_POPUP_CUSTOM)) {
wchar_t szDelay[4];
GetDlgItemText(hDlg, EDIT_DELAY, szDelay, _countof(szDelay));
- g_plugin.setByte(SET_POPUP_DELAY, (BYTE)wcstol(szDelay, nullptr, 10));
+ g_plugin.setByte(SET_POPUP_DELAY, (uint8_t)wcstol(szDelay, nullptr, 10));
}
else
g_plugin.delSetting(SET_POPUP_DELAY);
diff --git a/plugins/UserInfoEx/src/psp_profile.cpp b/plugins/UserInfoEx/src/psp_profile.cpp index 1123c8ad51..73840c48d0 100644 --- a/plugins/UserInfoEx/src/psp_profile.cpp +++ b/plugins/UserInfoEx/src/psp_profile.cpp @@ -196,7 +196,7 @@ static void ProfileList_Clear(HWND hList) * bSave - tells, whether to save changes (TRUE) or not (FALSE)
* return: returns 0 on success or nonzero
**/
-static int ProfileList_EndLabelEdit(LPLISTCTRL pList, BYTE bSave)
+static int ProfileList_EndLabelEdit(LPLISTCTRL pList, uint8_t bSave)
{
HWND hEdit;
@@ -210,7 +210,7 @@ static int ProfileList_EndLabelEdit(LPLISTCTRL pList, BYTE bSave) if (bSave != FALSE && pList->labelEdit.pItem) {
WORD ccText;
LPTSTR szEdit = nullptr;
- BYTE bChanged = FALSE;
+ uint8_t bChanged = FALSE;
// an list element was selected
if (pList->labelEdit.iSubItem && pList->labelEdit.dropDown.iItem != pList->labelEdit.pItem->iListItem && pList->labelEdit.dropDown.iItem >= 0 && pList->labelEdit.dropDown.iItem < pList->labelEdit.pItem->idstrListCount) {
@@ -257,7 +257,7 @@ static int ProfileList_EndLabelEdit(LPLISTCTRL pList, BYTE bSave) return 0;
}
-static int ProfileList_EndLabelEdit(HWND hList, BYTE bSave)
+static int ProfileList_EndLabelEdit(HWND hList, uint8_t bSave)
{
return ProfileList_EndLabelEdit((LPLISTCTRL)GetUserData(hList), bSave);
}
@@ -419,7 +419,7 @@ static int ProfileList_GetInsertIndex(HWND hList, LPTSTR pszGroup) *
* return: TRUE or FALSE
**/
-static BYTE ProfileList_AddNewItem(HWND hDlg, LPLISTCTRL pList, const PROFILEENTRY *pEntry)
+static uint8_t ProfileList_AddNewItem(HWND hDlg, LPLISTCTRL pList, const PROFILEENTRY *pEntry)
{
LPLCITEM pItem;
LVITEM lvi;
@@ -515,7 +515,7 @@ static int ProfileList_AddItemlistFromDB( for (j = 0; j < nList; j++) {
switch (dbvCat.type) {
case DBVT_BYTE:
- if (dbvCat.bVal != (BYTE)idList[j].nID)
+ if (dbvCat.bVal != (uint8_t)idList[j].nID)
continue;
break;
case DBVT_WORD:
@@ -655,7 +655,7 @@ static LRESULT CALLBACK ProfileList_LabelEditProc(HWND hwnd, UINT msg, WPARAM wP return 0;
case VK_RETURN:
{
- BYTE bEditNext;
+ uint8_t bEditNext;
int iItem;
if (GetWindowLongPtr(hwnd, GWL_STYLE) & ES_WANTRETURN && !(GetKeyState(VK_CONTROL) & 0x8000))
@@ -1115,10 +1115,10 @@ INT_PTR CALLBACK PSPProcContactProfile(HWND hDlg, UINT uMsg, WPARAM wParam, LPAR switch (((LPNMHDR)lParam)->code) {
case PSN_INFOCHANGED:
{
- BYTE msgResult = 0;
+ uint8_t msgResult = 0;
LPIDSTRLIST idList;
UINT nList;
- BYTE i;
+ uint8_t i;
int iItem = 0, iGrp = 0, numProtoItems, numUserItems;
if (!(pList->wFlags & CTRLF_CHANGED) && PSGetBaseProto(hDlg, pszProto) && *pszProto != 0) {
@@ -1175,7 +1175,7 @@ INT_PTR CALLBACK PSPProcContactProfile(HWND hDlg, UINT uMsg, WPARAM wParam, LPAR // user selected to apply settings to the database
case PSN_APPLY:
if (pList->wFlags & CTRLF_CHANGED) {
- BYTE iFmt = -1;
+ uint8_t iFmt = -1;
int iItem;
LVITEM lvi;
wchar_t szGroup[MAX_PATH];
diff --git a/plugins/UserInfoEx/src/stdafx.h b/plugins/UserInfoEx/src/stdafx.h index 79494a1969..8fef10991d 100644 --- a/plugins/UserInfoEx/src/stdafx.h +++ b/plugins/UserInfoEx/src/stdafx.h @@ -161,10 +161,10 @@ struct CMPlugin : public PLUGIN<CMPlugin> typedef struct _MGLOBAL
{
- BYTE CanChangeDetails : 1; // is service to upload own contact information for icq present?
- BYTE TzIndexExist : 1; // Win Reg has Timzone Index Info
- BYTE ShowPropsheetColours : 1; // cached SET_PROPSHEET_SHOWCOLOURS database value
- BYTE WantAeroAdaption : 1; // reserved for later use
+ uint8_t CanChangeDetails : 1; // is service to upload own contact information for icq present?
+ uint8_t TzIndexExist : 1; // Win Reg has Timzone Index Info
+ uint8_t ShowPropsheetColours : 1; // cached SET_PROPSHEET_SHOWCOLOURS database value
+ uint8_t WantAeroAdaption : 1; // reserved for later use
} MGLOBAL, *LPMGLOBAL;
extern MGLOBAL myGlobals;
@@ -214,7 +214,7 @@ static FORCEINLINE BOOL IsProtoAccountEnabled(PROTOACCOUNT *pAcc) typedef HRESULT (STDAPICALLTYPE *pfnDwmIsCompositionEnabled)(BOOL *);
extern pfnDwmIsCompositionEnabled dwmIsCompositionEnabled;
-static FORCEINLINE BYTE IsAeroMode()
+static FORCEINLINE uint8_t IsAeroMode()
{
BOOL result;
return myGlobals.WantAeroAdaption && dwmIsCompositionEnabled && (dwmIsCompositionEnabled(&result) == S_OK) && result;
diff --git a/plugins/UserInfoEx/src/svc_avatar.cpp b/plugins/UserInfoEx/src/svc_avatar.cpp index e8f80dd237..1f1f771d93 100644 --- a/plugins/UserInfoEx/src/svc_avatar.cpp +++ b/plugins/UserInfoEx/src/svc_avatar.cpp @@ -93,7 +93,7 @@ namespace NServices return 0;
}
- void Enable(BYTE bEnable)
+ void Enable(uint8_t bEnable)
{
DBVARIANT dbv;
@@ -103,7 +103,7 @@ namespace NServices for (auto &hContact : Contacts()) {
// don't set if avatar is locked!
if (!db_get_b(hContact, "ContactPhoto", "Locked", 0)) {
- BYTE bInvalidAvatar = TRUE;
+ uint8_t bInvalidAvatar = TRUE;
// the relative file is valid
if (!DB::Setting::GetAString(hContact, "ContactPhoto", "RFile", &dbv)) {
diff --git a/plugins/UserInfoEx/src/svc_avatar.h b/plugins/UserInfoEx/src/svc_avatar.h index 1e92275c67..488a5c287f 100644 --- a/plugins/UserInfoEx/src/svc_avatar.h +++ b/plugins/UserInfoEx/src/svc_avatar.h @@ -26,7 +26,7 @@ namespace NServices {
namespace NAvatar
{
- void Enable (BYTE bEnable);
+ void Enable (uint8_t bEnable);
void OnModulesLoaded ();
}
} /* namespace NServices */
diff --git a/plugins/UserInfoEx/src/svc_gender.cpp b/plugins/UserInfoEx/src/svc_gender.cpp index 64de29720f..a5e899b576 100644 --- a/plugins/UserInfoEx/src/svc_gender.cpp +++ b/plugins/UserInfoEx/src/svc_gender.cpp @@ -21,7 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "stdafx.h"
-BYTE GenderOf(MCONTACT hContact, LPCSTR pszProto)
+uint8_t GenderOf(MCONTACT hContact, LPCSTR pszProto)
{
DBVARIANT dbv;
if (DB::Setting::GetAsIsEx(hContact, USERINFO, pszProto, SET_CONTACT_GENDER, &dbv) == 0) {
@@ -44,7 +44,7 @@ BYTE GenderOf(MCONTACT hContact, LPCSTR pszProto) * @retval 0 - contact does not provide its gender
**/
-BYTE GenderOf(MCONTACT hContact)
+uint8_t GenderOf(MCONTACT hContact)
{
return GenderOf(hContact, Proto_GetBaseAccountName(hContact));
}
diff --git a/plugins/UserInfoEx/src/svc_gender.h b/plugins/UserInfoEx/src/svc_gender.h index ec7d9b734e..b99436000e 100644 --- a/plugins/UserInfoEx/src/svc_gender.h +++ b/plugins/UserInfoEx/src/svc_gender.h @@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifndef _UINFOEX_SVCGENDER_H_INCLUDED_
#define _UINFOEX_SVCGENDER_H_INCLUDED_
-BYTE GenderOf(MCONTACT hContact, LPCSTR pszProto);
-BYTE GenderOf(MCONTACT hContact);
+uint8_t GenderOf(MCONTACT hContact, LPCSTR pszProto);
+uint8_t GenderOf(MCONTACT hContact);
#endif /* _UINFOEX_SVCGENDER_H_INCLUDED_ */
\ No newline at end of file diff --git a/plugins/UserInfoEx/src/svc_refreshci.cpp b/plugins/UserInfoEx/src/svc_refreshci.cpp index 813b24af56..4f36b7dede 100644 --- a/plugins/UserInfoEx/src/svc_refreshci.cpp +++ b/plugins/UserInfoEx/src/svc_refreshci.cpp @@ -32,8 +32,8 @@ typedef INT_PTR(*PUpdCallback) (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar class CUpdProgress
{
protected:
- BYTE _bBBCode; // TRUE if text renderer can handle BBCodes
- BYTE _bIsCanceled; // is set to TRUE upon click on the CANCEL button
+ uint8_t _bBBCode; // TRUE if text renderer can handle BBCodes
+ uint8_t _bIsCanceled; // is set to TRUE upon click on the CANCEL button
PUpdCallback _pFnCallBack; // a pointer to a callback function, which can be used
// to catch several messages by the caller.
PVOID _pData; // application defined data
@@ -88,7 +88,7 @@ public: virtual void SetTitle(LPCTSTR szText) = 0;
virtual void SetText(LPCTSTR szText) = 0;
- BYTE IsVisible() const
+ uint8_t IsVisible() const
{
return _hWnd != nullptr;
}
@@ -96,7 +96,7 @@ public: *
*
**/
- BYTE IsCanceled() const
+ uint8_t IsCanceled() const
{
return _bIsCanceled;
}
@@ -518,7 +518,7 @@ class CContactUpdater : public CContactQueue if (ack->hProcess || ack->lParam) {
if (!_hContactAcks) {
_nContactAcks = (INT_PTR)ack->hProcess;
- _hContactAcks = (uint8_t*)mir_calloc(sizeof(BYTE) * (INT_PTR)ack->hProcess);
+ _hContactAcks = (uint8_t*)mir_calloc(sizeof(uint8_t) * (INT_PTR)ack->hProcess);
}
if (ack->result == ACKRESULT_SUCCESS || ack->result == ACKRESULT_FAILED)
diff --git a/plugins/UserInfoEx/src/svc_reminder.cpp b/plugins/UserInfoEx/src/svc_reminder.cpp index 6a02c83877..e3f8ed65a2 100644 --- a/plugins/UserInfoEx/src/svc_reminder.cpp +++ b/plugins/UserInfoEx/src/svc_reminder.cpp @@ -39,17 +39,17 @@ struct CEvent CEvent();
CEvent(EType eType, WORD wDaysLeft);
- BYTE operator << (const CEvent& e);
+ uint8_t operator << (const CEvent& e);
};
typedef struct _REMINDEROPTIONS
{
WORD wDaysEarlier;
- BYTE bPopups;
- BYTE bCListExtraIcon;
- BYTE bFlashCList;
- BYTE bCheckVisibleOnly;
- BYTE RemindState;
+ uint8_t bPopups;
+ uint8_t bCListExtraIcon;
+ uint8_t bFlashCList;
+ uint8_t bCheckVisibleOnly;
+ uint8_t RemindState;
CEvent evt;
}
REMINDEROPTIONS, *LPREMINDEROPTIONS;
@@ -69,7 +69,7 @@ HANDLE ghCListBirthdayIcons[11]; static REMINDEROPTIONS gRemindOpts;
-static void UpdateTimer(BYTE bStartup);
+static void UpdateTimer(uint8_t bStartup);
/***********************************************************************************************************
* struct CEvent
@@ -114,7 +114,7 @@ CEvent::CEvent(EType eType, WORD wDaysLeft) * @retval FALSE - The values are not assigned.
**/
-BYTE CEvent::operator << (const CEvent& evt)
+uint8_t CEvent::operator << (const CEvent& evt)
{
if (_wDaysLeft > evt._wDaysLeft) {
_wDaysLeft = evt._wDaysLeft;
@@ -337,7 +337,7 @@ static void NotifyFlashCListIcon(MCONTACT hContact, const CEvent &evt) * @retval 1 otherwise
**/
-static BYTE NotifyWithSound(const CEvent &evt)
+static uint8_t NotifyWithSound(const CEvent &evt)
{
if (evt._wDaysLeft <= min(g_plugin.getByte(SET_REMIND_SOUNDOFFSET, DEFVAL_REMIND_SOUNDOFFSET), gRemindOpts.wDaysEarlier)) {
switch (evt._eType) {
@@ -357,7 +357,7 @@ static BYTE NotifyWithSound(const CEvent &evt) * "check for anniversary" functions
***********************************************************************************************************/
-static BYTE CheckAnniversaries(MCONTACT hContact, MTime &Now, CEvent &evt, BYTE bNotify)
+static uint8_t CheckAnniversaries(MCONTACT hContact, MTime &Now, CEvent &evt, uint8_t bNotify)
{
int numAnniversaries = 0;
int Diff = 0;
@@ -440,7 +440,7 @@ static BYTE CheckAnniversaries(MCONTACT hContact, MTime &Now, CEvent &evt, BYTE * @retval FALSE - contact has no birthday or it is not within the desired period of time.
**/
-static bool CheckBirthday(MCONTACT hContact, MTime &Now, CEvent &evt, BYTE bNotify, PWORD LastAnwer)
+static bool CheckBirthday(MCONTACT hContact, MTime &Now, CEvent &evt, uint8_t bNotify, PWORD LastAnwer)
{
if (gRemindOpts.RemindState == REMIND_BIRTH || gRemindOpts.RemindState == REMIND_ALL) {
MAnnivDate mtb;
@@ -520,7 +520,7 @@ static bool CheckBirthday(MCONTACT hContact, MTime &Now, CEvent &evt, BYTE bNoti * @return nothing
**/
-static void CheckContact(MCONTACT hContact, MTime &Now, CEvent &evt, BYTE bNotify, PWORD LastAnwer = nullptr)
+static void CheckContact(MCONTACT hContact, MTime &Now, CEvent &evt, uint8_t bNotify, PWORD LastAnwer = nullptr)
{
// ignore meta subcontacts here as their birthday information are collected explicitly
if (hContact && (!gRemindOpts.bCheckVisibleOnly || !Contact_IsHidden(hContact)) && !db_mc_isSub(hContact)) {
@@ -775,7 +775,7 @@ static void CALLBACK TimerProc_Check(HWND, UINT, UINT_PTR, DWORD) * @return nothing
**/
-static void UpdateTimer(BYTE bStartup)
+static void UpdateTimer(uint8_t bStartup)
{
LONG wNotifyInterval = 60 * 60 * (LONG)g_plugin.getWord(SET_REMIND_NOTIFYINTERVAL, DEFVAL_REMIND_NOTIFYINTERVAL);
MTime now, last;
@@ -804,7 +804,7 @@ static void UpdateTimer(BYTE bStartup) * module loading & unloading
***********************************************************************************************************/
-void SvcReminderEnable(BYTE bEnable)
+void SvcReminderEnable(uint8_t bEnable)
{
if (bEnable) { // Reminder is on
// init hooks
diff --git a/plugins/UserInfoEx/src/svc_reminder.h b/plugins/UserInfoEx/src/svc_reminder.h index 88f3f45075..c8ebc1164f 100644 --- a/plugins/UserInfoEx/src/svc_reminder.h +++ b/plugins/UserInfoEx/src/svc_reminder.h @@ -101,7 +101,7 @@ LPCSTR SvcReminderGetMyBirthdayModule(void); void SvcReminderOnTopToolBarLoaded(void);
void SvcReminderOnModulesLoaded(void);
-void SvcReminderEnable(BYTE bEnable);
+void SvcReminderEnable(uint8_t bEnable);
void SvcReminderLoadModule(void);
void SvcReminderUnloadModule(void);
diff --git a/plugins/Variables/src/contact.cpp b/plugins/Variables/src/contact.cpp index 42a9357bde..2f1420d1e4 100644 --- a/plugins/Variables/src/contact.cpp +++ b/plugins/Variables/src/contact.cpp @@ -94,7 +94,7 @@ static OBJLIST<CONTACTCE> arContactCache(20, SortContactCache); static mir_cs csContactCache;
// converts a string into a CNF_ type
-BYTE getContactInfoType(wchar_t* type)
+uint8_t getContactInfoType(wchar_t* type)
{
if (type == nullptr || mir_wstrlen(type) == 0)
return 0;
@@ -107,7 +107,7 @@ BYTE getContactInfoType(wchar_t* type) }
// returns info about a contact as a string
-wchar_t* getContactInfoT(BYTE type, MCONTACT hContact)
+wchar_t* getContactInfoT(uint8_t type, MCONTACT hContact)
{
/* returns dynamic allocated buffer with info, or NULL if failed */
if (hContact == NULL)
@@ -262,7 +262,7 @@ MCONTACT getContactFromString(const wchar_t *tszContact, DWORD dwFlags, int nMat // CNF_ (exact)
if ((dwFlags & CI_CNFINFO) && !bMatch) {
- ptrW szFind(getContactInfoT((BYTE)(dwFlags & ~CI_CNFINFO), hContact));
+ ptrW szFind(getContactInfoT((uint8_t)(dwFlags & ~CI_CNFINFO), hContact));
if (!mir_wstrcmp(tszContact, szFind))
bMatch = true;
}
diff --git a/plugins/Variables/src/options.cpp b/plugins/Variables/src/options.cpp index 116bd46b14..d1f22f8258 100644 --- a/plugins/Variables/src/options.cpp +++ b/plugins/Variables/src/options.cpp @@ -94,10 +94,10 @@ static INT_PTR CALLBACK SetOptsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP mir_free(szFormatText);
}
- g_plugin.setByte(SETTING_PARSEATSTARTUP, (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_PARSEATSTARTUP) ? 1 : 0));
- g_plugin.setByte(SETTING_STRIPCRLF, (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_STRIPCRLF) ? 1 : 0));
- g_plugin.setByte(SETTING_STRIPWS, (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_STRIPWS) ? 1 : 0));
- g_plugin.setByte(SETTING_STRIPALL, (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_STRIPALL) ? 1 : 0));
+ g_plugin.setByte(SETTING_PARSEATSTARTUP, (uint8_t)(IsDlgButtonChecked(hwndDlg, IDC_PARSEATSTARTUP) ? 1 : 0));
+ g_plugin.setByte(SETTING_STRIPCRLF, (uint8_t)(IsDlgButtonChecked(hwndDlg, IDC_STRIPCRLF) ? 1 : 0));
+ g_plugin.setByte(SETTING_STRIPWS, (uint8_t)(IsDlgButtonChecked(hwndDlg, IDC_STRIPWS) ? 1 : 0));
+ g_plugin.setByte(SETTING_STRIPALL, (uint8_t)(IsDlgButtonChecked(hwndDlg, IDC_STRIPALL) ? 1 : 0));
}
break;
diff --git a/plugins/Variables/src/parse_miranda.cpp b/plugins/Variables/src/parse_miranda.cpp index 452989048d..0373b33837 100644 --- a/plugins/Variables/src/parse_miranda.cpp +++ b/plugins/Variables/src/parse_miranda.cpp @@ -113,7 +113,7 @@ static wchar_t* parseContactInfo(ARGUMENTSINFO *ai) if (hContact == INVALID_CONTACT_ID)
return nullptr;
- BYTE type = getContactInfoType(ai->argv.w[2]);
+ uint8_t type = getContactInfoType(ai->argv.w[2]);
if (type == 0)
return nullptr;
diff --git a/plugins/Variables/src/parse_system.cpp b/plugins/Variables/src/parse_system.cpp index ded98ec659..70604d5757 100644 --- a/plugins/Variables/src/parse_system.cpp +++ b/plugins/Variables/src/parse_system.cpp @@ -484,7 +484,7 @@ static wchar_t* parseRegistryValue(ARGUMENTSINFO *ai) return nullptr;
memset(res, 0, (len * sizeof(wchar_t)));
- int err = RegQueryValueEx(hKey, ai->argv.w[2], nullptr, &type, (BYTE*)res, &len);
+ int err = RegQueryValueEx(hKey, ai->argv.w[2], nullptr, &type, (uint8_t*)res, &len);
if ((err != ERROR_SUCCESS) || (type != REG_SZ)) {
RegCloseKey(hKey);
mir_free(res);
@@ -598,7 +598,7 @@ static wchar_t* parseTextFile(ARGUMENTSINFO *ai) DWORD readSz, totalReadSz;
unsigned long linePos;
wchar_t tUC, *res;
- BYTE *pBuf, *pCur;
+ uint8_t *pBuf, *pCur;
ReadFile(hFile, &tUC, sizeof(wchar_t), &readSz, nullptr);
if (tUC != (wchar_t)0xFEFF) {
tUC = 0;
diff --git a/plugins/Variables/src/stdafx.h b/plugins/Variables/src/stdafx.h index 7aadeee69e..bb3e040e30 100644 --- a/plugins/Variables/src/stdafx.h +++ b/plugins/Variables/src/stdafx.h @@ -163,8 +163,8 @@ int getTokenRegisterCount(); int initTokenRegister();
int deinitTokenRegister();
// contact.c
-BYTE getContactInfoType(wchar_t* type);
-wchar_t* getContactInfoT(BYTE type, MCONTACT hContact);
+uint8_t getContactInfoType(wchar_t* type);
+wchar_t* getContactInfoT(uint8_t type, MCONTACT hContact);
MCONTACT getContactFromString(const wchar_t *tszContact, DWORD dwFlags, int nMatch = 0);
int initContactModule();
int deinitContactModule();
diff --git a/plugins/WhoUsesMyFiles/src/options.cpp b/plugins/WhoUsesMyFiles/src/options.cpp index 7eec90b2f9..0373326b8b 100644 --- a/plugins/WhoUsesMyFiles/src/options.cpp +++ b/plugins/WhoUsesMyFiles/src/options.cpp @@ -225,16 +225,16 @@ INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg,UINT msg,WPARAM wparam,LPARAM lpara case PSN_APPLY: g_plugin.setDword(COLOR_TEXT, (DWORD)WumfOptions.ColorText); g_plugin.setDword(COLOR_BACK, (DWORD)WumfOptions.ColorBack); - g_plugin.setByte(COLOR_DEF, (BYTE)WumfOptions.UseDefColor); - g_plugin.setByte(COLOR_WIN, (BYTE)WumfOptions.UseWinColor); - g_plugin.setByte(COLOR_SET, (BYTE)WumfOptions.SelectColor ); - g_plugin.setByte(DELAY_DEF, (BYTE)WumfOptions.DelayDef); - g_plugin.setByte(DELAY_INF, (BYTE)WumfOptions.DelayInf); - g_plugin.setByte(DELAY_SET, (BYTE)WumfOptions.DelaySet); - g_plugin.setByte(DELAY_SEC, (BYTE)WumfOptions.DelaySec); - g_plugin.setByte(LOG_INTO_FILE, (BYTE)WumfOptions.LogToFile); - g_plugin.setByte(LOG_FOLDER, (BYTE)WumfOptions.LogFolders); - g_plugin.setByte(ALERT_FOLDER, (BYTE)WumfOptions.AlertFolders); + g_plugin.setByte(COLOR_DEF, (uint8_t)WumfOptions.UseDefColor); + g_plugin.setByte(COLOR_WIN, (uint8_t)WumfOptions.UseWinColor); + g_plugin.setByte(COLOR_SET, (uint8_t)WumfOptions.SelectColor ); + g_plugin.setByte(DELAY_DEF, (uint8_t)WumfOptions.DelayDef); + g_plugin.setByte(DELAY_INF, (uint8_t)WumfOptions.DelayInf); + g_plugin.setByte(DELAY_SET, (uint8_t)WumfOptions.DelaySet); + g_plugin.setByte(DELAY_SEC, (uint8_t)WumfOptions.DelaySec); + g_plugin.setByte(LOG_INTO_FILE, (uint8_t)WumfOptions.LogToFile); + g_plugin.setByte(LOG_FOLDER, (uint8_t)WumfOptions.LogFolders); + g_plugin.setByte(ALERT_FOLDER, (uint8_t)WumfOptions.AlertFolders); GetDlgItemText(hwndDlg, IDC_FILE, WumfOptions.LogFile, _countof(WumfOptions.LogFile)); g_plugin.setWString(OPT_FILE, WumfOptions.LogFile); } diff --git a/plugins/WhoUsesMyFiles/src/wumfplug.cpp b/plugins/WhoUsesMyFiles/src/wumfplug.cpp index 60444a7efd..f5ae72ebb6 100644 --- a/plugins/WhoUsesMyFiles/src/wumfplug.cpp +++ b/plugins/WhoUsesMyFiles/src/wumfplug.cpp @@ -190,7 +190,7 @@ static INT_PTR WumfMenuCommand(WPARAM, LPARAM) Menu_ModifyItem(hMenuItem, LPGENW("Disable WUMF popups"), Skin_GetIconHandle(SKINICON_OTHER_POPUP));
}
- g_plugin.setByte(POPUPS_ENABLED, (BYTE)WumfOptions.PopupsEnabled);
+ g_plugin.setByte(POPUPS_ENABLED, (uint8_t)WumfOptions.PopupsEnabled);
return 0;
}
diff --git a/plugins/XSoundNotify/src/stdafx.h b/plugins/XSoundNotify/src/stdafx.h index b11bb55a1b..80f0f0c16a 100644 --- a/plugins/XSoundNotify/src/stdafx.h +++ b/plugins/XSoundNotify/src/stdafx.h @@ -42,7 +42,7 @@ struct XSN_Data extern LIST<XSN_Data> XSN_Users;
extern MWindowList hChangeSoundDlgList;
-extern BYTE isIgnoreSound, isOwnSound;
+extern uint8_t isIgnoreSound, isOwnSound;
bool IsSuitableProto(PROTOACCOUNT *pa);
diff --git a/plugins/XSoundNotify/src/xsn_main.cpp b/plugins/XSoundNotify/src/xsn_main.cpp index 90a14f5c9c..4abffe43e8 100644 --- a/plugins/XSoundNotify/src/xsn_main.cpp +++ b/plugins/XSoundNotify/src/xsn_main.cpp @@ -14,7 +14,7 @@ CMPlugin g_plugin; LIST<XSN_Data> XSN_Users(10, HandleKeySortT);
HGENMENU hChangeSound = nullptr;
MWindowList hChangeSoundDlgList = nullptr;
-BYTE isIgnoreSound = 0, isOwnSound = 0, isIgnoreAccSound = 0, isAccSound = 0;
+uint8_t isIgnoreSound = 0, isOwnSound = 0, isIgnoreAccSound = 0, isAccSound = 0;
/////////////////////////////////////////////////////////////////////////////////////////
diff --git a/plugins/ZeroNotification/src/main.cpp b/plugins/ZeroNotification/src/main.cpp index d9ae7f3020..013fdc6e93 100644 --- a/plugins/ZeroNotification/src/main.cpp +++ b/plugins/ZeroNotification/src/main.cpp @@ -51,9 +51,9 @@ static int SoundSettingChanged(WPARAM, LPARAM lParam) int SetNotify(const long status)
{
- db_set_b(0, "Skin", "UseSound", (BYTE)!(g_plugin.getDword("NoSound", DEFAULT_NOSOUND) & status));
- db_set_b(0, "CList", "DisableTrayFlash", (BYTE)(g_plugin.getDword("NoBlink", DEFAULT_NOBLINK) & status));
- db_set_b(0, "CList", "NoIconBlink", (BYTE)(g_plugin.getDword("NoCLCBlink", DEFAULT_NOCLCBLINK) & status));
+ db_set_b(0, "Skin", "UseSound", (uint8_t)!(g_plugin.getDword("NoSound", DEFAULT_NOSOUND) & status));
+ db_set_b(0, "CList", "DisableTrayFlash", (uint8_t)(g_plugin.getDword("NoBlink", DEFAULT_NOBLINK) & status));
+ db_set_b(0, "CList", "NoIconBlink", (uint8_t)(g_plugin.getDword("NoCLCBlink", DEFAULT_NOCLCBLINK) & status));
UpdateMenuItem();
return 0;
|