From 6997e08b05c4c6e6d0111fed3f2da997c0137749 Mon Sep 17 00:00:00 2001 From: Quinn Date: Sun, 15 Jun 2025 14:29:28 +0200 Subject: [PATCH] add copyright information and code cleanup --- .clang-format | 2 ++ .editorconfig | 3 +++ .github/Dockerfile | 3 +++ .github/workflows/ci.yaml | 2 ++ .github/workflows/release.yaml | 2 ++ .gitignore | 3 +++ makefile | 3 +++ res/sh.frag.glsl | 3 +++ res/sh.geom.glsl | 3 +++ res/sh.vert.glsl | 3 +++ src/error.h | 10 +++++++--- src/io/window.c | 2 -- 12 files changed, 34 insertions(+), 5 deletions(-) diff --git a/.clang-format b/.clang-format index 998cb09..4619411 100644 --- a/.clang-format +++ b/.clang-format @@ -1,3 +1,5 @@ +# Copyright (c) 2025 Quinn +# Licensed under the MIT Licence. See LICENSE for details --- # --------------------------- # general style settings diff --git a/.editorconfig b/.editorconfig index 1135311..e0da6d9 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,3 +1,6 @@ +# Copyright (c) 2025 Quinn +# Licensed under the MIT Licence. See LICENSE for details + [*] charset = utf-8 end_of_line = lf diff --git a/.github/Dockerfile b/.github/Dockerfile index 2110e97..cccce6e 100644 --- a/.github/Dockerfile +++ b/.github/Dockerfile @@ -1,3 +1,6 @@ +# Copyright (c) 2025 Quinn +# Licensed under the MIT Licence. See LICENSE for details + # docker buildx build . -t ghcr.io/thepigeongenerator/mcaselector-lite:latest # docker push ghcr.io/thepigeongenerator/mcaselector-lite:latest FROM debian:testing-slim diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ec1f36b..acf9bcd 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,3 +1,5 @@ +# Copyright (c) 2025 Quinn +# Licensed under the MIT Licence. See LICENSE for details name: CI on: push: diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index b2e8bc3..f4d4e94 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,3 +1,5 @@ +# Copyright (c) 2025 Quinn +# Licensed under the MIT Licence. See LICENSE for details name: release on: release: diff --git a/.gitignore b/.gitignore index 95a59c1..6cd8d74 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ +# Copyright (c) 2025 Quinn +# Licensed under the MIT Licence. See LICENSE for details + # ignore all dotfiles by default .* diff --git a/makefile b/makefile index cb97afd..085ebc7 100644 --- a/makefile +++ b/makefile @@ -1,3 +1,6 @@ +# Copyright (c) 2025 Quinn +# Licensed under the MIT Licence. See LICENSE for details + # dependencies: # - make # - C compiler diff --git a/res/sh.frag.glsl b/res/sh.frag.glsl index 4ec98bb..95a9d8f 100644 --- a/res/sh.frag.glsl +++ b/res/sh.frag.glsl @@ -1,3 +1,6 @@ +// Copyright (c) 2025 Quinn +// Licensed under the MIT Licence. See LICENSE for details + #version 330 core out vec4 colour; diff --git a/res/sh.geom.glsl b/res/sh.geom.glsl index 8900a0e..f0606b8 100644 --- a/res/sh.geom.glsl +++ b/res/sh.geom.glsl @@ -1,3 +1,6 @@ +// Copyright (c) 2025 Quinn +// Licensed under the MIT Licence. See LICENSE for details + #version 330 core layout(points) in; layout(triangle_strip, max_vertices = 4) out; // output the vertices of this rectangle diff --git a/res/sh.vert.glsl b/res/sh.vert.glsl index d867fca..3251a18 100644 --- a/res/sh.vert.glsl +++ b/res/sh.vert.glsl @@ -1,3 +1,6 @@ +// Copyright (c) 2025 Quinn +// Licensed under the MIT Licence. See LICENSE for details + #version 330 core layout(location = 0) in ivec4 rect; // rectangle data uniform ivec2 screen; // current screen dimensions diff --git a/src/error.h b/src/error.h index 01302fe..c155a1a 100644 --- a/src/error.h +++ b/src/error.h @@ -2,6 +2,10 @@ // Licensed under the MIT Licence. See LICENSE for details #pragma once +#if __INCLUDE_LEVEL__ > 0 +#include +#endif + #define ERROR_STR_PRE(v) #v #define ERROR_STR(v) ERROR_STR_PRE(v) @@ -10,8 +14,8 @@ #define warn(s, ...) fprintf(stderr, "\033[93m" __FILE__ ":" ERROR_STR(__LINE__) ": [WAR]: " s "\033[0m\n", ##__VA_ARGS__) #define error(s, ...) fprintf(stderr, "\033[91m" __FILE__ ":" ERROR_STR(__LINE__) ": [ERR]: " s "\033[0m\n", ##__VA_ARGS__) -#define fatal(s, ...) \ - do { \ +#define fatal(s, ...) \ + do { \ printf("\033[101m" __FILE__ ":" ERROR_STR(__LINE__) ": [FAT]: " s "\033[0m\n", ##__VA_ARGS__); \ - exit(1); \ + exit(1); \ } while (0) diff --git a/src/io/window.c b/src/io/window.c index e37aaca..36be6d8 100644 --- a/src/io/window.c +++ b/src/io/window.c @@ -6,8 +6,6 @@ #include #include -#include -#include #include "../error.h" #include "input.h"