d3drm: Get rid of the Header typedef.

This commit is contained in:
Henri Verbeet 2013-10-03 23:31:48 +02:00 committed by Alexandre Julliard
parent cc3cde5124
commit 13e3219c2f
3 changed files with 13 additions and 11 deletions

View File

@ -1326,7 +1326,7 @@ static HRESULT WINAPI IDirect3DRM3Impl_Load(IDirect3DRM3 *iface, void *source, v
HRESULT hr;
const GUID* pGuid;
DWORD size;
Header* pHeader;
struct d3drm_file_header *header;
HRESULT ret = D3DRMERR_BADOBJECT;
DWORD i;
@ -1382,14 +1382,14 @@ static HRESULT WINAPI IDirect3DRM3Impl_Load(IDirect3DRM3 *iface, void *source, v
goto end;
}
hr = IDirectXFileData_GetData(data, NULL, &size, (void **)&pHeader);
if ((hr != DXFILE_OK) || (size != sizeof(Header)))
hr = IDirectXFileData_GetData(data, NULL, &size, (void **)&header);
if ((hr != DXFILE_OK) || (size != sizeof(*header)))
goto end;
TRACE("Version is %d %d %d\n", pHeader->major, pHeader->minor, pHeader->flags);
TRACE("Version is %u.%u, flags %#x.\n", header->major, header->minor, header->flags);
/* Version must be 1.0.x */
if ((pHeader->major != 1) || (pHeader->minor != 0))
if ((header->major != 1) || (header->minor != 0))
{
ret = D3DRMERR_BADFILE;
goto end;

View File

@ -37,11 +37,12 @@ HRESULT Direct3DRMTexture_create(REFIID riid, IUnknown** ret_iface) DECLSPEC_HID
HRESULT load_mesh_data(IDirect3DRMMeshBuilder3 *iface, IDirectXFileData *data,
D3DRMLOADTEXTURECALLBACK load_texture_proc, void *arg) DECLSPEC_HIDDEN;
typedef struct {
struct d3drm_file_header
{
WORD major;
WORD minor;
DWORD flags;
} Header;
};
extern char templates[];

View File

@ -1521,11 +1521,12 @@ static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_Load(IDirect3DRMMeshBuilder3*
IDirectXFileData *data = NULL;
const GUID* guid;
DWORD size;
Header* header;
struct d3drm_file_header *header;
HRESULT hr;
HRESULT ret = D3DRMERR_BADOBJECT;
TRACE("(%p)->(%p,%p,%x,%p,%p)\n", This, filename, name, loadflags, cb, arg);
TRACE("iface %p, filename %p, name %p, loadflags %#x, cb %p, arg %p.\n",
iface, filename, name, loadflags, cb, arg);
clean_mesh_builder_data(This);
@ -1573,10 +1574,10 @@ static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_Load(IDirect3DRMMeshBuilder3*
}
hr = IDirectXFileData_GetData(data, NULL, &size, (void**)&header);
if ((hr != DXFILE_OK) || (size != sizeof(Header)))
if ((hr != DXFILE_OK) || (size != sizeof(*header)))
goto end;
TRACE("Version is %d %d %d\n", header->major, header->minor, header->flags);
TRACE("Version is %u.%u, flags %#x.\n", header->major, header->minor, header->flags);
/* Version must be 1.0.x */
if ((header->major != 1) || (header->minor != 0))