Fix assorted compiler warnings found by Clang

This commit is contained in:
James Turner
2011-10-28 12:07:35 +01:00
parent c6d5cbd52c
commit 95ddc04a73
8 changed files with 9 additions and 9 deletions

View File

@@ -66,7 +66,7 @@ void Request::responseStart(const string& r)
void Request::responseHeader(const string& key, const string& value)
{
if (key == "connection") {
_willClose = (value.find("close") >= 0);
_willClose = (value.find("close") != string::npos);
}
_responseHeaders[key] = value;

View File

@@ -73,6 +73,6 @@ bool SGIOChannel::close() {
// dummy eof routine
bool SGIOChannel::eof() {
bool SGIOChannel::eof() const {
return false;
}

View File

@@ -149,7 +149,7 @@ public:
* false.
* @return result of eof check
*/
virtual bool eof();
virtual bool eof() const;
inline void set_type( SGChannelType t ) { type = t; }
inline SGChannelType get_type() const { return type; }

View File

@@ -88,7 +88,7 @@ public:
inline std::string get_file_name() const { return file_name; }
/** @return true of eof conditions exists */
inline bool eof() const { return eof_flag; };
virtual bool eof() const { return eof_flag; };
};

View File

@@ -206,7 +206,7 @@ string SGPath::base() const
return path;
}
if (index >= 0) {
if (index != string::npos) {
return path.substr(0, index);
} else {
return path;
@@ -256,7 +256,7 @@ string SGPath::complete_lower_extension() const
}
string::size_type firstDot = path.find(".", index);
if ((firstDot >= 0) && (path.find(sgDirPathSep, firstDot) == string::npos)) {
if ((firstDot != string::npos) && (path.find(sgDirPathSep, firstDot) == string::npos)) {
return boost::to_lower_copy(path.substr(firstDot + 1));
} else {
return "";

View File

@@ -124,7 +124,7 @@ public:
std::string dir() const;
/**
* Get the base part of the path (everything but the extension.)
* Get the base part of the path (everything but the final extension.)
* @return the base string
*/
std::string base() const;

View File

@@ -167,7 +167,7 @@ gzfilebuf::close()
std::streampos
gzfilebuf::seekoff( std::streamoff, ios_seekdir, int )
gzfilebuf::seekoff( std::streamoff, ios_seekdir, ios_openmode )
{
return std::streampos(EOF);
}

View File

@@ -90,7 +90,7 @@ public:
bool is_open() const { return (file != NULL); }
/** @return stream position */
virtual std::streampos seekoff( std::streamoff off, ios_seekdir way, int which );
virtual std::streampos seekoff( std::streamoff off, ios_seekdir way, ios_openmode which );
/** sync the stream */
virtual int sync();