mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 16:30:53 +00:00
Small clang compatibility patch by Niels Grewe
<niels.grewe@halbordnung.de>. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29421 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
7a9c943bc4
commit
25a22d9fc9
2 changed files with 10 additions and 7 deletions
|
@ -1265,17 +1265,14 @@ systemColorWithName(NSString *name)
|
|||
- (NSUInteger) hash
|
||||
{
|
||||
int nums = [self numberOfComponents];
|
||||
union {
|
||||
uint8_t bytes[sizeof(float) * nums];
|
||||
float floats[nums];
|
||||
} u;
|
||||
float floats[nums];
|
||||
NSUInteger h = 0;
|
||||
unsigned i;
|
||||
|
||||
[self getComponents: u.floats];
|
||||
for (i = 0; i < sizeof(u); i++)
|
||||
[self getComponents: &floats[0]];
|
||||
for (i = 0; i < sizeof(floats); i++)
|
||||
{
|
||||
h = (h << 5) + h + u.bytes[i];
|
||||
h = (h << 5) + h + *(uint8_t*)(((uintptr_t)&floats[0])+(i*sizeof(uint8_t)));
|
||||
}
|
||||
return h;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue