diff options
author | Hoe Hao Cheng <haochengho12907@gmail.com> | 2023-02-17 22:00:13 +0800 |
---|---|---|
committer | Erik Faye-Lund <erik.faye-lund@collabora.com> | 2023-02-20 07:45:35 +0000 |
commit | 3fe8d403d83eb4c1a943beb789938174544f58e2 (patch) | |
tree | 57922dde5a2ceb09da1d50b194d3727ece25b8f3 | |
parent | 62b439042d68748226857b77b6fa428bd48f2a52 (diff) | |
download | mesa-demos-3fe8d403d83eb4c1a943beb789938174544f58e2.tar.gz |
demos: fix clang warnings on implicit conversions
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
-rw-r--r-- | src/demos/fbo_firecube.c | 2 | ||||
-rw-r--r-- | src/demos/fire.c | 2 | ||||
-rw-r--r-- | src/redbook/pickdepth.c | 4 | ||||
-rw-r--r-- | src/redbook/picksquare.c | 4 | ||||
-rw-r--r-- | src/redbook/select.c | 4 |
5 files changed, 8 insertions, 8 deletions
diff --git a/src/demos/fbo_firecube.c b/src/demos/fbo_firecube.c index c8e5d2bc..8464859f 100644 --- a/src/demos/fbo_firecube.c +++ b/src/demos/fbo_firecube.c @@ -255,7 +255,7 @@ static float beta = 90.0; static float vrnd(void) { - return (((float) rand()) / RAND_MAX); + return ((float) rand() / (float) RAND_MAX); } static void diff --git a/src/demos/fire.c b/src/demos/fire.c index 34fac440..b2dad65d 100644 --- a/src/demos/fire.c +++ b/src/demos/fire.c @@ -144,7 +144,7 @@ static float beta = 90.0; static float vrnd(void) { - return (((float) rand()) / RAND_MAX); + return ((float) rand() / (float) RAND_MAX); } static void diff --git a/src/redbook/pickdepth.c b/src/redbook/pickdepth.c index c510241e..91ccbaf5 100644 --- a/src/redbook/pickdepth.c +++ b/src/redbook/pickdepth.c @@ -112,9 +112,9 @@ processHits(GLint hits, GLuint buffer[]) names = *ptr; printf(" number of names for hit = %d\n", names); ptr++; - printf(" z1 is %g;", (float) *ptr/0xffffffff); + printf(" z1 is %g;", (float) *ptr / (float) 0xffffffff); ptr++; - printf(" z2 is %g\n", (float) *ptr/0xffffffff); + printf(" z2 is %g\n", (float) *ptr / (float) 0xffffffff); ptr++; printf(" the name is "); for (j = 0; j < names; j++) { /* for each name */ diff --git a/src/redbook/picksquare.c b/src/redbook/picksquare.c index e2f72b57..8bc08ed4 100644 --- a/src/redbook/picksquare.c +++ b/src/redbook/picksquare.c @@ -95,8 +95,8 @@ static void processHits (GLint hits, GLuint buffer[]) for (i = 0; i < hits; i++) { /* for each hit */ names = *ptr; printf (" number of names for this hit = %d\n", names); ptr++; - printf(" z1 is %g;", (float) *ptr/0x7fffffff); ptr++; - printf(" z2 is %g\n", (float) *ptr/0x7fffffff); ptr++; + printf(" z1 is %g;", (float) *ptr / (float) 0x7fffffff); ptr++; + printf(" z2 is %g\n", (float) *ptr / (float) 0x7fffffff); ptr++; printf (" names are "); for (j = 0; j < names; j++) { /* for each name */ printf ("%d ", *ptr); diff --git a/src/redbook/select.c b/src/redbook/select.c index ef03cf2c..1e2bcbc1 100644 --- a/src/redbook/select.c +++ b/src/redbook/select.c @@ -132,8 +132,8 @@ static void processHits (GLint hits, GLuint buffer[]) for (i = 0; i < hits; i++) { /* for each hit */ names = *ptr; printf (" number of names for hit = %d\n", names); ptr++; - printf(" z1 is %g;", (float) *ptr/0x7fffffff); ptr++; - printf(" z2 is %g\n", (float) *ptr/0x7fffffff); ptr++; + printf(" z1 is %g;", (float) *ptr / (float) 0x7fffffff); ptr++; + printf(" z2 is %g\n", (float) *ptr / (float) 0x7fffffff); ptr++; printf (" the name is "); for (j = 0; j < names; j++) { /* for each name */ printf ("%d ", *ptr); ptr++; |