more C90 strictness; move dos stuff into a dosbox folder
This commit is contained in:
parent
9a6f8e16d5
commit
6cbe401022
25
.clang-tidy
Normal file
25
.clang-tidy
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
Checks: >
|
||||||
|
-*,
|
||||||
|
clang-diagnostic-*,
|
||||||
|
clang-analyzer-*,
|
||||||
|
readability-*,
|
||||||
|
-readability-identifier-length,
|
||||||
|
-readability-magic-numbers,
|
||||||
|
-readability-function-cognitive-complexity,
|
||||||
|
bugprone-*,
|
||||||
|
-bugprone-easily-swappable-parameters,
|
||||||
|
misc-*,
|
||||||
|
-misc-unused-parameters,
|
||||||
|
portability-*
|
||||||
|
|
||||||
|
WarningsAsErrors: ''
|
||||||
|
|
||||||
|
HeaderFilterRegex: '.*'
|
||||||
|
|
||||||
|
CheckOptions:
|
||||||
|
- key: readability-function-size.LineThreshold
|
||||||
|
value: '100'
|
||||||
|
- key: readability-function-size.StatementThreshold
|
||||||
|
value: '50'
|
||||||
|
|
||||||
|
FormatStyle: none
|
||||||
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,3 +1,4 @@
|
|||||||
.idea/
|
.idea/
|
||||||
build/
|
build/
|
||||||
cmake-build-debug/
|
cmake-build-debug/
|
||||||
|
cmake-build-release/
|
||||||
|
|||||||
@ -3,6 +3,7 @@ project(cordle C)
|
|||||||
|
|
||||||
set(CMAKE_C_STANDARD 90)
|
set(CMAKE_C_STANDARD 90)
|
||||||
set(CMAKE_C_STANDARD_REQUIRED ON)
|
set(CMAKE_C_STANDARD_REQUIRED ON)
|
||||||
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c90 -pedantic")
|
||||||
|
|
||||||
# Find ncurses library
|
# Find ncurses library
|
||||||
find_package(Curses REQUIRED)
|
find_package(Curses REQUIRED)
|
||||||
@ -27,5 +28,5 @@ target_link_libraries(cordle ${CURSES_LIBRARIES})
|
|||||||
|
|
||||||
# Set compiler flags for C90 compliance
|
# Set compiler flags for C90 compliance
|
||||||
if(CMAKE_C_COMPILER_ID MATCHES "GNU|Clang")
|
if(CMAKE_C_COMPILER_ID MATCHES "GNU|Clang")
|
||||||
target_compile_options(cordle PRIVATE -Wall -Wextra -pedantic)
|
target_compile_options(cordle PRIVATE -Wpedantic -Wextra -pedantic)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
6
build.sh
6
build.sh
@ -3,11 +3,15 @@
|
|||||||
mkdir -p build/cordle
|
mkdir -p build/cordle
|
||||||
|
|
||||||
echo "Building application."
|
echo "Building application."
|
||||||
gcc -std=c90 -pedantic -Wall -o build/cordle/cordle src/*.c -Iinclude -lncurses
|
gcc -v -std=c90 -pedantic -Wpedantic -o build/cordle/cordle src/*.c -Iinclude -lncurses > build/cordle-build.log 2>&1
|
||||||
export RESULT=$?
|
export RESULT=$?
|
||||||
|
|
||||||
if (( RESULT == 0 )); then
|
if (( RESULT == 0 )); then
|
||||||
echo "Compile successful. Copying wordlists..."
|
echo "Compile successful. Copying wordlists..."
|
||||||
cp -R wordlists build/cordle
|
cp -R wordlists build/cordle
|
||||||
echo "Build completed."
|
echo "Build completed."
|
||||||
|
rm build/cordle-build.log
|
||||||
|
else
|
||||||
|
echo "Something went wrong..."
|
||||||
|
cat build/cordle-build.log
|
||||||
fi
|
fi
|
||||||
|
|||||||
@ -76,7 +76,7 @@ void check_guess(GameState *game, const char *guess, int *colors) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* If still absent, mark letter as not in word */
|
/* If still absent, mark a letter as not in word */
|
||||||
if (colors[i] == COLOR_ABSENT) {
|
if (colors[i] == COLOR_ABSENT) {
|
||||||
if (game->letter_status[guess_copy[i] - 'A'] == STATUS_UNUSED) {
|
if (game->letter_status[guess_copy[i] - 'A'] == STATUS_UNUSED) {
|
||||||
game->letter_status[guess_copy[i] - 'A'] = STATUS_ABSENT;
|
game->letter_status[guess_copy[i] - 'A'] = STATUS_ABSENT;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user