Closed Bug 797106 Opened 7 years ago Closed 7 years ago

don't use PR_BYTES_PER_WORD in nsTextFormatter*.cpp

Categories

(Core :: General, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla18

People

(Reporter: froydnj, Assigned: froydnj)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

This is easily addressed with some template magic.
Attached patch patchSplinter Review
Attachment #667150 - Flags: review?(ehsan)
Comment on attachment 667150 [details] [diff] [review]
patch

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

Looks great!

::: content/base/src/nsTextFragmentImpl.h
@@ +3,5 @@
> + * License, v. 2.0. If a copy of the MPL was not distributed with this
> + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
> +
> +#ifndef nsTextFragmentImpl_h__
> +#define nsTextFragmentImpl_h__

Nit: please include mozilla/StandardInteger.h here.
Attachment #667150 - Flags: review?(ehsan) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/d0ba1abde985
Assignee: nobody → nfroyd
Status: NEW → ASSIGNED
I had to back this out as part of a weird reftest breakage on 64-bit platforms:

https://hg.mozilla.org/integration/mozilla-inbound/rev/402e2cf6602d

Example failure log: https://tbpl.mozilla.org/php/getParsedLog.php?id=15760281&tree=Mozilla-Inbound
Comment on attachment 667150 [details] [diff] [review]
patch

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

::: content/base/src/nsTextFragmentImpl.h
@@ +13,5 @@
> +  static const uint32_t numUnicharsPerWord = 2;
> +};
> +
> +template<> struct Non8BitParameters<8> {
> +  static const size_t mask = 0xff00ff00ff00ff0;

Missing 0 at the end here
(In reply to :Ms2ger from comment #5)
> ::: content/base/src/nsTextFragmentImpl.h
> @@ +13,5 @@
> > +  static const uint32_t numUnicharsPerWord = 2;
> > +};
> > +
> > +template<> struct Non8BitParameters<8> {
> > +  static const size_t mask = 0xff00ff00ff00ff0;
> 
> Missing 0 at the end here

Doh, thanks.

I also changed my templates to use static inline functions; Talos whined at me about increasing the number of constructors on my last push.  I didn't see the constructors compiling locally and I have a hard time understanding how the other changes in that push could have caused problems...

https://hg.mozilla.org/integration/mozilla-inbound/rev/28da4bd92b92
https://hg.mozilla.org/mozilla-central/rev/28da4bd92b92
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla18
Depends on: 900260
You need to log in before you can comment on or make changes to this bug.