formatting: add .clang-format

This commit is contained in:
Alex Denes 2026-04-21 14:11:09 +00:00
parent a2d03cf618
commit 1feb41da8e
No known key found for this signature in database
GPG key ID: F92BA85F61F4C173
6 changed files with 415 additions and 294 deletions

14
util.c
View file

@ -1,21 +1,22 @@
/* See LICENSE.dwm file for copyright and license details. */
#include "util.h"
#include <fcntl.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include "util.h"
void
die(const char *fmt, ...) {
die(const char *fmt, ...)
{
va_list ap;
va_start(ap, fmt);
vfprintf(stderr, fmt, ap);
va_end(ap);
if (fmt[0] && fmt[strlen(fmt)-1] == ':') {
if (fmt[0] && fmt[strlen(fmt) - 1] == ':') {
fputc(' ', stderr);
perror(NULL);
} else {
@ -36,7 +37,8 @@ ecalloc(size_t nmemb, size_t size)
}
int
fd_set_nonblock(int fd) {
fd_set_nonblock(int fd)
{
int flags = fcntl(fd, F_GETFL);
if (flags < 0) {
perror("fcntl(F_GETFL):");