I'm trying to clean up the warnings in my code. I have the following warning:
warning C4244: '=' : conversion from 'double' to 'int', possible loss of data
The concerning code follows:
CODE
int row, col;
int center = 511;
double sinval = sin(angle*pi/1800);
double cosval = cos(angle*pi/1800);
for (int hcounter = -511; hcounter <=511; hcounter++)
{
row = -hcounter*sinval + 511; //<------WARNING HERE
col = hcounter*cosval + center; //<------WARNING HERE
if ((row >= 0) && (row < height) && (col >= 0) && (col < width))
{
pixloc = row*width + col;
shade = frame[pixloc]*255/MAXPIXELVAL;
SetPixel (drawing_context,col+50,row+100, RGB(shade,shade,shade));
}
}
When i run my code i dont see anything unpredictable with the results (the int rounding from double is just fine). But I'd be interested in using some kind of conversion to eliminate the warning. Thx in advance!