Cleanup clang warnings. (#8546)

This commit is contained in:
Yossi Gottlieb 2021-02-24 10:10:02 +02:00 committed by GitHub
parent ae7d5bf617
commit d1b5767a82
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 3 deletions

View File

@ -21,7 +21,12 @@ NODEPS:=clean distclean
# Default settings # Default settings
STD=-pedantic -DREDIS_STATIC='' STD=-pedantic -DREDIS_STATIC=''
# Use -Wno-c11-extensions on clang, either where explicitly used or on
# platforms we can assume it's being used.
ifneq (,$(findstring clang,$(CC))) ifneq (,$(findstring clang,$(CC)))
STD+=-Wno-c11-extensions
else
ifneq (,$(findstring FreeBSD,$(uname_S))) ifneq (,$(findstring FreeBSD,$(uname_S)))
STD+=-Wno-c11-extensions STD+=-Wno-c11-extensions
endif endif

View File

@ -84,9 +84,9 @@ lwCanvas *lwDrawSchotter(int console_cols, int squares_per_row, int squares_per_
* rows. */ * rows. */
float angle = 0; float angle = 0;
if (y > 1) { if (y > 1) {
float r1 = (float)rand() / RAND_MAX / squares_per_col * y; float r1 = (float)rand() / (float) RAND_MAX / squares_per_col * y;
float r2 = (float)rand() / RAND_MAX / squares_per_col * y; float r2 = (float)rand() / (float) RAND_MAX / squares_per_col * y;
float r3 = (float)rand() / RAND_MAX / squares_per_col * y; float r3 = (float)rand() / (float) RAND_MAX / squares_per_col * y;
if (rand() % 2) r1 = -r1; if (rand() % 2) r1 = -r1;
if (rand() % 2) r2 = -r2; if (rand() % 2) r2 = -r2;
if (rand() % 2) r3 = -r3; if (rand() % 2) r3 = -r3;