Convert the fourth quarter of MFBT to Gecko style

RESOLVED FIXED in mozilla34

Status

()

defect
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: njn, Assigned: njn)

Tracking

unspecified
mozilla34
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

This finishes the style conversion begun in bug 1014377 and bug 1026319 and bug 1036789.
As before: indentation changes in the first patch (|hg qdiff -w| is empty),
everything else in the second, and I'll merge before landing.
Attachment #8460041 - Flags: review?(Ms2ger)
Posted patch ...the rest..Splinter Review
Attachment #8460042 - Flags: review?(Ms2ger)
Attachment #8460041 - Flags: review?(Ms2ger) → review+
Comment on attachment 8460042 [details] [diff] [review]
...the rest..

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

::: mfbt/STYLE
@@ +1,1 @@
> +MFBT uses standard Mozilla style, with the following exceptions.

Some parts of this file might be useful to keep.

::: mfbt/tests/TestAtomics.cpp
@@ +14,5 @@
>  using mozilla::Relaxed;
>  using mozilla::ReleaseAcquire;
>  using mozilla::SequentiallyConsistent;
>  
> +#define A(a,b)  MOZ_RELEASE_ASSERT(a,b)

Undef it at the end

::: mfbt/tests/TestBinarySearch.cpp
@@ +19,5 @@
>  };
>  
>  struct GetAge
>  {
> +  Vector<Person> &mV;

& to the left

@@ +20,5 @@
>  
>  struct GetAge
>  {
> +  Vector<Person> &mV;
> +  explicit GetAge(Vector<Person> &aV) : mV(aV) {}

Ditto

::: mfbt/tests/TestEndian.cpp
@@ +29,5 @@
>  }
>  
>  template<typename T>
>  void
> +TestSingleNoSwap(T aVal, T aUnswappedVal)

I prefer spelling out "value"

::: mfbt/tests/TestFloatingPoint.cpp
@@ +24,5 @@
>  using mozilla::PositiveInfinity;
>  using mozilla::SpecificNaN;
>  using mozilla::UnspecifiedNaN;
>  
> +#define A(a) MOZ_RELEASE_ASSERT(a)

undef

::: mfbt/tests/TestPoisonArea.cpp
@@ +227,2 @@
>  {
> +  if (aPage >= (uintptr_t)sInfo_.lpMaximumApplicationAddress &&

return aPage >= ...

@@ +273,2 @@
>  {
> +  if (madvise(reinterpret_cast<void*>(aPage), PageSize(), MADV_NORMAL)) {

return madvise(...

@@ +300,5 @@
>      return result;
> +  }
> +
> +  // First see if we can allocate the preferred poison address from the OS.
> +  uintptr_t candidate = (0xF0DEAFFF & ~(PageSize()-1));

Spaces around -

@@ +302,5 @@
> +
> +  // First see if we can allocate the preferred poison address from the OS.
> +  uintptr_t candidate = (0xF0DEAFFF & ~(PageSize()-1));
> +  void* result = ReserveRegion(candidate, false);
> +  if (result == (void*)candidate) {

reinterpret_cast

@@ +326,5 @@
> +  // consolation prize?
> +  if (result != MAP_FAILED) {
> +    printf("INFO | poison area allocated at 0x%.*" PRIxPTR
> +           " (consolation prize)\n", SIZxPTR, (uintptr_t)result);
> +    return (uintptr_t)result;

reinterpret_cast

@@ +335,5 @@
> +  result = ReserveRegion(0, false);
> +  if (result != MAP_FAILED) {
> +    printf("INFO | poison area allocated at 0x%.*" PRIxPTR
> +           " (fallback)\n", SIZxPTR, (uintptr_t)result);
> +    return (uintptr_t)result;

reinterpret_cast

@@ +356,5 @@
>      return 0;
>    }
>    printf("INFO | positive control allocated at 0x%.*" PRIxPTR "\n",
>           SIZxPTR, (uintptr_t)result);
>    return (uintptr_t)result;

reinterpret_cast

@@ +373,5 @@
>    }
>  
>    // Fill the page with return instructions.
> +  RETURN_INSTR_TYPE* p = (RETURN_INSTR_TYPE*)result;
> +  RETURN_INSTR_TYPE* limit = (RETURN_INSTR_TYPE*)(((char*)result) + PageSize());

reinterpret_cast
Attachment #8460042 - Flags: review?(Ms2ger) → review+
> ::: mfbt/STYLE
> @@ +1,1 @@
> > +MFBT uses standard Mozilla style, with the following exceptions.
> 
> Some parts of this file might be useful to keep.

Why? And which parts? I don't know how to act on this suggestion.

> @@ +273,2 @@
> >  {
> > +  if (madvise(reinterpret_cast<void*>(aPage), PageSize(), MADV_NORMAL)) {
> 
> return madvise(...

I did |return !!madvise(...);|, because madvise returns 0 or -1.
https://hg.mozilla.org/mozilla-central/rev/1b7d7dcf71e2
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla34
QA Whiteboard: [qa-]
You need to log in before you can comment on or make changes to this bug.