From: Nishi Date: Mon, 16 Sep 2024 07:52:02 +0000 (+0000) Subject: use __uintptr_type__ X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=1a4d60b6222f28f77be29412fb843aa9ec7b0d33;p=tewi.git use __uintptr_type__ git-svn-id: file:///raid/svn-personal/tewi/trunk@31 8739d7e6-ffea-ec47-b151-bdff447c6205 --- diff --git a/Server/server.c b/Server/server.c index a3f67fd..719f8a5 100644 --- a/Server/server.c +++ b/Server/server.c @@ -502,7 +502,7 @@ void tw_server_pass(int sock, bool ssl, int port, SOCKADDR addr) { continue; } if(s.st_size < 1024ULL) { - sprintf(size, "%d", s.st_size); + sprintf(size, "%d", (int)s.st_size); } else if(s.st_size < 1024ULL * 1024) { sprintf(size, "%.1fK", (double)s.st_size / 1024); } else if(s.st_size < 1024ULL * 1024 * 1024) { diff --git a/Server/ssl.c b/Server/ssl.c index 1892c94..405e6e5 100644 --- a/Server/ssl.c +++ b/Server/ssl.c @@ -20,7 +20,7 @@ int tw_ssl_cert_cb(SSL* ssl, void* arg) { s = config.hostname; cm_log("SSL", "Could not get the servername, defaulting to the hostname: %s", s); } - struct tw_config_entry* e = tw_vhost_match(s, (uint64_t)arg); + struct tw_config_entry* e = tw_vhost_match(s, (__UINTPTR_TYPE__)arg); if(e != NULL && e->sslkey != NULL && e->sslcert != NULL) { SSL_use_PrivateKey_file(ssl, e->sslkey, SSL_FILETYPE_PEM); SSL_use_certificate_file(ssl, e->sslcert, SSL_FILETYPE_PEM); @@ -34,7 +34,7 @@ int tw_ssl_cert_cb(SSL* ssl, void* arg) { } } -SSL_CTX* tw_create_ssl_ctx(uint64_t port) { +SSL_CTX* tw_create_ssl_ctx(__UINTPTR_TYPE__ port) { SSL_CTX* ctx = SSL_CTX_new(TLS_server_method()); SSL_CTX_set_cert_cb(ctx, tw_ssl_cert_cb, (void*)port); return ctx; diff --git a/Server/tw_ssl.h b/Server/tw_ssl.h index 0e2b246..9176ef2 100644 --- a/Server/tw_ssl.h +++ b/Server/tw_ssl.h @@ -4,7 +4,8 @@ #define __TW_SSL_H__ #include +#include -SSL_CTX* tw_create_ssl_ctx(uint64_t port); +SSL_CTX* tw_create_ssl_ctx(__UINTPTR_TYPE__ port); #endif