Skip to content

Commit

Permalink
Fix format errors found by the compiler
Browse files Browse the repository at this point in the history
  • Loading branch information
ellert authored and amadio committed Jan 28, 2025
1 parent 0a515fa commit 5f973e7
Show file tree
Hide file tree
Showing 12 changed files with 53 additions and 53 deletions.
4 changes: 2 additions & 2 deletions src/XrdCl/XrdClAsyncVectorReader.hh
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ namespace XrdCl
if( !chfound )
{
log->Error( XRootDMsg, "[%s] VectorReader: Impossible to find chunk "
"buffer corresponding to %d bytes at %ld",
"buffer corresponding to %d bytes at %lld",
url.GetHostId().c_str(), rdlst.rlen, rdlst.offset );
readstage = ReadDiscard;
continue;
Expand Down Expand Up @@ -181,7 +181,7 @@ namespace XrdCl
if( !st.IsOK() || st.code == suRetry )
return st;

log->Dump( XRootDMsg, "[%s] VectorReader: read buffer for chunk %d@%ld",
log->Dump( XRootDMsg, "[%s] VectorReader: read buffer for chunk %d@%lld",
url.GetHostId().c_str(), rdlst.rlen, rdlst.offset );

//----------------------------------------------------------------
Expand Down
20 changes: 10 additions & 10 deletions src/XrdCl/XrdClClassicCopyJob.cc
Original file line number Diff line number Diff line change
Expand Up @@ -890,8 +890,8 @@ namespace

if( !ch->status.IsOK() )
{
log->Debug( UtilityMsg, "Unable read %d bytes at %ld from %s: %s",
ch->chunk.GetLength(), ch->chunk.GetOffset(),
log->Debug( UtilityMsg, "Unable read %d bytes at %llu from %s: %s",
ch->chunk.GetLength(), (unsigned long long) ch->chunk.GetOffset(),
pUrl->GetObfuscatedURL().c_str(), ch->status.ToStr().c_str() );
delete [] (char *)ch->chunk.GetBuffer();
CleanUpChunks();
Expand Down Expand Up @@ -1458,7 +1458,7 @@ namespace
{
ss << *itr << ", ";
}
log->Debug( XrdCl::UtilityMsg, ss.str().c_str() );
log->Debug( XrdCl::UtilityMsg, "%s", ss.str().c_str() );

pXCpCtx = new XrdCl::XCpCtx( pReplicas, pBlockSize, pNbSrc, pChunkSize, pParallelChunks, fileSize );

Expand Down Expand Up @@ -1619,7 +1619,7 @@ namespace
if( pCurrentOffset != ci.GetOffset() )
{
log->Error( UtilityMsg, "Got out-of-bounds chunk, expected offset:"
" %ld, got %ld", pCurrentOffset, ci.GetOffset() );
" %llu, got %llu", (unsigned long long) pCurrentOffset, (unsigned long long) ci.GetOffset() );
return XRootDStatus( stError, errInternal );
}

Expand Down Expand Up @@ -1860,8 +1860,8 @@ namespace
if( !ch->status.IsOK() )
{
Log *log = DefaultEnv::GetLog();
log->Debug( UtilityMsg, "Unable write %d bytes at %ld from %s: %s",
ch->chunk.GetLength(), ch->chunk.GetOffset(),
log->Debug( UtilityMsg, "Unable write %d bytes at %llu from %s: %s",
ch->chunk.GetLength(), (unsigned long long) ch->chunk.GetOffset(),
pUrl.GetObfuscatedURL().c_str(), ch->status.ToStr().c_str() );
delete[] (char*)ci.GetBuffer(); // we took the ownership of the buffer
CleanUpChunks();
Expand Down Expand Up @@ -2190,8 +2190,8 @@ namespace
if( !ch->status.IsOK() )
{
Log *log = DefaultEnv::GetLog();
log->Debug( UtilityMsg, "Unable write %d bytes at %ld from %s: %s",
ch->chunk.GetLength(), ch->chunk.GetOffset(),
log->Debug( UtilityMsg, "Unable write %d bytes at %llu from %s: %s",
ch->chunk.GetLength(), (unsigned long long) ch->chunk.GetOffset(),
pUrl.GetObfuscatedURL().c_str(), ch->status.ToStr().c_str() );
CleanUpChunks();

Expand Down Expand Up @@ -2702,8 +2702,8 @@ namespace XrdCl
//--------------------------------------------------------------------------
if( src->GetSize() >= 0 && size != total_processed )
{
log->Error( UtilityMsg, "The declared source size is %ld bytes, but "
"received %ld bytes.", size, total_processed );
log->Error( UtilityMsg, "The declared source size is %llu bytes, but "
"received %llu bytes.", (unsigned long long) size, (unsigned long long) total_processed );
return SetResult( stError, errDataError );
}
pResults->Set( "size", total_processed );
Expand Down
16 changes: 8 additions & 8 deletions src/XrdCl/XrdClFileStateHandler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1415,21 +1415,21 @@ namespace XrdCl
if( inf->NeedRetry() ) // so we failed in the end
{
DefaultEnv::GetLog()->Warning( FileMsg, "[%p@%s] Failed retransmitting corrupted "
"page: pgoff=%llu, pglen=%du, pgdigest=%du", self.get(),
self->pFileUrl->GetObfuscatedURL().c_str(), pgoff, pglen, pgdigest );
"page: pgoff=%llu, pglen=%u, pgdigest=%u", self.get(),
self->pFileUrl->GetObfuscatedURL().c_str(), (unsigned long long) pgoff, pglen, pgdigest );
pgwrt->SetStatus( new XRootDStatus( stError, errDataError, 0,
"Failed to retransmit corrupted page" ) );
}
else
DefaultEnv::GetLog()->Info( FileMsg, "[%p@%s] Succesfuly retransmitted corrupted "
"page: pgoff=%llu, pglen=%du, pgdigest=%du", self.get(),
self->pFileUrl->GetObfuscatedURL().c_str(), pgoff, pglen, pgdigest );
"page: pgoff=%llu, pglen=%u, pgdigest=%u", self.get(),
self->pFileUrl->GetObfuscatedURL().c_str(), (unsigned long long) pgoff, pglen, pgdigest );
} );
auto st = PgWriteRetry( self, pgoff, pglen, pgbuf, pgdigest, h, timeout );
if( !st.IsOK() ) pgwrt->SetStatus( new XRootDStatus( st ) );
DefaultEnv::GetLog()->Info( FileMsg, "[%p@%s] Retransmitting corrupted page: "
"pgoff=%llu, pglen=%du, pgdigest=%du", self.get(),
self->pFileUrl->GetObfuscatedURL().c_str(), pgoff, pglen, pgdigest );
"pgoff=%llu, pglen=%u, pgdigest=%u", self.get(),
self->pFileUrl->GetObfuscatedURL().c_str(), (unsigned long long) pgoff, pglen, pgdigest );
}
} );

