nodiscard and c2x requirements were overkill

This commit is contained in:
kdx 2023-04-13 09:00:13 +02:00
parent 75e92881f1
commit 0525ff290c
3 changed files with 26 additions and 24 deletions

View File

@ -19,7 +19,7 @@ set(ASSETS
fxconv_declare_assets(${ASSETS} WITH_METADATA)
add_executable(thyaddin ${SOURCES} ${ASSETS})
target_compile_options(thyaddin PRIVATE -Wall -Wextra -Os -std=c2x)
target_compile_options(thyaddin PRIVATE -Wall -Wextra -Os -std=c99)
target_link_libraries(thyaddin Gint::Gint)
generate_g3a(TARGET thyaddin OUTPUT "lzy.g3a"

View File

@ -1,5 +1,5 @@
CC ?= gcc
CFLAGS = -std=c2x -Wall -Wextra -pedantic -O3 -I./inc -MMD $(shell sdl2-config --cflags)
CFLAGS = -std=c99 -Wall -Wextra -O3 -I./inc -MMD $(shell sdl2-config --cflags)
LDFLAGS = -lSDL2 -lSDL2_image -lSDL2_mixer $(shell sdl2-config --libs)
OBJ_NAME = lzy

View File

@ -78,31 +78,31 @@ typedef struct LZY_Event {
LZY_EventUnion u;
} LZY_Event;
[[nodiscard]] int LZY_Init(const char *title, int target_fps,
int LZY_Init(const char *title, int target_fps,
const char *tset_path, const char *font_path);
void LZY_Quit(void);
[[nodiscard]] int LZY_DrawBegin(void);
[[nodiscard]] int LZY_DrawEnd(void);
int LZY_DrawBegin(void);
int LZY_DrawEnd(void);
void LZY_DrawSetColor(uint8_t r, uint8_t g, uint8_t b);
void LZY_DrawSetColorNone(void);
[[nodiscard]] int LZY_DrawClear(void);
[[nodiscard]] int LZY_DrawPoint(int x, int y);
[[nodiscard]] int LZY_DrawLine(int x0, int y0, int x1, int y1);
[[nodiscard]] int LZY_DrawRect(int x, int y, int w, int h);
[[nodiscard]] int LZY_FillRect(int x, int y, int w, int h);
[[nodiscard]] int LZY_DrawTile(unsigned int id, int x, int y);
[[nodiscard]] int LZY_DrawTileEx(unsigned int id, int x, int y, unsigned int w,
unsigned int h);
[[nodiscard]] int LZY_DrawChar(unsigned char chr, int x, int y);
[[nodiscard]] int LZY_DrawText(int x, int y, const char *text);
[[nodiscard]] int LZY_DrawTextF(int x, int y, const char *fmt, ...);
[[nodiscard]] LZY_Music *LZY_MusicLoad(const char *path);
[[nodiscard]] int LZY_MusicDestroy(LZY_Music *music);
[[nodiscard]] int LZY_MusicPlay(LZY_Music *music, int loops);
[[nodiscard]] LZY_Sound *LZY_SoundLoad(const char *path);
[[nodiscard]] int LZY_SoundDestroy(LZY_Sound *sound);
int LZY_DrawClear(void);
int LZY_DrawPoint(int x, int y);
int LZY_DrawLine(int x0, int y0, int x1, int y1);
int LZY_DrawRect(int x, int y, int w, int h);
int LZY_FillRect(int x, int y, int w, int h);
int LZY_DrawTile(unsigned int id, int x, int y);
int LZY_DrawTileEx(unsigned int id, int x, int y, unsigned int w,
unsigned int h);
int LZY_DrawChar(unsigned char chr, int x, int y);
int LZY_DrawText(int x, int y, const char *text);
int LZY_DrawTextF(int x, int y, const char *fmt, ...);
LZY_Music *LZY_MusicLoad(const char *path);
int LZY_MusicDestroy(LZY_Music *music);
int LZY_MusicPlay(LZY_Music *music, int loops);
LZY_Sound *LZY_SoundLoad(const char *path);
int LZY_SoundDestroy(LZY_Sound *sound);
void LZY_SoundSetVolume(LZY_Sound *sound, float volume);
[[nodiscard]] int LZY_SoundPlay(LZY_Sound *sound, int loops);
int LZY_SoundPlay(LZY_Sound *sound, int loops);
int LZY_PollEvent(LZY_Event *);
void LZY_CycleEvents(void);
int LZY_KeyDown(unsigned int key);
@ -111,8 +111,10 @@ void LZY_Log(const char *fmt, ...);
int LZY_LogError(int rv);
const char *LZY_GetError(void);
[[deprecated("renamed to LZY_FillRect")]] [[nodiscard]] int
LZY_DrawFillRect(int x, int y, int w, int h);
#ifdef __has_cpp_attribute
[[deprecated("renamed to LZY_FillRect")]]
#endif
int LZY_DrawFillRect(int x, int y, int w, int h);
#ifdef __cplusplus
}