Add clang format (#270)

This commit is contained in:
Vasilii Rogin 2023-04-26 15:35:02 +03:00 committed by GitHub
parent 81c3ff9b1a
commit 63d8300c61
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 49 additions and 37 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 -exec clang-format --dry-run --Werror {} \;
android:
name: Android

View File

@ -92,7 +92,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* a1, void* a2);

View File

@ -1026,24 +1026,24 @@ static void buildNormalizedQwertyKeys()
keys[SDL_SCANCODE_F13] = -1;
keys[SDL_SCANCODE_F14] = -1;
keys[SDL_SCANCODE_F15] = -1;
//keys[DIK_KANA] = -1;
//keys[DIK_CONVERT] = -1;
//keys[DIK_NOCONVERT] = -1;
//keys[DIK_YEN] = -1;
// keys[DIK_KANA] = -1;
// keys[DIK_CONVERT] = -1;
// keys[DIK_NOCONVERT] = -1;
// keys[DIK_YEN] = -1;
keys[SDL_SCANCODE_KP_EQUALS] = -1;
//keys[DIK_PREVTRACK] = -1;
//keys[DIK_AT] = -1;
//keys[DIK_COLON] = -1;
//keys[DIK_UNDERLINE] = -1;
//keys[DIK_KANJI] = -1;
// keys[DIK_PREVTRACK] = -1;
// keys[DIK_AT] = -1;
// keys[DIK_COLON] = -1;
// keys[DIK_UNDERLINE] = -1;
// keys[DIK_KANJI] = -1;
keys[SDL_SCANCODE_STOP] = -1;
//keys[DIK_AX] = -1;
//keys[DIK_UNLABELED] = -1;
// keys[DIK_AX] = -1;
// keys[DIK_UNLABELED] = -1;
keys[SDL_SCANCODE_KP_ENTER] = SDL_SCANCODE_KP_ENTER;
keys[SDL_SCANCODE_RCTRL] = SDL_SCANCODE_RCTRL;
keys[SDL_SCANCODE_KP_COMMA] = -1;
keys[SDL_SCANCODE_KP_DIVIDE] = SDL_SCANCODE_KP_DIVIDE;
//keys[DIK_SYSRQ] = 84;
// keys[DIK_SYSRQ] = 84;
keys[SDL_SCANCODE_RALT] = SDL_SCANCODE_RALT;
keys[SDL_SCANCODE_HOME] = SDL_SCANCODE_HOME;
keys[SDL_SCANCODE_UP] = SDL_SCANCODE_UP;

View File

