Closed Bug 1205533 Opened 4 years ago Closed 4 years ago

Fix and disallow warnings in gfx/qcms/

Categories

(Core :: Graphics, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla43
Tracking Status
firefox43 --- fixed

People

(Reporter: njn, Assigned: njn)

Details

Attachments

(1 file)

This patch fixes various warnings from MSVC.

- Several "truncation from 'double' to 'float'" warnings, easily fixed by
  appending 'f' to literals.

- Some "signed/unsigned mismatch" warnings. In read_tag_lutType(), MSVC is
  apparently promoting the multiplication of a uint8_t and a uint16_t to an
  int32_t, oddly enough. A uint32_t cast fixes the warning.

- |offset| was unused in qcms_data_create_rbg_with_gamma().

- A couple of "overflow in floating-point constant arithmetic" warnings
  involving INFINITY in transform_util.c. There is some type confusion here --
  in C99 HUGE_VAL is a double and INFINITY is a float. So the HUGE_VAL here
  should actualy be HUGE_VALF. But, strangely enough, that isn't enough to
  avoid the warning, I don't know why. However, it turns out that any
  non-positive value for |interval| will have the same effect, so I just
  removed all the INFINITY/HUGE_VAL stuff and used -1 instead.

It also fixes an ARM-only GCC warning.

- "'__force_align_arg_pointer__' attribute directive ignored". This is an
  x86-only attribute. Instead of disabling it on x86-64, instead enable it on
  i386 (which avoids enabling it uselessly on ARM).
Attachment #8662178 - Flags: review?(jmuizelaar)
Attachment #8662178 - Flags: review?(jmuizelaar) → review+
https://hg.mozilla.org/mozilla-central/rev/4f8368eec32d
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla43
You need to log in before you can comment on or make changes to this bug.