Alexandre Julliard : d3d8: Avoid using a pointer difference in a trace.
Alexandre Julliard
julliard at winehq.org
Fri Apr 9 11:49:56 CDT 2010
Module: wine
Branch: master
Commit: 26cc3efb3305485e5c331d0843cc5272ccf55719
URL: http://source.winehq.org/git/wine.git/?a=commit;h=26cc3efb3305485e5c331d0843cc5272ccf55719
Author: Alexandre Julliard <julliard at winehq.org>
Date: Fri Apr 9 15:54:54 2010 +0200
d3d8: Avoid using a pointer difference in a trace.
---
dlls/d3d8/device.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c
index e9319be..2312a6a 100644
--- a/dlls/d3d8/device.c
+++ b/dlls/d3d8/device.c
@@ -171,18 +171,19 @@ static DWORD d3d8_allocate_handle(struct d3d8_handle_table *t, void *object, enu
if (t->free_entries)
{
+ DWORD index = t->free_entries - t->entries;
/* Use a free handle */
entry = t->free_entries;
if (entry->type != D3D8_HANDLE_FREE)
{
- ERR("Handle %u(%p) is in the free list, but has type %#x.\n", (entry - t->entries), entry, entry->type);
+ ERR("Handle %u(%p) is in the free list, but has type %#x.\n", index, entry, entry->type);
return D3D8_INVALID_HANDLE;
}
t->free_entries = entry->object;
entry->object = object;
entry->type = type;
- return entry - t->entries;
+ return index;
}
if (!(t->entry_count < t->table_size))
More information about the wine-cvs
mailing list