aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKrow Savcik <krow@savcik.xyz>2024-02-11 00:22:58 +0200
committerKrow Savcik <krow@savcik.xyz>2024-02-11 00:22:58 +0200
commit67abc25311d9dc7d12b28d07aaa37fcaf9b5fee5 (patch)
tree8f2a01b9c06168f538edbf9d99dba312215ea4ef
parent984700a66faac957ee8e0b7b3415587665aa6fbd (diff)
fix some warnings and compilation errors
-rw-r--r--config.mk2
-rw-r--r--src/canvas.c1
-rw-r--r--src/cdraw.c5
-rw-r--r--src/cdraw.h2
-rw-r--r--src/debug.c1
-rw-r--r--src/ui.c1
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 <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include <assert.h>
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[] = {