Expand Down Expand Up @@ -2420,9 +2420,9 @@ namespace XrdCl
}

log->Debug( FileMsg, "[%p@%s] successfully opened at %s, handle: %#x, "
"session id: %ld", this, pFileUrl->GetObfuscatedURL().c_str(),
"session id: %llu", this, pFileUrl->GetObfuscatedURL().c_str(),
pDataServer->GetHostId().c_str(), *((uint32_t*)pFileHandle),
pSessionId );
(unsigned long long) pSessionId );

//------------------------------------------------------------------------
// Inform the monitoring about opening success
Expand Down
4 changes: 2 additions & 2 deletions src/XrdCl/XrdClFileSystem.cc
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ namespace
std::ostringstream data;
data << ssp.st_dev << " " << ssp.st_size << " " << flags << " "
<< ssp.st_mtime;
log->Debug( FileMsg, data.str().c_str() );
log->Debug( FileMsg, "%s", data.str().c_str() );

StatInfo *statInfo = new StatInfo();
if( !statInfo->ParseServerResponse( data.str().c_str() ) )
Expand Down Expand Up @@ -641,7 +641,7 @@ namespace
XRootDStatus st = pCtx->fs->DirList( child, flags, handler, timeout );
if( !st.IsOK() )
{
log->Error( FileMsg, "Recursive directory list operation for %s failed: ",
log->Error( FileMsg, "Recursive directory list operation for %s failed: %s",
child.c_str(), st.ToString().c_str() );
pCtx->UpdateStatus( st );
continue;
Expand Down
2 changes: 1 addition & 1 deletion src/XrdCl/XrdClLocalFileHandler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ namespace XrdCl
std::ostringstream data;
data << ssp.st_dev << " " << ssp.st_size << " " << ssp.st_mode << " "
<< ssp.st_mtime;
log->Debug( FileMsg, data.str().c_str() );
log->Debug( FileMsg, "%s", data.str().c_str() );

StatInfo *statInfo = new StatInfo();
if( !statInfo->ParseServerResponse( data.str().c_str() ) )
Expand Down
6 changes: 3 additions & 3 deletions src/XrdCl/XrdClPollerBuiltIn.cc
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ namespace XrdCl
XrdSys::IOEvents::Poller* poller = IOEvents::Poller::Create( errNum, &errMsg );
if( !poller )
{
log->Error( PollerMsg, "Unable to create the internal poller object: ",
log->Error( PollerMsg, "Unable to create the internal poller object: "
"%s (%s)", XrdSysE2T( errno ), errMsg );
return false;
}
Expand Down Expand Up @@ -170,7 +170,7 @@ namespace XrdCl
helper->readTimeout, &errMsg );
if( !status )
{
log->Error( PollerMsg, "Unable to enable read notifications ",
log->Error( PollerMsg, "Unable to enable read notifications "
"while re-starting %s (%s)", XrdSysE2T( errno ), errMsg );

return false;
Expand All @@ -183,7 +183,7 @@ namespace XrdCl
helper->writeTimeout, &errMsg );
if( !status )
{
log->Error( PollerMsg, "Unable to enable write notifications ",
log->Error( PollerMsg, "Unable to enable write notifications "
"while re-starting %s (%s)", XrdSysE2T( errno ), errMsg );

return false;
Expand Down
10 changes: 5 additions & 5 deletions src/XrdCl/XrdClStream.cc
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@ namespace XrdCl
{
Log *log = DefaultEnv::GetLog();
log->Warning( PostMasterMsg, "[%s] Removed a leftover msg from the in-queue.",
pStreamName.c_str(), subStream );
pStreamName.c_str() );
}
}
pSubStreams[subStream]->outMsgHelper.Reset();
Expand Down Expand Up @@ -745,8 +745,8 @@ namespace XrdCl
// Check if we still have time to try and do something in the current window
//--------------------------------------------------------------------------
time_t elapsed = now-pConnectionInitTime;
log->Error( PostMasterMsg, "[%s] elapsed = %ld, pConnectionWindow = %d seconds.",
pStreamName.c_str(), elapsed, pConnectionWindow );
log->Error( PostMasterMsg, "[%s] elapsed = %lld, pConnectionWindow = %d seconds.",
pStreamName.c_str(), (long long) elapsed, pConnectionWindow );

//------------------------------------------------------------------------
// If we have some IP addresses left we try them
Expand Down Expand Up @@ -775,8 +775,8 @@ namespace XrdCl
else if( elapsed < pConnectionWindow && pConnectionCount < pConnectionRetry
&& !status.IsFatal() )
{
log->Info( PostMasterMsg, "[%s] Attempting reconnection in %ld seconds.",
pStreamName.c_str(), pConnectionWindow-elapsed );
log->Info( PostMasterMsg, "[%s] Attempting reconnection in %lld seconds.",
pStreamName.c_str(), (long long) (pConnectionWindow - elapsed) );

Task *task = new ::StreamConnectorTask( *pUrl, pStreamName );
pTaskManager->RegisterTask( task, pConnectionInitTime+pConnectionWindow );
Expand Down
4 changes: 2 additions & 2 deletions src/XrdCl/XrdClXRootDMsgHandler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2438,9 +2438,9 @@ namespace XrdCl

Log *log = DefaultEnv::GetLog();
if( warn )
log->Warning( XRootDMsg, sstrm.str().c_str() );
log->Warning( XRootDMsg, "%s", sstrm.str().c_str() );
else
log->Debug( XRootDMsg, sstrm.str().c_str() );
log->Debug( XRootDMsg, "%s", sstrm.str().c_str() );
}

// Read data from buffer
Expand Down
8 changes: 4 additions & 4 deletions src/XrdCl/XrdClXRootDTransport.cc
Original file line number Diff line number Diff line change
Expand Up @@ -764,9 +764,9 @@ namespace XrdCl
//--------------------------------------------------------------------------
XrdSysMutexHelper scopedLock( info->mutex );
uint16_t allocatedSIDs = info->sidManager->GetNumberOfAllocatedSIDs();
log->Dump( XRootDTransportMsg, "[%s] Stream inactive since %ld seconds, "
log->Dump( XRootDTransportMsg, "[%s] Stream inactive since %lld seconds, "
"TTL: %d, allocated SIDs: %d, open files: %d, bound file objects: %d",
info->streamName.c_str(), inactiveTime, ttl, allocatedSIDs,
info->streamName.c_str(), (long long) inactiveTime, ttl, allocatedSIDs,
info->openFiles, info->finstcnt.load( std::memory_order_relaxed ) );

if( info->openFiles != 0 && info->finstcnt.load( std::memory_order_relaxed ) != 0 )
Expand Down Expand Up @@ -799,9 +799,9 @@ namespace XrdCl
const bool anySID =
info->sidManager->IsAnySIDOldAs( now - streamTimeout );

log->Dump( XRootDTransportMsg, "[%s] Stream inactive since %ld seconds, "
log->Dump( XRootDTransportMsg, "[%s] Stream inactive since %lld seconds, "
"stream timeout: %d, any SID: %d, wait barrier: %s",
info->streamName.c_str(), inactiveTime, streamTimeout,
info->streamName.c_str(), (long long) inactiveTime, streamTimeout,
anySID, Utils::TimeToString(info->waitBarrier).c_str() );

if( inactiveTime < streamTimeout )
Expand Down
24 changes: 12 additions & 12 deletions src/XrdCl/XrdClZipArchive.cc
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ namespace XrdCl
[relativeOffset, rdbuff, &cache, &me]( XRootDStatus &st, RSP &rsp )
{
Log *log = DefaultEnv::GetLog();
log->Dump( ZipMsg, "[%p] Read %d bytes of remote data at offset %llu.",
&me, rsp.GetLength(), rsp.GetOffset() );
log->Dump( ZipMsg, "[%p] Read %u bytes of remote data at offset %llu.",
&me, rsp.GetLength(), (unsigned long long) rsp.GetOffset() );
cache.QueueRsp( st, relativeOffset, std::move( *rdbuff ) );
};
Async( std::move( p ), timeout );
Expand Down Expand Up @@ -187,8 +187,8 @@ namespace XrdCl
Pipeline p = XrdCl::RdWithRsp<RSP>( me.archive, offset, size, usrbuff ) >>
[=, &me]( XRootDStatus &st, RSP &r )
{
log->Dump( ZipMsg, "[%p] Read %d bytes of remote data at "
"offset %llu.", &me, r.GetLength(), r.GetOffset() );
log->Dump( ZipMsg, "[%p] Read %u bytes of remote data at "
"offset %llu.", &me, r.GetLength(), (unsigned long long) r.GetOffset() );
if( usrHandler )
{
XRootDStatus *status = ZipArchive::make_status( st );
Expand Down Expand Up @@ -298,7 +298,7 @@ namespace XrdCl
rdbuff = buffer.get();
openstage = HaveEocdBlk;
log->Dump( ZipMsg, "[%p] Opened a ZIP archive, reading "
"Central Directory at offset: %llu.", this, *rdoff );
"Central Directory at offset: %llu.", this, (unsigned long long) *rdoff );
}
// read the Central Directory (in several stages if necessary)
| XrdCl::Read( archive, rdoff, rdsize, rdbuff ) >>
Expand Down Expand Up @@ -327,12 +327,12 @@ namespace XrdCl
log->Dump( ZipMsg, "[%p] EOCD record parsed: %s", this,
eocd->ToString().c_str() );
if(eocd->cdOffset > archsize || eocd->cdOffset + eocd->cdSize > archsize)
throw bad_data();
throw bad_data();
}
catch(const bad_data &ex){
XRootDStatus error( stError, errDataError, 0,
"End-of-central-directory signature corrupted." );
Pipeline::Stop( error );
XRootDStatus error( stError, errDataError, 0,
"End-of-central-directory signature corrupted." );
Pipeline::Stop( error );
}
// Do we have the whole archive?
if( chunk.length == archsize )
Expand Down Expand Up @@ -372,7 +372,7 @@ namespace XrdCl
rdbuff = buffer.get();
openstage = HaveCdRecords;
log->Dump( ZipMsg, "[%p] Reading additional data at offset: %llu.",
this, *rdoff );
this, (unsigned long long) *rdoff );
Pipeline::Repeat(); break; // the break is really not needed ...
}

Expand All @@ -391,7 +391,7 @@ namespace XrdCl
rdbuff = buffer.get();
openstage = HaveZip64EocdBlk;
log->Dump( ZipMsg, "[%p] Reading additional data at offset: %llu.",
this, *rdoff );
this, (unsigned long long) *rdoff );
Pipeline::Repeat();
}

