diff --git a/.clang-format b/.clang-format index 7d53280..f4ee745 100644 --- a/.clang-format +++ b/.clang-format @@ -1,9 +1,3 @@ -# This file is part of MCA-Selector-lite, -# and is licensed under GPL-2.0-only. -# Copyright (C)2025 quinnthepigeon@proton.me Quinn -# For further information, view COPYING and CONTRIBUTORS -# at: www.github.com/thepigeongenerator/mcaselector-lite -# --- # --------------------------- # general style settings diff --git a/.editorconfig b/.editorconfig index c6d6110..75a5ed6 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,9 +1,3 @@ -# This file is part of MCA-Selector-lite, -# and is licensed under GPL-2.0-only. -# Copyright (C)2025 quinnthepigeon@proton.me Quinn -# For further information, view COPYING and CONTRIBUTORS -# at: www.github.com/thepigeongenerator/mcaselector-lite - [*] charset = utf-8 end_of_line = lf diff --git a/.gitignore b/.gitignore index 2e77b49..840b9a5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,3 @@ -# This file is part of MCA-Selector-lite, -# and is licensed under GPL-2.0-only. -# Copyright (C)2025 quinnthepigeon@proton.me Quinn -# For further information, view COPYING and CONTRIBUTORS -# at: www.github.com/thepigeongenerator/mcaselector-lite - # ignore all dotfiles by default .* diff --git a/Makefile b/Makefile index 3349066..9986679 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,7 @@ -# This file is part of MCA-Selector-lite, -# and is licensed under GPL-2.0-only. -# Copyright (C)2026 quinnthepigeon@proton.me Quinn -# For further information, view COPYING and CONTRIBUTORS -# at: www.github.com/thepigeongenerator/mcaselector-lite +# Copyright (C)2026 MCA-Selector-Lite +# Licensed under GPL-2.0-only. For further information, +# view `git log`, and the COPYING and CONTRIBUTORS files +# at www.github.com/thepigeongenerator/mcaselector-lite. SHELL = /bin/sh .SUFFIXES: @@ -37,12 +36,7 @@ LDFLAGS += $(shell pkg-config --libs-only-L libarchive) LDLIBS += $(shell pkg-config --libs-only-l libarchive) endif -msg-cc = $(info [CC] $(1)) -msg-clean = $(info [CLEAN] $(1)) -msg-ld = $(info [LD] $(1)) -msg-mkdir = $(info [MKDIR] $(1)) -msg-tar = $(info [TAR] $(1)) -msg-xxd = $(info [XXD] $(1)) +msg = @printf '%-8s %s\n' "$(1)" "$(2)" # Set Q to @ to silence commands being printed, unless --no-silent has been set ifeq (0, $(words $(findstring --no-silent,$(MAKEFLAGS)))) @@ -54,8 +48,7 @@ endif ifeq ($(OS),Windows_NT) NAME := $(NAME).exe # BUG: I am purposefully neglecting this -LDLIBS += -lopengl32 -lgdi32 -$(warning Detected Windows_NT, please refer to the documentation if you encounter issues.) +LDLIBS += -lopengl32 -lgdi32 $(warning Detected Windows_NT, please refer to the documentation if you encounter issues.) endif # Default target; compiles everything. @@ -78,9 +71,11 @@ uninstall: .PHONY: check-sparse: $(SRC) - $(foreach f,$(SRC),\ - -$(Q)$(SPARSE) $(CFLAGS) $(CPPFLAGS) $f\ - ) + -$(Q)$(SPARSE) $(CFLAGS) $(CPPFLAGS) $(SRC) + +.PHONY: +check-gcc: $(SRC) + -$(Q)$(CC) -fanalyzer $(CFLAGS) $(CPPFLAGS) $(SRC) .PHONY: clean: @@ -89,19 +84,19 @@ clean: # Links together the object files into the final binary. bin/$(NAME): $(OBJ) | bin/ - $(Q)$(call msg-ld,$@) + $(Q)$(call msg,LD,$@) $(Q)$(CC) $(LDFLAGS) $(LDLIBS) -o $@ $^ bin/stripped_$(NAME): $(OBJ) | bin/ - $(Q)$(call msg-ld,$@) + $(Q)$(call msg,LD,$@) $(Q)$(CC) -s $(LDFLAGS) $(LDLIBS) -o $@ $^ # Compiles C sources into object files %.c.o: %.c - $(Q)$(call msg-cc,$@) + $(Q)$(call msg,CC,$@) $(Q)$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $< %/: - $(Q)$(call msg-mkdir,$@) + $(Q)$(call msg,MKDIR,$@) $(Q)mkdir $@ # Generate and include dependencies, diff --git a/include/mcaselector-lite/atrb.h b/include/mcaselector-lite/atrb.h index ab021b0..d1b22a3 100644 --- a/include/mcaselector-lite/atrb.h +++ b/include/mcaselector-lite/atrb.h @@ -1,8 +1,7 @@ -/* This file is part of MCA-Selector-lite, - * and is licensed under GPL-2.0-only. - * Copyright (C)2025 quinnthepigeon@proton.me Quinn - * For further information, view COPYING and CONTRIBUTORS - * at: www.github.com/thepigeongenerator/mcaselector-lite */ +/* Copyright (C)2025 MCA-Selector-Lite + * Licensed under GPL-2.0-only. For further information, + * view `git log`, and the COPYING and CONTRIBUTORS files + * at www.github.com/thepigeongenerator/mcaselector-lite. */ #ifndef MCASELECTOR_LITE_ATRB_H #define MCASELECTOR_LITE_ATRB_H diff --git a/include/mcaselector-lite/endian.h b/include/mcaselector-lite/endian.h index 8a73149..754a9f8 100644 --- a/include/mcaselector-lite/endian.h +++ b/include/mcaselector-lite/endian.h @@ -1,8 +1,7 @@ -/* This file is part of MCA-Selector-lite, - * and is licensed under GPL-2.0-only. - * Copyright (C)2025 quinnthepigeon@proton.me Quinn - * For further information, view COPYING and CONTRIBUTORS - * at: www.github.com/thepigeongenerator/mcaselector-lite */ +/* Copyright (C)2025 MCA-Selector-Lite + * Licensed under GPL-2.0-only. For further information, + * view `git log`, and the COPYING and CONTRIBUTORS files + * at www.github.com/thepigeongenerator/mcaselector-lite. */ #ifndef MCASELECTOR_LITE_ENDIAN_H #define MCASELECTOR_LITE_ENDIAN_H diff --git a/include/mcaselector-lite/macro.h b/include/mcaselector-lite/macro.h index abd5fde..77f3a87 100644 --- a/include/mcaselector-lite/macro.h +++ b/include/mcaselector-lite/macro.h @@ -1,8 +1,7 @@ -/* This file is part of MCA-Selector-lite, - * and is licensed under GPL-2.0-only. - * Copyright (C)2025 quinnthepigeon@proton.me Quinn - * For further information, view COPYING and CONTRIBUTORS - * at: www.github.com/thepigeongenerator/mcaselector-lite */ +/* Copyright (C)2025 MCA-Selector-Lite + * Licensed under GPL-2.0-only. For further information, + * view `git log`, and the COPYING and CONTRIBUTORS files + * at www.github.com/thepigeongenerator/mcaselector-lite. */ #ifndef MCASELECTOR_LITE_MACRO_H #define MCASELECTOR_LITE_MACRO_H diff --git a/include/mcaselector-lite/types.h b/include/mcaselector-lite/types.h index 9f6d0e7..42e9e0b 100644 --- a/include/mcaselector-lite/types.h +++ b/include/mcaselector-lite/types.h @@ -1,8 +1,7 @@ -/* This file is part of MCA-Selector-lite, - * and is licensed under GPL-2.0-only. - * Copyright (C)2025 quinnthepigeon@proton.me Quinn - * For further information, view COPYING and CONTRIBUTORS - * at: www.github.com/thepigeongenerator/mcaselector-lite */ +/* Copyright (C)2025 MCA-Selector-Lite + * Licensed under GPL-2.0-only. For further information, + * view `git log`, and the COPYING and CONTRIBUTORS files + * at www.github.com/thepigeongenerator/mcaselector-lite. */ #ifndef MCASELECTOR_LITE_TYPES_H #define MCASELECTOR_LITE_TYPES_H diff --git a/include/mcaselector-lite/util.h b/include/mcaselector-lite/util.h index b15e861..2347bb4 100644 --- a/include/mcaselector-lite/util.h +++ b/include/mcaselector-lite/util.h @@ -1,8 +1,7 @@ -/* This file is part of MCA-Selector-lite, - * and is licensed under GPL-2.0-only. - * Copyright (C)2025 quinnthepigeon@proton.me Quinn - * For further information, view COPYING and CONTRIBUTORS - * at: www.github.com/thepigeongenerator/mcaselector-lite */ +/* Copyright (C)2025 MCA-Selector-Lite + * Licensed under GPL-2.0-only. For further information, + * view `git log`, and the COPYING and CONTRIBUTORS files + * at www.github.com/thepigeongenerator/mcaselector-lite. */ #ifndef MCASELECTOR_LITE_UTIL_H #define MCASELECTOR_LITE_UTIL_H diff --git a/include/mcaselector-lite/vec.h b/include/mcaselector-lite/vec.h index a13f9b8..fbfd065 100644 --- a/include/mcaselector-lite/vec.h +++ b/include/mcaselector-lite/vec.h @@ -1,8 +1,7 @@ -/* This file is part of MCA-Selector-lite, - * and is licensed under GPL-2.0-only. - * Copyright (C)2025 quinnthepigeon@proton.me Quinn - * For further information, view COPYING and CONTRIBUTORS - * at: www.github.com/thepigeongenerator/mcaselector-lite */ +/* Copyright (C)2025 MCA-Selector-Lite + * Licensed under GPL-2.0-only. For further information, + * view `git log`, and the COPYING and CONTRIBUTORS files + * at www.github.com/thepigeongenerator/mcaselector-lite. */ #ifndef MCASELECTOR_LITE_VEC_H #define MCASELECTOR_LITE_VEC_H diff --git a/src/dat/mcx.c b/src/dat/mcx.c index 235d302..c72bb73 100644 --- a/src/dat/mcx.c +++ b/src/dat/mcx.c @@ -1,8 +1,7 @@ -/* This file is part of MCA-Selector-lite, - * and is licensed under GPL-2.0-only. - * Copyright (C)2025 quinnthepigeon@proton.me Quinn - * For further information, view COPYING and CONTRIBUTORS - * at: www.github.com/thepigeongenerator/mcaselector-lite */ +/* Copyright (C)2025 MCA-Selector-Lite + * Licensed under GPL-2.0-only. For further information, + * view `git log`, and the COPYING and CONTRIBUTORS files + * at www.github.com/thepigeongenerator/mcaselector-lite. */ #include "mcx.h" #include diff --git a/src/dat/mcx.h b/src/dat/mcx.h index 161e672..35018f2 100644 --- a/src/dat/mcx.h +++ b/src/dat/mcx.h @@ -1,8 +1,7 @@ -/* This file is part of MCA-Selector-lite, - * and is licensed under GPL-2.0-only. - * Copyright (C)2025 quinnthepigeon@proton.me Quinn - * For further information, view COPYING and CONTRIBUTORS - * at: www.github.com/thepigeongenerator/mcaselector-lite */ +/* Copyright (C)2025 MCA-Selector-Lite + * Licensed under GPL-2.0-only. For further information, + * view `git log`, and the COPYING and CONTRIBUTORS files + * at www.github.com/thepigeongenerator/mcaselector-lite. */ #pragma once #include diff --git a/src/dat/nbt.c b/src/dat/nbt.c index 267d296..5960d02 100644 --- a/src/dat/nbt.c +++ b/src/dat/nbt.c @@ -1,8 +1,7 @@ -/* This file is part of MCA-Selector-lite, - * and is licensed under GPL-2.0-only. - * Copyright (C)2025 quinnthepigeon@proton.me Quinn - * For further information, view COPYING and CONTRIBUTORS - * at: www.github.com/thepigeongenerator/mcaselector-lite */ +/* Copyright (C)2025 MCA-Selector-Lite + * Licensed under GPL-2.0-only. For further information, + * view `git log`, and the COPYING and CONTRIBUTORS files + * at www.github.com/thepigeongenerator/mcaselector-lite. */ #include "nbt.h" #include @@ -45,9 +44,8 @@ static const u8 *procarr(const u8 *restrict buf, s32 nmemb, uint size, struct nb { usize len = nmemb * size; *out = (struct nbt_array){ - out->nmemb = nmemb, - out->dat = malloc(len), - }; + nmemb, + malloc(len)}; if (!out->dat) return buf + len; diff --git a/src/dat/nbt.h b/src/dat/nbt.h index 6cdaf6b..7fd4576 100644 --- a/src/dat/nbt.h +++ b/src/dat/nbt.h @@ -1,8 +1,7 @@ -/* This file is part of MCA-Selector-lite, - * and is licensed under GPL-2.0-only. - * Copyright (C)2025 quinnthepigeon@proton.me Quinn - * For further information, view COPYING and CONTRIBUTORS - * at: www.github.com/thepigeongenerator/mcaselector-lite */ +/* Copyright (C)2025 MCA-Selector-Lite + * Licensed under GPL-2.0-only. For further information, + * view `git log`, and the COPYING and CONTRIBUTORS files + * at www.github.com/thepigeongenerator/mcaselector-lite. */ #pragma once #include diff --git a/src/io/conf.c b/src/io/conf.c index 8a9515c..589e21b 100644 --- a/src/io/conf.c +++ b/src/io/conf.c @@ -1,8 +1,7 @@ -/* This file is part of MCA-Selector-lite, - * and is licensed under GPL-2.0-only. - * Copyright (C)2025 quinnthepigeon@proton.me Quinn - * For further information, view COPYING and CONTRIBUTORS - * at: www.github.com/thepigeongenerator/mcaselector-lite */ +/* Copyright (C)2025 MCA-Selector-Lite + * Licensed under GPL-2.0-only. For further information, + * view `git log`, and the COPYING and CONTRIBUTORS files + * at www.github.com/thepigeongenerator/mcaselector-lite. */ #include "conf.h" #include diff --git a/src/io/conf.h b/src/io/conf.h index c464b76..b79d801 100644 --- a/src/io/conf.h +++ b/src/io/conf.h @@ -1,8 +1,7 @@ -/* This file is part of MCA-Selector-lite, - * and is licensed under GPL-2.0-only. - * Copyright (C)2025 quinnthepigeon@proton.me Quinn - * For further information, view COPYING and CONTRIBUTORS - * at: www.github.com/thepigeongenerator/mcaselector-lite */ +/* Copyright (C)2025 MCA-Selector-Lite + * Licensed under GPL-2.0-only. For further information, + * view `git log`, and the COPYING and CONTRIBUTORS files + * at www.github.com/thepigeongenerator/mcaselector-lite. */ #pragma once #include #include diff --git a/src/main.c b/src/main.c index d72b16c..b16ebaf 100644 --- a/src/main.c +++ b/src/main.c @@ -1,8 +1,7 @@ -/* This file is part of MCA-Selector-lite, - * and is licensed under GPL-2.0-only. - * Copyright (C)2025 quinnthepigeon@proton.me Quinn - * For further information, view COPYING and CONTRIBUTORS - * at: www.github.com/thepigeongenerator/mcaselector-lite */ +/* Copyright (C)2025 MCA-Selector-Lite + * Licensed under GPL-2.0-only. For further information, + * view `git log`, and the COPYING and CONTRIBUTORS files + * at www.github.com/thepigeongenerator/mcaselector-lite. */ #include #include diff --git a/src/util/compat/io.h b/src/util/compat/io.h index 3fc6768..4bf4356 100644 --- a/src/util/compat/io.h +++ b/src/util/compat/io.h @@ -1,8 +1,7 @@ -/* This file is part of MCA-Selector-lite, - * and is licensed under GPL-2.0-only. - * Copyright (C)2025 quinnthepigeon@proton.me Quinn - * For further information, view COPYING and CONTRIBUTORS - * at: www.github.com/thepigeongenerator/mcaselector-lite */ +/* Copyright (C)2025 MCA-Selector-Lite + * Licensed under GPL-2.0-only. For further information, + * view `git log`, and the COPYING and CONTRIBUTORS files + * at www.github.com/thepigeongenerator/mcaselector-lite. */ #pragma once #if defined __unix__ diff --git a/src/util/compat/os.h b/src/util/compat/os.h index e8a3fd1..e18c6bd 100644 --- a/src/util/compat/os.h +++ b/src/util/compat/os.h @@ -1,8 +1,7 @@ -/* This file is part of MCA-Selector-lite, - * and is licensed under GPL-2.0-only. - * Copyright (C)2025 quinnthepigeon@proton.me Quinn - * For further information, view COPYING and CONTRIBUTORS - * at: www.github.com/thepigeongenerator/mcaselector-lite */ +/* Copyright (C)2025 MCA-Selector-Lite + * Licensed under GPL-2.0-only. For further information, + * view `git log`, and the COPYING and CONTRIBUTORS files + * at www.github.com/thepigeongenerator/mcaselector-lite. */ #pragma once #if defined(__unix__) diff --git a/src/util/error.c b/src/util/error.c index a4eae4c..afb1db2 100644 --- a/src/util/error.c +++ b/src/util/error.c @@ -1,8 +1,7 @@ -/* This file is part of MCA-Selector-lite, - * and is licensed under GPL-2.0-only. - * Copyright (C)2025 quinnthepigeon@proton.me Quinn - * For further information, view COPYING and CONTRIBUTORS - * at: www.github.com/thepigeongenerator/mcaselector-lite */ +/* Copyright (C)2025 MCA-Selector-Lite + * Licensed under GPL-2.0-only. For further information, + * view `git log`, and the COPYING and CONTRIBUTORS files + * at www.github.com/thepigeongenerator/mcaselector-lite. */ #include "error.h" #include diff --git a/src/util/error.h b/src/util/error.h index 3c53928..61c1d5f 100644 --- a/src/util/error.h +++ b/src/util/error.h @@ -1,8 +1,7 @@ -/* This file is part of MCA-Selector-lite, - * and is licensed under GPL-2.0-only. - * Copyright (C)2025 quinnthepigeon@proton.me Quinn - * For further information, view COPYING and CONTRIBUTORS - * at: www.github.com/thepigeongenerator/mcaselector-lite */ +/* Copyright (C)2025 MCA-Selector-Lite + * Licensed under GPL-2.0-only. For further information, + * view `git log`, and the COPYING and CONTRIBUTORS files + * at www.github.com/thepigeongenerator/mcaselector-lite. */ #pragma once #include