diff options
author | Remko Tronçon <git@el-tramo.be> | 2011-03-13 13:54:08 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2011-04-18 19:11:40 (GMT) |
commit | 039636edc1b151431cba21a28986ff2be66b5349 (patch) | |
tree | 0bb5b964806885c9cb1b933d7a5a27480757b630 /Swiften/Base/ByteArray.h | |
parent | e494f9a206cbb44903f3a032f858b0ef35a039d1 (diff) | |
download | swift-swift-2.0alpha.zip swift-swift-2.0alpha.tar.bz2 |
Cleaned up includes.swift-2.0alpha
Diffstat (limited to 'Swiften/Base/ByteArray.h')
-rw-r--r-- | Swiften/Base/ByteArray.h | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/Swiften/Base/ByteArray.h b/Swiften/Base/ByteArray.h index ad2c1e5..2059052 100644 --- a/Swiften/Base/ByteArray.h +++ b/Swiften/Base/ByteArray.h @@ -6,11 +6,9 @@ #pragma once -#include <cstring> #include <vector> -#include <iostream> - #include <string> +#include <cstring> // for memcpy namespace Swift { class ByteArray @@ -24,7 +22,7 @@ namespace Swift { ByteArray(const char* c) { while (*c) { - data_.push_back(*c); + data_.push_back(static_cast<unsigned char>(*c)); ++c; } } @@ -75,7 +73,7 @@ namespace Swift { } void resize(size_t size, char c) { - return data_.resize(size, c); + return data_.resize(size, static_cast<unsigned char>(c)); } friend ByteArray operator+(const ByteArray& a, const ByteArray&b) { @@ -87,7 +85,7 @@ namespace Swift { friend ByteArray operator+(const ByteArray& a, char b) { ByteArray x; x.resize(1); - x[0] = b; + x[0] = static_cast<unsigned char>(b); return a + x; } @@ -97,7 +95,7 @@ namespace Swift { } ByteArray& operator+=(char c) { - data_.push_back(c); + data_.push_back(static_cast<unsigned char>(c)); return *this; } |