diff options
author | George Hazan <ghazan@miranda.im> | 2022-10-06 14:33:30 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2022-10-06 14:33:30 +0300 |
commit | 43134f01d3bcf7d5abe6c84c297faf1372e38bda (patch) | |
tree | 4f5b5027abe753d01f976d716e7c8d34c3901800 /src/mir_core | |
parent | 9a0350523aa1d59fcbe1adb44fffa2a7581165d4 (diff) |
uint8_t is far more kosher than char considering binary buffers
Diffstat (limited to 'src/mir_core')
-rw-r--r-- | src/mir_core/src/binbuffer.cpp | 10 | ||||
-rw-r--r-- | src/mir_core/src/mir_core.def | 2 | ||||
-rw-r--r-- | src/mir_core/src/mir_core64.def | 2 |
3 files changed, 7 insertions, 7 deletions
diff --git a/src/mir_core/src/binbuffer.cpp b/src/mir_core/src/binbuffer.cpp index 3b961b489b..fbde7bfb4d 100644 --- a/src/mir_core/src/binbuffer.cpp +++ b/src/mir_core/src/binbuffer.cpp @@ -62,7 +62,7 @@ struct BufImpl } }; -__forceinline BufImpl* ptr2buf(char *p) +__forceinline BufImpl* ptr2buf(uint8_t *p) { return (p == nullptr) ? nullptr : (BufImpl*)p-1; } @@ -86,7 +86,7 @@ MBinBuffer::MBinBuffer(size_t preAlloc) BufImpl *p = (BufImpl *)mir_alloc(sizeof(BufImpl) + preAlloc); p->lockCount = 1; p->size = (unsigned)preAlloc; - m_buf = (char*)(p + 1); + m_buf = (uint8_t *)(p + 1); } MBinBuffer& MBinBuffer::operator=(MBinBuffer &&from) noexcept @@ -108,7 +108,7 @@ void MBinBuffer::append(const void *pBuf, size_t bufLen) BufImpl *p = ptr2buf(m_buf)->realloc(bufLen); if (p) { - m_buf = (char*)(p + 1); + m_buf = (uint8_t *)(p + 1); memcpy(m_buf + p->size, pBuf, bufLen); p->size += (unsigned)bufLen; } @@ -122,7 +122,7 @@ void MBinBuffer::appendBefore(const void *pBuf, size_t bufLen) BufImpl *p = ptr2buf(m_buf)->realloc(bufLen); if (p) { - m_buf = (char *)(p + 1); + m_buf = (uint8_t *)(p + 1); memmove(m_buf + bufLen, m_buf, p->size); memcpy(m_buf, pBuf, bufLen); p->size += (unsigned)bufLen; @@ -138,7 +138,7 @@ void MBinBuffer::assign(const void *pBuf, size_t bufLen) BufImpl *p = ptr2buf(m_buf)->alloc(bufLen); if (p) { p->size = (unsigned)bufLen; - m_buf = (char *)(p + 1); + m_buf = (uint8_t *)(p + 1); memcpy(m_buf, pBuf, bufLen); } else m_buf = nullptr; diff --git a/src/mir_core/src/mir_core.def b/src/mir_core/src/mir_core.def index 140837fef9..0b62e5dcda 100644 --- a/src/mir_core/src/mir_core.def +++ b/src/mir_core/src/mir_core.def @@ -994,7 +994,7 @@ CallFunctionSync @1170 ??4MBinBuffer@@QAEAAV0@$$QAV0@@Z @1208 NONAME
?append@MBinBuffer@@QAEXPBXI@Z @1209 NONAME
?appendBefore@MBinBuffer@@QAEXPBXI@Z @1210 NONAME
-?data@MBinBuffer@@QBEPADXZ @1211 NONAME
+?data@MBinBuffer@@QBEPAEXZ @1211 NONAME
?isEmpty@MBinBuffer@@QBE_NXZ @1212 NONAME
?length@MBinBuffer@@QBEIXZ @1213 NONAME
?remove@MBinBuffer@@QAEXI@Z @1214 NONAME
diff --git a/src/mir_core/src/mir_core64.def b/src/mir_core/src/mir_core64.def index bf5cb32785..e7da28b523 100644 --- a/src/mir_core/src/mir_core64.def +++ b/src/mir_core/src/mir_core64.def @@ -994,7 +994,7 @@ CallFunctionSync @1170 ??4MBinBuffer@@QEAAAEAV0@$$QEAV0@@Z @1208 NONAME
?append@MBinBuffer@@QEAAXPEBX_K@Z @1209 NONAME
?appendBefore@MBinBuffer@@QEAAXPEBX_K@Z @1210 NONAME
-?data@MBinBuffer@@QEBAPEADXZ @1211 NONAME
+?data@MBinBuffer@@QEBAPEAEXZ @1211 NONAME
?isEmpty@MBinBuffer@@QEBA_NXZ @1212 NONAME
?length@MBinBuffer@@QEBA_KXZ @1213 NONAME
?remove@MBinBuffer@@QEAAX_K@Z @1214 NONAME
|