Commit 70a6ac07 authored by Alexandre Julliard's avatar Alexandre Julliard

ver: Use nameless unions/structs.

parent 80ee53bb
...@@ -25,8 +25,6 @@ ...@@ -25,8 +25,6 @@
#include <string.h> #include <string.h>
#include <sys/types.h> #include <sys/types.h>
#define NONAMELESSUNION
#define NONAMELESSSTRUCT
#include "windef.h" #include "windef.h"
#include "wine/winbase16.h" #include "wine/winbase16.h"
#include "winternl.h" #include "winternl.h"
...@@ -55,9 +53,9 @@ static const IMAGE_RESOURCE_DIRECTORY *find_entry_by_id( const IMAGE_RESOURCE_DI ...@@ -55,9 +53,9 @@ static const IMAGE_RESOURCE_DIRECTORY *find_entry_by_id( const IMAGE_RESOURCE_DI
while (min <= max) while (min <= max)
{ {
pos = (min + max) / 2; pos = (min + max) / 2;
if (entry[pos].u.Id == id) if (entry[pos].Id == id)
return (const IMAGE_RESOURCE_DIRECTORY *)((const char *)root + entry[pos].u2.s2.OffsetToDirectory); return (const IMAGE_RESOURCE_DIRECTORY *)((const char *)root + entry[pos].OffsetToDirectory);
if (entry[pos].u.Id > id) max = pos - 1; if (entry[pos].Id > id) max = pos - 1;
else min = pos + 1; else min = pos + 1;
} }
return NULL; return NULL;
...@@ -76,7 +74,7 @@ static const IMAGE_RESOURCE_DIRECTORY *find_entry_default( const IMAGE_RESOURCE_ ...@@ -76,7 +74,7 @@ static const IMAGE_RESOURCE_DIRECTORY *find_entry_default( const IMAGE_RESOURCE_
const IMAGE_RESOURCE_DIRECTORY_ENTRY *entry; const IMAGE_RESOURCE_DIRECTORY_ENTRY *entry;
entry = (const IMAGE_RESOURCE_DIRECTORY_ENTRY *)(dir + 1); entry = (const IMAGE_RESOURCE_DIRECTORY_ENTRY *)(dir + 1);
return (const IMAGE_RESOURCE_DIRECTORY *)((const char *)root + entry->u2.s2.OffsetToDirectory); return (const IMAGE_RESOURCE_DIRECTORY *)((const char *)root + entry->OffsetToDirectory);
} }
...@@ -114,11 +112,11 @@ static const IMAGE_RESOURCE_DIRECTORY *find_entry_by_name( const IMAGE_RESOURCE_ ...@@ -114,11 +112,11 @@ static const IMAGE_RESOURCE_DIRECTORY *find_entry_by_name( const IMAGE_RESOURCE_
while (min <= max) while (min <= max)
{ {
pos = (min + max) / 2; pos = (min + max) / 2;
str = (const IMAGE_RESOURCE_DIR_STRING_U *)((const char *)root + entry[pos].u.s.NameOffset); str = (const IMAGE_RESOURCE_DIR_STRING_U *)((const char *)root + entry[pos].NameOffset);
res = wcsnicmp( nameW, str->NameString, str->Length ); res = wcsnicmp( nameW, str->NameString, str->Length );
if (!res && namelen == str->Length) if (!res && namelen == str->Length)
{ {
ret = (const IMAGE_RESOURCE_DIRECTORY *)((const char *)root + entry[pos].u2.s2.OffsetToDirectory); ret = (const IMAGE_RESOURCE_DIRECTORY *)((const char *)root + entry[pos].OffsetToDirectory);
break; break;
} }
if (res < 0) max = pos - 1; if (res < 0) max = pos - 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment