aboutsummaryrefslogtreecommitdiffstats
path: root/common/rfb/SMsgWriter.cxx
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2022-09-10 13:19:41 +0200
committerPierre Ossman <ossman@cendio.se>2023-02-01 21:17:12 +0100
commit6881c895ab317bd302addac5f228b7367136017f (patch)
tree18d1119f59209147d97e873c3dbc9be36e429aaf /common/rfb/SMsgWriter.cxx
parentbaca73d03217a1c219d9c4f024ffcd39f85fd322 (diff)
downloadtigervnc-6881c895ab317bd302addac5f228b7367136017f.tar.gz
tigervnc-6881c895ab317bd302addac5f228b7367136017f.zip
Use stdint types
Avoid having our own custom stuff and instead use the modern, standard types, for familiarity.
Diffstat (limited to 'common/rfb/SMsgWriter.cxx')
-rw-r--r--common/rfb/SMsgWriter.cxx41
1 files changed, 21 insertions, 20 deletions
diff --git a/common/rfb/SMsgWriter.cxx b/common/rfb/SMsgWriter.cxx
index c8b50b67..29bd5897 100644
--- a/common/rfb/SMsgWriter.cxx
+++ b/common/rfb/SMsgWriter.cxx
@@ -27,6 +27,7 @@
#include <rdr/OutStream.h>
#include <rdr/MemOutStream.h>
#include <rdr/ZlibOutStream.h>
+#include <rdr/types.h>
#include <rfb/msgTypes.h>
#include <rfb/fenceTypes.h>
@@ -56,7 +57,7 @@ SMsgWriter::~SMsgWriter()
{
}
-void SMsgWriter::writeServerInit(rdr::U16 width, rdr::U16 height,
+void SMsgWriter::writeServerInit(uint16_t width, uint16_t height,
const PixelFormat& pf, const char* name)
{
os->writeU16(width);
@@ -68,9 +69,9 @@ void SMsgWriter::writeServerInit(rdr::U16 width, rdr::U16 height,
}
void SMsgWriter::writeSetColourMapEntries(int firstColour, int nColours,
- const rdr::U16 red[],
- const rdr::U16 green[],
- const rdr::U16 blue[])
+ const uint16_t red[],
+ const uint16_t green[],
+ const uint16_t blue[])
{
startMsg(msgTypeSetColourMapEntries);
os->pad(1);
@@ -105,8 +106,8 @@ void SMsgWriter::writeServerCutText(const char* str)
endMsg();
}
-void SMsgWriter::writeClipboardCaps(rdr::U32 caps,
- const rdr::U32* lengths)
+void SMsgWriter::writeClipboardCaps(uint32_t caps,
+ const uint32_t* lengths)
{
size_t i, count;
@@ -134,7 +135,7 @@ void SMsgWriter::writeClipboardCaps(rdr::U32 caps,
endMsg();
}
-void SMsgWriter::writeClipboardRequest(rdr::U32 flags)
+void SMsgWriter::writeClipboardRequest(uint32_t flags)
{
if (!client->supportsEncoding(pseudoEncodingExtendedClipboard))
throw Exception("Client does not support extended clipboard");
@@ -148,7 +149,7 @@ void SMsgWriter::writeClipboardRequest(rdr::U32 flags)
endMsg();
}
-void SMsgWriter::writeClipboardPeek(rdr::U32 flags)
+void SMsgWriter::writeClipboardPeek(uint32_t flags)
{
if (!client->supportsEncoding(pseudoEncodingExtendedClipboard))
throw Exception("Client does not support extended clipboard");
@@ -162,7 +163,7 @@ void SMsgWriter::writeClipboardPeek(rdr::U32 flags)
endMsg();
}
-void SMsgWriter::writeClipboardNotify(rdr::U32 flags)
+void SMsgWriter::writeClipboardNotify(uint32_t flags)
{
if (!client->supportsEncoding(pseudoEncodingExtendedClipboard))
throw Exception("Client does not support extended clipboard");
@@ -176,9 +177,9 @@ void SMsgWriter::writeClipboardNotify(rdr::U32 flags)
endMsg();
}
-void SMsgWriter::writeClipboardProvide(rdr::U32 flags,
+void SMsgWriter::writeClipboardProvide(uint32_t flags,
const size_t* lengths,
- const rdr::U8* const* data)
+ const uint8_t* const* data)
{
rdr::MemOutStream mos;
rdr::ZlibOutStream zos;
@@ -211,7 +212,7 @@ void SMsgWriter::writeClipboardProvide(rdr::U32 flags,
endMsg();
}
-void SMsgWriter::writeFence(rdr::U32 flags, unsigned len, const char data[])
+void SMsgWriter::writeFence(uint32_t flags, unsigned len, const char data[])
{
if (!client->supportsEncoding(pseudoEncodingFence))
throw Exception("Client does not support fences");
@@ -242,7 +243,7 @@ void SMsgWriter::writeEndOfContinuousUpdates()
endMsg();
}
-void SMsgWriter::writeDesktopSize(rdr::U16 reason, rdr::U16 result)
+void SMsgWriter::writeDesktopSize(uint16_t reason, uint16_t result)
{
ExtendedDesktopSizeMsg msg;
@@ -445,8 +446,8 @@ void SMsgWriter::writePseudoRects()
rdr::U8Array data(cursor.width()*cursor.height() * (client->pf().bpp/8));
rdr::U8Array mask(cursor.getMask());
- const rdr::U8* in;
- rdr::U8* out;
+ const uint8_t* in;
+ uint8_t* out;
in = cursor.getBuffer();
out = data.buf;
@@ -538,8 +539,8 @@ void SMsgWriter::writeSetDesktopSizeRect(int width, int height)
os->writeU32(pseudoEncodingDesktopSize);
}
-void SMsgWriter::writeExtendedDesktopSizeRect(rdr::U16 reason,
- rdr::U16 result,
+void SMsgWriter::writeExtendedDesktopSizeRect(uint16_t reason,
+ uint16_t result,
int fb_width,
int fb_height,
const ScreenSet& layout)
@@ -632,7 +633,7 @@ void SMsgWriter::writeSetXCursorRect(int width, int height,
void SMsgWriter::writeSetCursorWithAlphaRect(int width, int height,
int hotspotX, int hotspotY,
- const rdr::U8* data)
+ const uint8_t* data)
{
if (!client->supportsEncoding(pseudoEncodingCursorWithAlpha))
throw Exception("Client does not support local cursors");
@@ -660,7 +661,7 @@ void SMsgWriter::writeSetCursorWithAlphaRect(int width, int height,
void SMsgWriter::writeSetVMwareCursorRect(int width, int height,
int hotspotX, int hotspotY,
- const rdr::U8* data)
+ const uint8_t* data)
{
if (!client->supportsEncoding(pseudoEncodingVMwareCursor))
throw Exception("Client does not support local cursors");
@@ -694,7 +695,7 @@ void SMsgWriter::writeSetVMwareCursorPositionRect(int hotspotX, int hotspotY)
os->writeU32(pseudoEncodingVMwareCursorPosition);
}
-void SMsgWriter::writeLEDStateRect(rdr::U8 state)
+void SMsgWriter::writeLEDStateRect(uint8_t state)
{
if (!client->supportsEncoding(pseudoEncodingLEDState) &&
!client->supportsEncoding(pseudoEncodingVMwareLEDState))