Skip to content
Merged
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
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
45 changes: 45 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: "CodeQL"
run-name: CodeQL
on:
push:
branches:
- 'master'
pull_request:
types:
- edited
- opened
- synchronize
concurrency:
# Cancel concurrent workflows for the same PR or commit hash.
group: ${{github.workflow}}-${{github.event_name == 'pull_request' && github.head_ref || github.sha}}
cancel-in-progress: true
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
security-events: write
packages: read
actions: read
contents: read

strategy:
fail-fast: false
matrix:
include:
- language: actions
build-mode: none
- language: c-cpp
build-mode: autobuild
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4
with:
category: "/language:${{ matrix.language }}"
24 changes: 21 additions & 3 deletions .github/workflows/linux_aarch64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,23 @@ concurrency:
cancel-in-progress: true
jobs:
build_ubuntu_aarch64:
runs-on: ubuntu-22.04-arm
runs-on: ubuntu-24.04-arm
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
include:
- env: ubuntu
steps:
- name: Install build dependencies
run: |
sudo apt update
sudo apt install build-essential snapd
- name: Check out repository code
uses: actions/checkout@v4
uses: actions/checkout@v6
- name: Build
run: |
# Public runners come with 4 CPUs.
Expand All @@ -38,8 +46,18 @@ jobs:
cp LICENSE publish/quake2-ctf-linux_aarch64-${{github.sha}}/misc/docs/LICENSE.txt
cp README.md publish/quake2-ctf-linux_aarch64-${{github.sha}}/misc/docs/README.txt
- name: Upload testbuild package
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
with:
name: quake2-ctf-linux_aarch64-${{github.sha}}
path: publish/
if-no-files-found: error
- name: Run Cppcheck
run: |
sudo snap install cppcheck --edge
/snap/bin/cppcheck -j 4 --enable=all --output-format=sarif \
--output-file=cppcheck_results.sarif --inconclusive --library=posix \
-DYQ2OSTYPE=\"Linux\" src
- name: Upload SARIF to GitHub Code Scanning
uses: github/codeql-action/upload-sarif@v4
with:
sarif_file: cppcheck_results.sarif
13 changes: 10 additions & 3 deletions .github/workflows/linux_x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,22 @@ concurrency:
cancel-in-progress: true
jobs:
build_ubuntu_x86_64:
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
strategy:
fail-fast: false
matrix:
include:
- env: ubuntu
steps:
- name: Install build dependencies
run: |
sudo apt update
sudo apt install build-essential
- name: Check out repository code
uses: actions/checkout@v4
uses: actions/checkout@v6
- name: Build
run: |
# Public runners come with 4 CPUs.
Expand All @@ -38,7 +45,7 @@ jobs:
cp LICENSE publish/quake2-ctf-linux_x86_64-${{github.sha}}/misc/docs/LICENSE.txt
cp README.md publish/quake2-ctf-linux_x86_64-${{github.sha}}/misc/docs/README.txt
- name: Upload testbuild package
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
with:
name: quake2-ctf-linux_x86_64-${{github.sha}}
path: publish/
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ concurrency:
jobs:
build_macos_aarch64:
runs-on: macos-latest
permissions:
actions: read
contents: read
strategy:
fail-fast: false
matrix:
Expand All @@ -27,7 +30,7 @@ jobs:
brew update
brew install make
- name: Check out repository code
uses: actions/checkout@v4
uses: actions/checkout@v6
- name: Build
run: |
# Public runners come with 3 CPUs.
Expand All @@ -42,7 +45,7 @@ jobs:
cp LICENSE publish/quake2-ctf-macos-${{github.sha}}/misc/docs/LICENSE.txt
cp README.md publish/quake2-ctf-macos-${{github.sha}}/misc/docs/README.txt
- name: Upload testbuild package
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
with:
name: quake2-ctf-macos-${{github.sha}}
path: publish/
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/win32.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ concurrency:
jobs:
build_mingw_x86_32:
runs-on: windows-latest
permissions:
actions: read
contents: read
strategy:
fail-fast: false
matrix:
Expand All @@ -32,7 +35,7 @@ jobs:
mingw-w64-${{matrix.env}}-gcc
mingw-w64-${{matrix.env}}-make
- name: Check out repository code
uses: actions/checkout@v4
uses: actions/checkout@v6
- name: Build
shell: msys2 {0}
run: |
Expand All @@ -49,7 +52,7 @@ jobs:
cp LICENSE publish/quake2-ctf-win32-${{github.sha}}/misc/docs/LICENSE.txt
cp README.md publish/quake2-ctf-win32-${{github.sha}}/misc/docs/README.txt
- name: Upload testbuild package
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
with:
name: quake2-ctf-win32-${{github.sha}}
path: publish/
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/win64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,16 @@ concurrency:
jobs:
build_mingw_x86_64:
runs-on: windows-latest
permissions:
actions: read
contents: read
strategy:
fail-fast: false
matrix:
include:
- { sys: mingw64, env: x86_64 }
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: msys2/setup-msys2@v2
with:
Expand All @@ -32,7 +37,7 @@ jobs:
mingw-w64-${{matrix.env}}-gcc
mingw-w64-${{matrix.env}}-make
- name: Check out repository code
uses: actions/checkout@v4
uses: actions/checkout@v6
- name: Build
shell: msys2 {0}
run: |
Expand All @@ -49,7 +54,7 @@ jobs:
cp LICENSE publish/quake2-ctf-win64-${{github.sha}}/misc/docs/LICENSE.txt
cp README.md publish/quake2-ctf-win64-${{github.sha}}/misc/docs/README.txt
- name: Upload testbuild package
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
with:
name: quake2-ctf-win64-${{github.sha}}
path: publish/
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ set(Ctf-Source
src/g_misc.c
src/g_monster.c
src/g_phys.c
src/g_save.c
src/savegame/savegame.c
src/g_spawn.c
src/g_svcmds.c
src/g_target.c
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ CTF_OBJS_ = \
src/g_misc.o \
src/g_monster.o \
src/g_phys.o \
src/g_save.o \
src/savegame/savegame.o \
src/g_spawn.o \
src/g_svcmds.o \
src/g_target.o \
Expand Down
23 changes: 12 additions & 11 deletions src/g_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,9 @@ ShutdownGame(void)
}

