Jacek Caban jacek@codeweavers.com wrote:
+static HRESULT read_stream(BSCallback *This, IStream *stream, void *buf, DWORD size, DWORD *ret_size) +{
- DWORD read_size = 0;
- HRESULT hres;
- hres = IStream_Read(stream, buf, size, &read_size);
- This->readed += (*ret_size = read_size);
- return hres;
+}
Using 'ret_size' directly in the IStream_Read call would look more natural IMHO, like: hres = IStream_Read(stream, buf, size, ret_size); This->readed += *ret_size;
On 07/27/12 11:05, Dmitry Timoshkov wrote:
Jacek Caban jacek@codeweavers.com wrote:
+static HRESULT read_stream(BSCallback *This, IStream *stream, void *buf, DWORD size, DWORD *ret_size) +{
- DWORD read_size = 0;
- HRESULT hres;
- hres = IStream_Read(stream, buf, size, &read_size);
- This->readed += (*ret_size = read_size);
- return hres;
+}
Using 'ret_size' directly in the IStream_Read call would look more natural IMHO, like: hres = IStream_Read(stream, buf, size, ret_size); This->readed += *ret_size;
Sure, but for patch 3 using separated variable is cleaner, so I introduced it here already to make the whole series cleaner.
Jacek