use __uintptr_type__

git-svn-id: file:///raid/svn-personal/tewi/trunk@31 8739d7e6-ffea-ec47-b151-bdff447c6205
This commit is contained in:
Nishi 2024-09-16 07:52:02 +00:00
parent 0f999d053a
commit 1a4d60b622
3 changed files with 5 additions and 4 deletions

View 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) {

View 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;

View 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