"...git@developer.sourcefind.cn:renzhc/diffusers_dcu.git" did not exist on "91db81894b44798649b6cf54be085c205e146805"
Unverified Commit 9185a925 authored by hwiesmann's avatar hwiesmann Committed by GitHub
Browse files

Integer conversions generating compiler warnings (#2024)



* Prevention of compiler warning due to usage of int instead of a size type

* Conversion of status type to long to prevent compiler warnings

* The returned number of read items from a buffer is specified in numbers of type "streamsize"
Co-authored-by: default avatarHartwig <git@skywind.eu>
parent 08aeada7
......@@ -67,7 +67,7 @@ namespace dlib
//! \return modified string ``s'' with spaces trimmed from left
inline std::string& triml(std::string& s)
{
int pos(0);
std::string::size_type pos(0);
for ( ; s[pos] == ' ' || s[pos] == '\t' || s[pos] == '\r' || s[pos] == '\n' ; ++pos );
s.erase(0, pos);
return s;
......@@ -78,7 +78,7 @@ namespace dlib
//! \return modified string ``s'' with spaces trimmed from right
inline std::string& trimr(std::string& s)
{
int pos(s.size());
std::string::size_type pos(s.size());
for ( ; pos && (s[pos-1] == ' ' || s[pos-1] == '\t' || s[pos-1] == '\r' || s[pos-1] == '\n') ; --pos );
s.erase(pos, s.size()-pos);
return s;
......
......@@ -159,7 +159,7 @@ namespace dlib
// forward data from a to b
char buf[200];
int status;
long status;
bool error = false; // becomes true if one of the connections returns an error
while (true)
{
......@@ -287,7 +287,7 @@ namespace dlib
// forward data from b to a
char buf[200];
int status;
long status;
bool error = false;
while (true)
{
......
......@@ -454,7 +454,7 @@ namespace dlib
unsigned long len = 0;
std::streamsize len = 0;
// an array of 16 words
uint32 x[16];
......@@ -467,7 +467,7 @@ namespace dlib
std::streambuf& inputbuf = *input.rdbuf();
while(!at_end)
{
int num = inputbuf.sgetn(reinterpret_cast<char*>(temp),64);
std::streamsize num = inputbuf.sgetn(reinterpret_cast<char*>(temp),64);
len += num;
// if we hit the end of the stream then pad and add length
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment