Fixed auto-cast instance.

master
Hannes Matuschek 12 years ago
parent cbbfecef40
commit 8210ccf6f8

@ -90,10 +90,10 @@ public:
// If no conversion is selected // If no conversion is selected
if (0 == _cast) { return; } if (0 == _cast) { return; }
// If the identity conversion is selected -> forward buffer // If the identity conversion is selected -> forward buffer
if (_identity == _cast) { this->send(buffer, allow_overwrite); } if (_identity == _cast) { this->send(buffer, allow_overwrite); return; }
// Otherwise cast // Otherwise cast
size_t bytes = _cast(buffer, _buffer); size_t bytes = _cast(buffer, _buffer);
this->send(RawBuffer(_buffer, 0, bytes), true); this->send(RawBuffer(_buffer, 0, bytes), false);
} }
@ -106,7 +106,7 @@ protected:
protected: protected:
/** Performs no cast at all. */ /** Performs no cast at all. */
static size_t _identity(const RawBuffer &in, const RawBuffer &out) { static size_t _identity(const RawBuffer &in, const RawBuffer &out) {
memcpy(out.data(), in.data(), in.bytesLen()); memcpy(out.ptr(), in.data(), in.bytesLen());
return in.bytesLen(); return in.bytesLen();
} }

Loading…
Cancel
Save