gecko/gfx/qcms/moz.build
Nicholas Nethercote d856434c17 Bug 1205533 - Fix and disallow warnings in gfx/qcms/. r=jrmuizel.
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).
2015-09-17 17:11:27 -07:00

64 lines
1.9 KiB
Python

# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
EXPORTS += [
'qcms.h',
'qcmstypes.h',
]
SOURCES += [
'chain.c',
'iccread.c',
'matrix.c',
'transform.c',
'transform_util.c',
]
FINAL_LIBRARY = 'xul'
if CONFIG['GNU_CC']:
CFLAGS += ['-Wno-missing-field-initializers']
use_sse1 = False
use_sse2 = False
use_altivec = False
if '86' in CONFIG['OS_TEST']:
use_sse2 = True
if CONFIG['_MSC_VER']:
if CONFIG['OS_ARCH'] != 'WINNT' or CONFIG['OS_TEST'] != 'x86_64':
use_sse1 = True
else:
use_sse1 = True
elif 'ppc' in CONFIG['CPU_ARCH']:
if CONFIG['GNU_CC']:
use_altivec = True
if use_sse1:
SOURCES += ['transform-sse1.c']
SOURCES['transform-sse1.c'].flags += CONFIG['SSE_FLAGS']
if CONFIG['SOLARIS_SUNPRO_CC']:
if '64' in CONFIG['OS_TEST']:
# Sun Studio doesn't work correctly for x86 intristics
# with -m64 and without optimization.
SOURCES['transform-sse1.c'].flags += ['-xO4']
else:
SOURCES['transform-sse1.c'].flags += ['-xarch=sse']
if use_sse2:
SOURCES += ['transform-sse2.c']
SOURCES['transform-sse2.c'].flags += CONFIG['SSE2_FLAGS']
if CONFIG['SOLARIS_SUNPRO_CC']:
if '64' in CONFIG['OS_TEST']:
# Sun Studio doesn't work correctly for x86 intristics
# with -m64 and without optimization.
SOURCES['transform-sse2.c'].flags += ['-xO4']
else:
SOURCES['transform-sse2.c'].flags += ['-xarch=sse2']
if use_altivec:
SOURCES += ['transform-altivec.c']
SOURCES['transform-altivec.c'].flags += ['-maltivec']