diff --git a/QtScrcpy/util/bufferutil.cpp b/QtScrcpy/util/bufferutil.cpp index 65f62d2..0c9362e 100644 --- a/QtScrcpy/util/bufferutil.cpp +++ b/QtScrcpy/util/bufferutil.cpp @@ -16,11 +16,11 @@ void BufferUtil::write16(QBuffer &buffer, quint32 value) quint16 BufferUtil::read16(QBuffer &buffer) { - char c; + uchar c; quint16 ret = 0; - buffer.getChar(&c); + buffer.getChar(reinterpret_cast(&c)); ret |= (c << 8); - buffer.getChar(&c); + buffer.getChar(reinterpret_cast(&c)); ret |= c; return ret; @@ -28,15 +28,15 @@ quint16 BufferUtil::read16(QBuffer &buffer) quint32 BufferUtil::read32(QBuffer &buffer) { - char c; + uchar c; quint32 ret = 0; - buffer.getChar(&c); + buffer.getChar(reinterpret_cast(&c)); ret |= (c << 24); - buffer.getChar(&c); + buffer.getChar(reinterpret_cast(&c)); ret |= (c << 16); - buffer.getChar(&c); + buffer.getChar(reinterpret_cast(&c)); ret |= (c << 8); - buffer.getChar(&c); + buffer.getChar(reinterpret_cast(&c)); ret |= c; return ret;