summaryrefslogtreecommitdiff
path: root/plugins/MirLua
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2021-12-26 16:39:04 +0300
committerGeorge Hazan <ghazan@miranda.im>2021-12-26 16:39:04 +0300
commit62a186697df33c96dc1a6dac0f4dfc38652fb96f (patch)
tree1437d0906218fae8827aed384026f2b7e656f4ac /plugins/MirLua
parentfcbb395dc7ff3edab972b6d4b27dbbfb3305f5d7 (diff)
BYTE -> uint8_t
Diffstat (limited to 'plugins/MirLua')
-rwxr-xr-xplugins/MirLua/Modules/WinAPI/src/winapi.cpp16
-rw-r--r--plugins/MirLua/src/Modules/m_database.cpp6
2 files changed, 11 insertions, 11 deletions
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*)&num;
+ value = (uint8_t*)&num;
}
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);