ver: Use nameless unions/structs.
This commit is contained in:
parent
80ee53bb90
commit
70a6ac07bf
1 changed files with 6 additions and 8 deletions
|
@ -25,8 +25,6 @@
|
|||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#define NONAMELESSUNION
|
||||
#define NONAMELESSSTRUCT
|
||||
#include "windef.h"
|
||||
#include "wine/winbase16.h"
|
||||
#include "winternl.h"
|
||||
|
@ -55,9 +53,9 @@ static const IMAGE_RESOURCE_DIRECTORY *find_entry_by_id( const IMAGE_RESOURCE_DI
|
|||
while (min <= max)
|
||||
{
|
||||
pos = (min + max) / 2;
|
||||
if (entry[pos].u.Id == id)
|
||||
return (const IMAGE_RESOURCE_DIRECTORY *)((const char *)root + entry[pos].u2.s2.OffsetToDirectory);
|
||||
if (entry[pos].u.Id > id) max = pos - 1;
|
||||
if (entry[pos].Id == id)
|
||||
return (const IMAGE_RESOURCE_DIRECTORY *)((const char *)root + entry[pos].OffsetToDirectory);
|
||||
if (entry[pos].Id > id) max = pos - 1;
|
||||
else min = pos + 1;
|
||||
}
|
||||
return NULL;
|
||||
|
@ -76,7 +74,7 @@ static const IMAGE_RESOURCE_DIRECTORY *find_entry_default( const IMAGE_RESOURCE_
|
|||
const IMAGE_RESOURCE_DIRECTORY_ENTRY *entry;
|
||||
|
||||
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_
|
|||
while (min <= max)
|
||||
{
|
||||
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 );
|
||||
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;
|
||||
}
|
||||
if (res < 0) max = pos - 1;
|
||||
|
|
Loading…
Add table
Reference in a new issue