Merge everything from upstream except PR i3#280

This commit is contained in:
Raymond Li 2020-07-18 21:59:04 -04:00
parent b5724ab6d2
commit 79a9eacaed
No known key found for this signature in database
GPG Key ID: A014EA89B62BBB1B
6 changed files with 13 additions and 15 deletions

View File

@ -8,3 +8,4 @@ IndentWidth: 4
PointerBindsToType: false
ColumnLimit: 0
SpaceBeforeParens: ControlStatements
SortIncludes: false

View File

@ -7,11 +7,7 @@ language: c
compiler:
- gcc
- clang
addons:
apt:
packages:
- clang-format-3.5
script:
- clang-format-3.5 -i *.[ch] && git diff --exit-code || (echo 'Code was not formatted using clang-format!'; false)
- docker build --pull --no-cache --rm -t=i3lock -f travis/Dockerfile .
- docker run -e CC=$CC -v $PWD:/usr/src:rw i3lock /bin/sh -c 'clang-format-9 -i *.[ch] && git diff --exit-code || (echo "Code was not formatted using clang-format!"; false)'
- docker run -e CC=$CC -v $PWD:/usr/src:rw i3lock /bin/sh -c 'autoreconf -fi && mkdir -p build && cd build && (../configure || (cat config.log; false)) && make -j V=1 CFLAGS="-Wformat -Wformat-security -Wextra -Wno-unused-parameter -Werror"'

View File

@ -66,6 +66,7 @@ AC_FUNC_FORK
AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
AC_FUNC_STRNLEN
AC_CHECK_FUNCS([atexit dup2 ftruncate getcwd gettimeofday localtime_r memchr memset mkdir rmdir setlocale socket strcasecmp strchr strdup strerror strncasecmp strndup strrchr strspn strstr strtol strtoul], , [AC_MSG_FAILURE([cannot find the $ac_func function, which i3lock requires])])
AC_CHECK_FUNCS([explicit_bzero])
# Checks for libraries.

View File

@ -18,7 +18,6 @@
#include <stdlib.h>
#include <pwd.h>
#include <sys/types.h>
#include <string.h>
#include <dirent.h>
#include <unistd.h>
#include <stdbool.h>
@ -29,7 +28,7 @@
#include <err.h>
#include <errno.h>
#include <assert.h>
#ifdef __OpenBSD__
#ifdef HAVE_EXPLICIT_BZERO
#include <bsd_auth.h>
#else
#include <security/pam_appl.h>
@ -45,7 +44,7 @@
#include <xkbcommon/xkbcommon-x11.h>
#include <cairo.h>
#include <cairo/cairo-xcb.h>
#ifdef __OpenBSD__
#ifdef HAVE_EXPLICIT_BZERO
#include <strings.h> /* explicit_bzero(3) */
#endif
#include <xcb/xcb_aux.h>
@ -906,7 +905,7 @@ static void process_xkb_event(xcb_generic_event_t *gevent) {
* and also redraw the image, if any.
*
*/
void handle_screen_resize(void) {
static void handle_screen_resize(void) {
xcb_get_geometry_cookie_t geomc;
xcb_get_geometry_reply_t *geom;
geomc = xcb_get_geometry(conn, screen->root);

View File

@ -8,10 +8,11 @@
* This is important because xautolock (for example) closes stdout/stderr by
* default, so just printing something to stdout will lead to the data ending
* up on the X11 socket (!). */
#define DEBUG(fmt, ...) \
do { \
if (debug_mode) \
printf("[i3lock-debug] " fmt, ##__VA_ARGS__); \
#define DEBUG(fmt, ...) \
do { \
if (debug_mode) { \
fprintf(stderr, "[i3lock-debug] " fmt, ##__VA_ARGS__); \
} \
} while (0)
#endif

View File

@ -11,7 +11,7 @@ RUN echo 'APT::Acquire::Retries "5";' > /etc/apt/apt.conf.d/80retry
# (3608 kB/s)). Hence, lets stick with httpredir.debian.org (default) for now.
# Install mk-build-deps (for installing the i3 build dependencies),
# clang and clang-format-3.8 (for checking formatting and building with clang),
# clang and clang-format-9 (for checking formatting and building with clang),
# lintian (for checking spelling errors),
# test suite dependencies (for running tests)
RUN apt-get update && \
@ -19,7 +19,7 @@ RUN apt-get update && \
build-essential clang git autoconf automake libxcb-randr0-dev pkg-config libpam0g-dev \
libcairo2-dev libxcb1-dev libxcb-dpms0-dev libxcb-image0-dev libxcb-util0-dev \
libxcb-xrm-dev libev-dev libxcb-xinerama0-dev libxcb-xkb-dev libxkbcommon-dev \
libxkbcommon-x11-dev && \
libxkbcommon-x11-dev clang-format-9 && \
rm -rf /var/lib/apt/lists/*
WORKDIR /usr/src