fix casting

git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@106 e54a6e83-5905-42d5-8d5c-058d10e6a962
This commit is contained in:
mws
2009-12-22 09:44:04 +00:00
parent 732ffb18be
commit c8e87eb023

View File

@@ -27,7 +27,7 @@ size_t write_length_field (unsigned char * buffer, unsigned int length)
{ {
if (length < 128) if (length < 128)
{ {
buffer[0] = length; buffer[0] = static_cast<unsigned char>(length);
return 1; return 1;
} }
else else
@@ -47,7 +47,7 @@ size_t write_length_field (unsigned char * buffer, unsigned int length)
while (shiftby != 0) while (shiftby != 0)
{ {
shiftby -= 8; shiftby -= 8;
buffer[pos++] = length >> shiftby; buffer[pos++] = static_cast<unsigned char>(length >> shiftby);
} }
return pos; return pos;
} }
@@ -66,7 +66,7 @@ unsigned int parse_length_field (const unsigned char * buffer)
else if (size_indicator == 1) else if (size_indicator == 1)
{ {
unsigned char length_field_size = buffer[0] & 0x7F; unsigned char length_field_size = static_cast<unsigned char>(buffer[0] & 0x7F);
unsigned int i; unsigned int i;
for (i = 0; i < length_field_size; i++) for (i = 0; i < length_field_size; i++)