1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

[gemini] cast

This commit is contained in:
Witold Filipczyk 2022-01-25 19:26:57 +01:00
parent 0d7aadf67c
commit 582d002e21
2 changed files with 8 additions and 8 deletions

View File

@ -62,7 +62,7 @@ static const char *
gemini_code_to_string(int code) gemini_code_to_string(int code)
{ {
const struct gemini_code *element const struct gemini_code *element
= bsearch((void *) (long) code, gemini_code, = (const struct gemini_code *)bsearch((void *) (long) code, gemini_code,
sizeof_array(gemini_code), sizeof_array(gemini_code),
sizeof(*element), sizeof(*element),
compare_gemini_codes); compare_gemini_codes);
@ -129,7 +129,7 @@ struct gemini_error_info {
static void static void
show_gemini_error_document(struct session *ses, void *data) show_gemini_error_document(struct session *ses, void *data)
{ {
struct gemini_error_info *info = data; struct gemini_error_info *info = (struct gemini_error_info *)data;
struct terminal *term = ses->tab->term; struct terminal *term = ses->tab->term;
struct cache_entry *cached = find_in_cache(info->uri); struct cache_entry *cached = find_in_cache(info->uri);
struct cache_entry *cache = cached ? cached : get_cache_entry(info->uri); struct cache_entry *cache = cached ? cached : get_cache_entry(info->uri);

View File

@ -82,7 +82,7 @@ gemini_protocol_handler(struct connection *conn)
static void static void
done_gemini_connection(struct connection *conn) done_gemini_connection(struct connection *conn)
{ {
struct gemini_connection_info *gemini = conn->info; struct gemini_connection_info *gemini = (struct gemini_connection_info *)conn->info;
mem_free(gemini); mem_free(gemini);
conn->info = NULL; conn->info = NULL;
@ -109,7 +109,7 @@ init_gemini_connection_info(struct connection *conn)
static void static void
gemini_send_header(struct socket *socket) gemini_send_header(struct socket *socket)
{ {
struct connection *conn = socket->conn; struct connection *conn = (struct connection *)socket->conn;
struct gemini_connection_info *gemini; struct gemini_connection_info *gemini;
struct string header; struct string header;
struct uri *uri = conn->uri; struct uri *uri = conn->uri;
@ -159,7 +159,7 @@ read_more_gemini_data(struct connection *conn, struct read_buffer *rb,
static void static void
read_gemini_data_done(struct connection *conn) read_gemini_data_done(struct connection *conn)
{ {
struct gemini_connection_info *gemini = conn->info; struct gemini_connection_info *gemini = (struct gemini_connection_info *)conn->info;
/* There's no content but an error so just print /* There's no content but an error so just print
* that instead of nothing. */ * that instead of nothing. */
@ -203,7 +203,7 @@ read_normal_gemini_data(struct connection *conn, struct read_buffer *rb)
static void static void
read_gemini_data(struct socket *socket, struct read_buffer *rb) read_gemini_data(struct socket *socket, struct read_buffer *rb)
{ {
struct connection *conn = socket->conn; struct connection *conn = (struct connection *)socket->conn;
int ret; int ret;
if (socket->state == SOCKET_CLOSED) { if (socket->state == SOCKET_CLOSED) {
@ -264,8 +264,8 @@ get_gemini_code(struct read_buffer *rb, int *code)
static void static void
gemini_got_header(struct socket *socket, struct read_buffer *rb) gemini_got_header(struct socket *socket, struct read_buffer *rb)
{ {
struct connection *conn = socket->conn; struct connection *conn = (struct connection *)socket->conn;
struct gemini_connection_info *gemini = conn->info; struct gemini_connection_info *gemini = (struct gemini_connection_info *)conn->info;
struct string head_string; struct string head_string;
struct connection_state state = (!is_in_state(conn->state, S_PROC) struct connection_state state = (!is_in_state(conn->state, S_PROC)
? connection_state(S_GETH) ? connection_state(S_GETH)