mirror of
https://gitlab.com/dosowisko.net/libsuperderpy.git
synced 2024-12-05 00:38:00 +01:00
code model, clang-tidy related tweaks and fixes
This commit is contained in:
parent
c8ee56fc2c
commit
a961845698
7 changed files with 10 additions and 11 deletions
|
@ -1 +1 @@
|
|||
Checks: '*,-clang-analyzer-alpha.*,-hicpp-no-assembler,-google-readability-todo,-misc-unused-parameters,-hicpp-signed-bitwise,-hicpp-multiway-paths-covered,-cert-msc30-c,-cert-msc50-cpp,-cert-msc32-c,-cert-msc51-cpp'
|
||||
Checks: '*,-clang-analyzer-alpha.*,-hicpp-no-assembler,-google-readability-todo,-misc-unused-parameters,-hicpp-signed-bitwise,-cert-msc30-c,-cert-msc50-cpp,-cert-msc32-c,-cert-msc51-cpp'
|
||||
|
|
|
@ -15,5 +15,5 @@ See [the configuration file](.clang-tidy).
|
|||
```
|
||||
-Weverything -Wno-missing-field-initializers -Wno-unused-parameter -Wno-padded -Wno-conversion
|
||||
-Wno-double-promotion -Wno-bad-function-cast -Wno-pedantic -Wno-unused-macros -Wno-switch-enum
|
||||
-Wno-disabled-macro-expansion -std=c11 -D__codemodel__
|
||||
-Wno-disabled-macro-expansion -D__codemodel__
|
||||
```
|
||||
|
|
|
@ -13,8 +13,8 @@ if (NOT LIBSUPERDERPY_CONFIG_INCLUDED)
|
|||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -ffast-math")
|
||||
|
||||
if(MAEMO5)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++98")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++98")
|
||||
endif(MAEMO5)
|
||||
|
||||
if(ANDROID)
|
||||
|
|
|
@ -101,7 +101,7 @@ void ReloadCode(struct Game* game);
|
|||
void ResumeExecution(struct Game* game);
|
||||
void ReloadShaders(struct Game* game, bool force);
|
||||
void DestroyShaders(struct Game* game);
|
||||
char* GetGameName(struct Game* game, const char* format);
|
||||
__attribute__((__format__(__printf__, 2, 0))) char* GetGameName(struct Game* game, const char* format);
|
||||
ALLEGRO_BITMAP* AddBitmap(struct Game* game, char* filename);
|
||||
void RemoveBitmap(struct Game* game, char* filename);
|
||||
|
||||
|
|
|
@ -342,7 +342,6 @@ SYMBOL_EXPORT double Interpolate(double pos, TWEEN_STYLE style) {
|
|||
default:
|
||||
return pos;
|
||||
}
|
||||
return pos;
|
||||
}
|
||||
|
||||
SYMBOL_EXPORT double GetTweenInterpolation(struct Tween* tween) {
|
||||
|
|
|
@ -70,7 +70,7 @@ SYMBOL_EXPORT int DrawWrappedText(ALLEGRO_FONT* font, ALLEGRO_COLOR color, float
|
|||
}
|
||||
//-------------------- Code Begins
|
||||
|
||||
char* context;
|
||||
char* context = NULL;
|
||||
|
||||
pch = strtok_r(stext, " ", &context); // Get the first word.
|
||||
do {
|
||||
|
@ -207,7 +207,7 @@ SYMBOL_EXPORT ALLEGRO_BITMAP* LoadScaledBitmap(struct Game* game, char* filename
|
|||
return target;
|
||||
}
|
||||
|
||||
__attribute__((__format__(__printf__, 6, 0))) SYMBOL_EXPORT void FatalErrorWithContext(struct Game* game, int line, const char* file, const char* func, bool exit, char* format, ...) {
|
||||
SYMBOL_EXPORT void FatalErrorWithContext(struct Game* game, int line, const char* file, const char* func, bool exit, char* format, ...) {
|
||||
// TODO: interrupt and take over loading thread when it happens
|
||||
char text[1024] = {0};
|
||||
PrintConsole(game, "Fatal Error, displaying Blue Screen of Derp...");
|
||||
|
@ -396,7 +396,7 @@ SYMBOL_EXPORT char* GetDataFilePath(struct Game* game, const char* filename) {
|
|||
|
||||
ALLEGRO_DEBUG_CHANNEL("libsuperderpy")
|
||||
|
||||
__attribute__((__format__(__printf__, 5, 0))) SYMBOL_EXPORT void PrintConsoleWithContext(struct Game* game, int line, const char* file, const char* func, char* format, ...) {
|
||||
SYMBOL_EXPORT void PrintConsoleWithContext(struct Game* game, int line, const char* file, const char* func, char* format, ...) {
|
||||
va_list vl;
|
||||
va_start(vl, format);
|
||||
char* text = game->_priv.console[game->_priv.console_pos];
|
||||
|
|
|
@ -68,7 +68,7 @@ ALLEGRO_BITMAP* LoadScaledBitmap(struct Game* game, char* filename, int width, i
|
|||
/*! \brief Finds path for data file. */
|
||||
char* GetDataFilePath(struct Game* game, const char* filename);
|
||||
|
||||
void PrintConsoleWithContext(struct Game* game, int line, const char* file, const char* func, char* format, ...);
|
||||
__attribute__((__format__(__printf__, 5, 6))) void PrintConsoleWithContext(struct Game* game, int line, const char* file, const char* func, char* format, ...);
|
||||
/*! \brief Print some message on game console.
|
||||
*
|
||||
* Draws message on console bitmap, so it'll be displayed when calling DrawConsole.
|
||||
|
@ -77,7 +77,7 @@ void PrintConsoleWithContext(struct Game* game, int line, const char* file, cons
|
|||
*/
|
||||
#define PrintConsole(game, format, ...) PrintConsoleWithContext(game, __LINE__, __FILE__, __func__, format, ##__VA_ARGS__)
|
||||
|
||||
void FatalErrorWithContext(struct Game* game, int line, const char* file, const char* func, bool exit, char* format, ...);
|
||||
__attribute__((__format__(__printf__, 6, 7))) void FatalErrorWithContext(struct Game* game, int line, const char* file, const char* func, bool exit, char* format, ...);
|
||||
#define FatalError(game, exit, format, ...) FatalErrorWithContext(game, __LINE__, __FILE__, __func__, exit, format, ##__VA_ARGS__)
|
||||
|
||||
void SetupViewport(struct Game* game, struct Viewport config);
|
||||
|
|
Loading…
Reference in a new issue