Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# .clang-format
# Second revision, highly tailored to minimize changes to the original C/C++ codebase.

Language: Cpp
# This configuration avoids "BasedOnStyle" to prevent inheriting unwanted defaults.

# --- Core Style Settings to Match Original ---

# 1. Indentation and Bracing
UseTab: Always
IndentWidth: 4
TabWidth: 4
BreakBeforeBraces: Allman
IndentCaseLabels: false # Critical: 'case' is not indented within 'switch' in original code.

# 2. Pointer Alignment
# Aligns pointers to the variable name (e.g., `char *ptr;`)
PointerAlignment: Right

# 3. Line Breaking and Wrapping
# Disable column limit to prevent unwanted line wrapping.
ColumnLimit: 120
# Prevent clang-format from merging lines.
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: true
AllowShortLoopsOnASingleLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false

# 4. Spacing
SpaceBeforeParens: ControlStatements

# 5. Includes
# Preserve manual grouping of includes.
SortIncludes: false

# --- Finer-grained Control to Reduce Diffs ---

# Prevent re-alignment of assignments and declarations.
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignTrailingComments: true
AlignOperands: false

# Control how function arguments/parameters are packed.
BinPackArguments: false
BinPackParameters: false

# Keep empty lines where they are.
KeepEmptyLinesAtTheStartOfBlocks: true
MaxEmptyLinesToKeep: 2

# C++ Specific
Standard: Latest

42 changes: 42 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# .gitignore for C/C++ projects built with Make

# --- Build artifacts ---
# Ignore the entire build directory created by the makefile.
/build/

# --- Executables ---
# Ignore all files in the binary output directory.
/build/bin/

# --- Object and Dependency Files ---
# Ignore all object files and dependency files.
*.o
*.d

# --- Common Editor/IDE files ---
# Visual Studio Code
.vscode/
# Vim
*.swp
*.swo
*~
# CLion
.idea/
# Eclipse
.cproject
.project
.settings/

# --- OS-specific files ---
# macOS
.DS_Store
# Windows
Thumbs.db
Desktop.ini

# --- Miscellaneous ---
# Ignore compiled executables that might be created in the root directory
*.exe
*.out
a.out

5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"files.associations": {
"cstdint": "cpp"
}
}
Loading