Closed Bug 1353544 Opened 3 years ago Closed 3 years ago

Replace usage of PR_BEGIN_MACRO in xpcom

Categories

(Core :: XPCOM, enhancement)

enhancement
Not set

Tracking

()

RESOLVED FIXED
mozilla55
Tracking Status
firefox55 --- fixed

People

(Reporter: erahm, Assigned: erahm)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

We can just use do/while in place of PR_BEGIN_MACRO and PR_END_MACRO.
Attachment #8854602 - Flags: review?(nfroyd)
Comment on attachment 8854602 [details] [diff] [review]
Replace usage of PR_BEGIN_MACRO in xpcom

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

::: xpcom/base/nsAgg.h
@@ +112,2 @@
>      fOuter = outer ? outer : &fAggregated;                                  \
> +  } while(false)

I think while(0) is slightly more idiomatic, but I'm not going to argue strongly for it.
Attachment #8854602 - Flags: review?(nfroyd) → review+
(In reply to Nathan Froyd [:froydnj] from comment #2)
> Comment on attachment 8854602 [details] [diff] [review]
> Replace usage of PR_BEGIN_MACRO in xpcom
> 
> Review of attachment 8854602 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> ::: xpcom/base/nsAgg.h
> @@ +112,2 @@
> >      fOuter = outer ? outer : &fAggregated;                                  \
> > +  } while(false)
> 
> I think while(0) is slightly more idiomatic, but I'm not going to argue
> strongly for it.

Hah I changed that to appease you; there was some comment about preferring false to 0 in another review. I'll make it '0' before landing.
https://hg.mozilla.org/mozilla-central/rev/6ccd3fd0f5e6
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in before you can comment on or make changes to this bug.