]> Nishi Git Mirror - tewi.git/commitdiff
use __uintptr_type__
authorNishi <nishi@nishi.boats>
Mon, 16 Sep 2024 07:52:02 +0000 (07:52 +0000)
committerNishi <nishi@nishi.boats>
Mon, 16 Sep 2024 07:52:02 +0000 (07:52 +0000)
git-svn-id: file:///raid/svn-personal/tewi/trunk@31 8739d7e6-ffea-ec47-b151-bdff447c6205

Server/server.c
Server/ssl.c
Server/tw_ssl.h

index a3f67fd2a5885bd74e5c27815bf7cdbde93758ef..719f8a584dc659a3b0ffe5eace80ae8361dd86ae 100644 (file)
@@ -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) {
index 1892c940a5541c8c1bd26a6920e87ecd77cf1276..405e6e5e8a3852514ced6182b7bf0d559ff1afa7 100644 (file)
@@ -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;
index 0e2b2462c446f7e7a6c0dc35cb8c1e5f471365b6..9176ef28acc791a67014f4b47eed4a60e6215b01 100644 (file)
@@ -4,7 +4,8 @@
 #define __TW_SSL_H__
 
 #include <openssl/ssl.h>
+#include <stdint.h>
 
-SSL_CTX* tw_create_ssl_ctx(uint64_t port);
+SSL_CTX* tw_create_ssl_ctx(__UINTPTR_TYPE__ port);
 
 #endif