Add code format check

See alexbatalov/fallout2-ce#270
This commit is contained in:
Alexander Batalov 2023-05-20 08:57:13 +03:00
parent d40be3ad11
commit 7dcad05867
10 changed files with 19 additions and 10 deletions

View File

@ -31,6 +31,18 @@ jobs:
- name: cppcheck
run: cppcheck --std=c++17 src/
code-format:
name: Code format check
runs-on: ubuntu-latest
steps:
- name: Clone
uses: actions/checkout@v3
- name: clang-format
run: find src -type f -name \*.cc -o -name \*.h | xargs clang-format --dry-run --Werror
android:
name: Android

View File

@ -91,7 +91,7 @@ typedef enum AnimationType {
LAST_SF_DEATH_ANIM = ANIM_FALL_FRONT_BLOOD_SF,
} AnimationType;
#define FID_ANIM_TYPE(value) ((value) & 0xFF0000) >> 16
#define FID_ANIM_TYPE(value) ((value)&0xFF0000) >> 16
// Signature of animation callback accepting 2 parameters.
typedef int AnimationCallback(void*, void*);

View File

@ -16,8 +16,8 @@
#include "plib/gnw/gnw.h"
#include "plib/gnw/grbuf.h"
#include "plib/gnw/input.h"
#include "plib/gnw/svga.h"
#include "plib/gnw/rect.h"
#include "plib/gnw/svga.h"
namespace fallout {

View File

@ -421,7 +421,6 @@ static void endgame_exit()
win_delete(endgame_window);
win_delete(gEndgameEndingOverlay);
if (!endgame_mouse_state) {
mouse_hide();
}

View File

@ -19,12 +19,12 @@
#include "int/audiof.h"
#include "int/movie.h"
#include "platform_compat.h"
#include "pointer_registry.h"
#include "plib/db/db.h"
#include "plib/gnw/debug.h"
#include "plib/gnw/gnw.h"
#include "plib/gnw/input.h"
#include "plib/gnw/memory.h"
#include "pointer_registry.h"
namespace fallout {

View File

@ -29,7 +29,7 @@ enum {
OBJ_TYPE_COUNT,
};
#define FID_TYPE(value) ((value) & 0xF000000) >> 24
#define FID_TYPE(value) ((value)&0xF000000) >> 24
#define PID_TYPE(value) (value) >> 24
#define SID_TYPE(value) (value) >> 24

View File

@ -54,7 +54,7 @@ int roll_save(DB_FILE* stream)
return 0;
}
//0x49140C
// 0x49140C
int roll_load(DB_FILE* stream)
{
return 0;

View File

@ -642,7 +642,7 @@ int soundRewind(Sound* sound)
hr = audioEngineSoundBufferSetCurrentPosition(sound->soundBuffer, 0);
}
if (!hr ) {
if (!hr) {
soundErrorno = SOUND_UNKNOWN_ERROR;
return soundErrorno;
}

View File

@ -291,7 +291,7 @@ void compat_resolve_path(char* path)
#ifndef _WIN32
char* pch = path;
DIR *dir;
DIR* dir;
if (pch[0] == '/') {
dir = opendir("/");
pch++;

View File

@ -2214,7 +2214,6 @@ static int db_fill_hash_table(DB_DATABASE* database, const char* path)
} while (db_findnext(&find_data) != -1);
db_findclose(&find_data);
}
return 0;
@ -2785,7 +2784,6 @@ int db_freadUInt16(DB_FILE* stream, unsigned short* valuePtr)
return db_freadShort(stream, valuePtr);
}
int db_freadInt16(DB_FILE* stream, short* valuePtr)
{
unsigned short value;