Fix a compiler complaint

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui 2019-02-18 21:08:21 +00:00
parent 2a41847aa6
commit bb8fd08b5b
No known key found for this signature in database
GPG Key ID: 37C999F617EA1A47
2 changed files with 14 additions and 4 deletions

View File

@ -1153,17 +1153,19 @@ bool init_render(session_t *ps) {
// Blur filter // Blur filter
if (ps->o.blur_background || ps->o.blur_background_frame) { if (ps->o.blur_background || ps->o.blur_background_frame) {
bool ret; bool ret = false;
if (ps->o.backend == BKEND_GLX) { if (ps->o.backend == BKEND_GLX) {
#ifdef CONFIG_OPENGL #ifdef CONFIG_OPENGL
ret = glx_init_blur(ps); ret = glx_init_blur(ps);
#else #else
assert(false); assert(false);
#endif #endif
} else } else {
ret = xr_init_blur(ps); ret = xr_init_blur(ps);
if (!ret) }
return false; if (!ret) {
return ret;
}
} }
ps->gaussian_map = gaussian_kernel(ps->o.shadow_radius); ps->gaussian_map = gaussian_kernel(ps->o.shadow_radius);

View File

@ -9,6 +9,7 @@
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
#include <assert.h>
#include "compiler.h" #include "compiler.h"
@ -29,6 +30,13 @@ safe_isnan(double a) {
return isnan(a); return isnan(a);
} }
/// Same as assert false, but make sure we abort _even in release builds_.
/// Silence compiler warning caused by release builds making some code paths reachable.
attr_noret static inline void BUG(void) {
assert(false);
abort();
}
/** /**
* Normalize an int value to a specific range. * Normalize an int value to a specific range.
* *