/*
=================
GetGameAPI

Returns a pointer to the structure with all entry points
and global variables
=================
*/
* Returns a pointer to the structure with
* all entry points and global variables
*/
Q2_DLL_EXPORTED game_export_t *
GetGameAPI(game_import_t *import)
{
Expand Down Expand Up @@ -145,7 +141,7 @@ GetGameAPI(game_import_t *import)
}

void
Sys_Error(char *error, ...)
Sys_Error(const char *error, ...)
{
va_list argptr;
char text[1024];
Expand All @@ -154,11 +150,11 @@ Sys_Error(char *error, ...)
vsprintf(text, error, argptr);
va_end(argptr);

gi.error(ERR_FATAL, "%s", text);
gi.error("%s", text);
}

void
Com_Printf(char *msg, ...)
Com_Printf(const char *msg, ...)
{
va_list argptr;
char text[1024];
Expand All @@ -179,7 +175,7 @@ ClientEndServerFrames(void)
edict_t *ent;

/* calc the player views now that all
pushing and damage has been added */
pushing and damage has been added */
for (i = 0; i < maxclients->value; i++)
{
ent = g_edicts + 1 + i;
Expand All @@ -201,6 +197,11 @@ CreateTargetChangeLevel(char *map)
{
edict_t *ent;

if (!map)
{
return NULL;
}

ent = G_Spawn();
ent->classname = "target_changelevel";
Com_sprintf(level.nextmap, sizeof(level.nextmap), "%s", map);
Expand Down
Loading