From 67abc25311d9dc7d12b28d07aaa37fcaf9b5fee5 Mon Sep 17 00:00:00 2001 From: Krow Savcik Date: Sun, 11 Feb 2024 00:22:58 +0200 Subject: fix some warnings and compilation errors --- config.mk | 2 +- src/canvas.c | 1 + src/cdraw.c | 5 +---- src/cdraw.h | 2 +- src/debug.c | 1 + src/ui.c | 1 - 6 files changed, 5 insertions(+), 7 deletions(-) diff --git a/config.mk b/config.mk index e234f8b..6f21cc3 100644 --- a/config.mk +++ b/config.mk @@ -1,6 +1,6 @@ # INCS = `sdl2-config --cflags` -CFLAGS = -std=c89 -DSDL_DISABLE_IMMINTRIN_H -w -I. +CFLAGS = -DSDL_DISABLE_IMMINTRIN_H -I. -w -g LIBS = -lm -lSDL2 -lSDL2_image CC = cc diff --git a/src/canvas.c b/src/canvas.c index ce8772b..47f9b92 100644 --- a/src/canvas.c +++ b/src/canvas.c @@ -388,6 +388,7 @@ canvas_save(Canvas *c, const char *path, short int s) fclose(fp); if (s) canvas_set_proj_path(c, path); + return 0; } uint8 diff --git a/src/cdraw.c b/src/cdraw.c index 25c0dba..74335d4 100644 --- a/src/cdraw.c +++ b/src/cdraw.c @@ -10,9 +10,6 @@ #include "palette.h" #include "ui.h" -/* macros */ -#define LENGTH(X) (sizeof X / sizeof X[0]) - typedef struct { SDL_Keymod mod; SDL_Keycode sym; @@ -77,7 +74,7 @@ main_window_init(const char *s) return 1; } - ren = SDL_CreateRenderer(win, -1, 0); + ren = SDL_CreateRenderer(win, -1, SDL_RENDERER_PRESENTVSYNC); if (ren == NULL) { printf("SDL_CreateRenderer failed: %s\n", SDL_GetError()); return 1; diff --git a/src/cdraw.h b/src/cdraw.h index 1d66b6b..633eea7 100644 --- a/src/cdraw.h +++ b/src/cdraw.h @@ -15,7 +15,7 @@ extern int mouseX, mouseY; extern const unsigned int back_c; unsigned int main_event_handle(); -unsigned int main_window_init(); +unsigned int main_window_init(const char *); unsigned int main_quit(); /* Functions for user bind to something else */ diff --git a/src/debug.c b/src/debug.c index 3f2b85a..b673835 100644 --- a/src/debug.c +++ b/src/debug.c @@ -1,5 +1,6 @@ #include #include +#include #include struct debug_header { diff --git a/src/ui.c b/src/ui.c index 28a54f6..202abcb 100644 --- a/src/ui.c +++ b/src/ui.c @@ -13,7 +13,6 @@ #include "palette.h" #define fpan main_ui->focus_panel -#define LENGTH(X) (sizeof X / sizeof *X) #define MAX(a, b) (((a) > (b)) ? (a) : (b)); static const SDL_Rect ui_frame_rect[] = { -- cgit v1.2.3