Add clang-format and gitignore

This commit is contained in:
PedroEdiaz
2025-10-01 12:43:37 -06:00
parent 454c10bd99
commit 561652bc6a
4 changed files with 67 additions and 50 deletions

15
.clang-format Normal file
View File

@@ -0,0 +1,15 @@
# Tabs
UseTab: ForContinuationAndIndentation #ForIndentation
# Sized
TabWidth: 8
IndentWidth: 8
ContinuationIndentWidth: 8
# Column Limit
ColumnLimit: 80
# Functions
AllowAllArgumentsOnNextLine: false
# Allman
BreakBeforeBraces: Allman

2
.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
cdplayer
cdplayer.o

View File

@@ -9,3 +9,9 @@ CFLAGS = -Itinyalsa/include
$(BIN): $(OBJ) $(BIN): $(OBJ)
$(CC) $(OBJ) -o $(BIN) $(CC) $(OBJ) -o $(BIN)
fmt:
clang-format -i cdplayer.c
clean:
rm $(BIN) $(OBJ)

View File

@@ -1,9 +1,9 @@
#include <fcntl.h> #include <fcntl.h>
#include <unistd.h> #include <linux/cdrom.h>
#include <signal.h> #include <signal.h>
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <linux/cdrom.h>
#include <tinyalsa/pcm.h> #include <tinyalsa/pcm.h>
#include <unistd.h>
#define FRAMES 1 #define FRAMES 1
@@ -13,15 +13,9 @@
struct cdrom_read_audio sr; struct cdrom_read_audio sr;
void forward( int signum ) void forward(int signum) { sr.addr.lba += 3600; }
{
sr.addr.lba+=3600;
}
void backward( int signum ) void backward(int signum) { sr.addr.lba -= 3600; }
{
sr.addr.lba-=3600;
}
void weite_err(char *s) void weite_err(char *s)
{ {