From c3d5fdc6fba10b7ab71bb5437f8fdad4b2038b3d Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Mon, 14 Oct 2024 15:51:39 +0200 Subject: m misc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- Makefile | 4 ++-- config.mk | 8 ++++---- coopgammad.c | 4 ++-- servers-coopgamma.c | 4 ++-- servers-crtc.c | 2 +- servers-kernel.c | 11 ++++++----- state.h | 4 ++-- types-ramps.c | 4 ++-- util.c | 4 ++-- 9 files changed, 23 insertions(+), 22 deletions(-) diff --git a/Makefile b/Makefile index 065ed9e..56f35d5 100644 --- a/Makefile +++ b/Makefile @@ -20,12 +20,12 @@ PARTS =\ types-message\ types-ring -OBJ = $(PARTS:=.o) coopgammad.c +OBJ = $(PARTS:=.o) coopgammad.o HDR = $(PARTS:=.h) arg.h all: coopgammad -$(OBJ): $(@:.o=.c) $(HDR) +$(OBJ): $(HDR) .c.o: $(CC) -c -o $@ $< $(XCPPFLAGS) $(CPPFLAGS) $(CFLAGS) diff --git a/config.mk b/config.mk index 9e65d09..e2d6dee 100644 --- a/config.mk +++ b/config.mk @@ -5,8 +5,8 @@ MANPREFIX = $(PREFIX)/share/man PKGNAME = coopgammad COMMAND = coopgammad -CC=cc +CC = cc -std=c11 -CPPFLAGS = -D_XOPEN_SOURCE=700 -D_GNU_SOURCE -DUSE_VALGRIND -CFLAGS = -std=c11 -Wall -Og -LDFLAGS = -lgamma -s +CPPFLAGS = -D_XOPEN_SOURCE=700 -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_GNU_SOURCE -DUSE_VALGRIND +CFLAGS = -Wall +LDFLAGS = -lgamma diff --git a/coopgammad.c b/coopgammad.c index ecf4619..8638679 100644 --- a/coopgammad.c +++ b/coopgammad.c @@ -166,7 +166,7 @@ GCC_ONLY(__attribute__((__nonnull__))) static int get_method(const char *restrict arg) { -#if LIBGAMMA_METHOD_MAX > 5 +#if LIBGAMMA_METHOD_COUNT > 6 # warning libgamma has added more adjustment methods #endif @@ -278,7 +278,7 @@ daemonise(int keep_stderr) fd = open(pidpath, O_WRONLY); if (fd < 0) goto fail; - if (dprintf(fd, "%llu\n", (unsigned long long)getpid()) < 0) + if (dprintf(fd, "%llu\n", (unsigned long long int)getpid()) < 0) goto fail; close(fd); fd = -1; diff --git a/servers-coopgamma.c b/servers-coopgamma.c index f14c0c4..42cd783 100644 --- a/servers-coopgamma.c +++ b/servers-coopgamma.c @@ -6,13 +6,13 @@ #include "util.h" #include "types-output.h" -#include - #include #include #include #include +#include + /** * Apply a filter on top of another filter diff --git a/servers-crtc.c b/servers-crtc.c index 24018e1..9171586 100644 --- a/servers-crtc.c +++ b/servers-crtc.c @@ -53,7 +53,7 @@ handle_enumerate_crtcs(size_t conn, const char *restrict message_id) * @return The name of the CRTC, `NULL` on error */ char * -get_crtc_name(const libgamma_crtc_information_t *restrict info, const libgamma_crtc_state_t *restrict crtc) +get_crtc_name(const struct libgamma_crtc_information *restrict info, const struct libgamma_crtc_state *restrict crtc) { char *name; if (!info->edid_error && info->edid) { diff --git a/servers-kernel.c b/servers-kernel.c index fd60aef..a5e3871 100644 --- a/servers-kernel.c +++ b/servers-kernel.c @@ -3,8 +3,6 @@ #include "state.h" #include "util.h" -#include - #include #include #include @@ -16,6 +14,8 @@ #include #include +#include + /** * Get the pathname of the runtime file @@ -29,6 +29,7 @@ get_pathname(const char *restrict suffix) { const char *restrict rundir = getenv("XDG_RUNTIME_DIR"); const char *restrict username = ""; + const char *const_name; char *name = NULL; char *p; char *restrict rc; @@ -39,8 +40,8 @@ get_pathname(const char *restrict suffix) name = memdup(sitename, strlen(sitename) + 1); if (!name) goto fail; - } else if ((name = libgamma_method_default_site(method))) { - name = memdup(name, strlen(name) + 1); + } else if ((const_name = libgamma_method_default_site(method))) { + name = memdup(const_name, strlen(const_name) + 1); if (!name) goto fail; } @@ -176,7 +177,7 @@ retry: goto bad; if ((size_t)(p - content) != n) goto bad; - sprintf(temp, "%llu\n", (unsigned long long)pid); + sprintf(temp, "%llu\n", (unsigned long long int)pid); if (strcmp(content, temp)) goto bad; free(content); diff --git a/state.h b/state.h index 6273bdb..a76eee2 100644 --- a/state.h +++ b/state.h @@ -6,11 +6,11 @@ #include "types-ring.h" #include "types-output.h" -#include - #include #include +#include + #ifndef GCC_ONLY # if defined(__GNUC__) && !defined(__clang__) # define GCC_ONLY(...) __VA_ARGS__ diff --git a/types-ramps.c b/types-ramps.c index a80f66b..87a3012 100644 --- a/types-ramps.c +++ b/types-ramps.c @@ -1,12 +1,12 @@ /* See LICENSE file for copyright and license details. */ #include "types-ramps.h" -#include - #include #include #include +#include + /** * The name of the process diff --git a/util.c b/util.c index a6a97a9..7daeb52 100644 --- a/util.c +++ b/util.c @@ -1,8 +1,6 @@ /* See LICENSE file for copyright and license details. */ #include "util.h" -#include - #include #include #include @@ -11,6 +9,8 @@ #include #include +#include + /** * Duplicate a memory segment -- cgit v1.2.3-70-g09d2