mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-16 00:00:07 +01:00
warning C4018: '<' : signed/unsigned mismatch
This commit is contained in:
parent
2ce456b247
commit
f1a87a9600
8 changed files with 23 additions and 22 deletions
|
@ -23,7 +23,7 @@
|
|||
|
||||
int lws_handshake_client(struct libwebsocket *wsi, unsigned char **buf, size_t len)
|
||||
{
|
||||
int n;
|
||||
size_t n;
|
||||
|
||||
switch (wsi->mode) {
|
||||
case LWS_CONNMODE_WS_CLIENT_WAITING_PROXY_REPLY:
|
||||
|
|
|
@ -116,7 +116,7 @@ http_postbody:
|
|||
* what we have in the read buffer (len)
|
||||
* remaining portion of the POST body (content_remain)
|
||||
*/
|
||||
body_chunk_len = min(wsi->u.http.content_remain,len);
|
||||
body_chunk_len = min(wsi->u.http.content_remain,(int)len);
|
||||
wsi->u.http.content_remain -= body_chunk_len;
|
||||
len -= body_chunk_len;
|
||||
|
||||
|
|
|
@ -46,9 +46,9 @@ libwebsocket_0405_frame_mask_generate(struct libwebsocket *wsi)
|
|||
|
||||
LWS_VISIBLE void lwsl_hexdump(void *vbuf, size_t len)
|
||||
{
|
||||
int n;
|
||||
int m;
|
||||
int start;
|
||||
size_t n;
|
||||
size_t m;
|
||||
size_t start;
|
||||
unsigned char *buf = (unsigned char *)vbuf;
|
||||
char line[80];
|
||||
char *p;
|
||||
|
|
|
@ -548,7 +548,7 @@ struct _lws_header_related {
|
|||
|
||||
struct _lws_websocket_related {
|
||||
char *rx_user_buffer;
|
||||
int rx_user_buffer_head;
|
||||
size_t rx_user_buffer_head;
|
||||
unsigned char frame_masking_nonce_04[4];
|
||||
unsigned char frame_mask_index;
|
||||
size_t rx_packet_length;
|
||||
|
|
|
@ -58,7 +58,8 @@ callback_fraggle(struct libwebsocket_context *context,
|
|||
enum libwebsocket_callback_reasons reason,
|
||||
void *user, void *in, size_t len)
|
||||
{
|
||||
int n;
|
||||
int jn;
|
||||
size_t it;
|
||||
unsigned char buf[LWS_SEND_BUFFER_PRE_PADDING + 8000 +
|
||||
LWS_SEND_BUFFER_POST_PADDING];
|
||||
struct per_session_data__fraggle *psf = user;
|
||||
|
@ -99,8 +100,8 @@ callback_fraggle(struct libwebsocket_context *context,
|
|||
|
||||
case FRAGSTATE_RANDOM_PAYLOAD:
|
||||
|
||||
for (n = 0; n < len; n++)
|
||||
psf->sum += p[n];
|
||||
for (it = 0; it < len; it++)
|
||||
psf->sum += p[it];
|
||||
|
||||
psf->total_message += len;
|
||||
psf->packets_left++;
|
||||
|
@ -158,8 +159,8 @@ callback_fraggle(struct libwebsocket_context *context,
|
|||
psf->total_message += chunk;
|
||||
|
||||
libwebsockets_get_random(context, bp, chunk);
|
||||
for (n = 0; n < chunk; n++)
|
||||
psf->sum += bp[n];
|
||||
for (jn = 0; jn < chunk; jn++)
|
||||
psf->sum += bp[jn];
|
||||
|
||||
psf->packets_left--;
|
||||
if (psf->packets_left)
|
||||
|
@ -167,10 +168,10 @@ callback_fraggle(struct libwebsocket_context *context,
|
|||
else
|
||||
psf->state = FRAGSTATE_POST_PAYLOAD_SUM;
|
||||
|
||||
n = libwebsocket_write(wsi, bp, chunk, write_mode);
|
||||
if (n < 0)
|
||||
jn = libwebsocket_write(wsi, bp, chunk, write_mode);
|
||||
if (jn < 0)
|
||||
return -1;
|
||||
if (n < chunk) {
|
||||
if (jn < chunk) {
|
||||
lwsl_err("Partial write\n");
|
||||
return -1;
|
||||
}
|
||||
|
@ -189,11 +190,11 @@ callback_fraggle(struct libwebsocket_context *context,
|
|||
bp[2] = 0xff & (psf->sum >> 8);
|
||||
bp[3] = 0xff & (psf->sum);
|
||||
|
||||
n = libwebsocket_write(wsi, (unsigned char *)bp,
|
||||
jn = libwebsocket_write(wsi, (unsigned char *)bp,
|
||||
4, LWS_WRITE_BINARY);
|
||||
if (n < 0)
|
||||
if (jn < 0)
|
||||
return -1;
|
||||
if (n < 4) {
|
||||
if (jn < 4) {
|
||||
lwsl_err("Partial write\n");
|
||||
return -1;
|
||||
}
|
||||
|
|
|
@ -230,7 +230,7 @@ callback_lws_mirror(struct libwebsocket_context * this,
|
|||
shift -= 8;
|
||||
}
|
||||
|
||||
while (p - &pingbuf[LWS_SEND_BUFFER_PRE_PADDING] < size)
|
||||
while (p - &pingbuf[LWS_SEND_BUFFER_PRE_PADDING] < (ptrdiff_t)size)
|
||||
*p++ = 0;
|
||||
|
||||
gettimeofday(&tv, NULL);
|
||||
|
@ -267,13 +267,13 @@ callback_lws_mirror(struct libwebsocket_context * this,
|
|||
|
||||
if (n < 0)
|
||||
return -1;
|
||||
if (n < size) {
|
||||
if (n < (int)size) {
|
||||
lwsl_err("Partial write\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (flood &&
|
||||
(psd->ping_index - psd->rx_count) < (screen_width - 1))
|
||||
(psd->ping_index - psd->rx_count) < (unsigned long)(screen_width - 1))
|
||||
fprintf(stderr, ".");
|
||||
break;
|
||||
|
||||
|
|
|
@ -620,7 +620,7 @@ callback_lws_mirror(struct libwebsocket_context *context,
|
|||
lwsl_err("ERROR %d writing to mirror socket\n", n);
|
||||
return -1;
|
||||
}
|
||||
if (n < ringbuffer[pss->ringbuffer_tail].len)
|
||||
if (n < (int)ringbuffer[pss->ringbuffer_tail].len)
|
||||
lwsl_err("mirror partial write %d vs %d\n",
|
||||
n, ringbuffer[pss->ringbuffer_tail].len);
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ int gettimeofday(struct timeval *tv, struct timezone *tz)
|
|||
|
||||
/*converting file time to unix epoch*/
|
||||
tmpres /= 10; /*convert into microseconds*/
|
||||
tmpres -= DELTA_EPOCH_IN_MICROSECS;
|
||||
tmpres -= DELTA_EPOCH_IN_MICROSECS;
|
||||
tv->tv_sec = (long)(tmpres / 1000000UL);
|
||||
tv->tv_usec = (long)(tmpres % 1000000UL);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue