Commit 67ce4384 authored by spiiroin's avatar spiiroin

[build] Silence compilation warnings

Do not use the same buffer for readlink() input and output.

Add missing "fall through" comments and tell gcc to be less
strict about wording / capitalization of existing ones.
Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
parent c34d8cd7
......@@ -262,6 +262,7 @@ CFLAGS += -Wstack-protector
#CFLAGS += -Werror (OBS build might have different compiler)
CFLAGS += -Wno-declaration-after-statement
CFLAGS += -Wno-missing-field-initializers
CFLAGS += -Wimplicit-fallthrough=2
# Linker
LDLIBS += -Wl,--as-needed
......
......@@ -2,7 +2,8 @@
* @file evdev.c
* Mode Control Entity - evdev input device handling
* <p>
* Copyright (C) 2012-2019 Jolla Ltd.
* Copyright (c) 2012 - 2020 Jolla Ltd.
* Copyright (c) 2020 Open Mobile Platform LLC.
* <p>
* @author Simo Piiroinen <simo.piiroinen@jollamobile.com>
*
......@@ -262,7 +263,8 @@ int evdev_identify_device(int fd)
unsigned long bmap_type[BMAP_SIZE(EV_CNT)];
unsigned long bmap_code[BMAP_SIZE(KEY_CNT)];
unsigned long bmap_stat[BMAP_SIZE(KEY_CNT)];
char path[256];
char linkpath[PATH_MAX];
char path[PATH_MAX];
int n;
if( fd < 0 )
......@@ -270,8 +272,8 @@ int evdev_identify_device(int fd)
goto cleanup;
}
snprintf(path, sizeof path, "/proc/self/fd/%d", fd);
if( (n = readlink(path, path, sizeof path - 1)) <= 0 )
snprintf(linkpath, sizeof linkpath, "/proc/self/fd/%d", fd);
if( (n = readlink(linkpath, path, sizeof path - 1)) <= 0 )
{
strcpy(path, "unknown");
}
......
......@@ -2,8 +2,9 @@
* @file event-input.c
* /dev/input event provider for the Mode Control Entity
* <p>
* Copyright © 2004-2011 Nokia Corporation and/or its subsidiary(-ies).
* Copyright (C) 2013-2019 Jolla Ltd.
* Copyright (c) 2004 - 2011 Nokia Corporation and/or its subsidiary(-ies).
* Copyright (c) 2013 - 2020 Jolla Ltd.
* Copyright (c) 2020 Open Mobile Platform LLC.
* <p>
* @author David Weinehall <david.weinehall@nokia.com>
* @author Ismo Laitinen <ismo.laitinen@nokia.com>
......@@ -3542,6 +3543,7 @@ evin_datapipe_display_state_curr_cb(gconstpointer data)
evin_input_grab_set_touching(&evin_ts_grab_state, true);
evin_input_grab_set_touching(&evin_ts_grab_state, false);
}
/* Fall through */
case MCE_DISPLAY_ON:
case MCE_DISPLAY_DIM:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment