diff options
author | Glenn Strauss <gstrauss@gluelogic.com> | 2020-02-24 18:48:03 -0500 |
---|---|---|
committer | Glenn Strauss <gstrauss@gluelogic.com> | 2020-07-08 19:54:30 -0400 |
commit | 0acb0f3604083eaa8363d865beab602efaab5381 (patch) | |
tree | 7212db5c6d83c4d0468f1d1d0f389fba5bcdf93e | |
parent | c752d4696ec34a45d4341700d63056a173312ebc (diff) | |
download | lighttpd-git-0acb0f3604083eaa8363d865beab602efaab5381.tar.gz |
[multiple] fix some cc warnings in 32-bit, powerpc
-rw-r--r-- | src/algo_sha1.c | 1 | ||||
-rw-r--r-- | src/connections.c | 4 | ||||
-rw-r--r-- | src/fdevent_libev.c | 1 | ||||
-rw-r--r-- | src/mod_magnet.c | 8 | ||||
-rw-r--r-- | src/mod_wstunnel.c | 28 |
5 files changed, 22 insertions, 20 deletions
diff --git a/src/algo_sha1.c b/src/algo_sha1.c index fd251cd8..d6a58599 100644 --- a/src/algo_sha1.c +++ b/src/algo_sha1.c @@ -66,6 +66,7 @@ typedef union _BYTE64QUAD16 { } BYTE64QUAD16; /* Hash a single 512-bit block. This is the core of the algorithm. */ +static void SHA1_Transform(sha1_quadbyte state[5], const sha1_byte buffer[64]) { sha1_quadbyte a, b, c, d, e; BYTE64QUAD16 src; diff --git a/src/connections.c b/src/connections.c index 2cc3e5d7..5dfedd4f 100644 --- a/src/connections.c +++ b/src/connections.c @@ -1452,11 +1452,11 @@ static void connection_check_timeout (connection * const con, const time_t cur_t if (r->conf.log_timeouts) { log_error(r->conf.errh, __FILE__, __LINE__, "NOTE: a request from %.*s for %.*s timed out after writing " - "%zd bytes. We waited %d seconds. If this is a problem, " + "%lld bytes. We waited %d seconds. If this is a problem, " "increase server.max-write-idle", BUFFER_INTLEN_PTR(con->dst_addr_buf), BUFFER_INTLEN_PTR(&r->target), - con->bytes_written, (int)r->conf.max_write_idle); + (long long)con->bytes_written, (int)r->conf.max_write_idle); } connection_set_state(r, CON_STATE_ERROR); changed = 1; diff --git a/src/fdevent_libev.c b/src/fdevent_libev.c index d6f82c4f..993c17da 100644 --- a/src/fdevent_libev.c +++ b/src/fdevent_libev.c @@ -1,5 +1,6 @@ #include "first.h" +#include <string.h> #include <stdlib.h> #include "fdevent_impl.h" diff --git a/src/mod_magnet.c b/src/mod_magnet.c index 47b6dc6b..6e80bd7e 100644 --- a/src/mod_magnet.c +++ b/src/mod_magnet.c @@ -259,14 +259,14 @@ typedef struct { size_t len; } const_buffer; -static const_buffer magnet_checkconstbuffer(lua_State *L, int index) { +static const_buffer magnet_checkconstbuffer(lua_State *L, int idx) { const_buffer cb; - cb.ptr = luaL_checklstring(L, index, &cb.len); + cb.ptr = luaL_checklstring(L, idx, &cb.len); return cb; } -static buffer* magnet_checkbuffer(lua_State *L, int index) { - const_buffer cb = magnet_checkconstbuffer(L, index); +static buffer* magnet_checkbuffer(lua_State *L, int idx) { + const_buffer cb = magnet_checkconstbuffer(L, idx); buffer *b = buffer_init(); buffer_copy_string_len(b, cb.ptr, cb.len); return b; diff --git a/src/mod_wstunnel.c b/src/mod_wstunnel.c index fcaea20a..934f13cb 100644 --- a/src/mod_wstunnel.c +++ b/src/mod_wstunnel.c @@ -937,8 +937,8 @@ static int recv_ietf_00(handler_ctx *hctx) { chunkqueue *cq = r->reqbody_queue; buffer *payload = hctx->frame.payload; char *mem; - DEBUG_LOG_DEBUG("recv data from client (fd=%d), size=%zx", - r->con->fd, chunkqueue_length(cq)); + DEBUG_LOG_DEBUG("recv data from client (fd=%d), size=%llx", + r->con->fd, (long long)chunkqueue_length(cq)); for (chunk *c = cq->first; c; c = c->next) { char *frame = c->mem->ptr+c->offset; /*(chunk_remaining_length() on MEM_CHUNK)*/ @@ -1122,8 +1122,8 @@ static int recv_rfc_6455(handler_ctx *hctx) { request_st * const r = hctx->gw.r; chunkqueue *cq = r->reqbody_queue; buffer *payload = hctx->frame.payload; - DEBUG_LOG_DEBUG("recv data from client (fd=%d), size=%zx", - r->con->fd, chunkqueue_length(cq)); + DEBUG_LOG_DEBUG("recv data from client (fd=%d), size=%llx", + r->con->fd, (long long)chunkqueue_length(cq)); for (chunk *c = cq->first; c; c = c->next) { char *frame = c->mem->ptr+c->offset; /*(chunk_remaining_length() on MEM_CHUNK)*/ @@ -1177,8 +1177,8 @@ static int recv_rfc_6455(handler_ctx *hctx) { hctx->frame.ctl.mask_cnt = 0; hctx->frame.ctl.siz = (uint64_t)(frame[i] & 0x7f); if (hctx->frame.ctl.siz == 0) { - DEBUG_LOG_DEBUG("specified payload size=%zx", - hctx->frame.ctl.siz); + DEBUG_LOG_DEBUG("specified payload size=%llx", + (unsigned long long)hctx->frame.ctl.siz); hctx->frame.state = MOD_WEBSOCKET_FRAME_STATE_READ_MASK; } else if (hctx->frame.ctl.siz == MOD_WEBSOCKET_FRAME_LEN16) { @@ -1194,8 +1194,8 @@ static int recv_rfc_6455(handler_ctx *hctx) { MOD_WEBSOCKET_FRAME_STATE_READ_EX_LENGTH; } else { - DEBUG_LOG_DEBUG("specified payload size=%zx", - hctx->frame.ctl.siz); + DEBUG_LOG_DEBUG("specified payload size=%llx", + (unsigned long long)hctx->frame.ctl.siz); hctx->frame.state = MOD_WEBSOCKET_FRAME_STATE_READ_MASK; } i++; @@ -1211,8 +1211,8 @@ static int recv_rfc_6455(handler_ctx *hctx) { MOD_WEBSOCKET_BUFMAX); return -1; } - DEBUG_LOG_DEBUG("specified payload size=%zx", - hctx->frame.ctl.siz); + DEBUG_LOG_DEBUG("specified payload size=%llx", + (unsigned long long)hctx->frame.ctl.siz); hctx->frame.state = MOD_WEBSOCKET_FRAME_STATE_READ_MASK; } i++; @@ -1241,8 +1241,8 @@ static int recv_rfc_6455(handler_ctx *hctx) { case MOD_WEBSOCKET_FRAME_STATE_READ_PAYLOAD: /* hctx->frame.ctl.siz <= SIZE_MAX */ if (hctx->frame.ctl.siz <= flen - i) { - DEBUG_LOG_DEBUG("read payload, size=%zx", - hctx->frame.ctl.siz); + DEBUG_LOG_DEBUG("read payload, size=%llx", + (unsigned long long)hctx->frame.ctl.siz); buffer_append_string_len(payload, frame+i, (size_t) (hctx->frame.ctl.siz & SIZE_MAX)); i += (size_t)(hctx->frame.ctl.siz & SIZE_MAX); @@ -1256,8 +1256,8 @@ static int recv_rfc_6455(handler_ctx *hctx) { buffer_append_string_len(payload, frame+i, flen - i); hctx->frame.ctl.siz -= flen - i; i += flen - i; - DEBUG_LOG_DEBUG("rest of payload size=%zx", - hctx->frame.ctl.siz); + DEBUG_LOG_DEBUG("rest of payload size=%llx", + (unsigned long long)hctx->frame.ctl.siz); } switch (hctx->frame.type) { case MOD_WEBSOCKET_FRAME_TYPE_TEXT: |