Fixed a few warnings.

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4381 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2003-08-26 21:36:38 +00:00
parent 9f01bd9197
commit 66abd4d0a6
8 changed files with 18 additions and 14 deletions
+1 -1
View File
@@ -215,7 +215,7 @@ status_t BMessageBody::ReplaceData(const char *name, int32 index,
{ {
debugger("\n\n\tyou \033[44;1;37mB\033[41;1;37me\033[m screwed\n\n"); debugger("\n\n\tyou \033[44;1;37mB\033[41;1;37me\033[m screwed\n\n");
} }
if (index < RItem->Data().Size()) if (index < (int32)RItem->Data().Size())
{ {
RItem->Data()[index] = data; RItem->Data()[index] = data;
} }
+4 -2
View File
@@ -66,8 +66,9 @@ class BMessageField
static const char* sNullData; static const char* sNullData;
BMessageField(const std::string& name, type_code t) BMessageField(const std::string& name, type_code t)
: fName(name), fType(t) : fType(t), fName(name)
{;} {;}
virtual ~BMessageField() {}
virtual const std::string& Name() const { return fName; } virtual const std::string& Name() const { return fName; }
virtual type_code Type() const { return fType; } virtual type_code Type() const { return fType; }
virtual bool FixedSize() const { return true; } virtual bool FixedSize() const { return true; }
@@ -169,6 +170,7 @@ class BMessageFieldImpl : public BMessageField
fMaxSize(0), fMaxSize(0),
fFlags(MSG_FLAG_ALL) fFlags(MSG_FLAG_ALL)
{;} {;}
virtual ~BMessageFieldImpl() {}
virtual bool FixedSize() const virtual bool FixedSize() const
{ return fFlags & MSG_FLAG_FIXED_SIZE; } { return fFlags & MSG_FLAG_FIXED_SIZE; }
@@ -397,7 +399,7 @@ template<> struct BMessageFieldPrintPolicy<float>
}; };
template<> struct BMessageFieldPrintPolicy<double> template<> struct BMessageFieldPrintPolicy<double>
{ {
static void PrintData(const double& d) { std::printf("%.8lf", d); } static void PrintData(const double& d) { std::printf("%.8f", d); }
}; };
template<> struct BMessageFieldPrintPolicy<BString> template<> struct BMessageFieldPrintPolicy<BString>
{ {
+2 -1
View File
@@ -199,6 +199,7 @@ BMessage& BMessage::operator=(const BMessage& msg)
fHasSpecifiers = msg.fHasSpecifiers; fHasSpecifiers = msg.fHasSpecifiers;
*fBody = *(msg.fBody); *fBody = *(msg.fBody);
return *this;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void BMessage::init_data() void BMessage::init_data()
@@ -1925,7 +1926,7 @@ static status_t handle_reply(port_id reply_port,
return err; return err;
} }
if (*pCode = 'PUSH') if (*pCode == 'PUSH')
{ {
return B_ERROR; return B_ERROR;
} }
+2
View File
@@ -237,11 +237,13 @@ status_t BMessageBody::Flatten(BDataIO* stream) const
status_t BMessageBody::Unflatten(const char* flat_buffer) status_t BMessageBody::Unflatten(const char* flat_buffer)
{ {
// TODO: implement // TODO: implement
return B_ERROR;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
status_t BMessageBody::Unflatten(BDataIO* stream) status_t BMessageBody::Unflatten(BDataIO* stream)
{ {
// TODO: implement // TODO: implement
return B_ERROR;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
status_t BMessageBody::AddData(const char* name, type_code type, status_t BMessageBody::AddData(const char* name, type_code type,
+2 -3
View File
@@ -20,8 +20,8 @@ const char BTestShell::indent[] = " ";
BTestShell::BTestShell(const std::string &description, SyncObject *syncObject) BTestShell::BTestShell(const std::string &description, SyncObject *syncObject)
: fVerbosityLevel(v2) : fVerbosityLevel(v2)
, fDescription(description)
, fTestResults(syncObject) , fTestResults(syncObject)
, fDescription(description)
, fListTestsAndExit(false) , fListTestsAndExit(false)
, fTestDir(NULL) , fTestDir(NULL)
{ {
@@ -42,7 +42,6 @@ BTestShell::AddSuite(BTestSuite *suite) {
fSuites[suite->getName()] = suite; fSuites[suite->getName()] = suite;
// Add its tests // Add its tests
bool first = true;
const TestMap &map = suite->getTests(); const TestMap &map = suite->getTests();
for (TestMap::const_iterator i = map.begin(); for (TestMap::const_iterator i = map.begin();
i != map.end(); i != map.end();
@@ -378,7 +377,7 @@ BTestShell::LoadDynamicSuites() {
BDirectory libDir((*i).c_str()); BDirectory libDir((*i).c_str());
if (Verbosity() >= v3) if (Verbosity() >= v3)
cout << "Checking " << *i << endl; cout << "Checking " << *i << endl;
int count = LoadSuitesFrom(&libDir); /* int count =*/ LoadSuitesFrom(&libDir);
if (Verbosity() >= v3) { if (Verbosity() >= v3) {
// cout << "Loaded " << count << " suite" << (count == 1 ? "" : "s"); // cout << "Loaded " << count << " suite" << (count == 1 ? "" : "s");
// cout << " from " << *i << endl; // cout << " from " << *i << endl;
@@ -163,12 +163,12 @@ CompilerOutputter::wrap( std::string message )
std::string line( *it ); std::string line( *it );
const int maxLineLength = 80; const int maxLineLength = 80;
int index =0; int index =0;
while ( index < line.length() ) while ( index < (int)line.length() )
{ {
std::string line( line.substr( index, maxLineLength ) ); std::string line( line.substr( index, maxLineLength ) );
wrapped += line; wrapped += line;
index += maxLineLength; index += maxLineLength;
if ( index < line.length() ) if ( index < (int)line.length() )
wrapped += "\n"; wrapped += "\n";
} }
wrapped += '\n'; wrapped += '\n';
+2 -2
View File
@@ -14,10 +14,10 @@ namespace TextUi {
* \param outputter used to print text result. Owned by the runner. * \param outputter used to print text result. Owned by the runner.
*/ */
TestRunner::TestRunner( Outputter *outputter ) TestRunner::TestRunner( Outputter *outputter )
: m_outputter( outputter ) : m_suite( new TestSuite( "All Tests" ) )
, m_suite( new TestSuite( "All Tests" ) )
, m_result( new TestResultCollector() ) , m_result( new TestResultCollector() )
, m_eventManager( new TestResult() ) , m_eventManager( new TestResult() )
, m_outputter( outputter )
{ {
if ( !m_outputter ) if ( !m_outputter )
m_outputter = new TextOutputter( m_result, std::cout ); m_outputter = new TextOutputter( m_result, std::cout );
+3 -3
View File
@@ -108,7 +108,7 @@ std::string
XmlOutputter::Node::escape( std::string value ) const XmlOutputter::Node::escape( std::string value ) const
{ {
std::string escaped; std::string escaped;
for ( int index =0; index < value.length(); ++index ) for ( int index =0; index < (int)value.length(); ++index )
{ {
char c = value[index ]; char c = value[index ];
switch ( c ) // escape all predefined XML entity (safe?) switch ( c ) // escape all predefined XML entity (safe?)
@@ -229,7 +229,7 @@ XmlOutputter::addFailedTests( FailedTests &failedTests,
rootNode->addNode( testsNode ); rootNode->addNode( testsNode );
const TestResultCollector::Tests &tests = m_result->tests(); const TestResultCollector::Tests &tests = m_result->tests();
for ( int testNumber = 0; testNumber < tests.size(); ++testNumber ) for ( int testNumber = 0; testNumber < (int)tests.size(); ++testNumber )
{ {
Test *test = tests[testNumber]; Test *test = tests[testNumber];
if ( failedTests.find( test ) != failedTests.end() ) if ( failedTests.find( test ) != failedTests.end() )
@@ -246,7 +246,7 @@ XmlOutputter::addSucessfulTests( FailedTests &failedTests,
rootNode->addNode( testsNode ); rootNode->addNode( testsNode );
const TestResultCollector::Tests &tests = m_result->tests(); const TestResultCollector::Tests &tests = m_result->tests();
for ( int testNumber = 0; testNumber < tests.size(); ++testNumber ) for ( int testNumber = 0; testNumber < (int)tests.size(); ++testNumber )
{ {
Test *test = tests[testNumber]; Test *test = tests[testNumber];
if ( failedTests.find( test ) == failedTests.end() ) if ( failedTests.find( test ) == failedTests.end() )