mirror of
https://github.com/barry-ran/QtScrcpy.git
synced 2025-07-23 09:21:33 +00:00
fix: char to int error
This commit is contained in:
parent
7b54990f10
commit
a135c28b99
1 changed files with 8 additions and 8 deletions
|
@ -16,11 +16,11 @@ void BufferUtil::write16(QBuffer &buffer, quint32 value)
|
||||||
|
|
||||||
quint16 BufferUtil::read16(QBuffer &buffer)
|
quint16 BufferUtil::read16(QBuffer &buffer)
|
||||||
{
|
{
|
||||||
char c;
|
uchar c;
|
||||||
quint16 ret = 0;
|
quint16 ret = 0;
|
||||||
buffer.getChar(&c);
|
buffer.getChar(reinterpret_cast<char*>(&c));
|
||||||
ret |= (c << 8);
|
ret |= (c << 8);
|
||||||
buffer.getChar(&c);
|
buffer.getChar(reinterpret_cast<char*>(&c));
|
||||||
ret |= c;
|
ret |= c;
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -28,15 +28,15 @@ quint16 BufferUtil::read16(QBuffer &buffer)
|
||||||
|
|
||||||
quint32 BufferUtil::read32(QBuffer &buffer)
|
quint32 BufferUtil::read32(QBuffer &buffer)
|
||||||
{
|
{
|
||||||
char c;
|
uchar c;
|
||||||
quint32 ret = 0;
|
quint32 ret = 0;
|
||||||
buffer.getChar(&c);
|
buffer.getChar(reinterpret_cast<char*>(&c));
|
||||||
ret |= (c << 24);
|
ret |= (c << 24);
|
||||||
buffer.getChar(&c);
|
buffer.getChar(reinterpret_cast<char*>(&c));
|
||||||
ret |= (c << 16);
|
ret |= (c << 16);
|
||||||
buffer.getChar(&c);
|
buffer.getChar(reinterpret_cast<char*>(&c));
|
||||||
ret |= (c << 8);
|
ret |= (c << 8);
|
||||||
buffer.getChar(&c);
|
buffer.getChar(reinterpret_cast<char*>(&c));
|
||||||
ret |= c;
|
ret |= c;
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue