From b033314bf1901d436dc71d41d5e1f37dda47e511 Mon Sep 17 00:00:00 2001 From: Anton Kling Date: Thu, 12 Dec 2024 16:03:08 +0100 Subject: formatting: Use clang-format on all projects This commit also add braces to all `if` statements. --- userland/irc/Makefile | 14 +++++--------- userland/irc/sv.c | 2 +- 2 files changed, 6 insertions(+), 10 deletions(-) (limited to 'userland/irc') diff --git a/userland/irc/Makefile b/userland/irc/Makefile index c5f0c3d..835a7ee 100644 --- a/userland/irc/Makefile +++ b/userland/irc/Makefile @@ -2,20 +2,16 @@ CC="i686-sb-gcc" CFLAGS = -ggdb -O2 -Wall -Wextra -Werror -Wno-pointer-sign -Wno-int-conversion -static LIB=-L../libgui -lgui INC=-I../libgui +OBJS=sb.o sv.o irc.o BINS=irc all: $(BINS) -sb.o: sb.c +%.o: %.c + clang-format -i $< $(CC) $(CFLAGS) $(INC) $(LIB) -o $@ -c $< -sv.o: sv.c - $(CC) $(CFLAGS) $(INC) $(LIB) -o $@ -c $< - -irc.o: irc.c - $(CC) $(CFLAGS) $(INC) $(LIB) -o $@ -c $< - -irc: irc.o sb.o sv.o +irc: $(OBJS) $(CC) $(CFLAGS) -o $@ $^ $(LIB) clean: - rm $(BINS) *.o + rm $(BINS) $(OBJS) diff --git a/userland/irc/sv.c b/userland/irc/sv.c index c29d082..76d48d6 100644 --- a/userland/irc/sv.c +++ b/userland/irc/sv.c @@ -1,7 +1,7 @@ #include "sv.h" +#include #include #include -#include char *SV_TO_C(struct sv s) { char *c_string = malloc(s.length + 1); -- cgit v1.2.3