From 8c7d91212021d55e48a321058c9ac8aea28ad042 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Tue, 1 Apr 2014 12:51:56 +0200 Subject: enable more warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- Makefile | 8 ++++++-- src/blueshift_drm_c.c | 2 +- src/blueshift_drm_c.h | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index bba7c92..707d284 100644 --- a/Makefile +++ b/Makefile @@ -49,9 +49,13 @@ PKGCONFIG ?= pkg-config OPTIMISE ?= -Og -g # Warnings settings for C code compilation WARN = -Wall -Wextra -pedantic -Wdouble-promotion -Wformat=2 -Winit-self -Wmissing-include-dirs \ - -Wtrampolines -Wfloat-equal -Wmissing-prototypes + -Wfloat-equal -Wmissing-prototypes -Wmissing-declarations -Wtrampolines -Wnested-externs \ + -Wno-variadic-macros -Wstrict-overflow -Wdeclaration-after-statement -Wundef -Wpacked \ + -Wbad-function-cast -Wwrite-strings -Wlogical-op -Wstrict-prototypes -Wold-style-definition \ + -Wvector-operation-performance -Wstack-protector -Wunsuffixed-float-constants -Wcast-align \ + -Wsync-nand -Wunsafe-loop-optimizations # Warnings violated by Cython and therefore excluded: (TODO) -# -Wswitch-default -Wshadow +# -Wshadow -Wredundant-decls -Winline -Wsign-conversion -Wcast-qual -Wpadded # The C standard for C code compilation STD = c99 LIBS_idcrtc = xcb-randr diff --git a/src/blueshift_drm_c.c b/src/blueshift_drm_c.c index 1d04f86..8888146 100644 --- a/src/blueshift_drm_c.c +++ b/src/blueshift_drm_c.c @@ -427,9 +427,9 @@ long blueshift_drm_get_edid(int connection, int connector_index, char* edid, lon drmModePropertyBlobRes* blob = drmModeGetPropertyBlob(fd, connector->prop_values[prop_i]); if (hexadecimal) { - rc += blob->length; uint32_t n = size / 2; uint32_t i; + rc += blob->length; if (n < blob->length) n = blob->length; for (i = 0; i < n ; i++) diff --git a/src/blueshift_drm_c.h b/src/blueshift_drm_c.h index 3a4f738..e2e3757 100644 --- a/src/blueshift_drm_c.h +++ b/src/blueshift_drm_c.h @@ -28,7 +28,7 @@ #include #ifndef O_CLOEXEC - #define O_CLOEXEC 02000000 +# define O_CLOEXEC 02000000 #endif /* Requires video group */ -- cgit v1.2.3-70-g09d2