Bug 33709 - Cleanup: Typedef DragOperation as type int
Summary: Cleanup: Typedef DragOperation as type int
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-15 02:20 PST by Daniel Bates
Modified: 2010-06-10 20:21 PDT (History)
4 users (show)

See Also:


Attachments
Patch (3.62 KB, patch)
2010-01-15 02:25 PST, Daniel Bates
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Bates 2010-01-15 02:20:46 PST
Following up on a remark brought up by Eric Seidel <https://bugs.webkit.org/show_bug.cgi?id=24731#c25>, we should typedef DragOperation as type int since it is also used to compose bitwise masks of multiple drag operations.

Use of DragOperation as a bitwise mask appears in:

Clipboard.cpp:

<http://trac.webkit.org/browser/trunk/WebCore/dom/Clipboard.cpp?rev=53301#L71>
<http://trac.webkit.org/browser/trunk/WebCore/dom/Clipboard.cpp?rev=53301#L73>
<http://trac.webkit.org/browser/trunk/WebCore/dom/Clipboard.cpp?rev=53301#L75>
<http://trac.webkit.org/browser/trunk/WebCore/dom/Clipboard.cpp?rev=53301#L83>

DragController.cpp:

<http://trac.webkit.org/browser/trunk/WebCore/page/DragController.cpp?rev=53296#L639>
Comment 1 Daniel Bates 2010-01-15 02:25:02 PST
Created attachment 46660 [details]
Patch

No functionality was changed. So, no new tests.
Comment 2 Oliver Hunt 2010-01-15 02:27:00 PST
Comment on attachment 46660 [details]
Patch

I suspect this will break windows due to missing window export file updates
Comment 3 Eric Seidel (no email) 2010-01-15 02:32:33 PST
Attachment 46660 [details] did not build on mac:
Build output: http://webkit-commit-queue.appspot.com/results/189110
Comment 4 Daniel Bates 2010-01-15 02:42:06 PST
Comment on attachment 46660 [details]
Patch

Clearing review flag, while I look into this. There seems to be signed/unsigned mismatching issues.
Comment 5 Adam Roben (:aroben) 2010-01-15 07:47:43 PST
I think it would be better to leave DragOperation as an enum, but introduce a new DragOperationMask typedef (we normally use unsigned for this). Then we'd use DragOperationMask everywhere that multiple DragOperations are combined.