[0.4.10][CYLFRAC] Fix 3 MSVC2010SP1 x86 dbg warnings C4305 CORE-18104
authorJoachim Henze <Joachim.Henze@reactos.org>
Thu, 31 Mar 2022 04:14:33 +0000 (06:14 +0200)
committerJoachim Henze <Joachim.Henze@reactos.org>
Thu, 31 Mar 2022 04:14:33 +0000 (06:14 +0200)
can be observed with MSVC 2010SP1 (16.0.40219.1) x86 target in dbg configuration:
C:\047rls\reactos\modules\rosapps\applications\screensavers\cylfrac\cylfrac.c(109) : warning C4305: 'function' : truncation from 'double' to 'float'
C:\047rls\reactos\modules\rosapps\applications\screensavers\cylfrac\cylfrac.c(110) : warning C4305: 'function' : truncation from 'double' to 'float'
C:\047rls\reactos\modules\rosapps\applications\screensavers\cylfrac\cylfrac.c(137) : warning C4305: 'initializing' : truncation from 'double' to 'GLfloat'

partial pick of 0.4.15-dev-2951-g 5d8e834897781944dcaf80de6c3df9c2c51212c7

modules/rosapps/applications/screensavers/cylfrac/cylfrac.c

index d72f638..1f89b5e 100644 (file)
@@ -106,8 +106,8 @@ void DrawScene(HWND hwnd, HDC dc, int ticks)
     angle += ticks * 0.01;
     colorh += ticks * 0.003;
     if (colorh > 360.0) colorh -= 360.0;
-    HLStoRGB(colorh, 1.0, 0.7, &rval, &gval, &bval);
-    DrawCylinder(lvls, angle, 0.2);
+    HLStoRGB(colorh, 1.0f, 0.7f, &rval, &gval, &bval);
+    DrawCylinder(lvls, angle, 0.2f);
     SwapBuffers(dc);
     EndPaint(hwnd, &ps);
 }
@@ -134,7 +134,7 @@ void MyPixelFormat(HDC dc)
 
 void InitGL(HWND hwnd)
 {
-    GLfloat lightpos[4] = {2.0, 2.0, -2.0, 0.7};
+    GLfloat lightpos[4] = {2.0f, 2.0f, -2.0f, 0.7f};
     GLfloat ca = 1.0;
     dc = GetDC(hwnd);
     MyPixelFormat(dc);