summaryrefslogtreecommitdiff
path: root/userland/irc
diff options
context:
space:
mode:
authorAnton Kling <anton@kling.gg>2024-12-12 16:03:08 +0100
committerAnton Kling <anton@kling.gg>2024-12-12 16:03:08 +0100
commitb033314bf1901d436dc71d41d5e1f37dda47e511 (patch)
tree120bd137888a7f96904a47af7d20422608ffe225 /userland/irc
parentdcbcdbdc5bcfb86eca05fb655e3bf009d89e39e0 (diff)
formatting: Use clang-format on all projects
This commit also add braces to all `if` statements.
Diffstat (limited to 'userland/irc')
-rw-r--r--userland/irc/Makefile14
-rw-r--r--userland/irc/sv.c2
2 files changed, 6 insertions, 10 deletions
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 <ctype.h>
#include <stdlib.h>
#include <string.h>
-#include <ctype.h>
char *SV_TO_C(struct sv s) {
char *c_string = malloc(s.length + 1);