mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-04-05 07:09:32 +00:00
Fixed warning C26451: Arithmetic overflow: Using operator '+' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before calling operator '+' to avoid overflow (io.2).
This commit is contained in:
@@ -296,8 +296,8 @@ static void transformSurfaceRGBA(SDL_Surface *src, SDL_Surface *dst, int isin, i
|
||||
int y;
|
||||
for (y = 0; y < dst->h; y++) {
|
||||
int x;
|
||||
double src_x = (rect_dest->x + 0 + 0.5 - center->x);
|
||||
double src_y = (rect_dest->y + y + 0.5 - center->y);
|
||||
double src_x = ((double)rect_dest->x + 0 + 0.5 - center->x);
|
||||
double src_y = ((double)rect_dest->y + y + 0.5 - center->y);
|
||||
int sdx = (int)((icos * src_x - isin * src_y) + cx - fp_half);
|
||||
int sdy = (int)((isin * src_x + icos * src_y) + cy - fp_half);
|
||||
for (x = 0; x < dst->w; x++) {
|
||||
@@ -364,8 +364,8 @@ static void transformSurfaceRGBA(SDL_Surface *src, SDL_Surface *dst, int isin, i
|
||||
int y;
|
||||
for (y = 0; y < dst->h; y++) {
|
||||
int x;
|
||||
double src_x = (rect_dest->x + 0 + 0.5 - center->x);
|
||||
double src_y = (rect_dest->y + y + 0.5 - center->y);
|
||||
double src_x = ((double)rect_dest->x + 0 + 0.5 - center->x);
|
||||
double src_y = ((double)rect_dest->y + y + 0.5 - center->y);
|
||||
int sdx = (int)((icos * src_x - isin * src_y) + cx - fp_half);
|
||||
int sdy = (int)((isin * src_x + icos * src_y) + cy - fp_half);
|
||||
for (x = 0; x < dst->w; x++) {
|
||||
@@ -437,8 +437,8 @@ static void transformSurfaceY(SDL_Surface *src, SDL_Surface *dst, int isin, int
|
||||
*/
|
||||
for (y = 0; y < dst->h; y++) {
|
||||
int x;
|
||||
double src_x = (rect_dest->x + 0 + 0.5 - center->x);
|
||||
double src_y = (rect_dest->y + y + 0.5 - center->y);
|
||||
double src_x = ((double)rect_dest->x + 0 + 0.5 - center->x);
|
||||
double src_y = ((double)rect_dest->y + y + 0.5 - center->y);
|
||||
int sdx = (int)((icos * src_x - isin * src_y) + cx - fp_half);
|
||||
int sdy = (int)((isin * src_x + icos * src_y) + cy - fp_half);
|
||||
for (x = 0; x < dst->w; x++) {
|
||||
|
||||
Reference in New Issue
Block a user