{ NULL, 0, 0, 0 }
};
-static int ratelimit_connects(unsigned int *last, int secs)
+static int ratelimit_connects(unsigned int *last, unsigned int secs)
{
struct timeval tv;
while (!force_exit) {
- if (!wsi_dumb && ratelimit_connects(&rl_dumb, 2)) {
+ if (!wsi_dumb && ratelimit_connects(&rl_dumb, 2u)) {
lwsl_notice("dumb: connecting\n");
wsi_dumb = lws_client_connect(context, address, port,
use_ssl, "/", argv[optind], argv[optind],
ietf_version);
}
- if (!wsi_mirror && ratelimit_connects(&rl_mirror, 2)) {
+ if (!wsi_mirror && ratelimit_connects(&rl_mirror, 2u)) {
lwsl_notice("mirror: connecting\n");
wsi_mirror = lws_client_connect(context,
address, port, use_ssl, "/",
case FRAGSTATE_RANDOM_PAYLOAD:
- for (n = 0; n < len; n++)
+ for (n = 0; (unsigned int)n < len; n++)
psf->sum += p[n];
psf->total_message += len;
psf->total_message, psf->sum);
bp[0] = psf->sum >> 24;
- bp[1] = psf->sum >> 16;
- bp[2] = psf->sum >> 8;
- bp[3] = psf->sum;
+ bp[1] = (unsigned char)(psf->sum >> 16);
+ bp[2] = (unsigned char)(psf->sum >> 8);
+ bp[3] = (unsigned char)psf->sum;
n = lws_write(wsi, (unsigned char *)bp,
4, LWS_WRITE_BINARY);
/* 64-bit ping index in network byte order */
while (shift >= 0) {
- *p++ = psd->ping_index >> shift;
+ *p++ = (unsigned char)(psd->ping_index >> shift);
shift -= 8;
}
- while (p - &pingbuf[LWS_SEND_BUFFER_PRE_PADDING] < size)
+ while ((unsigned int)(p - &pingbuf[LWS_SEND_BUFFER_PRE_PADDING]) < size)
*p++ = 0;
gettimeofday(&tv, NULL);
psd->ringbuffer[psd->ringbuffer_head].issue_timestamp =
(tv.tv_sec * 1000000) + tv.tv_usec;
- psd->ringbuffer[psd->ringbuffer_head].index = psd->ping_index++;
+ psd->ringbuffer[psd->ringbuffer_head].index = (unsigned long)psd->ping_index++;
psd->ringbuffer[psd->ringbuffer_head].seen = 0;
if (psd->ringbuffer_head == PING_RINGBUFFER_SIZE - 1)
if (n < 0)
return -1;
- if (n < size) {
+ if (n < (int)size) {
lwsl_err("Partial write\n");
return -1;
}
protocols[PROTOCOL_LWS_MIRROR].name = protocol_name;
break;
case 'i':
- interval_us = 1000000.0 * atof(optarg);
+ interval_us = (unsigned int)(1000000.0 * atof(optarg));
break;
case 's':
size = atoi(optarg);