10 Commits

Author SHA1 Message Date
Roman Fomin
215c75a55a
add clang-tidy to CI and fix some warnings (#1717)
* fix replacement of `author` umapinfo string (assumed to be lump name)

* remove some variables that are never read

* remove `toolsrc` from the build (we don't package it anyway)

* make sure that `dropoff` parameter is boolean

* allow `i` values outside enum mobjtype_t range

* `oldgamestate` out of range for `gamestate_t` enum

* false positive (?) for leaking memory in U_SaveState

* use the `__VA_ARGS__` macro instead of functions with variable parameters

In standard C, using NULL to terminate the argument list of a variadic
function is undefined behaviour.
2024-05-30 20:20:46 +07:00
Roman Fomin
5a4a47bed3
move config code to m_config (#1567)
* Use clang-format
2024-03-07 15:19:31 +07:00
Roman Fomin
a6836b314f
header cleanup using IWYU tool (#1467)
* Forward declaration of structures in headers where possible

* Use M_snprinf instead of sprintf

* Remove D_INTMAX D_INTMIN

* Don't change libtextscreen files

* Add miniz and win32 include directories
2024-02-20 19:26:28 +07:00
Fabian Greffrath
d6e0bb8ca8
enable -Wbad-function-cast compiler warning (#1366)
* experiment with -Wbad-function-cast

* cast FRACUNIT to double, instead of function return value

* assign sqrt() result to variable, cast and bit-shift this

* restore thinker function to intermediate variable

* cast pointer to int

* assign ShellExecute() return value to intermediate pointer, cast and compare this

* more compact fixes

* add -Wcast-function-type

* attempt to fix i_winmusic:PlayerProc()

* attempt to fix MSVC build

* back to PrBoom's float version of P_GetOffset()

* improve consistency with Win API

* attempt to fix P_DegenMobjThinker() signature

* add -Wno-cast-function-type-strict

* get rid of -Wcast-function-type again
2024-01-04 13:20:31 +01:00
Roman Fomin
000bcd5e72
implement M_getenv for compatibility with non-Latin paths on Windows (#667)
* implement M_getenv for compatibility with non-Latin paths on Windows

* use regular wcslen

SDL_wcslen is undocumented

* fix memory leak

* cache the `wenv == NULL` case
2022-07-18 21:07:33 +07:00
Roman Fomin
3d1f4c2e35 remove unused code 2022-06-10 22:08:15 +07:00
Roman Fomin
467fc8c946
replace win_fopen.c with wrappers from Chocolate Doom (#592)
* replace win_fopen.c with wrappers from Chocolate Doom

* always include direct.h on Windows

* add missing header files, fix gcc warning

* move wrappers to m_io.c, formatting

* fix cmakedefine

* always include string.h

* use only strcasecmp and strncasecmp

* add missing thermo.h

* include config.h

* move str(n)casecmp define to doomtype.h
2022-06-10 07:49:38 +02:00
Roman Fomin
e8be294808 fix non-latin paths on Windows 2022-06-06 10:16:34 +07:00
Roman Fomin
e5e6eb8c2e fix gcc warnings 2022-06-02 21:37:08 +07:00
Roman Fomin
f99ae8ab05 implement multiplayer setup (based on Chocolate Doom) 2022-06-02 21:28:08 +07:00