From ef77bedeaebbf17a66299f42f6a6cd05f126bb45 Mon Sep 17 00:00:00 2001 From: Sebastian Krzyszkowiak Date: Fri, 11 Jan 2019 15:26:12 +0100 Subject: [PATCH] clean up --- cmake/libsuperderpy.cmake | 1 + src/character.h | 2 +- src/config.h | 2 +- src/defines.h.in | 6 +++--- src/emscripten-audio-stream.h | 2 +- src/gamestate.h | 2 +- src/imgui/imgui_impl_allegro5.h | 5 ++++- src/internal.h | 2 +- src/libsuperderpy.h | 2 +- src/mainloop.h | 2 +- src/maths.h | 2 +- src/particle.h | 2 +- src/shader.h | 2 +- src/timeline.h | 2 +- src/tween.h | 2 +- src/utils.h | 2 +- 16 files changed, 21 insertions(+), 17 deletions(-) diff --git a/cmake/libsuperderpy.cmake b/cmake/libsuperderpy.cmake index 474e510..ce79879 100644 --- a/cmake/libsuperderpy.cmake +++ b/cmake/libsuperderpy.cmake @@ -51,6 +51,7 @@ if (NOT LIBSUPERDERPY_CONFIG_INCLUDED) set(CMAKE_CXX_STANDARD 98) set(CMAKE_CXX_STANDARD_REQUIRED true) + # TODO: add -fvisibility=hidden, but only to libsuperderpy target set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -ffast-math -fstack-protector") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -ffast-math -fstack-protector") diff --git a/src/character.h b/src/character.h index c932e4b..a90053c 100644 --- a/src/character.h +++ b/src/character.h @@ -155,4 +155,4 @@ void ShowCharacter(struct Game* game, struct Character* character); void HideCharacter(struct Game* game, struct Character* character); bool IsCharacterHidden(struct Game* game, struct Character* character); -#endif +#endif /* LIBSUPERDERPY_CHARACTER_H */ diff --git a/src/config.h b/src/config.h index eb9a8fb..2102c74 100644 --- a/src/config.h +++ b/src/config.h @@ -34,4 +34,4 @@ void SetConfigOption(struct Game* game, char* section, char* name, char* value); /*! \brief Writes config from memory to file. */ void DeinitConfig(struct Game* game); -#endif +#endif /* LIBSUPERDERPY_CONFIG_H */ diff --git a/src/defines.h.in b/src/defines.h.in index 761fce7..f432070 100644 --- a/src/defines.h.in +++ b/src/defines.h.in @@ -1,5 +1,5 @@ -#ifndef DEFINES_H -#define DEFINES_H +#ifndef LIBSUPERDERPY_DEFINES_H +#define LIBSUPERDERPY_DEFINES_H /* * These values are automatically set according to their cmake variables. @@ -8,4 +8,4 @@ #define LIBSUPERDERPY_GAMENAME_PRETTY "${LIBSUPERDERPY_GAMENAME_PRETTY}" #define LIBSUPERDERPY_GAME_GIT_REV "${LIBSUPERDERPY_GAME_GIT_REV}" -#endif /* DEFINES_H */ +#endif /* LIBSUPERDERPY_DEFINES_H */ diff --git a/src/emscripten-audio-stream.h b/src/emscripten-audio-stream.h index d7b310d..f473f75 100644 --- a/src/emscripten-audio-stream.h +++ b/src/emscripten-audio-stream.h @@ -106,4 +106,4 @@ ALLEGRO_AUDIO_STREAM* emscripten_create_audio_stream(size_t fragment_count, unsi #define al_set_audio_stream_channel_matrix emscripten_set_audio_stream_channel_matrix #endif -#endif +#endif /* LIBSUPERDERPY_EMSCRIPTEN_H */ diff --git a/src/gamestate.h b/src/gamestate.h index 756e259..430248b 100644 --- a/src/gamestate.h +++ b/src/gamestate.h @@ -92,4 +92,4 @@ __attribute__((used)) void Gamestate_Unload(struct Game* game, struct GamestateR __attribute__((used)) void Gamestate_ProcessEvent(struct Game* game, struct GamestateResources* data, ALLEGRO_EVENT* ev); __attribute__((used)) void Gamestate_Reload(struct Game* game, struct GamestateResources* data); -#endif +#endif /* LIBSUPERDERPY_GAMESTATE_H */ diff --git a/src/imgui/imgui_impl_allegro5.h b/src/imgui/imgui_impl_allegro5.h index b7b7376..f0cfca5 100644 --- a/src/imgui/imgui_impl_allegro5.h +++ b/src/imgui/imgui_impl_allegro5.h @@ -15,7 +15,8 @@ /// \privatesection -#pragma once +#ifndef LIBSUPERDERPY_IMGUI_IMPL_ALLEGRO5_H +#define LIBSUPERDERPY_IMGUI_IMPL_ALLEGRO5_H #ifdef __cplusplus #include "3rdparty/cimgui/imgui/imgui.h" @@ -35,3 +36,5 @@ bool ImGui_ImplAllegro5_ProcessEvent(ALLEGRO_EVENT* event); // Use if you want to reset your rendering device without losing ImGui state. bool ImGui_ImplAllegro5_CreateDeviceObjects(void); void ImGui_ImplAllegro5_InvalidateDeviceObjects(void); + +#endif /* LIBSUPERDERPY_IMGUI_IMPL_ALLEGRO5_H */ diff --git a/src/internal.h b/src/internal.h index 3a422b0..3bfeac5 100644 --- a/src/internal.h +++ b/src/internal.h @@ -131,4 +131,4 @@ __attribute__((__format__(__printf__, 2, 0))) char* GetGameName(struct Game* gam ALLEGRO_BITMAP* AddBitmap(struct Game* game, char* filename); void RemoveBitmap(struct Game* game, char* filename); -#endif +#endif /* LIBSUPERDERPY_INTERNAL_H */ diff --git a/src/libsuperderpy.h b/src/libsuperderpy.h index 0ce5836..fa11c81 100644 --- a/src/libsuperderpy.h +++ b/src/libsuperderpy.h @@ -259,4 +259,4 @@ int libsuperderpy_start(struct Game* game); int libsuperderpy_run(struct Game* game); void libsuperderpy_destroy(struct Game* game); -#endif +#endif /* LIBSUPERDERPY_MAIN_H */ diff --git a/src/mainloop.h b/src/mainloop.h index 5bfdfab..163503f 100644 --- a/src/mainloop.h +++ b/src/mainloop.h @@ -25,4 +25,4 @@ bool libsuperderpy_mainloop(struct Game* game); -#endif +#endif /* LIBSUPERDERPY_MAINLOOP_H */ diff --git a/src/maths.h b/src/maths.h index 8de4405..8c428dc 100644 --- a/src/maths.h +++ b/src/maths.h @@ -31,4 +31,4 @@ double Lerp(double left, double right, double pos); int Sign(double val); double Fract(double val); -#endif +#endif /* LIBSUPERDERPY_MATHS_H */ diff --git a/src/particle.h b/src/particle.h index 6deac9c..6ba07a4 100644 --- a/src/particle.h +++ b/src/particle.h @@ -60,4 +60,4 @@ void DrawParticles(struct Game* game, struct ParticleBucket* bucket); void EmitParticle(struct Game* game, struct ParticleBucket* bucket, struct Character* archetype, ParticleFunc* func, struct ParticleState state, void* data); void DestroyParticleBucket(struct Game* game, struct ParticleBucket* bucket); -#endif +#endif /* LIBSUPERDERPY_PARTICLE_H */ diff --git a/src/shader.h b/src/shader.h index 0a671ff..06629fb 100644 --- a/src/shader.h +++ b/src/shader.h @@ -26,4 +26,4 @@ ALLEGRO_SHADER* CreateShader(struct Game* game, const char* vertex, const char* fragment); void DestroyShader(struct Game* game, ALLEGRO_SHADER* shader); -#endif +#endif /* LIBSUPERDERPY_SHADER_H */ diff --git a/src/timeline.h b/src/timeline.h index 9f93f0e..5d5fdf6 100644 --- a/src/timeline.h +++ b/src/timeline.h @@ -141,4 +141,4 @@ bool TM_IsBackgroundEmpty(struct Timeline* timeline); /*! \brief Macro for easy timeline action definition. */ #define TM_ACTION(name) bool name(struct Game* game, struct GamestateResources* data, struct TM_Action* action) -#endif +#endif /* LIBSUPERDERPY_TIMELINE_H */ diff --git a/src/tween.h b/src/tween.h index 2b521b7..52bb932 100644 --- a/src/tween.h +++ b/src/tween.h @@ -92,4 +92,4 @@ double GetTweenValue(struct Tween* tween); void UpdateTween(struct Tween* tween, double delta); double Interpolate(double pos, TWEEN_STYLE style); -#endif +#endif /* LIBSUPERDERPY_TWEEN_H */ diff --git a/src/utils.h b/src/utils.h index fdf47aa..69b1ca7 100644 --- a/src/utils.h +++ b/src/utils.h @@ -88,4 +88,4 @@ char* PunchNumber(struct Game* game, char* text, char ch, int number); /*! \brief Quits the game. On platforms that allow it, brings the game to the background without quiting if is true. */ void QuitGame(struct Game* game, bool allow_pausing); -#endif +#endif /* LIBSUPERDERPY_UTILS_H */