From f22d350e75e798863927c54031fc5dc5e84ae3c4 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Tue, 10 Nov 2015 12:58:49 +0100 Subject: [PATCH] Make ConnParams useful when const --- common/rfb/ConnParams.cxx | 2 +- common/rfb/ConnParams.h | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/common/rfb/ConnParams.cxx b/common/rfb/ConnParams.cxx index 615f49ae..ab3b884a 100644 --- a/common/rfb/ConnParams.cxx +++ b/common/rfb/ConnParams.cxx @@ -99,7 +99,7 @@ void ConnParams::setCursor(const Cursor& other) memcpy(cursor_.mask.buf, other.mask.buf, cursor_.maskLen()); } -bool ConnParams::supportsEncoding(rdr::S32 encoding) +bool ConnParams::supportsEncoding(rdr::S32 encoding) const { return encodings_.count(encoding) != 0; } diff --git a/common/rfb/ConnParams.h b/common/rfb/ConnParams.h index 0b8a89cd..9e647baa 100644 --- a/common/rfb/ConnParams.h +++ b/common/rfb/ConnParams.h @@ -56,14 +56,14 @@ namespace rfb { void setVersion(int major, int minor) { majorVersion = major; minorVersion = minor; } - bool isVersion(int major, int minor) { + bool isVersion(int major, int minor) const { return majorVersion == major && minorVersion == minor; } - bool beforeVersion(int major, int minor) { + bool beforeVersion(int major, int minor) const { return (majorVersion < major || (majorVersion == major && minorVersion < minor)); } - bool afterVersion(int major, int minor) { + bool afterVersion(int major, int minor) const { return !beforeVersion(major,minor+1); } @@ -71,16 +71,16 @@ namespace rfb { int height; ScreenSet screenLayout; - const PixelFormat& pf() { return pf_; } + const PixelFormat& pf() const { return pf_; } void setPF(const PixelFormat& pf); - const char* name() { return name_; } + const char* name() const { return name_; } void setName(const char* name); - const Cursor& cursor() { return cursor_; } + const Cursor& cursor() const { return cursor_; } void setCursor(const Cursor& cursor); - bool supportsEncoding(rdr::S32 encoding); + bool supportsEncoding(rdr::S32 encoding) const; void setEncodings(int nEncodings, const rdr::S32* encodings); -- 2.39.5