mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-09 09:09:03 -04:00
[CMake] add -Wvla #2301
This commit is contained in:
parent
f6443e2152
commit
548b4e2729
@ -116,7 +116,7 @@ if(NOT WIN32)
|
||||
add_compile_definitions(_FORTIFY_SOURCE=2)
|
||||
add_compile_options(-Wformat -Werror=format-security)
|
||||
endif()
|
||||
add_compile_options(-Wall -Wextra -W -Wshadow)
|
||||
add_compile_options(-Wall -Wextra -W -Wshadow -Wvla)
|
||||
# -ffast-math dies on NaNs we draw from libav (by -ffinite-math-only)
|
||||
add_compile_options(-fno-signed-zeros -fno-trapping-math -fassociative-math)
|
||||
add_compile_options(-fno-math-errno -freciprocal-math -funsafe-math-optimizations)
|
||||
|
@ -16,8 +16,8 @@ wipebitmap(struct notcurses* nc){
|
||||
&cellpxy, &cellpxx, NULL, NULL);
|
||||
int pixy = cellpxy * 6;
|
||||
int pixx = cellpxx * 6;
|
||||
uint32_t pixels[pixx * pixy];
|
||||
memset(pixels, 0xff, sizeof(pixels));
|
||||
uint32_t* pixels = malloc(sizeof(*pixels) * pixx * pixy);
|
||||
memset(pixels, 0xff, sizeof(*pixels) * pixx * pixy);
|
||||
struct ncvisual* ncv = ncvisual_from_rgba(pixels,
|
||||
6 * cellpxy,
|
||||
6 * cellpxx * 4,
|
||||
@ -145,6 +145,7 @@ wipebitmap(struct notcurses* nc){
|
||||
ncvisual_destroy(ncve);
|
||||
ncvisual_destroy(ncv);
|
||||
ncplane_destroy(n);
|
||||
free(pixels);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user