From: quzar <qu...@us...> - 2025-05-16 18:43:49
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A KallistiOS implementation of conio. ". The branch, master has been updated via b9ea5cec481bf04821004ad80f1acb36f4d87d05 (commit) via ae543453d3861d740206638b1aada20cf3fc6d6b (commit) via e6d0d6de44c1e5f9235cbdc2a2512f40333b3201 (commit) from 95323837e6b19ed78a965d24e29a0720105e3967 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit b9ea5cec481bf04821004ad80f1acb36f4d87d05 Author: QuzarDC <qu...@co...> Date: Sun May 11 23:32:04 2025 -0400 Clean up minor warnings in conio. Unused param being voided, thd_create was being compared to 0, and input_buffer pos was signed for no good reason. commit ae543453d3861d740206638b1aada20cf3fc6d6b Author: QuzarDC <qu...@co...> Date: Sun May 11 23:27:57 2025 -0400 Voidify functions. commit e6d0d6de44c1e5f9235cbdc2a2512f40333b3201 Author: QuzarDC <qu...@co...> Date: Sun May 11 23:12:43 2025 -0400 Fix missing includes. These had been imported through dbglog via stdio. ----------------------------------------------------------------------- Summary of changes: conio.c | 24 ++++++++++++++---------- draw.c | 6 +++--- include/conio.h | 18 +++++++++--------- include/draw.h | 6 +++--- include/input.h | 6 +++--- input.c | 20 ++++++++++---------- 6 files changed, 42 insertions(+), 38 deletions(-) diff --git a/conio.c b/conio.c index 7a0757c..d2c2395 100644 --- a/conio.c +++ b/conio.c @@ -10,6 +10,8 @@ #include <stdio.h> #include <string.h> #include <assert.h> +#include <unistd.h> +#include <kos/fs.h> #include <kos/thread.h> #include <kos/sem.h> #include <dc/maple/keyboard.h> @@ -34,7 +36,7 @@ static semaphore_t ft_mutex; file_t conio_serial_fd; /* scroll everything up a line */ -void conio_scroll() { +void conio_scroll(void) { int i; switch (conio_ttymode) { @@ -57,7 +59,7 @@ void conio_scroll() { } /* move the cursor back, don't scroll (we can't) */ -void conio_deadvance_cursor() { +void conio_deadvance_cursor(void) { switch (conio_ttymode) { case CONIO_TTY_PVR: conio_cursor.col--; @@ -87,7 +89,7 @@ void conio_deadvance_cursor() { } /* move the cursor ahead, scroll if we need to */ -void conio_advance_cursor() { +void conio_advance_cursor(void) { switch (conio_ttymode) { case CONIO_TTY_PVR: conio_cursor.col++; @@ -139,7 +141,7 @@ void conio_gotoxy(int x, int y) { } /* blocking call for a character */ -int conio_getch() { +int conio_getch(void) { int key = -1; uint8 b; @@ -183,7 +185,7 @@ int conio_getch() { } /* Check to see if a key has been pressed */ -int conio_check_getch() { +int conio_check_getch(void) { int key = -1; uint8 b; @@ -307,7 +309,7 @@ int conio_printf(const char *fmt, ...) { } /* clear the screen */ -void conio_clear() { +void conio_clear(void) { int row, col; switch (conio_ttymode) { @@ -330,12 +332,12 @@ void conio_clear() { } /* conio freeze (for sub-process taking over TA) */ -void conio_freeze() { +void conio_freeze(void) { sem_wait(&ft_mutex); } /* conio thaw */ -void conio_thaw() { +void conio_thaw(void) { sem_signal(&ft_mutex); } @@ -352,6 +354,8 @@ static volatile int conio_exit = 0; /* the drawing/keyboard polling thread */ static void *conio_thread(void *param) { + (void)param; + conio_entered = 1; while (!conio_exit) { sem_wait(&ft_mutex); @@ -406,7 +410,7 @@ int conio_init(int ttymode, int inputmode) { /* create the conio thread */ conio_exit = 0; - if (thd_create(1, conio_thread, 0) < 0) + if (!thd_create(1, conio_thread, 0)) return -1; /* Wait for it to actually start */ @@ -416,7 +420,7 @@ int conio_init(int ttymode, int inputmode) { return 0; } -int conio_shutdown() { +int conio_shutdown(void) { /* shutup our thread */ conio_exit = 1; diff --git a/draw.c b/draw.c index cc7c9b5..7d96e4f 100644 --- a/draw.c +++ b/draw.c @@ -16,7 +16,7 @@ static pvr_ptr_t font_texture = NULL; /* initialize draw stuff: get our texture of the font, etc */ -void conio_draw_init() { +void conio_draw_init(void) { uint16 *vram; int x, y; @@ -32,7 +32,7 @@ void conio_draw_init() { } } -void conio_draw_shutdown() { +void conio_draw_shutdown(void) { assert( font_texture != NULL ); pvr_mem_free(font_texture); } @@ -175,7 +175,7 @@ static void draw_cursor(float r, float g, float b) { } /* our exported drawing function: does a full redraw of everything */ -void conio_draw_frame() { +void conio_draw_frame(void) { pvr_wait_ready(); pvr_scene_begin(); pvr_list_begin(PVR_LIST_TR_POLY); diff --git a/include/conio.h b/include/conio.h index 95d4f35..147c829 100644 --- a/include/conio.h +++ b/include/conio.h @@ -33,19 +33,19 @@ extern char conio_virtscr[CONIO_NUM_ROWS][CONIO_NUM_COLS]; #endif /* functions */ -void conio_scroll(); -void conio_deadvance_cursor(); -void conio_advance_cursor(); +void conio_scroll(void); +void conio_deadvance_cursor(void); +void conio_advance_cursor(void); void conio_gotoxy(int x, int y); -int conio_getch(); -int conio_check_getch(); +int conio_getch(void); +int conio_check_getch(void); void conio_setch(int ch); void conio_putch(int ch); void conio_putstr(char *str); int conio_printf(const char *fmt, ...); -void conio_clear(); -void conio_freeze(); -void conio_thaw(); +void conio_clear(void); +void conio_freeze(void); +void conio_thaw(void); void conio_set_theme(int theme); /* Themes: @@ -74,7 +74,7 @@ void conio_set_theme(int theme); extern int conio_ttymode, conio_inputmode, conio_theme; int conio_init(int ttymode, int inputmode); -int conio_shutdown(); +int conio_shutdown(void); __END_DECLS diff --git a/include/draw.h b/include/draw.h index 05dd7e7..e327d7e 100644 --- a/include/draw.h +++ b/include/draw.h @@ -23,9 +23,9 @@ #define CONIO_SCREEN_LASTCOL (CONIO_SCREEN_WIDTH - CONIO_SCREEN_FIRSTCOL) /* functions */ -void conio_draw_init(); -void conio_draw_shutdown(); -void conio_draw_frame(); +void conio_draw_init(void); +void conio_draw_shutdown(void); +void conio_draw_frame(void); #endif /* __CONIO_DRAW_H */ diff --git a/include/input.h b/include/input.h index aedf700..fdc57d3 100644 --- a/include/input.h +++ b/include/input.h @@ -14,9 +14,9 @@ #define CONIO_INPUT_BUFFSIZE 256 /* functions */ -void conio_input_frame(); -void conio_input_init(); -void conio_input_shutdown(); +void conio_input_frame(void); +void conio_input_init(void); +void conio_input_shutdown(void); typedef void (*conio_input_callback_t)(const char *str); void conio_input_callback(conio_input_callback_t cb); diff --git a/input.c b/input.c index a61a0ae..7602105 100644 --- a/input.c +++ b/input.c @@ -22,7 +22,7 @@ /* the buffer for input */ static struct { char text[CONIO_INPUT_BUFFSIZE]; - int pos; /* pos in the buffer, not the screen */ + unsigned int pos; /* pos in the buffer, not the screen */ } input_buffer; /* the state var */ @@ -44,7 +44,7 @@ static volatile cb_sem_data_t *cb_queue; static semaphore_t cb_sem, cb_mutex; static volatile int cb_dead; -static void input_cb_init() { +static void input_cb_init(void) { sem_init(&cb_sem, 0); sem_init(&cb_mutex, 1); cb_queue = NULL; @@ -64,7 +64,7 @@ static void cb_default(const char *str) { sem_signal(&cb_sem); } -static void input_cb_shutdown() { +static void input_cb_shutdown(void) { cb_sem_data_t *t, *n; int i; @@ -167,7 +167,7 @@ static void input_insertbuff(int ch) { } /* remove the char at input_buffer.pos from the buffer, and reflect the changes on the virtscr */ -static void input_delchar_buff() { +static void input_delchar_buff(void) { int len; len = strlen(input_buffer.text); @@ -186,7 +186,7 @@ static void input_delchar_buff() { } /* print the prompt out, clear input buffer */ -static void input_prompt() { +static void input_prompt(void) { input_buffer.pos = 0; *input_buffer.text = '\0'; /* conio_putstr("> "); */ @@ -194,7 +194,7 @@ static void input_prompt() { } /* reading commands from the prompt */ -static void input_readcomm() { +static void input_readcomm(void) { int key; key = conio_check_getch(); @@ -243,25 +243,25 @@ static void input_readcomm() { } /* read command line, try to execute builtin commands, otherwise externals (this coming soon) */ -static void input_command() { +static void input_command(void) { input_state = INPUT_PROMPT; if (input_cb) input_cb(input_buffer.text); } -void conio_input_init() { +void conio_input_init(void) { input_cb_init(); input_cb = cb_default; } -void conio_input_shutdown() { +void conio_input_shutdown(void) { input_cb = NULL; input_cb_shutdown(); } /* our exported input function, called once per frame. */ -void conio_input_frame() { +void conio_input_frame(void) { switch (input_state) { case INPUT_PROMPT: input_prompt(); break; case INPUT_READCOMM: input_readcomm(); break; hooks/post-receive -- A KallistiOS implementation of conio. |