Closed Bug 1012971 Opened 6 years ago Closed 6 years ago

Fix warnings

Categories

(Core :: JavaScript Engine: JIT, enhancement)

enhancement
Not set

Tracking

()

RESOLVED FIXED
mozilla32

People

(Reporter: sunfish, Assigned: sunfish)

Details

Attachments

(2 files)

The attached patches fix several compiler warnings in js and mfbt: meaningless qualifiers on return types, unused variables, format string characters, signed vs unsigned comparisons.
Attachment #8425126 - Flags: review?(nicolas.b.pierron)
Attachment #8425129 - Flags: review?(nicolas.b.pierron)
Attachment #8425129 - Flags: review?(nicolas.b.pierron) → review+
Comment on attachment 8425126 [details] [diff] [review]
fix-warnings.patch

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

::: js/src/jit/IonFrames.h
@@ +732,5 @@
>  
>      friend struct IonDOMMethodExitFrameLayoutTraits;
>  
>    public:
> +    static JitCode *Token() { return (JitCode *)0x3; }

Why aren't these static constant?

::: js/src/jit/MIR.h
@@ +8525,5 @@
>      {
>          return new(alloc) MSetDOMProperty(func, obj, val);
>      }
>  
> +    JSJitSetterOp fun() {

nit: add a const between ) and {

@@ +8592,5 @@
>      {
>          return new(alloc) MGetDOMProperty(info, obj, guard);
>      }
>  
> +    JSJitGetterOp fun() {

nit: idem
Attachment #8425126 - Flags: review?(nicolas.b.pierron) → review+
(In reply to Nicolas B. Pierron [:nbp] from comment #2)
> Comment on attachment 8425126 [details] [diff] [review]
> fix-warnings.patch
> 
> Review of attachment 8425126 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> ::: js/src/jit/IonFrames.h
> @@ +732,5 @@
> >  
> >      friend struct IonDOMMethodExitFrameLayoutTraits;
> >  
> >    public:
> > +    static JitCode *Token() { return (JitCode *)0x3; }
> 
> Why aren't these static constant?

Previously the return type was "JitCode *const". This says the function's return value JitCode* itself is const. const isn't meaningful on a non-reference return type.

> ::: js/src/jit/MIR.h
> @@ +8525,5 @@
> >      {
> >          return new(alloc) MSetDOMProperty(func, obj, val);
> >      }
> >  
> > +    JSJitSetterOp fun() {
> 
> nit: add a const between ) and {

Fixed.

> @@ +8592,5 @@
> >      {
> >          return new(alloc) MGetDOMProperty(info, obj, guard);
> >      }
> >  
> > +    JSJitGetterOp fun() {
> 
> nit: idem

Fixed.

https://hg.mozilla.org/integration/mozilla-inbound/rev/fab2921f6306
https://hg.mozilla.org/integration/mozilla-inbound/rev/55b109739287
https://hg.mozilla.org/mozilla-central/rev/fab2921f6306
https://hg.mozilla.org/mozilla-central/rev/55b109739287
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla32
You need to log in before you can comment on or make changes to this bug.