Browse Source

[multiple] fix some cc warnings in 32-bit, powerpc

personal/stbuehler/ci-build
Glenn Strauss 1 year ago
parent
commit
0acb0f3604
  1. 1
      src/algo_sha1.c
  2. 4
      src/connections.c
  3. 1
      src/fdevent_libev.c
  4. 8
      src/mod_magnet.c
  5. 28
      src/mod_wstunnel.c

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

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

1
src/fdevent_libev.c

@ -1,5 +1,6 @@
#include "first.h"
#include <string.h>
#include <stdlib.h>
#include "fdevent_impl.h"

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

28
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:

Loading…
Cancel
Save