Skip to content

Commit 30f16f6

Browse files
committed
Clang formatted and repaired whitespaces
1 parent 871d287 commit 30f16f6

5 files changed

Lines changed: 34 additions & 35 deletions

File tree

include/debug/debug_stdio.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ void dprintf(char* (*handler)(const char*, void*, int), const char* fmt, ...);
1111
void dprintf(char* (*handler)(const char*, void*, int), const char* fmt, ...);
1212

1313
[[gnu::format(printf, 1, 2)]]
14-
void uprintf(const char *fmt, ...);
14+
void uprintf(const char* fmt, ...);
1515

1616
#ifndef NDEBUG
1717

include/drivers/console.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#ifndef CONSOLE_H
22
#define CONSOLE_H
33
int readline(void);
4-
int process_command(char *comm);
4+
int process_command(char* comm);
55
#endif

include/drivers/uart.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
#define UART_H
33
void init_uart(void);
44
void putc_uart(int c);
5-
void puts_uart(char *s);
5+
void puts_uart(char* s);
66
int getc_uart(void);
77
#endif

src/drivers/console.c

Lines changed: 30 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,43 @@
1-
#include <stdbigos/string.h>
21
#include <drivers/uart.h>
2+
#include <stdbigos/string.h>
33

4-
#define ENTER 0xd
5-
#define BACKSPACE 0x100
4+
#define ENTER 0xd
5+
#define BACKSPACE 0x100
66
#define BUFFER_SIZE 4096
77

88
char console_buffer[BUFFER_SIZE];
99

1010
int readline(void) {
11-
int console_read = 0;
12-
int c;
13-
while ((c = getc_uart()) != ENTER) {
14-
if (c == -1) continue;
11+
int console_read = 0;
12+
int c;
13+
while ((c = getc_uart()) != ENTER) {
14+
if (c == -1)
15+
continue;
1516

16-
if (c == '\x7f' || c == 8) {
17-
if (console_read != 0) {
18-
puts_uart("\b \b");
19-
console_read--;
20-
}
21-
}
22-
else if(console_read != BUFFER_SIZE - 1) {
23-
if(console_read < 0 || console_read >= BUFFER_SIZE)
24-
puts_uart("\nAssertion failed in readline!!\n");
17+
if (c == '\x7f' || c == 8) {
18+
if (console_read != 0) {
19+
puts_uart("\b \b");
20+
console_read--;
21+
}
22+
} else if (console_read != BUFFER_SIZE - 1) {
23+
if (console_read < 0 || console_read >= BUFFER_SIZE)
24+
puts_uart("\nAssertion failed in readline!!\n");
2525

26-
console_buffer[console_read] = c;
27-
console_read++;
28-
putc_uart(c);
29-
}
30-
}
31-
console_buffer[console_read] = '\0';
26+
console_buffer[console_read] = c;
27+
console_read++;
28+
putc_uart(c);
29+
}
30+
}
31+
console_buffer[console_read] = '\0';
3232

33-
return console_read;
33+
return console_read;
3434
}
3535

36-
int process_command(char *comm) {
37-
if (!strcmp(comm, "help")) {
38-
puts_uart("\nIt's only this lousy command for now mate");
39-
}
40-
else if (!strcmp(comm, "ping")) {
41-
puts_uart("\npong");
42-
}
43-
return 0;
36+
int process_command(char* comm) {
37+
if (!strcmp(comm, "help")) {
38+
puts_uart("\nIt's only this lousy command for now mate");
39+
} else if (!strcmp(comm, "ping")) {
40+
puts_uart("\npong");
41+
}
42+
return 0;
4443
}

src/example_dtree/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ target_link_libraries(example_dtree PRIVATE stdbigos)
1010
target_link_libraries(example_dtree PRIVATE drivers)
1111

1212
COMPILE_BINARY(example_dtree)
13-
ADD_QEMU_TARGET(example_dtree)
13+
ADD_QEMU_TARGET(example_dtree)

0 commit comments

Comments
 (0)