From 076abcb66830d11f0f89267eb687c996f4933962 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Tue, 1 Jun 2021 22:20:42 -0400 Subject: [PATCH] Fixed a few test app type conversions that Visual Studio complains about. --- test/graywin.c | 2 +- test/testdyngl.c | 8 ++++---- test/testoverlay.c | 16 ++++++++-------- test/testoverlay2.c | 20 ++++++++++---------- test/testsprite.c | 6 +++--- 5 files changed, 26 insertions(+), 26 deletions(-) diff --git a/test/graywin.c b/test/graywin.c index 456311496..c1f8a5dd3 100644 --- a/test/graywin.c +++ b/test/graywin.c @@ -24,7 +24,7 @@ void DrawBox(SDL_Surface *screen, int X, int Y, int width, int height) /* Seed the random number generator */ if ( seeded == 0 ) { - srand(time(NULL)); + srand((unsigned int) time(NULL)); seeded = 1; } diff --git a/test/testdyngl.c b/test/testdyngl.c index a20bd1a48..538b47fcb 100644 --- a/test/testdyngl.c +++ b/test/testdyngl.c @@ -138,9 +138,9 @@ int main(int argc,char *argv[]) for(i=0;iformat, 255, 0, 0); SDL_Rect r; - r.x = (sin((float)t * 2 * 3.1459) + 1.0) / 2.0 * (screen->w-20); + r.x = (Sint16) ((sin((float)t * 2 * 3.1459) + 1.0) / 2.0 * (screen->w-20)); r.y = 0; r.w = 20; r.h = screen->h; @@ -137,7 +137,7 @@ Uint32 FastestFlags(Uint32 flags, int width, int height, int bpp) /* Direct hardware blitting without double-buffering causes really bad flickering. */ - if ( info->video_mem*1024 > (height*width*bpp/8) ) { + if ( info->video_mem*1024 > ((Uint32)(height*width*bpp/8)) ) { flags |= SDL_DOUBLEBUF; } else { flags &= ~SDL_HWSURFACE; @@ -239,7 +239,7 @@ int main(int argc, char *argv[]) sprite_rects += numsprites; sprite_w = sprite->w; sprite_h = sprite->h; - srand(time(NULL)); + srand((unsigned int) time(NULL)); for ( i=0; iw - sprite_w); positions[i].y = rand()%(screen->h - sprite_h);