From c21fa69aeaaec4edfea3fd1895ef19b13cc5ab25 Mon Sep 17 00:00:00 2001 From: natureh Date: Sun, 26 Feb 2012 01:05:57 +0100 Subject: [PATCH] Suppressing loads of GCC warning about automatic typecasting ambiguity --- rtengine/CA_correct_RT.cc | 4 ++-- rtengine/array2D.h | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/rtengine/CA_correct_RT.cc b/rtengine/CA_correct_RT.cc index c8848d9f1..7434ae516 100644 --- a/rtengine/CA_correct_RT.cc +++ b/rtengine/CA_correct_RT.cc @@ -465,7 +465,7 @@ void RawImageSource::CA_correct_RT(double cared, double cablue) { gdiff=0.3125*(rgb[indx+TS][1]-rgb[indx-TS][1])+0.09375*(rgb[indx+TS+1][1]-rgb[indx-TS+1][1]+rgb[indx+TS-1][1]-rgb[indx-TS-1][1]); deltgrb=(rgb[indx][c]-rgb[indx][1])-0.5*((rgb[indx-v4][c]-rgb[indx-v4][1])+(rgb[indx+v4][c]-rgb[indx+v4][1])); - gradwt=fabs(0.25*rbhpfv[indx]+0.125*(rbhpfv[indx+2]+rbhpfv[indx-2]) );//*(grblpfv[indx-v2]+grblpfv[indx+v2])/(eps+0.1*grblpfv[indx-v2]+rblpfv[indx-v2]+0.1*grblpfv[indx+v2]+rblpfv[indx+v2]); + gradwt=fabs(0.25*rbhpfv[indx]+0.125*(rbhpfv[indx+2]+rbhpfv[indx-2]) );// *(grblpfv[indx-v2]+grblpfv[indx+v2])/(eps+0.1*grblpfv[indx-v2]+rblpfv[indx-v2]+0.1*grblpfv[indx+v2]+rblpfv[indx+v2]); if (gradwt>eps) { coeff[0][0][c] += gradwt*deltgrb*deltgrb; coeff[0][1][c] += gradwt*gdiff*deltgrb; @@ -477,7 +477,7 @@ void RawImageSource::CA_correct_RT(double cared, double cablue) { gdiff=0.3125*(rgb[indx+1][1]-rgb[indx-1][1])+0.09375*(rgb[indx+1+TS][1]-rgb[indx-1+TS][1]+rgb[indx+1-TS][1]-rgb[indx-1-TS][1]); deltgrb=(rgb[indx][c]-rgb[indx][1])-0.5*((rgb[indx-4][c]-rgb[indx-4][1])+(rgb[indx+4][c]-rgb[indx+4][1])); - gradwt=fabs(0.25*rbhpfh[indx]+0.125*(rbhpfh[indx+v2]+rbhpfh[indx-v2]) );//*(grblpfh[indx-2]+grblpfh[indx+2])/(eps+0.1*grblpfh[indx-2]+rblpfh[indx-2]+0.1*grblpfh[indx+2]+rblpfh[indx+2]); + gradwt=fabs(0.25*rbhpfh[indx]+0.125*(rbhpfh[indx+v2]+rbhpfh[indx-v2]) );// *(grblpfh[indx-2]+grblpfh[indx+2])/(eps+0.1*grblpfh[indx-2]+rblpfh[indx-2]+0.1*grblpfh[indx+2]+rblpfh[indx+2]); if (gradwt>eps) { coeff[1][0][c] += gradwt*deltgrb*deltgrb; coeff[1][1][c] += gradwt*gdiff*deltgrb; diff --git a/rtengine/array2D.h b/rtengine/array2D.h index d0ebbf471..c79d4b5b5 100644 --- a/rtengine/array2D.h +++ b/rtengine/array2D.h @@ -156,7 +156,7 @@ public: } // use with indices - T * operator[](size_t index) { + T * operator[](int index) { assert(index & operator[](size_t index) { - if (index >= num) { - printf("index %zu is out of range[0..%zu]", index, num - 1); + array2D & operator[](int index) { + if (static_cast(index) >= num) { + printf("index %0u is out of range[0..%0u]", index, num - 1); raise( SIGSEGV); } return list[index];