Closed Bug 569608 Opened 14 years ago Closed 14 years ago

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

Categories

(Core :: Graphics: Color Management, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: jacek, Assigned: jacek)

References

Details

Attachments

(1 file, 1 obsolete file)

Attached patch fix v1.0 (obsolete) — Splinter Review
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.
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.
Attached patch fix v1.1Splinter Review
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)
Attachment #448783 - Flags: review?(vladimir)
Blocks: 570342
Keywords: checkin-needed
http://hg.mozilla.org/mozilla-central/rev/63e1a2df087b
Status: NEW → RESOLVED
Closed: 14 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: