2016-01-11 16:01 GMT+01:00 Józef Kucia joseph.kucia@gmail.com:
On Mon, Jan 11, 2016 at 10:46 AM, Alistair Leslie-Hughes leslie_alistair@hotmail.com wrote:
What's the point of this change? It doesn't fix anything and doesn't make code more readable. If the file signature isn't included in the DDS header size it doesn't necessarily mean we have to move it out of struct dds_header.
I asked this kind of change in https://www.winehq.org/pipermail/wine-patches/2016-January/145814.html, after Henri's review spotted it in https://www.winehq.org/pipermail/wine-devel/2015-December/110742.html, although I was referring to the structure in the implementation more than this one in the tests. I'm not adamant on requiring this change but I still think that the signature field shouldn't be in the dds_header structure (for the little that it might count, the signature is not in the structure described in https://msdn.microsoft.com/en-us/library/bb943982.aspx).
Specifically about this patch, moving the signature out of struct dds_header doesn't necessarily mean that the code has to get much uglier. I haven't tried myself but you could probably create a new structure to contain both the signature DWORD and struct dds_header, avoiding the new casts and manual offsets in this patch.