nsWebSocketHandler.cpp fails to compile on mingw-w64

RESOLVED FIXED

Status

()

Core
Networking: WebSockets
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: Jacek Caban, Assigned: Jacek Caban)

Tracking

Trunk
x86_64
Windows 7
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

6 years ago
Created attachment 536870 [details] [diff] [review]
fix v1.0

mozilla-central/netwerk/protocol/websocket/nsWebSocketHandler.cpp:966:36: error: cast from 'PRUint8*' to 'long unsigned int' loses precision [-fpermissive]

That's because long is 32-bit on win64. In this case we don't care about losing precision, but it's still an error for GCC. The fix is as simple as using uintptr_t.
Attachment #536870 - Flags: review?(Olli.Pettay)

Comment 1

6 years ago
Could you cast to some PRU*** type?

Comment 2

6 years ago
Comment on attachment 536870 [details] [diff] [review]
fix v1.0

Or, uintptr_t could be ok, but this is Patrick's code
Attachment #536870 - Flags: review?(Olli.Pettay) → review?(mcmanus)
(Assignee)

Comment 3

6 years ago
Created attachment 537132 [details] [diff] [review]
fix using PRUptrdiff

The attached patch uses PRUptrdiff instead of uintptr_t. Please choose preferred version.
Attachment #537132 - Flags: review?
Comment on attachment 536870 [details] [diff] [review]
fix v1.0

Review of attachment 536870 [details] [diff] [review]:
-----------------------------------------------------------------

Jacek, what do you think about using PRUptrdiff ?

There are a number of places in the code base (netwerk is not one of them) that go to some length to make sure uintptr_t is defined for old platforms.
Attachment #537132 - Flags: review? → review+
Attachment #536870 - Flags: review?(mcmanus)
(In reply to comment #3)
> Created attachment 537132 [details] [diff] [review] [review]
> fix using PRUptrdiff
> 
> The attached patch uses PRUptrdiff instead of uintptr_t. Please choose
> preferred version.

heh - race condition.

good to go.
Attachment #536870 - Attachment is obsolete: true
(Assignee)

Comment 6

6 years ago
Thanks for the review, pushed to m-c:

http://hg.mozilla.org/mozilla-central/rev/780fb17abc1e
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.