Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sure that everything is Clang formatted #480

Closed
Closed
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
12 changes: 9 additions & 3 deletions .github/workflows/clang-format-check.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
name: clang-format Check
on: workflow_dispatch

on:
workflow_dispatch:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
formatting-check:
name: Formatting Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run clang-format style check for C/C++/Protobuf programs.
uses: jidicula/clang-format-action@v4.11.0
uses: jidicula/clang-format-action@v4.13.0
with:
clang-format-version: '18'
2 changes: 1 addition & 1 deletion 2dlib/font.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Descent 3
* Descent 3
* Copyright (C) 2024 Parallax Software
*
* This program is free software: you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion 2dlib/hardsurf.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Descent 3
* Descent 3
* Copyright (C) 2024 Parallax Software
*
* This program is free software: you can redistribute it and/or modify
Expand Down
32 changes: 16 additions & 16 deletions 2dlib/lib2d.h
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
/*
* Descent 3
* Copyright (C) 2024 Parallax Software
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
* Descent 3
* Copyright (C) 2024 Parallax Software
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

/* internal header to 2dlib

Expand Down
2 changes: 1 addition & 1 deletion 2dlib/memsurf.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Descent 3
* Descent 3
* Copyright (C) 2024 Parallax Software
*
* This program is free software: you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion 2dlib/pen.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Descent 3
* Descent 3
* Copyright (C) 2024 Parallax Software
*
* This program is free software: you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion 2dlib/pentext.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Descent 3
* Descent 3
* Copyright (C) 2024 Parallax Software
*
* This program is free software: you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion 2dlib/screen.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Descent 3
* Descent 3
* Copyright (C) 2024 Parallax Software
*
* This program is free software: you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion 2dlib/surface.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Descent 3
* Descent 3
* Copyright (C) 2024 Parallax Software
*
* This program is free software: you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion 2dlib/viewport.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Descent 3
* Descent 3
* Copyright (C) 2024 Parallax Software
*
* This program is free software: you can redistribute it and/or modify
Expand Down
38 changes: 18 additions & 20 deletions AudioEncode/encoder.cpp
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
/*
* Descent 3
* Copyright (C) 2024 Parallax Software
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
* Descent 3
* Copyright (C) 2024 Parallax Software
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include <cstdint>
#include <stdio.h>
Expand All @@ -38,7 +38,7 @@ int32_t aenc_ReadSamp(void *data) {
}

bool aenc_Compress(char *input_filename, char *output_filename, int *input_levels, int *input_samples, int *input_rate,
int *input_channels, float *input_factor, float *input_volscale) {
int *input_channels, float *input_factor, float *input_volscale) {
FILE *in, *out;
int32_t result;

Expand Down Expand Up @@ -114,9 +114,7 @@ bool aenc_Compress(char *input_filename, char *output_filename, int *input_level
} else if (!levels_set) {
unsigned subbands = (2048 / samples_per_subband) >> 1;

for (levels = 0; subbands; subbands >>= 1, ++levels)
{

for (levels = 0; subbands; subbands >>= 1, ++levels) {
}
}

Expand Down
174 changes: 87 additions & 87 deletions CMakePresets.json
Original file line number Diff line number Diff line change
@@ -1,89 +1,89 @@
{
"version": 3,
"configurePresets": [
{
"name": "defaults",
"hidden": true,
"binaryDir": "${sourceDir}/builds/${presetName}"
},
{
"name": "win",
"inherits": "defaults",
"generator": "Ninja Multi-Config",
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Windows"
},
"cacheVariables": {
"VCPKG_TARGET_TRIPLET": "x64-windows-static-md"
},
"architecture": {
"strategy": "external",
"value": "x64"
},
"toolchainFile": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
},
{
"name": "mac",
"inherits": "defaults",
"generator": "Ninja Multi-Config",
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Darwin"
}
},
{
"name": "linux",
"inherits": "defaults",
"generator": "Ninja Multi-Config",
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Linux"
}
}
],
"buildPresets": [
{
"name": "win",
"configurePreset": "win"
},
{
"name": "mac",
"configurePreset": "mac"
},
{
"name": "linux",
"configurePreset": "linux"
}
],
"testPresets": [
{
"name": "defaults",
"hidden": true,
"output": {
"outputOnFailure": true
}
},
{
"name": "win",
"inherits": "defaults",
"description": "Testing under Windows x64",
"configurePreset": "win"
},
{
"name": "mac",
"inherits": "defaults",
"description": "Testing under macOS",
"configurePreset": "mac"
},
{
"name": "linux",
"inherits": "defaults",
"description": "Testing under Linux",
"configurePreset": "linux"
}
]
"version": 3,
"configurePresets": [
{
"name": "defaults",
"hidden": true,
"binaryDir": "${sourceDir}/builds/${presetName}"
},
{
"name": "win",
"inherits": "defaults",
"generator": "Ninja Multi-Config",
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Windows"
},
"cacheVariables": {
"VCPKG_TARGET_TRIPLET": "x64-windows-static-md"
},
"architecture": {
"strategy": "external",
"value": "x64"
},
"toolchainFile": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
},
{
"name": "mac",
"inherits": "defaults",
"generator": "Ninja Multi-Config",
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Darwin"
}
},
{
"name": "linux",
"inherits": "defaults",
"generator": "Ninja Multi-Config",
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Linux"
}
}
],
"buildPresets": [
{
"name": "win",
"configurePreset": "win"
},
{
"name": "mac",
"configurePreset": "mac"
},
{
"name": "linux",
"configurePreset": "linux"
}
],
"testPresets": [
{
"name": "defaults",
"hidden": true,
"output": {
"outputOnFailure": true
}
},
{
"name": "win",
"inherits": "defaults",
"description": "Testing under Windows x64",
"configurePreset": "win"
},
{
"name": "mac",
"inherits": "defaults",
"description": "Testing under macOS",
"configurePreset": "mac"
},
{
"name": "linux",
"inherits": "defaults",
"description": "Testing under Linux",
"configurePreset": "linux"
}
]
}
28 changes: 14 additions & 14 deletions Descent3/AIGoal.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Descent 3
* Descent 3
* Copyright (C) 2024 Parallax Software
*
* This program is free software: you can redistribute it and/or modify
Expand Down Expand Up @@ -708,19 +708,19 @@ void GoalDoFrame(object *obj) {
if (!(cur_goal->flags & GF_HAS_PATH) || ai_info->path.num_paths == 0) {
GoalInitWanderAround(obj, cur_goal);
}
/*
else if ((cur_goal->flags & GF_HAS_PATH) && ai_info->path.num_paths != 0) {
vector *posp = &cur_goal->g_info.pos;
float dist = vm_VectorDistance(
&AIDynamicPath[ai_info->path.num_paths - 1].pos[ai_info->path.path_end_node[ai_info->path.num_paths - 1]],
posp);

if (dist > 5.0f) {
mprintf(0, "In wander path case for obj %d - %s....\n", OBJNUM(obj), Object_info[obj->id].name);
cur_goal->next_path_time = Gametime - 1.0f;
}
}
*/
/*
else if ((cur_goal->flags & GF_HAS_PATH) && ai_info->path.num_paths != 0) {
vector *posp = &cur_goal->g_info.pos;
float dist = vm_VectorDistance(
&AIDynamicPath[ai_info->path.num_paths - 1].pos[ai_info->path.path_end_node[ai_info->path.num_paths -
1]], posp);

if (dist > 5.0f) {
mprintf(0, "In wander path case for obj %d - %s....\n", OBJNUM(obj), Object_info[obj->id].name);
cur_goal->next_path_time = Gametime - 1.0f;
}
}
*/
}

if (OBJGOAL(cur_goal)) {
Expand Down
2 changes: 1 addition & 1 deletion Descent3/AIGoal.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Descent 3
* Descent 3
* Copyright (C) 2024 Parallax Software
*
* This program is free software: you can redistribute it and/or modify
Expand Down
Loading