From 635229246abbac7c8d29191a58042c043f9d2004 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9B=D1=83=D0=B6=D0=B5=D1=86=D0=BA=D0=B8=D0=B9?= Date: Tue, 2 Sep 2014 13:37:35 +0400 Subject: [PATCH] warning C4244: '=' : conversion from 'unsigned short' to 'unsigned char', possible loss of data --- lib/parsers.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/parsers.c b/lib/parsers.c index 20e6fe926..8b5cfe4df 100644 --- a/lib/parsers.c +++ b/lib/parsers.c @@ -133,7 +133,7 @@ int lws_hdr_simple_create(struct libwebsocket *wsi, return -1; } - wsi->u.hdr.ah->frag_index[h] = wsi->u.hdr.ah->next_frag_index; + wsi->u.hdr.ah->frag_index[h] = (unsigned char)wsi->u.hdr.ah->next_frag_index; wsi->u.hdr.ah->frags[wsi->u.hdr.ah->next_frag_index].offset = wsi->u.hdr.ah->pos; @@ -384,7 +384,7 @@ int libwebsocket_parse( wsi->u.hdr.ah->next_frag_index].next_frag_index = 0; wsi->u.hdr.ah->frag_index[WSI_TOKEN_HTTP_URI_ARGS] = - wsi->u.hdr.ah->next_frag_index; + (unsigned char)wsi->u.hdr.ah->next_frag_index; /* defeat normal uri path processing */ wsi->u.hdr.ups = URIPS_ARGUMENTS; @@ -506,14 +506,14 @@ start_fragment: n = wsi->u.hdr.ah->frag_index[wsi->u.hdr.parser_state]; if (!n) { /* first fragment */ wsi->u.hdr.ah->frag_index[wsi->u.hdr.parser_state] = - wsi->u.hdr.ah->next_frag_index; + (unsigned char)wsi->u.hdr.ah->next_frag_index; break; } /* continuation */ while (wsi->u.hdr.ah->frags[n].next_frag_index) n = wsi->u.hdr.ah->frags[n].next_frag_index; wsi->u.hdr.ah->frags[n].next_frag_index = - wsi->u.hdr.ah->next_frag_index; + (unsigned char)wsi->u.hdr.ah->next_frag_index; if (wsi->u.hdr.ah->pos == sizeof(wsi->u.hdr.ah->data)) { lwsl_warn("excessive header content\n");