don't use empty initializers (it's a GNU extension)

This commit is contained in:
Sebastian Krzyszkowiak 2017-09-10 22:07:02 +02:00
parent 2b1248ce14
commit bf4aa069a4
6 changed files with 13 additions and 13 deletions

View file

@ -73,7 +73,7 @@ SYMBOL_EXPORT void LoadSpritesheets(struct Game* game, struct Character* charact
struct Spritesheet* tmp = character->spritesheets;
while (tmp) {
if (!tmp->bitmap) {
char filename[255] = {};
char filename[255] = {0};
snprintf(filename, 255, "sprites/%s/%s.png", character->name, tmp->name);
tmp->bitmap = al_load_bitmap(GetDataFilePath(game, filename));
tmp->width = al_get_bitmap_width(tmp->bitmap);
@ -105,7 +105,7 @@ SYMBOL_EXPORT void RegisterSpritesheet(struct Game* game, struct Character* char
s = s->next;
}
PrintConsole(game, "Registering %s spritesheet: %s", character->name, name);
char filename[255] = {};
char filename[255] = {0};
snprintf(filename, 255, "sprites/%s/%s.ini", character->name, name);
ALLEGRO_CONFIG* config = al_load_config_file(GetDataFilePath(game, filename));
s = malloc(sizeof(struct Spritesheet));

View file

@ -23,6 +23,8 @@
#ifndef LIBSUPERDERPY_EMSCRIPTEN_H
#define LIBSUPERDERPY_EMSCRIPTEN_H
#include <allegro5/allegro_audio.h>
typedef struct {
ALLEGRO_SAMPLE* sample;
ALLEGRO_SAMPLE_INSTANCE* instance;

View file

@ -119,7 +119,7 @@ SYMBOL_INTERNAL void DrawConsole(struct Game* game) {
cur++;
}
char sfps[6] = {};
char sfps[6] = {0};
snprintf(sfps, 6, "%.0f", game->_priv.fps_count.fps);
DrawTextWithShadow(game->_priv.font_console, al_map_rgb(255, 255, 255), clipX + clipWidth, clipY, ALLEGRO_ALIGN_RIGHT, sfps);

View file

@ -260,11 +260,13 @@ SYMBOL_EXPORT int libsuperderpy_run(struct Game* game) {
al_flip_display();
al_start_timer(game->_priv.timer);
struct Gamestate* tmp = game->_priv.gamestates;
while (tmp) {
// don't show loading screen on init if requested
tmp->showLoading = game->show_loading_on_launch;
tmp = tmp->next;
{
struct Gamestate* tmp = game->_priv.gamestates;
while (tmp) {
// don't show loading screen on init if requested
tmp->showLoading = game->show_loading_on_launch;
tmp = tmp->next;
}
}
game->_priv.loading.gamestate = AllocateGamestate(game, "loading");

View file

@ -307,10 +307,6 @@ SYMBOL_EXPORT struct TM_Action* TM_AddQueuedBackgroundAction(struct Timeline* ti
}
SYMBOL_EXPORT void TM_AddDelay(struct Timeline* timeline, int delay) {
/*int *tmp;
tmp = malloc(sizeof(int));
*tmp = delay;
TM_AddAction(NULL, TM_AddToArgs(NULL, tmp));*/
struct TM_Action* tmp = TM_AddAction(timeline, NULL, NULL, "TM_Delay");
PrintConsole(timeline->game, "Timeline Manager[%s]: queue: adding delay %d ms (%d)", timeline->name, delay, tmp->id);
tmp->delay = delay;

View file

@ -184,7 +184,7 @@ SYMBOL_EXPORT ALLEGRO_BITMAP* LoadScaledBitmap(struct Game* game, char* filename
}
SYMBOL_EXPORT void FatalError(struct Game* game, bool exit, char* format, ...) {
char text[1024] = {};
char text[1024] = {0};
PrintConsole(game, "Fatal Error, displaying Blue Screen of Derp...");
va_list vl;
va_start(vl, format);