summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Zabka <zabkaste@hu-berlin.de>2020-04-29 18:20:55 +0200
committerStefan Zabka <zabkaste@hu-berlin.de>2020-04-29 18:20:55 +0200
commit5b4ed0301c3b2786ef6043e0c48e49eca368c692 (patch)
tree22f338f86004ff428290812339d4dd4a00b88861
parenta72be9093d5d261822ede23a2072fc57f78331a3 (diff)
downloadbetriebssysteme-5b4ed0301c3b2786ef6043e0c48e49eca368c692.tar.gz
betriebssysteme-5b4ed0301c3b2786ef6043e0c48e49eca368c692.zip
clang-format now runs in makefile
-rw-r--r--01_exercise/Makefile1
-rw-r--r--01_exercise/bootloader.c8
2 files changed, 4 insertions, 5 deletions
diff --git a/01_exercise/Makefile b/01_exercise/Makefile
index 4bf8198..3576c2b 100644
--- a/01_exercise/Makefile
+++ b/01_exercise/Makefile
@@ -8,6 +8,7 @@ CFLAGS = -m32 -c -Os -march=i686 -ffreestanding -Wall -Werror
LFLAGS = -m elf_i386 -static -Tlinker.ld -nostdlib --nmagic
%.o: %.c
+ clang-format -i $^
$(CC) $(CFLAGS) $^ -o $@
%.elf: %.o
diff --git a/01_exercise/bootloader.c b/01_exercise/bootloader.c
index fe2d829..faede85 100644
--- a/01_exercise/bootloader.c
+++ b/01_exercise/bootloader.c
@@ -17,14 +17,12 @@ void put(char c) {
// clang-format on
}
-char WRITE_STRING = 0x13;
-
-void print(char const * const str) {
- for(int i = 0; str[i] != '\0'; ++i ) {
+void print(char const *const str) {
+ for (int i = 0; str[i] != '\0'; ++i) {
put(str[i]);
}
}
void main(void) {
- print("Hello!");
+ print("Hello!");
}