If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

gfxTextRunWordCache.cpp compilation failure on mingw-w64 due to pointer to long cast loosing precision.

RESOLVED FIXED

Status

()

Core
GFX: Color Management
RESOLVED FIXED
7 years ago
7 years ago

People

(Reporter: Jacek Caban, Assigned: Jacek Caban)

Tracking

Trunk
x86
Windows XP
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

977 bytes, patch
vlad
: review+
Details | Diff | Splinter Review
(Assignee)

Description

7 years ago
Created attachment 448766 [details] [diff] [review]
fix v1.0

I get following error:

gfx/thebes/src/gfxTextRunWordCache.cpp:938:57: error: cast from 'void*' to 'long int' loses precision

long is 32-bit on win64, so it's really loosing precision. The attached patch changes cast to intptr_t instead of long.
(Assignee)

Updated

7 years ago
Attachment #448766 - Attachment is patch: true
Attachment #448766 - Flags: review?(vladimir)
This should likely do a reinterpret_cast then; we really do want only the low 32 bits (as the hash key is only 32 bits), and I believe going up to 64 bits here will widen the whole expression for no good reason.
(Assignee)

Comment 2

7 years ago
Created attachment 448783 [details] [diff] [review]
fix v1.1

Thanks for review. I had an impression that in this case there will be implicit cast to 32-bit integer.

reinterpret_cast alone doesn't fix the problem. The error remains. The attached patch uses two casts to make sure that we get 32-bit int. It could use reinterpret_cast if you prefer.
Assignee: nobody → jacek
Attachment #448766 - Attachment is obsolete: true
Attachment #448766 - Flags: review?(vladimir)
(Assignee)

Updated

7 years ago
Attachment #448783 - Flags: review?(vladimir)
(Assignee)

Updated

7 years ago
Blocks: 570342
Attachment #448783 - Flags: review?(vladimir) → review+
(Assignee)

Updated

7 years ago
Keywords: checkin-needed
(Assignee)

Comment 3

7 years ago
http://hg.mozilla.org/mozilla-central/rev/63e1a2df087b
Status: NEW → RESOLVED
Last Resolved: 7 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.