WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
108628
Added TriState to WTF and started using it in one place
https://bugs.webkit.org/show_bug.cgi?id=108628
Summary
Added TriState to WTF and started using it in one place
Geoffrey Garen
Reported
2013-02-01 06:12:49 PST
Added TriState to WTF and started using it in one place
Attachments
Patch
(11.61 KB, patch)
2013-02-01 06:17 PST
,
Geoffrey Garen
bdakin
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Geoffrey Garen
Comment 1
2013-02-01 06:17:22 PST
Created
attachment 186030
[details]
Patch
Geoffrey Garen
Comment 2
2013-02-01 07:02:59 PST
Committed
r141588
: <
http://trac.webkit.org/changeset/141588
>
Mark Lam
Comment 3
2013-02-01 10:09:17 PST
Comment on
attachment 186030
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=186030&action=review
> Source/WTF/wtf/TriState.h:35 > +};
If you use the new EnumClass.h, you can make this: ENUM_CLASS_BEGIN(TriState) { False, True, Mixed } ENUM_CLASS_END(TriState); And everywhere you use TriState::False, TriState::True, and TriState::Mixed. Not sure that that is better, but fyi for your consideration.
Benjamin Poulain
Comment 4
2013-02-01 13:33:30 PST
Comment on
attachment 186030
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=186030&action=review
> Source/WTF/WTF.xcodeproj/project.pbxproj:-313 > FEDACD3E1630F83F00C69634 /* StackStats.h in Headers */ = {isa = PBXBuildFile; fileRef = FEDACD3C1630F83F00C69634 /* StackStats.h */; }; > - FE43302716A7ADC300D1585D /* TypeSafeEnum.h in Headers */ = {isa = PBXBuildFile; fileRef = FE43302616A7ADC300D1585D /* TypeSafeEnum.h */; };
Why are you removing the TypeSafeEnum?
> Source/WTF/WTF.xcodeproj/project.pbxproj:1264 > A8A47487151A825B004123FF /* WTFThreadData.h in Headers */, > + 149EF16316BBFE0D000A4331 /* TriState.h in Headers */,
Build section unsorted :(
>> Source/WTF/wtf/TriState.h:35 >> +enum TriState { >> + FalseTriState, >> + TrueTriState, >> + MixedTriState >> +}; > > If you use the new EnumClass.h, you can make this: > > ENUM_CLASS_BEGIN(TriState) { > False, > True, > Mixed > } ENUM_CLASS_END(TriState); > > And everywhere you use TriState::False, TriState::True, and TriState::Mixed. Not sure that that is better, but fyi for your consideration.
Instead of an enum, I wonder if this would not benefit from a class with the logic function explicitly defined? If you plan to use the TriState in logic operations, it would be beneficial to define and, or and not.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug