meson: enable more compiler warnings

This commit is contained in:
emersion 2019-02-28 23:15:34 +01:00
parent 4135fafecd
commit 5445d8aad0
7 changed files with 34 additions and 21 deletions

View File

@ -440,7 +440,7 @@ static bool add_signal_matches(struct logind_session *session) {
int ret;
char str[256];
const char *fmt = "type='signal',"
const char fmt[] = "type='signal',"
"sender='org.freedesktop.login1',"
"interface='org.freedesktop.login1.%s',"
"member='%s',"

View File

@ -194,7 +194,7 @@ static void keyboard_handle_keymap(void *data, struct wl_keyboard *wl_keyboard,
// TODO: set keymap
}
static uint32_t get_current_time_msec() {
static uint32_t get_current_time_msec(void) {
struct timespec now;
clock_gettime(CLOCK_MONOTONIC, &now);
return now.tv_nsec / 1000;

View File

@ -176,7 +176,7 @@ static void timer_arm(unsigned seconds) {
}
}
static void do_updates() {
static void do_updates(void) {
printf("Update %d\n", update_stage);
switch (update_stage) {
case 0:
@ -240,7 +240,7 @@ static void do_updates() {
};
}
static void handle_timer() {
static void handle_timer(void) {
printf("Timer dispatched at %d\n", update_stage);
do_updates();
}

View File

@ -102,7 +102,7 @@ static size_t utf8_offset(char *utf8_str, size_t byte_offset) {
}
// TODO: would be nicer to have this text display inside the window
static void show_status() {
static void show_status(void) {
printf("State %d:", serial);
if (!enabled) {
printf(" disabled");

View File

@ -16,16 +16,31 @@ project(
# for a reference about clean library versioning.
so_version = ['1', '2', '0']
add_project_arguments(
[
'-DWLR_SRC_DIR="@0@"'.format(meson.current_source_dir()),
'-DWLR_USE_UNSTABLE',
add_project_arguments([
'-DWLR_SRC_DIR="@0@"'.format(meson.current_source_dir()),
'-DWLR_USE_UNSTABLE',
], language: 'c')
'-Wno-unused-parameter',
'-Wundef',
],
language: 'c',
)
cc = meson.get_compiler('c')
add_project_arguments(cc.get_supported_arguments([
'-Wundef',
'-Wlogical-op',
'-Wmissing-include-dirs',
'-Wold-style-definition',
'-Wpointer-arith',
'-Winit-self',
'-Wstrict-prototypes',
'-Wredundant-decls',
'-Wimplicit-fallthrough=2',
'-Wendif-labels',
'-Wstrict-aliasing=2',
'-Woverflow',
'-Wno-missing-braces',
'-Wno-missing-field-initializers',
'-Wno-unused-parameter',
]), language: 'c')
conf_data = configuration_data()
conf_data.set10('WLR_HAS_LIBCAP', false)
@ -38,8 +53,6 @@ conf_data.set10('WLR_HAS_XCB_ICCCM', false)
wlr_inc = include_directories('.', 'include')
cc = meson.get_compiler('c')
# Clang complains about some zeroed initializer lists (= {0}), even though they
# are valid
if cc.get_id() == 'clang'

View File

@ -312,7 +312,7 @@ static bool gles2_read_pixels(struct wlr_renderer *wlr_renderer,
glGetError(); // Clear the error flag
unsigned char *p = data + dst_y * stride;
unsigned char *p = (unsigned char *)data + dst_y * stride;
uint32_t pack_stride = width * fmt->bpp / 8;
if (pack_stride == stride && dst_x == 0 && flags != NULL) {
// Under these particular conditions, we can read the pixels with only

View File

@ -14,11 +14,11 @@
#include <wlr/util/log.h>
#include "sockets.h"
static const char *lock_fmt = "/tmp/.X%d-lock";
static const char *socket_dir = "/tmp/.X11-unix";
static const char *socket_fmt = "/tmp/.X11-unix/X%d";
static const char lock_fmt[] = "/tmp/.X%d-lock";
static const char socket_dir[] = "/tmp/.X11-unix";
static const char socket_fmt[] = "/tmp/.X11-unix/X%d";
#ifndef __linux__
static const char *socket_fmt2 = "/tmp/.X11-unix/X%d_";
static const char socket_fmt2[] = "/tmp/.X11-unix/X%d_";
#endif
bool set_cloexec(int fd, bool cloexec) {