mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-24 10:52:56 +00:00
0 to Q_NULLPTR
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
This commit is contained in:
parent
ab283311d3
commit
269ae91c12
4 changed files with 10 additions and 12 deletions
|
@ -57,8 +57,7 @@ QT_BEGIN_NAMESPACE
|
|||
|
||||
On Unix this will be a file name
|
||||
*/
|
||||
QString
|
||||
QSharedMemoryPrivate::makePlatformSafeKey(const QString &key,
|
||||
QString QSharedMemoryPrivate::makePlatformSafeKey(const QString &key,
|
||||
const QString &prefix)
|
||||
{
|
||||
if (key.isEmpty())
|
||||
|
@ -407,7 +406,7 @@ bool QSharedMemory::attach(AccessMode mode)
|
|||
bool QSharedMemory::isAttached() const
|
||||
{
|
||||
Q_D(const QSharedMemory);
|
||||
return (0 != d->memory);
|
||||
return (d->memory != Q_NULLPTR);
|
||||
}
|
||||
|
||||
/*!
|
||||
|
|
|
@ -96,7 +96,7 @@ public:
|
|||
{
|
||||
if (q_sm && q_sm->lock())
|
||||
return true;
|
||||
q_sm = 0;
|
||||
q_sm = Q_NULLPTR;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -302,7 +302,7 @@ bool QSharedMemoryPrivate::attach(QSharedMemory::AccessMode mode)
|
|||
// grab the memory
|
||||
memory = shmat(id, 0, (mode == QSharedMemory::ReadOnly ? SHM_RDONLY : 0));
|
||||
if ((void*) - 1 == memory) {
|
||||
memory = 0;
|
||||
memory = Q_NULLPTR;
|
||||
setErrorString(QLatin1String("QSharedMemory::attach (shmat)"));
|
||||
return false;
|
||||
}
|
||||
|
@ -348,11 +348,11 @@ bool QSharedMemoryPrivate::attach(QSharedMemory::AccessMode mode)
|
|||
|
||||
// grab the memory
|
||||
int mprot = (mode == QSharedMemory::ReadOnly ? PROT_READ : PROT_READ | PROT_WRITE);
|
||||
memory = mmap(0, size, mprot, MAP_SHARED, hand, 0);
|
||||
memory = mmap(Q_NULLPTR, size, mprot, MAP_SHARED, hand, 0);
|
||||
if (memory == MAP_FAILED || !memory) {
|
||||
setErrorString(QLatin1String("QSharedMemory::attach (mmap)"));
|
||||
cleanHandle();
|
||||
memory = 0;
|
||||
memory = Q_NULLPTR;
|
||||
size = 0;
|
||||
return false;
|
||||
}
|
||||
|
@ -377,7 +377,7 @@ bool QSharedMemoryPrivate::detach()
|
|||
}
|
||||
return false;
|
||||
}
|
||||
memory = 0;
|
||||
memory = Q_NULLPTR;
|
||||
size = 0;
|
||||
|
||||
// Get the number of current attachments
|
||||
|
@ -416,7 +416,7 @@ bool QSharedMemoryPrivate::detach()
|
|||
setErrorString(QLatin1String("QSharedMemory::detach (munmap)"));
|
||||
return false;
|
||||
}
|
||||
memory = 0;
|
||||
memory = Q_NULLPTR;
|
||||
size = 0;
|
||||
|
||||
// get the number of current attachments
|
||||
|
|
|
@ -288,8 +288,7 @@ void QNetworkDiskCachePrivate::storeItem(QCacheItem *cacheItem)
|
|||
currentCacheSize += 1024 + cacheItem->size();
|
||||
currentCacheSize = q->expire();
|
||||
if (!cacheItem->file) {
|
||||
QString templateName = tmpCacheFileName();
|
||||
cacheItem->file = new QTemporaryFile(templateName, &cacheItem->data);
|
||||
cacheItem->file = new QTemporaryFile(tmpCacheFileName(), &cacheItem->data);
|
||||
if (cacheItem->file->open()) {
|
||||
cacheItem->writeHeader(cacheItem->file);
|
||||
cacheItem->writeCompressedData(cacheItem->file);
|
||||
|
|
Loading…
Add table
Reference in a new issue