* Added missing ToReferenceable().
* _SetTo(const BVariant&): Acquire a reference for the wrong object. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31959 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -86,6 +86,7 @@ public:
|
|||||||
double ToDouble() const;
|
double ToDouble() const;
|
||||||
void* ToPointer() const;
|
void* ToPointer() const;
|
||||||
const char* ToString() const;
|
const char* ToString() const;
|
||||||
|
BReferenceable* ToReferenceable() const;
|
||||||
|
|
||||||
void SwapEndianess();
|
void SwapEndianess();
|
||||||
// has effect only on scalar types (pointer
|
// has effect only on scalar types (pointer
|
||||||
|
|||||||
@@ -336,13 +336,21 @@ BVariant::_SetTo(const BVariant& other)
|
|||||||
}
|
}
|
||||||
} else if ((other.fFlags & B_VARIANT_REFERENCEABLE_DATA) != 0) {
|
} else if ((other.fFlags & B_VARIANT_REFERENCEABLE_DATA) != 0) {
|
||||||
if (other.fReferenceable != NULL)
|
if (other.fReferenceable != NULL)
|
||||||
fReferenceable->AcquireReference();
|
other.fReferenceable->AcquireReference();
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy(this, &other, sizeof(BVariant));
|
memcpy(this, &other, sizeof(BVariant));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
BReferenceable*
|
||||||
|
BVariant::ToReferenceable() const
|
||||||
|
{
|
||||||
|
return (fFlags & B_VARIANT_REFERENCEABLE_DATA) != 0
|
||||||
|
? fReferenceable : NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
BVariant::SwapEndianess()
|
BVariant::SwapEndianess()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user