Remove compile warning from 1340446.

RESOLVED FIXED in Firefox 54

Status

()

defect
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: ayang, Assigned: ayang)

Tracking

unspecified
mozilla54
Points:
---

Firefox Tracking Flags

(firefox54 fixed)

Details

Attachments

(1 attachment, 1 obsolete attachment)

Fix for "warning: taking the absolute value of unsigned type 'unsigned long long' has no effect [-Wabsolute-value]".
Assignee: nobody → ayang
See Also: → 1340446
Comment on attachment 8840772 [details]
Bug 1342339 - remove compile warning from bug 1340446.

https://reviewboard.mozilla.org/r/115196/#review116680
Attachment #8840772 - Flags: review?(kinetik) → review+
Duplicate of this bug: 1342842
Comment on attachment 8840772 [details]
Bug 1342339 - remove compile warning from bug 1340446.

https://reviewboard.mozilla.org/r/115196/#review117668

Thank you for taking care of this. A fly-by suggestion:

::: media/libstagefright/binding/MP4Metadata.cpp:359
(Diff revision 1)
> -      MOZ_DIAGNOSTIC_ASSERT(llabs(data.indices[i].start_composition - aDest[i].start_composition) <= 1);
> -      MOZ_DIAGNOSTIC_ASSERT(llabs(data.indices[i].end_composition - aDest[i].end_composition) <= 1);
> -      MOZ_DIAGNOSTIC_ASSERT(llabs(data.indices[i].start_decode - aDest[i].start_decode) <= 1);
> +      MOZ_DIAGNOSTIC_ASSERT(llabs((int64_t)(data.indices[i].start_composition - aDest[i].start_composition)) <= 1);
> +      MOZ_DIAGNOSTIC_ASSERT(llabs((int64_t)(data.indices[i].end_composition - aDest[i].end_composition)) <= 1);
> +      MOZ_DIAGNOSTIC_ASSERT(llabs((int64_t)(data.indices[i].start_decode - aDest[i].start_decode)) <= 1);

May I suggest you don't use C-style casts?
The easiest would be a C++ constructor-style cast, just remove the parentheses around 'int64_t'. ;-)
Attachment #8840772 - Flags: review+
Attachment #8840772 - Attachment is obsolete: true
Comment on attachment 8842277 [details]
Bug 1342339 - remove compile warning from bug 1340446.

https://reviewboard.mozilla.org/r/116142/#review117708
Attachment #8842277 - Flags: review?(kinetik) → review+
https://hg.mozilla.org/mozilla-central/rev/2da1219f2347
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla54
You need to log in before you can comment on or make changes to this bug.