Skip to content

Commit

Permalink
Fix compilation warning on SL6
Browse files Browse the repository at this point in the history
  • Loading branch information
Alja MRak-Tadel committed Oct 28, 2016
1 parent 3aefdcc commit be65003
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
14 changes: 7 additions & 7 deletions src/XrdFileCache/XrdFileCacheInfo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ struct FpHelper

using namespace XrdFileCache;

const char* Info::m_infoExtension = ".cinfo";
const char* Info::m_traceID = "Cinfo";
const int Info::m_defaultVersion = 2;
const int Info::m_maxNumAccess = 3;
const char* Info::m_infoExtension = ".cinfo";
const char* Info::m_traceID = "Cinfo";
const int Info::m_defaultVersion = 2;
const size_t Info::m_maxNumAccess = 3;

//------------------------------------------------------------------------------

Expand Down Expand Up @@ -268,9 +268,9 @@ bool Info::ReadV1(XrdOssDF* fp, const std::string &fname)
TRACE(Dump, trace_pfx << " complete "<< m_complete << " access_cnt " << m_store.m_accessCnt);


int startFillIdx = m_store.m_accessCnt < m_maxNumAccess ? 0 : m_store.m_accessCnt - m_maxNumAccess;
size_t startFillIdx = m_store.m_accessCnt < m_maxNumAccess ? 0 : m_store.m_accessCnt - m_maxNumAccess;
AStatV1 av1;
for (int i = 0; i < m_store.m_accessCnt; ++i)
for (size_t i = 0; i < m_store.m_accessCnt; ++i)
{
if (r.ReadRaw(&av1, sizeof(AStatV1))) return false;

Expand Down Expand Up @@ -381,4 +381,4 @@ bool Info::GetLatestDetachTime(time_t& t) const

t = m_store.m_astats[m_store.m_accessCnt-1].DetachTime;
return true;
}
}
14 changes: 7 additions & 7 deletions src/XrdFileCache/XrdFileCacheInfo.hh
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public:
unsigned char *m_buff_synced; //!< disk written state vector
char m_cksum[16]; //!< cksum of downloaded information
time_t m_creationTime; //!< time the info file was created
int m_accessCnt; //!< number of written AStat structs
size_t m_accessCnt; //!< number of written AStat structs
std::vector<AStat> m_astats; //!< number of last m_maxAcessCnts

Store () : m_version(1), m_bufferSize(-1), m_fileSize(0), m_buff_synced(0),m_creationTime(0), m_accessCnt(0) {}
Expand Down Expand Up @@ -208,7 +208,7 @@ public:
//---------------------------------------------------------------------
//! Get number of accesses
//---------------------------------------------------------------------
int GetAccessCnt() { return m_store.m_accessCnt; }
size_t GetAccessCnt() { return m_store.m_accessCnt; }

//---------------------------------------------------------------------
//! Get version
Expand All @@ -225,14 +225,14 @@ public:
//---------------------------------------------------------------------
void GetCksum( unsigned char* buff, char* digest);

const static char* m_infoExtension;
const static char* m_traceID;
const static int m_defaultVersion;
const static int m_maxNumAccess;
const static char* m_infoExtension;
const static char* m_traceID;
const static int m_defaultVersion;
const static size_t m_maxNumAccess;

XrdOucTrace* GetTrace() const {return m_trace; }

static int GetMaxNumAccess() { return m_maxNumAccess; }
static size_t GetMaxNumAccess() { return m_maxNumAccess; }

protected:
XrdOucTrace* m_trace;
Expand Down
6 changes: 3 additions & 3 deletions src/XrdFileCache/XrdFileCachePrint.cc
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,10 @@ void Print::printFile(const std::string& path)
}

// printf("\nlatest access statistics:\n");
int startIdx = cfi.GetAccessCnt() < cfi.GetMaxNumAccess() ? 0 : cfi.GetAccessCnt() - cfi.GetMaxNumAccess();
size_t startIdx = cfi.GetAccessCnt() < cfi.GetMaxNumAccess() ? 0 : cfi.GetAccessCnt() - cfi.GetMaxNumAccess();
for (std::vector<Info::AStat>::const_iterator it = store.m_astats.begin(); it != store.m_astats.end(); ++it)
{
printf("access %d: ", startIdx++);
printf("access %lu: ", startIdx++);
char as[1000];
strftime(as, 1000, "%c", localtime(&(it->AttachTime)));
char ds[1000];
Expand Down Expand Up @@ -259,4 +259,4 @@ int main(int argc, char *argv[])
{
XrdFileCache::Print p(oss, verbose, path);
}
}
}

0 comments on commit be65003

Please sign in to comment.