Suppressing loads of GCC warning about automatic typecasting ambiguity

This commit is contained in:
natureh 2012-02-26 01:05:57 +01:00
parent d5cc52771b
commit c21fa69aea
2 changed files with 7 additions and 7 deletions

View File

@ -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;

View File

@ -156,7 +156,7 @@ public:
}
// use with indices
T * operator[](size_t index) {
T * operator[](int index) {
assert(index<y);
return ptr[index];
}
@ -252,7 +252,7 @@ private:
public:
multi_array2D(int x, int y, int flags = 0) {
for (int i = 0; i < num; i++)
for (size_t i = 0; i < num; i++)
list[i](x, y, flags);
}
@ -260,9 +260,9 @@ public:
//printf("trying to delete the list of array2D objects\n");
}
array2D<T> & operator[](size_t index) {
if (index >= num) {
printf("index %zu is out of range[0..%zu]", index, num - 1);
array2D<T> & operator[](int index) {
if (static_cast<size_t>(index) >= num) {
printf("index %0u is out of range[0..%0u]", index, num - 1);
raise( SIGSEGV);
}
return list[index];