From 8bc052929e9f90202eea0ac8f8e72ac69ce2c02b Mon Sep 17 00:00:00 2001 From: Yuxuan Shui Date: Wed, 19 Dec 2018 23:41:58 +0000 Subject: [PATCH] Enable -Werror in CI And fixes some warnings. Signed-off-by: Yuxuan Shui --- .circleci/config.yml | 2 +- src/kernel.c | 4 ++-- src/kernel.h | 3 +-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7f2bedc..bae5d00 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -25,7 +25,7 @@ jobs: - ".git" - run: name: config - command: meson << parameters.build-config >> . build + command: meson << parameters.build-config >> -Dwerror=true . build - run: name: build command: ninja -C build diff --git a/src/kernel.c b/src/kernel.c index f816310..435857b 100644 --- a/src/kernel.c +++ b/src/kernel.c @@ -23,7 +23,7 @@ * 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 fx, fy; 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; } -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: // https://en.wikipedia.org/wiki/Gaussian_blur#Mathematics // Except a special case for r == 0 to produce sharp shadows diff --git a/src/kernel.h b/src/kernel.h index fcc5ddf..7864619 100644 --- a/src/kernel.h +++ b/src/kernel.h @@ -13,8 +13,7 @@ typedef struct conv { /// 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) -double attr_const attr_pure sum_kernel(const conv *map, int x, int y, int width, - int height); +double attr_const sum_kernel(const conv *map, int x, int y, int width, int height); /// Create a kernel with gaussian distribution of radius r conv *gaussian_kernel(double r);