From 5fe48dd2498953fc3df7f8f22655e91c77f97076 Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Mon, 4 Jan 2016 16:11:06 +0000 Subject: Squash warnings: MSVC ones. Tweak the code to avoid the warnings seen in the MSVC debug build of gs. Mostly adding a few casts to make type changes explicit (and hence avoid the "casting from int to double might lose data" etc warnings). Reorder the headers in a couple of places to avoid offsetof being redefined in a system header warnings. --- base/gsicc_create.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'base/gsicc_create.c') diff --git a/base/gsicc_create.c b/base/gsicc_create.c index 0cf4c126c..57511c15d 100644 --- a/base/gsicc_create.c +++ b/base/gsicc_create.c @@ -439,15 +439,15 @@ gsicc_vec_to_mlut(gs_vector3 *vec, unsigned short *clut) *curr_ptr ++= 0; *curr_ptr ++= 0; *curr_ptr ++= 0; - temp = vec->u * 65535; + temp = (int)(vec->u * 65535); if (temp > 65535) temp = 65535; if (temp < 0) temp = 0; *curr_ptr ++= temp; - temp = vec->v * 65535; + temp = (int)(vec->v * 65535); if (temp > 65535) temp = 65535; if (temp < 0) temp = 0; *curr_ptr ++= temp; - temp = vec->w * 65535; + temp = (int)(vec->w * 65535); if (temp > 65535) temp = 65535; if (temp < 0) temp = 0; *curr_ptr ++= temp; @@ -1560,9 +1560,9 @@ create_lutAtoBprofile(unsigned char **pp_buffer_in, icHeader *header, d50_cieA[2] = D50_Z; } else { /* Need to do final scaling to ICC CIEXYZ range */ - d50_cieA[0] = D50_X / (1.0 + (32767.0/32768.0)) ; - d50_cieA[1] = D50_Y / (1.0 + (32767.0/32768.0)); - d50_cieA[2] = D50_Z / (1.0 + (32767.0/32768.0)); + d50_cieA[0] = (float)(D50_X / (1.0 + (32767.0/32768.0))); + d50_cieA[1] = (float)(D50_Y / (1.0 + (32767.0/32768.0))); + d50_cieA[2] = (float)(D50_Z / (1.0 + (32767.0/32768.0))); } matrixmult(&(d50_cieA[0]), 3, 1, &(lmn_vector[0]), 1, 3, &(lutatobparts->matrix->cu.u)); -- cgit v1.2.1