Closed Bug 1298855 Opened 3 years ago Closed 3 years ago

remove prtypes.h include from xpt code

Categories

(Core :: XPCOM, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla52
Tracking Status
firefox51 --- fix-optional
firefox52 --- fixed

People

(Reporter: froydnj, Assigned: froydnj)

References

(Blocks 1 open bug)

Details

Attachments

(2 files, 1 obsolete file)

We have the technology.
More obvious, slightly more efficient, and dispensing with NSPR macro
goo is always a good thing.
Attachment #8786017 - Flags: review?(erahm)
Nothing else in this code requires prcpucfg.h at this point.
Attachment #8786018 - Flags: review?(erahm)
Comment on attachment 8786017 [details] [diff] [review]
part 1 - use EndianUtils.h in xpt_xdr.cpp

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

::: xpcom/typelib/xpt/xpt_xdr.cpp
@@ +188,4 @@
>  XPT_PUBLIC_API(bool)
>  XPT_Do64(NotNull<XPTCursor*> cursor, int64_t *u64p)
>  {
> +    return XPT_DoInt<int64_t, mozilla::BigEndian::readInt64>(cursor, u64p);

Seems like if we exposed BigEndian::read<T> directly this would be a bit simpler. I guess we wanted to restrict the types?
Attachment #8786017 - Flags: review?(erahm) → review+
Attachment #8786018 - Flags: review?(erahm) → review+
(In reply to Eric Rahm [:erahm] from comment #3)
> ::: xpcom/typelib/xpt/xpt_xdr.cpp
> @@ +188,4 @@
> >  XPT_PUBLIC_API(bool)
> >  XPT_Do64(NotNull<XPTCursor*> cursor, int64_t *u64p)
> >  {
> > +    return XPT_DoInt<int64_t, mozilla::BigEndian::readInt64>(cursor, u64p);
> 
> Seems like if we exposed BigEndian::read<T> directly this would be a bit
> simpler. I guess we wanted to restrict the types?

That's correct; one doesn't have to deal with ensuring the template parameter is an integer type, etc.
I think this will work on Windows, even if it is uglier.
Attachment #8788923 - Flags: review?(erahm)
Attachment #8786017 - Attachment is obsolete: true
Comment on attachment 8788923 [details] [diff] [review]
part 1 - use EndianUtils.h in xpt_xdr.cpp

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

r=me

::: xpcom/typelib/xpt/xpt_xdr.cpp
@@ +5,5 @@
>  
>  /* Implementation of XDR primitives. */
>  
>  #include "xpt_xdr.h"
>  #include "nspr.h"

Do we still need this?
Attachment #8788923 - Flags: review?(erahm) → review+
Pushed by nfroyd@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/fd9ce614a611
part 1 - use EndianUtils.h in xpt_xdr.cpp; r=erahm
https://hg.mozilla.org/integration/mozilla-inbound/rev/6b12cec59752
part 2 - remove prcpucfg.h #include from xpt_arena.h; r=erahm
https://hg.mozilla.org/mozilla-central/rev/fd9ce614a611
https://hg.mozilla.org/mozilla-central/rev/6b12cec59752
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla52
Mark 51 as fix-optional. If it's worth uplift to 51, feel free to nominate it.
You need to log in before you can comment on or make changes to this bug.