Bug 89902 (W_LPARAM_DEF) - WPARAM and LPARAM are incorrectly defined for x64
Summary: WPARAM and LPARAM are incorrectly defined for x64
Status: RESOLVED FIXED
Alias: W_LPARAM_DEF
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Windows 7
: P3 Minor
Assignee: Alex Christensen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-25 13:02 PDT by Alex Christensen
Modified: 2012-08-13 20:32 PDT (History)
7 users (show)

See Also:


Attachments
Patch (3.70 KB, patch)
2012-06-25 13:20 PDT, Alex Christensen
no flags Details | Formatted Diff | Diff
Patch (873 bytes, patch)
2012-06-25 16:49 PDT, Alex Christensen
no flags Details | Formatted Diff | Diff
Patch (3.66 KB, patch)
2012-07-23 08:13 PDT, Alex Christensen
no flags Details | Formatted Diff | Diff
Patch (5.69 KB, patch)
2012-08-13 09:32 PDT, Alex Christensen
no flags Details | Formatted Diff | Diff
Patch (5.69 KB, patch)
2012-08-13 09:38 PDT, Alex Christensen
no flags Details | Formatted Diff | Diff
Patch (4.82 KB, patch)
2012-08-13 09:48 PDT, Alex Christensen
no flags Details | Formatted Diff | Diff
Patch (4.81 KB, patch)
2012-08-13 09:54 PDT, Alex Christensen
no flags Details | Formatted Diff | Diff
Patch (4.35 KB, patch)
2012-08-13 10:38 PDT, Alex Christensen
no flags Details | Formatted Diff | Diff
Patch (4.38 KB, patch)
2012-08-13 11:41 PDT, Alex Christensen
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Christensen 2012-06-25 13:02:29 PDT
There are 5 places in Source/WebCore/platform where WPARAM and LPARAM are defined to be unsigned and long, respectively.  This happens to be correct when building for an x86 machine, but this incorrectly redefines the types for x64 machines.  Visual Studio's BaseTsd.h uses #if defined(_WIN64) to change these types to 64-bit unsigned and signed integers, so if we did the same it would not cause compiler errors.
Comment 1 Alex Christensen 2012-06-25 13:20:22 PDT
Created attachment 149342 [details]
Patch
Comment 2 WebKit Review Bot 2012-06-25 13:23:21 PDT
Attachment 149342 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1
Source/WebCore/ChangeLog:8:  You should remove the 'No new tests' and either add and list tests, or explain why no new tests were possible.  [changelog/nonewtests] [5]
Total errors found: 1 in 6 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Alex Christensen 2012-06-25 16:49:30 PDT
Created attachment 149393 [details]
Patch
Comment 4 Ryosuke Niwa 2012-07-19 16:27:45 PDT
Comment on attachment 149393 [details]
Patch

You're missing the change.
Comment 5 Alex Christensen 2012-07-23 08:13:59 PDT
Created attachment 153801 [details]
Patch
Comment 6 Alex Christensen 2012-07-23 10:05:47 PDT
no wonder it passed all the tests :)

(In reply to comment #4)
> (From update of attachment 149393 [details])
> You're missing the change.
Comment 7 Alex Christensen 2012-07-23 13:17:39 PDT
I have a new patch with the changes.  Could someone review it?
Comment 8 Patrick R. Gansterer 2012-08-06 14:48:37 PDT
Please don't do copy&past programming. It's already not the best to have the same typdefs three times. So it's a good time to move them in their own header.
Comment 9 Alexis Menard (darktears) 2012-08-06 15:44:25 PDT
Comment on attachment 153801 [details]
Patch

Would it be possible to refactor this a bit more and add this insane copy pasting in some common headers (platform.h for example?)
Comment 10 Patrick R. Gansterer 2012-08-06 15:45:55 PDT
(In reply to comment #9)
> (From update of attachment 153801 [details])
> Would it be possible to refactor this a bit more and add this insane copy pasting in some common headers (platform.h for example?)
IMHO Platform.h is too general. WindowsExtras.h should be ok for this.
Comment 11 Alexis Menard (darktears) 2012-08-06 15:50:20 PDT
(In reply to comment #10)
> (In reply to comment #9)
> > (From update of attachment 153801 [details] [details])
> > Would it be possible to refactor this a bit more and add this insane copy pasting in some common headers (platform.h for example?)
> IMHO Platform.h is too general. WindowsExtras.h should be ok for this.

(In reply to comment #10)
> (In reply to comment #9)
> > (From update of attachment 153801 [details] [details])
> > Would it be possible to refactor this a bit more and add this insane copy pasting in some common headers (platform.h for example?)
> IMHO Platform.h is too general. WindowsExtras.h should be ok for this.

Indeed. Maybe we could even refactor the other copy/pasted defines which are not part of this patch to clean that up. (The bug could be renamed or a new one could be created to move later on the other defines).
Comment 12 Alex Christensen 2012-08-13 09:32:36 PDT
Created attachment 158017 [details]
Patch
Comment 13 Alex Christensen 2012-08-13 09:35:19 PDT
Now the files include WindowsExtras.h, which includes <windows.h> if PLATFORM(WIN) is true, which includes the correct definitions.  No duplicate definitions!
Comment 14 WebKit Review Bot 2012-08-13 09:36:14 PDT
Attachment 158017 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1
Source/WebCore/platform/win/WindowsExtras.h:58:  Should have a space between // and comment  [whitespace/comments] [4]
Total errors found: 1 in 8 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 15 Alex Christensen 2012-08-13 09:38:57 PDT
Created attachment 158021 [details]
Patch
Comment 16 Alex Christensen 2012-08-13 09:48:08 PDT
Created attachment 158026 [details]
Patch
Comment 17 Alex Christensen 2012-08-13 09:54:31 PDT
Created attachment 158028 [details]
Patch
Comment 18 Alex Christensen 2012-08-13 10:38:16 PDT
Created attachment 158036 [details]
Patch
Comment 19 Alex Christensen 2012-08-13 10:39:53 PDT
Sorry about all the patches.  I don't have a mac to test on.
Comment 20 Patrick R. Gansterer 2012-08-13 11:25:19 PDT
Comment on attachment 158036 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=158036&action=review

> Source/WebCore/platform/PlatformKeyboardEvent.h:31
> +#if PLATFORM(WIN)

please use OS(WINDOWS) here and everywhere else in this patch
Comment 21 Alex Christensen 2012-08-13 11:41:55 PDT
Created attachment 158060 [details]
Patch
Comment 22 Brent Fulgham 2012-08-13 19:58:11 PDT
Comment on attachment 158060 [details]
Patch

Very nice removal of duplicated code.  Thanks for taking this on.
Comment 23 WebKit Review Bot 2012-08-13 20:32:28 PDT
Comment on attachment 158060 [details]
Patch

Clearing flags on attachment: 158060

Committed r125506: <http://trac.webkit.org/changeset/125506>
Comment 24 WebKit Review Bot 2012-08-13 20:32:33 PDT
All reviewed patches have been landed.  Closing bug.