MinGW tweak: Constructs such as:
CharArray somevariable = "somestring"
...are not allowed. It seems like MSVC does not correctly check
accessibility for temporaries. Chapter 12.2 of ISO/IEC 14882:2003(E):
> Even when the creation of the temporary object is avoided (12.8),
> all the semantic restrictions must be respected as if the temporary
> object was created. [Example: even if the copy constructor is not
> called, all the semantic restrictions, such as accessibility
> (clause 11), shall be satisfied. ]
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@3344 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/win/rfb_win32/Registry.cxx b/win/rfb_win32/Registry.cxx
index 1a828ed..4f073f4 100644
--- a/win/rfb_win32/Registry.cxx
+++ b/win/rfb_win32/Registry.cxx
@@ -175,7 +175,7 @@
}
void RegKey::getBinary(const TCHAR* valname, void** data, int* length) const {
- TCharArray hex = getRepresentation(valname);
+ TCharArray hex(getRepresentation(valname));
if (!rdr::HexInStream::hexStrToBin(CStr(hex.buf), (char**)data, length))
throw rdr::Exception("getBinary failed");
}
@@ -193,7 +193,7 @@
}
int RegKey::getInt(const TCHAR* valname) const {
- TCharArray tmp = getRepresentation(valname);
+ TCharArray tmp(getRepresentation(valname));
return _ttoi(tmp.buf);
}
int RegKey::getInt(const TCHAR* valname, int def) const {
@@ -234,7 +234,7 @@
switch (type) {
case REG_BINARY:
{
- TCharArray hex = rdr::HexOutStream::binToHexStr(data.buf, length);
+ TCharArray hex(rdr::HexOutStream::binToHexStr(data.buf, length));
return hex.takeBuf();
}
case REG_SZ:
@@ -272,7 +272,7 @@
bool RegKey::isValue(const TCHAR* valname) const {
try {
- TCharArray tmp = getRepresentation(valname);
+ TCharArray tmp(getRepresentation(valname));
return true;
} catch(rdr::Exception) {
return false;