diff --git a/gfx/qcms/iccread.c b/gfx/qcms/iccread.c index fd7a7d628ba6..c3221d3cc7de 100644 --- a/gfx/qcms/iccread.c +++ b/gfx/qcms/iccread.c @@ -312,17 +312,17 @@ qcms_bool qcms_profile_is_bogus(qcms_profile *profile) sum[2] = rZ + gZ + bZ; // Build our target vector (see mozilla bug 460629) - target[0] = 0.96420; - target[1] = 1.00000; - target[2] = 0.82491; + target[0] = 0.96420f; + target[1] = 1.00000f; + target[2] = 0.82491f; // Our tolerance vector - Recommended by Chris Murphy based on // conversion from the LAB space criterion of no more than 3 in any one // channel. This is similar to, but slightly more tolerant than Adobe's // criterion. - tolerance[0] = 0.02; - tolerance[1] = 0.02; - tolerance[2] = 0.04; + tolerance[0] = 0.02f; + tolerance[1] = 0.02f; + tolerance[2] = 0.04f; // Compare with our tolerance for (i = 0; i < 3; ++i) { @@ -751,7 +751,7 @@ static struct lutType *read_tag_lutType(struct mem_source *src, struct tag_index lut->e21 = read_s15Fixed16Number(src, offset+40); lut->e22 = read_s15Fixed16Number(src, offset+44); - for (i = 0; i < lut->num_input_table_entries * in_chan; i++) { + for (i = 0; i < (uint32_t)(lut->num_input_table_entries * in_chan); i++) { if (type == LUT8_TYPE) { lut->input_table[i] = uInt8Number_to_float(read_uInt8Number(src, offset + 52 + i * entry_size)); } else { @@ -773,7 +773,7 @@ static struct lutType *read_tag_lutType(struct mem_source *src, struct tag_index } output_offset = clut_offset + clut_size * out_chan * entry_size; - for (i = 0; i < lut->num_output_table_entries * out_chan; i++) { + for (i = 0; i < (uint32_t)(lut->num_output_table_entries * out_chan); i++) { if (type == LUT8_TYPE) { lut->output_table[i] = uInt8Number_to_float(read_uInt8Number(src, output_offset + i*entry_size)); } else { @@ -1310,7 +1310,7 @@ void qcms_data_from_unicode_path(const wchar_t *path, void **mem, size_t *size) #define ICC_PROFILE_HEADER_LENGTH 128 void qcms_data_create_rgb_with_gamma(qcms_CIE_xyY white_point, qcms_CIE_xyYTRIPLE primaries, float gamma, void **mem, size_t *size) { - uint32_t length, offset, index, xyz_count, trc_count; + uint32_t length, index, xyz_count, trc_count; size_t tag_table_offset, tag_data_offset; void *data; struct matrix colorants; diff --git a/gfx/qcms/moz.build b/gfx/qcms/moz.build index 4a82645aabce..a67a46b8fc38 100644 --- a/gfx/qcms/moz.build +++ b/gfx/qcms/moz.build @@ -17,9 +17,6 @@ SOURCES += [ 'transform_util.c', ] -# XXX: We should fix these warnings. -ALLOW_COMPILER_WARNINGS = True - FINAL_LIBRARY = 'xul' if CONFIG['GNU_CC']: diff --git a/gfx/qcms/transform.c b/gfx/qcms/transform.c index ca7d2dc19628..bafdcefcd26e 100644 --- a/gfx/qcms/transform.c +++ b/gfx/qcms/transform.c @@ -259,9 +259,9 @@ static struct matrix adaption_matrix(struct CIE_XYZ source_illumination, struct CIE_XYZ target_illumination) { struct matrix lam_rigg = {{ // Bradford matrix - { 0.8951, 0.2664, -0.1614 }, - { -0.7502, 1.7135, 0.0367 }, - { 0.0389, -0.0685, 1.0296 } + { 0.8951f, 0.2664f, -0.1614f }, + { -0.7502f, 1.7135f, 0.0367f }, + { 0.0389f, -0.0685f, 1.0296f } }}; return compute_chromatic_adaption(source_illumination, target_illumination, lam_rigg); } @@ -1394,7 +1394,7 @@ qcms_transform* qcms_transform_create( return transform; } -#if defined(__GNUC__) && !defined(__x86_64__) && !defined(__amd64__) +#if defined(__GNUC__) && defined(__i386__) /* we need this to avoid crashes when gcc assumes the stack is 128bit aligned */ __attribute__((__force_align_arg_pointer__)) #endif diff --git a/gfx/qcms/transform_util.c b/gfx/qcms/transform_util.c index 8f46c83a7bdc..f15a3f1cfeba 100644 --- a/gfx/qcms/transform_util.c +++ b/gfx/qcms/transform_util.c @@ -1,5 +1,3 @@ -#define _ISOC99_SOURCE /* for INFINITY */ - #include #include #include //memcpy @@ -7,10 +5,6 @@ #include "transform_util.h" #include "matrix.h" -#if !defined(INFINITY) -#define INFINITY HUGE_VAL -#endif - #define PARAMETRIC_CURVE_TYPE 0x70617261 //'para' /* value must be a value between 0 and 1 */ @@ -131,7 +125,7 @@ void compute_curve_gamma_table_type_parametric(float gamma_table[256], float par c = 0; e = 0; f = 0; - interval = -INFINITY; + interval = -1; } else if(count == 1) { a = parameter[1]; b = parameter[2]; @@ -167,12 +161,12 @@ void compute_curve_gamma_table_type_parametric(float gamma_table[256], float par c = 0; e = 0; f = 0; - interval = -INFINITY; - } + interval = -1; + } for (X = 0; X < 256; X++) { if (X >= interval) { - // XXX The equations are not exactly as definied in the spec but are - // algebraic equivilent. + // XXX The equations are not exactly as defined in the spec but are + // algebraically equivalent. // TODO Should division by 255 be for the whole expression. gamma_table[X] = clamp_float(pow(a * X / 255. + b, y) + c + e); } else {