Re: [1/2] msvcirt: Add initial implementation of streambuf
On 06/02/15 14:52, Iván Matellanes wrote:
+/* ??0streambuf@@IAE(a)XZ */ +/* ??0streambuf@@IEAA(a)XZ */ +DEFINE_THISCALL_WRAPPER(streambuf_ctor, 4) +streambuf* __thiscall streambuf_ctor(streambuf *this) +{ + TRACE("(%p)\n", this); + this->vtable = &MSVCP_streambuf_vtable; + this->allocated = 0; + this->unbuffered = 0; + this->unknown = -1; + this->unknown2 = -1; + streambuf_setb(this, NULL, NULL, 0); + streambuf_setg(this, NULL, NULL, NULL); + streambuf_setp(this, NULL, NULL); + InitializeCriticalSection(&this->lock); + return this; +} Can't it be simplified to: streambuf* __thiscall streambuf_ctor(streambuf *this) { return streambuf_reserve_ctor(this, NULL, 0); } ?
El 02/06/15 a las 15:38, Piotr Caban escribió:
On 06/02/15 14:52, Iván Matellanes wrote:
+/* ??0streambuf@@IAE(a)XZ */ +/* ??0streambuf@@IEAA(a)XZ */ +DEFINE_THISCALL_WRAPPER(streambuf_ctor, 4) +streambuf* __thiscall streambuf_ctor(streambuf *this) +{ + TRACE("(%p)\n", this); + this->vtable = &MSVCP_streambuf_vtable; + this->allocated = 0; + this->unbuffered = 0; + this->unknown = -1; + this->unknown2 = -1; + streambuf_setb(this, NULL, NULL, 0); + streambuf_setg(this, NULL, NULL, NULL); + streambuf_setp(this, NULL, NULL); + InitializeCriticalSection(&this->lock); + return this; +} Can't it be simplified to: streambuf* __thiscall streambuf_ctor(streambuf *this) { return streambuf_reserve_ctor(this, NULL, 0); } ?
You're right, it can be simplified. The value of this->unbuffered will be different, though. I will resend. Iván.
participants (2)
-
Iván Matellanes -
Piotr Caban