Closed Bug 785321 Opened 7 years ago Closed 7 years ago

Replace PRUptrdiff with uintptr_t, prtdiff_t or etc

Categories

(Core :: General, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla18

People

(Reporter: m_kato, Assigned: m_kato)

References

Details

Attachments

(1 file)

bug 579517 is fixed, but Gecko still uses PRUptrdiff.  We should replace it with uintptr_t, ptrdiff_t or etc.
Attached patch fixSplinter Review
Assignee: nobody → m_kato
Attachment #654947 - Flags: review?(ehsan)
See bug 478190 why we use PRUptrdiff for PtrBits.
Comment on attachment 654947 [details] [diff] [review]
fix

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

::: gfx/qcms/qcmstypes.h
@@ +28,5 @@
>  #ifdef __OS2__
>  /* OS/2's stdlib typdefs uintptr_t. So we'll just include that so we don't collide */
>  #include <stdlib.h>
>  #elif !defined(__intptr_t_defined) && !defined(_UINTPTR_T_DEFINED)
> +typedef unsigned long uintptr_t;

I'm not very sure if this change is correct because the size of long is not always the same as the size of a pointer.  Also the code above it doesn't make much sense to me.  I've asked Jeff to review this part.
Attachment #654947 - Flags: review?(jmuizelaar)
Attachment #654947 - Flags: review?(ehsan)
Attachment #654947 - Flags: review+
Attachment #654947 - Flags: review?(jmuizelaar) → review+
https://hg.mozilla.org/mozilla-central/rev/1ff74108db1d
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Comment on attachment 654947 [details] [diff] [review]
fix

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

::: gfx/ycbcr/convert.patch
@@ +321,5 @@
>     // after the end for SSE2 version.
>     uint8 yuvbuf[16 + kFilterBufferSize * 3 + 16];
>     uint8* ybuf =
>  -      reinterpret_cast<uint8*>(reinterpret_cast<uintptr_t>(yuvbuf + 15) & ~15);
> ++      reinterpret_cast<uint8*>(reinterpret_cast<uintptr_t>(yuvbuf + 15) & ~15);

I'm not missing anything here, am I?
(In reply to :Ms2ger from comment #6)
> Comment on attachment 654947 [details] [diff] [review]
> fix
> 
> Review of attachment 654947 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> ::: gfx/ycbcr/convert.patch
> @@ +321,5 @@
> >     // after the end for SSE2 version.
> >     uint8 yuvbuf[16 + kFilterBufferSize * 3 + 16];
> >     uint8* ybuf =
> >  -      reinterpret_cast<uint8*>(reinterpret_cast<uintptr_t>(yuvbuf + 15) & ~15);
> > ++      reinterpret_cast<uint8*>(reinterpret_cast<uintptr_t>(yuvbuf + 15) & ~15);
> 
> I'm not missing anything here, am I?

It is not at all clear what you're asking here!
I guess he's asking why exactly the same line appears in the diff.
> -      reinterpret_cast<uint8*>(reinterpret_cast<uintptr_t>(yuvbuf + 15) & ~15);
>-+      reinterpret_cast<uint8*>(reinterpret_cast<PRUptrdiff>(yuvbuf + 15) & ~15);
>++      reinterpret_cast<uint8*>(reinterpret_cast<uintptr_t>(yuvbuf + 15) & ~15);
This diff line itself can be removed from convert.patch.
Ah, I see!  I removed the entire hunk from convert.patch:

https://hg.mozilla.org/integration/mozilla-inbound/rev/14eac84d5ce6
Depends on: 793314
You need to log in before you can comment on or make changes to this bug.