@ -1400,11 +1400,11 @@ static void keyboardBuildFrenchConfiguration()
gLogicalKeyEntries[SDL_SCANCODE_BACKSLASH].rmenu = -1;
gLogicalKeyEntries[SDL_SCANCODE_BACKSLASH].ctrl = -1;
//gLogicalKeyEntries[DIK_OEM_102].unmodified = KEY_LESS;
//gLogicalKeyEntries[DIK_OEM_102].shift = KEY_GREATER;
//gLogicalKeyEntries[DIK_OEM_102].lmenu = -1;
//gLogicalKeyEntries[DIK_OEM_102].rmenu = -1;
//gLogicalKeyEntries[DIK_OEM_102].ctrl = -1;
// gLogicalKeyEntries[DIK_OEM_102].unmodified = KEY_LESS;
// gLogicalKeyEntries[DIK_OEM_102].shift = KEY_GREATER;
// gLogicalKeyEntries[DIK_OEM_102].lmenu = -1;
// gLogicalKeyEntries[DIK_OEM_102].rmenu = -1;
// gLogicalKeyEntries[DIK_OEM_102].ctrl = -1;
switch (gKeyboardLayout) {
case KEYBOARD_LAYOUT_QWERTY:
@ -1583,11 +1583,11 @@ static void keyboardBuildGermanConfiguration()
gLogicalKeyEntries[SDL_SCANCODE_BACKSLASH].rmenu = -1;
gLogicalKeyEntries[SDL_SCANCODE_BACKSLASH].ctrl = -1;
//gLogicalKeyEntries[DIK_OEM_102].unmodified = KEY_LESS;
//gLogicalKeyEntries[DIK_OEM_102].shift = KEY_GREATER;
//gLogicalKeyEntries[DIK_OEM_102].lmenu = -1;
//gLogicalKeyEntries[DIK_OEM_102].rmenu = KEY_166;
//gLogicalKeyEntries[DIK_OEM_102].ctrl = -1;
// gLogicalKeyEntries[DIK_OEM_102].unmodified = KEY_LESS;
// gLogicalKeyEntries[DIK_OEM_102].shift = KEY_GREATER;
// gLogicalKeyEntries[DIK_OEM_102].lmenu = -1;
// gLogicalKeyEntries[DIK_OEM_102].rmenu = KEY_166;
// gLogicalKeyEntries[DIK_OEM_102].ctrl = -1;
switch (gKeyboardLayout) {
case KEYBOARD_LAYOUT_FRENCH:
@ -1684,11 +1684,11 @@ static void keyboardBuildItalianConfiguration()
gLogicalKeyEntries[SDL_SCANCODE_GRAVE].rmenu = -1;
gLogicalKeyEntries[SDL_SCANCODE_GRAVE].ctrl = -1;
//gLogicalKeyEntries[DIK_OEM_102].unmodified = KEY_LESS;
//gLogicalKeyEntries[DIK_OEM_102].shift = KEY_GREATER;
//gLogicalKeyEntries[DIK_OEM_102].lmenu = -1;
//gLogicalKeyEntries[DIK_OEM_102].rmenu = -1;
//gLogicalKeyEntries[DIK_OEM_102].ctrl = -1;
// gLogicalKeyEntries[DIK_OEM_102].unmodified = KEY_LESS;
// gLogicalKeyEntries[DIK_OEM_102].shift = KEY_GREATER;
// gLogicalKeyEntries[DIK_OEM_102].lmenu = -1;
// gLogicalKeyEntries[DIK_OEM_102].rmenu = -1;
// gLogicalKeyEntries[DIK_OEM_102].ctrl = -1;
gLogicalKeyEntries[SDL_SCANCODE_1].unmodified = KEY_1;
gLogicalKeyEntries[SDL_SCANCODE_1].shift = KEY_EXCLAMATION;
@ -1896,11 +1896,11 @@ static void keyboardBuildSpanishConfiguration()
gLogicalKeyEntries[SDL_SCANCODE_RIGHTBRACKET].rmenu = KEY_BRACKET_RIGHT;
gLogicalKeyEntries[SDL_SCANCODE_RIGHTBRACKET].ctrl = -1;
//gLogicalKeyEntries[DIK_OEM_102].unmodified = KEY_LESS;
//gLogicalKeyEntries[DIK_OEM_102].shift = KEY_GREATER;
//gLogicalKeyEntries[DIK_OEM_102].lmenu = -1;
//gLogicalKeyEntries[DIK_OEM_102].rmenu = -1;
//gLogicalKeyEntries[DIK_OEM_102].ctrl = -1;
// gLogicalKeyEntries[DIK_OEM_102].unmodified = KEY_LESS;
// gLogicalKeyEntries[DIK_OEM_102].shift = KEY_GREATER;
// gLogicalKeyEntries[DIK_OEM_102].lmenu = -1;
// gLogicalKeyEntries[DIK_OEM_102].rmenu = -1;
// gLogicalKeyEntries[DIK_OEM_102].ctrl = -1;
gLogicalKeyEntries[SDL_SCANCODE_SEMICOLON].unmodified = KEY_241;
gLogicalKeyEntries[SDL_SCANCODE_SEMICOLON].shift = KEY_209;

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