Expand Down Expand Up @@ -423,7 +423,7 @@ namespace XrdCl
rdbuff = buffer.get();
openstage = HaveCdRecords;
log->Dump( ZipMsg, "[%p] Reading additional data at offset: %llu.",
this, *rdoff );
this, (unsigned long long) *rdoff );
Pipeline::Repeat(); break; // the break is really not needed ...
}

Expand Down
4 changes: 2 additions & 2 deletions src/XrdClHttp/XrdClHttpFilePlugIn.cc
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ XRootDStatus HttpFilePlugIn::Read(uint64_t offset, uint32_t size, void *buffer,
if (avoid_pread_) offset_locker.unlock();

logger_->Debug(kLogXrdClHttp, "Read %d bytes, at offset %llu, from URL: %s",
num_bytes_read, offset, url_.c_str());
num_bytes_read, (unsigned long long) offset, url_.c_str());

auto status = new XRootDStatus();
auto chunk_info = new ChunkInfo(offset, num_bytes_read, buffer);
Expand Down Expand Up @@ -370,7 +370,7 @@ XRootDStatus HttpFilePlugIn::Write(uint64_t offset, uint32_t size,
filesize += res.first;

logger_->Debug(kLogXrdClHttp, "Wrote %d bytes, at offset %llu, to URL: %s",
res.first, offset, url_.c_str());
res.first, (unsigned long long) offset, url_.c_str());

handler->HandleResponse(new XRootDStatus(), nullptr);

Expand Down
4 changes: 2 additions & 2 deletions tests/XrdCl/XrdClFileTest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -643,10 +643,10 @@ void FileTest::VectorWriteTest()
const uint32_t MB = 1024*1024;
const uint32_t limit = 10*MB;

time_t seed = time( 0 );
unsigned int seed = (unsigned int) time( 0 );
srand( seed );
DefaultEnv::GetLog()->Info( UtilityMsg,
"Carrying out the VectorWrite test with seed: %d", seed );
"Carrying out the VectorWrite test with seed: %u", seed );

// figure out how many chunks are we going to write/read
size_t nbChunks = rand() % 100 + 1;
Expand Down

0 comments on commit 5f973e7

Please sign in to comment.