diff --git a/src/core/archive.cpp b/src/core/archive.cpp index 83f88e7..87f977c 100644 --- a/src/core/archive.cpp +++ b/src/core/archive.cpp @@ -790,7 +790,7 @@ int cFileArchive::Write(const void* pDest, int count) // throw(eArchive) // increase the size, if needed if (mReadHead > mFileSize) { -#if 0 // IS_SUNPRO \ +#if 0 // IS_SUNPRO // These two lines seem to be all there is between code that crashes and code that works for sunpro cDebug d("cFileArchive::Write()"); d.TraceDebug(_T("file(%s) adjusted mFileSize = %d mReadHead = %d\n"), mCurrentFilename.c_str(), (int)mFileSize, (int)mReadHead); diff --git a/src/fs/fspropdisplayer.cpp b/src/fs/fspropdisplayer.cpp index 4ed6215..ac8bdbc 100644 --- a/src/fs/fspropdisplayer.cpp +++ b/src/fs/fspropdisplayer.cpp @@ -141,7 +141,7 @@ void cFSPropDisplayer::Merge(const iFCOPropDisplayer* const ppd) if (ppd->GetType() != this->GetType()) ASSERT(false); - const cFSPropDisplayer* const pfspd = static_cast(ppd); + const cFSPropDisplayer* const pfspd = static_cast(ppd); // merge propvectors mpvPropsWeDisplay |= pfspd->GetPropsConverted(); @@ -260,7 +260,7 @@ void cFSPropDisplayer::InitForProp(const iFCO* const pFCO, const int propIdx) case cFSPropSet::PROP_UID: { const int64& i64UID = - static_cast(pFCO->GetPropSet()->GetPropAt(cFSPropSet::PROP_UID))->GetValue(); + static_cast(pFCO->GetPropSet()->GetPropAt(cFSPropSet::PROP_UID))->GetValue(); // check if prop is in table. if it is, then don't hit the FS TSTRING tstrDummy; @@ -279,7 +279,7 @@ void cFSPropDisplayer::InitForProp(const iFCO* const pFCO, const int propIdx) case cFSPropSet::PROP_GID: { const int64& i64GID = - static_cast(pFCO->GetPropSet()->GetPropAt(cFSPropSet::PROP_GID))->GetValue(); + static_cast(pFCO->GetPropSet()->GetPropAt(cFSPropSet::PROP_GID))->GetValue(); // check if prop is in table. if it is, then don't hit the FS TSTRING tstrDummy; @@ -330,7 +330,9 @@ TSTRING cFSPropDisplayer::PropAsString(const iFCO* const pFCO, const int propIdx case cFSPropSet::PROP_SIZE: case cFSPropSet::PROP_NLINK: { - const cFCOPropInt64* const pTypedProp = static_cast(pProp); + // Note that supplying both consts within the static cast makes gcc emit a + // "type qualifiers ignored on cast result type" (-Wignored-qualifiers) warning. + const cFCOPropInt64* const pTypedProp = static_cast(pProp); cTWLocale::FormatNumber(pTypedProp->GetValue(), strProp); } break; @@ -338,14 +340,14 @@ TSTRING cFSPropDisplayer::PropAsString(const iFCO* const pFCO, const int propIdx case cFSPropSet::PROP_MTIME: case cFSPropSet::PROP_CTIME: { - const cFCOPropInt64* const pTypedProp = static_cast(pProp); + const cFCOPropInt64* const pTypedProp = static_cast(pProp); int64 i64 = pTypedProp->GetValue(); cTWLocale::FormatTime(i64, strProp); } break; case cFSPropSet::PROP_MODE: { - const cFCOPropUint64* const pTypedProp = static_cast(pProp); + const cFCOPropUint64* const pTypedProp = static_cast(pProp); ASSERT(pTypedProp != 0); iFSServices::GetInstance()->ConvertModeToString(pTypedProp->GetValue(), strProp); @@ -353,7 +355,7 @@ TSTRING cFSPropDisplayer::PropAsString(const iFCO* const pFCO, const int propIdx break; case cFSPropSet::PROP_UID: { - const cFCOPropInt64* const pTypedProp = static_cast(pProp); + const cFCOPropInt64* const pTypedProp = static_cast(pProp); ASSERT(pTypedProp != 0); if (GetUsername(pTypedProp->GetValue(), strProp)) { @@ -367,7 +369,7 @@ TSTRING cFSPropDisplayer::PropAsString(const iFCO* const pFCO, const int propIdx break; case cFSPropSet::PROP_GID: { - const cFCOPropInt64* const pTypedProp = static_cast(pProp); + const cFCOPropInt64* const pTypedProp = static_cast(pProp); ASSERT(pTypedProp != 0); if (GetGroupname(pTypedProp->GetValue(), strProp)) { diff --git a/src/twtest/fcoreport_t.cpp b/src/twtest/fcoreport_t.cpp index d3f5a17..da0f3cd 100644 --- a/src/twtest/fcoreport_t.cpp +++ b/src/twtest/fcoreport_t.cpp @@ -103,10 +103,12 @@ void TestFCOReport() cFSObject* newChangedFCO = new cFSObject(cFCOName(_T("/etc/changed_file"))); cFCOPropVector changedPropVector; + /* //Calculate the time taken to generate the test report: time_t* dummy_arg = NULL; time_t time_finish; - //time_t time_begin = time(dummy_arg); + time_t time_begin = time(dummy_arg); + */ { cFCOReport report; @@ -122,10 +124,12 @@ void TestFCOReport() it.GetRemovedSet()->Insert(removedFCO); report.AddChangedFCO(it, oldChangedFCO, newChangedFCO, changedPropVector); + /* //Store the time taken to generate the test report: time_finish = time(dummy_arg); - //report.SetCreationTime( (int64)difftime(time_finish, time_begin)); - //d.TraceDebug("Report calculation time = %I64i seconds.\n", report.GetCreationTime()); + report.SetCreationTime( (int64)difftime(time_finish, time_begin)); + d.TraceDebug("Report calculation time = %I64i seconds.\n", report.GetCreationTime()); + */ d.TraceDebug("Before serializing report:\n"); TraceReport(report, d); diff --git a/src/twtest/textreportviewer_t.cpp b/src/twtest/textreportviewer_t.cpp index 8642dac..92ae35b 100644 --- a/src/twtest/textreportviewer_t.cpp +++ b/src/twtest/textreportviewer_t.cpp @@ -62,6 +62,7 @@ void MakeFile(TSTRING& fcoNameMakeMe); void MakeDir(const TCHAR* const lpszDirName); +#if 0 // Not used untill this test is fixed // we use this instead of TraceContents() so we can test the report iterators. static void TraceReport(const cFCOReport& r, cDebug& d) { @@ -105,6 +106,7 @@ static void TraceReport(const cFCOReport& r, cDebug& d) } } } +#endif /* // @@ -156,7 +158,7 @@ void TestTextReportViewer() fcoNameTempFile = fcoNameTempDir += _T("twtempXXXXXX"); pFSServices->MakeTempFilename( fcoNameTempFile ); } - catch(eFSServices& /* e */) + catch(const eFSServices& /* e */) { // TODO: properly handle error TEST( false ); @@ -459,7 +461,7 @@ void MakeFile(TSTRING& strNameMakeMe) TEST(file); file.close(); } - catch (eFSServices e) + catch (const eFSServices& e) { TEST(false); } diff --git a/src/util/fileutil.cpp b/src/util/fileutil.cpp index 3b9a5fa..0f651a1 100644 --- a/src/util/fileutil.cpp +++ b/src/util/fileutil.cpp @@ -111,7 +111,7 @@ bool cFileUtil::IsDir(const TSTRING& fileName) { iFSServices::GetInstance()->Stat(fileName, s); } - catch (eFSServices) + catch (const eFSServices&) { return false; } @@ -126,7 +126,7 @@ bool cFileUtil::IsRegularFile(const TSTRING& fileName) { iFSServices::GetInstance()->Stat(fileName, s); } - catch (eFSServices) + catch (const eFSServices&) { return false; }