From 30b94fbc5c89c8e7af89bbd98367b08fbcf15b8c Mon Sep 17 00:00:00 2001 From: mws Date: Tue, 22 Dec 2009 09:44:04 +0000 Subject: [PATCH] fix casting git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@106 e54a6e83-5905-42d5-8d5c-058d10e6a962 Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/c8e87eb023dada206e8f9f5fa71a53f75ec915d5 Author: mws Date: 2009-12-22 (Tue, 22 Dec 2009) ------------------ This commit was generated by Migit --- lib/connection/messagetools.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/connection/messagetools.cpp b/lib/connection/messagetools.cpp index cf140aa71..e16254c52 100644 --- a/lib/connection/messagetools.cpp +++ b/lib/connection/messagetools.cpp @@ -27,7 +27,7 @@ size_t write_length_field (unsigned char * buffer, unsigned int length) { if (length < 128) { - buffer[0] = length; + buffer[0] = static_cast(length); return 1; } else @@ -47,7 +47,7 @@ size_t write_length_field (unsigned char * buffer, unsigned int length) while (shiftby != 0) { shiftby -= 8; - buffer[pos++] = length >> shiftby; + buffer[pos++] = static_cast(length >> shiftby); } return pos; } @@ -66,7 +66,7 @@ unsigned int parse_length_field (const unsigned char * buffer) else if (size_indicator == 1) { - unsigned char length_field_size = buffer[0] & 0x7F; + unsigned char length_field_size = static_cast(buffer[0] & 0x7F); unsigned int i; for (i = 0; i < length_field_size; i++) @@ -91,6 +91,6 @@ size_t get_length_field_size (const unsigned int length) if (length < 0x1000000) return 0x04; - + return 0x05; }