Suppressed many integer size warnings by a mix of type adjustments and casts,

none of which should have a real effect.

--HG--
branch : WINDOWSPORT
This commit is contained in:
Jean-Francois Dockes
2015-09-01 19:39:20 +02:00
parent 2fe75dba28
commit 1cbf02f713
36 changed files with 107 additions and 103 deletions
+1 -1
View File
@@ -47,7 +47,7 @@ BincStream::~BincStream(void)
}
//------------------------------------------------------------------------
string BincStream::popString(unsigned int size)
string BincStream::popString(std::string::size_type size)
{
if (size > nstr.length())
size = nstr.length();
+3 -3
View File
@@ -93,7 +93,7 @@ namespace Binc {
std::string tmp;
for (std::string::const_iterator i = s.begin();
i != s.end() && i + 1 != s.end(); i += 2) {
int n;
ptrdiff_t n;
unsigned char c = *i;
unsigned char d = *(i + 1);
@@ -145,7 +145,7 @@ namespace Binc {
//----------------------------------------------------------------------
inline void chomp(std::string &s_in, const std::string &chars = " \t\r\n")
{
int n = s_in.length();
std::string::size_type n = s_in.length();
while (n > 1 && chars.find(s_in[n - 1]) != std::string::npos)
s_in.resize(n-- - 1);
}
@@ -290,7 +290,7 @@ namespace Binc {
BincStream &operator << (char t);
//--
std::string popString(unsigned int size);
std::string popString(std::string::size_type size);
//--
char popChar(void);
+6 -6
View File
@@ -49,7 +49,7 @@ namespace Binc {
inline MimeInputSource(int fd, unsigned int start = 0);
virtual inline ~MimeInputSource(void);
virtual inline size_t fillRaw(char *raw, size_t nbytes);
virtual inline ssize_t fillRaw(char *raw, size_t nbytes);
virtual inline void reset(void);
virtual inline bool fillInputBuffer(void);
@@ -87,7 +87,7 @@ namespace Binc {
{
}
inline size_t MimeInputSource::fillRaw(char *raw, size_t nbytes)
inline ssize_t MimeInputSource::fillRaw(char *raw, size_t nbytes)
{
return read(fd, raw, nbytes);
}
@@ -179,7 +179,7 @@ namespace Binc {
class MimeInputSourceStream : public MimeInputSource {
public:
inline MimeInputSourceStream(istream& s, unsigned int start = 0);
virtual inline size_t fillRaw(char *raw, size_t nb);
virtual inline ssize_t fillRaw(char *raw, size_t nb);
virtual inline void reset(void);
private:
istream& s;
@@ -191,7 +191,7 @@ namespace Binc {
{
}
inline size_t MimeInputSourceStream::fillRaw(char *raw, size_t nb)
inline ssize_t MimeInputSourceStream::fillRaw(char *raw, size_t nb)
{
// Why can't streams tell how many characters were actually read
// when hitting eof ?
@@ -204,11 +204,11 @@ namespace Binc {
nbytes = nb;
}
if (nbytes <= 0) {
return (size_t)-1;
return (ssize_t)-1;
}
s.read(raw, nbytes);
return nbytes;
return static_cast<ssize_t>(nbytes);
}
inline void MimeInputSourceStream::reset(void)
+7 -7
View File
@@ -306,7 +306,7 @@ void Binc::MimePart::parseMessageRFC822(vector<Binc::MimePart> *members,
bool Binc::MimePart::skipUntilBoundary(const string &delimiter,
unsigned int *nlines, bool *eof)
{
int endpos = delimiter.length();
string::size_type endpos = delimiter.length();
char *delimiterqueue = 0;
int delimiterpos = 0;
const char *delimiterStr = delimiter.c_str();
@@ -340,7 +340,7 @@ bool Binc::MimePart::skipUntilBoundary(const string &delimiter,
delimiterpos = 0;
if (compareStringToQueue(delimiterStr, delimiterqueue,
delimiterpos, endpos)) {
delimiterpos, int(endpos))) {
foundBoundary = true;
break;
}
@@ -451,7 +451,7 @@ void Binc::MimePart::parseMultipart(const string &boundary,
skipUntilBoundary(delimiter, nlines, eof);
if (!eof)
*boundarysize = delimiter.size();
*boundarysize = int(delimiter.size());
postBoundaryProcessing(eof, nlines, boundarysize, foundendofpart);
@@ -484,7 +484,7 @@ void Binc::MimePart::parseMultipart(const string &boundary,
skipUntilBoundary(delimiter, nlines, eof);
if (!*eof)
*boundarysize = delimiter.size();
*boundarysize = int(delimiter.size());
postBoundaryProcessing(eof, nlines, boundarysize, foundendofpart);
}
@@ -528,7 +528,7 @@ void Binc::MimePart::parseSinglePart(const string &toboundary,
// *boundarysize = _toboundary.length();
char *boundaryqueue = 0;
int endpos = _toboundary.length();
size_t endpos = _toboundary.length();
if (toboundary != "") {
boundaryqueue = new char[endpos];
memset(boundaryqueue, 0, endpos);
@@ -553,8 +553,8 @@ void Binc::MimePart::parseSinglePart(const string &toboundary,
boundarypos = 0;
if (compareStringToQueue(_toboundaryStr, boundaryqueue,
boundarypos, endpos)) {
*boundarysize = _toboundary.length();
boundarypos, int(endpos))) {
*boundarysize = static_cast<int>(_toboundary.length());
break;
}
}
+1 -1
View File
@@ -119,7 +119,7 @@ int Binc::MimePart::doParseOnlyHeader(MimeInputSource *ms,
if (c == '\n') ++nlines;
if (c == ':') break;
if (c == '\n') {
for (int i = name.length() - 1; i >= 0; --i)
for (string::size_type i = name.length() - 1; i >= 0; --i)
mimeSource->ungetChar();
quit = true;