Enable -Werror in CI

And fixes some warnings.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui 2018-12-19 23:41:58 +00:00
parent 9d115a1cc2
commit 8bc052929e
No known key found for this signature in database
GPG Key ID: 37C999F617EA1A47
3 changed files with 4 additions and 5 deletions

View File

@ -25,7 +25,7 @@ jobs:
- ".git" - ".git"
- run: - run:
name: config name: config
command: meson << parameters.build-config >> . build command: meson << parameters.build-config >> -Dwerror=true . build
- run: - run:
name: build name: build
command: ninja -C build command: ninja -C build

View File

@ -23,7 +23,7 @@
* center +-----+-------------------+-----+ * center +-----+-------------------+-----+
*/ */
double attr_const attr_pure sum_kernel(const conv *map, int x, int y, int width, double sum_kernel(const conv *map, int x, int y, int width,
int height) { int height) {
int fx, fy; int fx, fy;
const double *g_data; const double *g_data;
@ -77,7 +77,7 @@ double attr_const attr_pure sum_kernel(const conv *map, int x, int y, int width,
return v; return v;
} }
static double attr_const attr_pure gaussian(double r, double x, double y) { static double attr_const gaussian(double r, double x, double y) {
// Formula can be found here: // Formula can be found here:
// https://en.wikipedia.org/wiki/Gaussian_blur#Mathematics // https://en.wikipedia.org/wiki/Gaussian_blur#Mathematics
// Except a special case for r == 0 to produce sharp shadows // Except a special case for r == 0 to produce sharp shadows

View File

@ -13,8 +13,7 @@ typedef struct conv {
/// Calculate the sum of a rectangle part of the convolution kernel /// Calculate the sum of a rectangle part of the convolution kernel
/// the rectangle is defined by top left (x, y), and a size (width x height) /// the rectangle is defined by top left (x, y), and a size (width x height)
double attr_const attr_pure sum_kernel(const conv *map, int x, int y, int width, double attr_const sum_kernel(const conv *map, int x, int y, int width, int height);
int height);
/// Create a kernel with gaussian distribution of radius r /// Create a kernel with gaussian distribution of radius r
conv *gaussian_kernel(double r); conv *gaussian_kernel(double r);