Bug 7618 - use unsigned bitfields when storing enums in them, to avoid mangling on win32 (was causing all layout to be RTL)
Summary: use unsigned bitfields when storing enums in them, to avoid mangling on win32...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: 420+
Hardware: Macintosh OS X 10.4
: P2 Normal
Assignee: Maciej Stachowiak
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-03-05 17:53 PST by Maciej Stachowiak
Modified: 2006-03-05 20:23 PST (History)
0 users

See Also:


Attachments
take 1 (kinda ugly) (87.89 KB, patch)
2006-03-05 17:55 PST, Maciej Stachowiak
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Maciej Stachowiak 2006-03-05 17:53:19 PST
In MSVC, enums are signed, as are bitfields containing them. This often makes values at the extreme end of the enum range go negative, so they fail equality comparisons.

I fixed this by always using unsigned for bitfields that hold enums, unless the enum actually uses negative values.
Comment 1 Maciej Stachowiak 2006-03-05 17:55:24 PST
Created attachment 6880 [details]
take 1 (kinda ugly)
Comment 2 Darin Adler 2006-03-05 20:17:57 PST
Comment on attachment 6880 [details]
take 1 (kinda ugly)

r=me

I didn't spot any problems. The trick with a change like this is to do enough testing.
Comment 3 Darin Adler 2006-03-05 20:23:36 PST
Maciej landed this.