Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
35b32286
Kaydet (Commit)
35b32286
authored
Kas 10, 2015
tarafından
Stephan Bergmann
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
loplugin:nullptr (automatic rewrite)
Change-Id: I2a4f84e8c36197a9d39a5bd36cb1e2401a956d87
üst
da95f17c
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
101 additions
and
101 deletions
+101
-101
store.hxx
include/store/store.hxx
+9
-9
lockbyte.cxx
store/source/lockbyte.cxx
+15
-15
storbase.cxx
store/source/storbase.cxx
+12
-12
storbase.hxx
store/source/storbase.hxx
+15
-15
storbios.cxx
store/source/storbios.cxx
+12
-12
storcach.cxx
store/source/storcach.cxx
+25
-25
stordata.hxx
store/source/stordata.hxx
+2
-2
stordir.cxx
store/source/stordir.cxx
+3
-3
stordir.hxx
store/source/stordir.hxx
+1
-1
store.cxx
store/source/store.cxx
+4
-4
storlckb.hxx
store/source/storlckb.hxx
+1
-1
storpage.hxx
store/source/storpage.hxx
+1
-1
stortree.cxx
store/source/stortree.cxx
+1
-1
No files found.
include/store/store.hxx
Dosyayı görüntüle @
35b32286
...
...
@@ -40,7 +40,7 @@ public:
/** Construction.
*/
inline
OStoreStream
()
:
m_hImpl
(
0
)
:
m_hImpl
(
nullptr
)
{}
/** Destruction.
...
...
@@ -100,7 +100,7 @@ public:
if
(
m_hImpl
)
{
(
void
)
store_releaseHandle
(
m_hImpl
);
m_hImpl
=
0
;
m_hImpl
=
nullptr
;
}
return
store_openStream
(
hFile
,
rPath
.
pData
,
rName
.
pData
,
eMode
,
&
m_hImpl
);
}
...
...
@@ -152,7 +152,7 @@ public:
/** Construction.
*/
inline
OStoreDirectory
()
:
m_hImpl
(
0
)
:
m_hImpl
(
nullptr
)
{}
/** Destruction.
...
...
@@ -212,7 +212,7 @@ public:
if
(
m_hImpl
)
{
(
void
)
store_releaseHandle
(
m_hImpl
);
m_hImpl
=
0
;
m_hImpl
=
nullptr
;
}
return
store_openDirectory
(
hFile
,
rPath
.
pData
,
rName
.
pData
,
eMode
,
&
m_hImpl
);
}
...
...
@@ -262,7 +262,7 @@ public:
/** Construction.
*/
inline
OStoreFile
()
:
m_hImpl
(
0
)
:
m_hImpl
(
nullptr
)
{}
/** Destruction.
...
...
@@ -315,7 +315,7 @@ public:
*/
inline
bool
isValid
()
const
{
return
(
m_hImpl
!=
0
);
return
(
m_hImpl
!=
nullptr
);
}
/** Open the file.
...
...
@@ -329,7 +329,7 @@ public:
if
(
m_hImpl
)
{
(
void
)
store_releaseHandle
(
m_hImpl
);
m_hImpl
=
0
;
m_hImpl
=
nullptr
;
}
return
store_openFile
(
rFilename
.
pData
,
eAccessMode
,
nPageSize
,
&
m_hImpl
);
}
...
...
@@ -343,7 +343,7 @@ public:
if
(
m_hImpl
)
{
(
void
)
store_releaseHandle
(
m_hImpl
);
m_hImpl
=
0
;
m_hImpl
=
nullptr
;
}
return
store_createMemoryFile
(
nPageSize
,
&
m_hImpl
);
}
...
...
@@ -356,7 +356,7 @@ public:
if
(
m_hImpl
)
{
(
void
)
store_closeFile
(
m_hImpl
);
m_hImpl
=
0
;
m_hImpl
=
nullptr
;
}
}
...
...
store/source/lockbyte.cxx
Dosyayı görüntüle @
35b32286
...
...
@@ -60,8 +60,8 @@ storeError ILockBytes::writePageAt (PageHolder const & rPage, sal_uInt32 nOffset
{
// [SECURITY:ValInput]
PageData
const
*
pagedata
=
rPage
.
get
();
OSL_PRECOND
(
!
(
pagedata
==
0
),
"store::ILockBytes::writePageAt(): invalid Page"
);
if
(
pagedata
==
0
)
OSL_PRECOND
(
!
(
pagedata
==
nullptr
),
"store::ILockBytes::writePageAt(): invalid Page"
);
if
(
pagedata
==
nullptr
)
return
store_E_InvalidParameter
;
sal_uInt32
const
offset
=
pagedata
->
location
();
...
...
@@ -80,7 +80,7 @@ storeError ILockBytes::readAt (sal_uInt32 nOffset, void * pBuffer, sal_uInt32 nB
{
// [SECURITY:ValInput]
sal_uInt8
*
dst_lo
=
static_cast
<
sal_uInt8
*>
(
pBuffer
);
if
(
!
(
dst_lo
!=
0
))
if
(
!
(
dst_lo
!=
nullptr
))
return
store_E_InvalidParameter
;
sal_uInt8
*
dst_hi
=
dst_lo
+
nBytes
;
...
...
@@ -102,7 +102,7 @@ storeError ILockBytes::writeAt (sal_uInt32 nOffset, void const * pBuffer, sal_uI
{
// [SECURITY:ValInput]
sal_uInt8
const
*
src_lo
=
static_cast
<
sal_uInt8
const
*>
(
pBuffer
);
if
(
!
(
src_lo
!=
0
))
if
(
!
(
src_lo
!=
nullptr
))
return
store_E_InvalidParameter
;
sal_uInt8
const
*
src_hi
=
src_lo
+
nBytes
;
...
...
@@ -148,7 +148,7 @@ struct FileHandle
{
oslFileHandle
m_handle
;
FileHandle
()
:
m_handle
(
0
)
{}
FileHandle
()
:
m_handle
(
nullptr
)
{}
bool
operator
!=
(
FileHandle
const
&
rhs
)
{
...
...
@@ -270,7 +270,7 @@ struct FileHandle
{
// Release handle.
closeFile
(
rFile
.
m_handle
);
rFile
.
m_handle
=
0
;
rFile
.
m_handle
=
nullptr
;
}
};
typedef
CloseFile
destructor_type
;
...
...
@@ -379,7 +379,7 @@ storeError FileLockBytes::readPageAt_Impl (PageHolder & rPage, sal_uInt32 nOffse
storeError
FileLockBytes
::
writePageAt_Impl
(
PageHolder
const
&
rPage
,
sal_uInt32
nOffset
)
{
PageData
const
*
pagedata
=
rPage
.
get
();
OSL_PRECOND
(
pagedata
!=
0
,
"contract violation"
);
OSL_PRECOND
(
pagedata
!=
nullptr
,
"contract violation"
);
return
writeAt_Impl
(
nOffset
,
pagedata
,
pagedata
->
size
());
}
...
...
@@ -448,7 +448,7 @@ struct FileMapping
sal_uInt32
m_nSize
;
oslFileHandle
m_hFile
;
FileMapping
()
:
m_pAddr
(
0
),
m_nSize
(
0
),
m_hFile
(
0
)
{}
FileMapping
()
:
m_pAddr
(
nullptr
),
m_nSize
(
0
),
m_hFile
(
nullptr
)
{}
bool
operator
!=
(
FileMapping
const
&
rhs
)
const
{
...
...
@@ -490,7 +490,7 @@ struct FileMapping
{
// Release mapping.
unmapFile
(
rMapping
.
m_hFile
,
rMapping
.
m_pAddr
,
rMapping
.
m_nSize
);
rMapping
.
m_pAddr
=
0
,
rMapping
.
m_nSize
=
0
;
rMapping
.
m_pAddr
=
nullptr
,
rMapping
.
m_nSize
=
0
;
}
};
typedef
UnmapFile
destructor_type
;
...
...
@@ -554,9 +554,9 @@ MappedLockBytes::~MappedLockBytes()
void
MappedLockBytes
::
allocate_Impl
(
void
**
ppPage
,
sal_uInt16
*
pnSize
)
{
OSL_PRECOND
((
ppPage
!=
0
)
&&
(
pnSize
!=
0
),
"contract violation"
);
if
((
ppPage
!=
0
)
&&
(
pnSize
!=
0
))
*
ppPage
=
0
,
*
pnSize
=
m_nPageSize
;
OSL_PRECOND
((
ppPage
!=
nullptr
)
&&
(
pnSize
!=
nullptr
),
"contract violation"
);
if
((
ppPage
!=
nullptr
)
&&
(
pnSize
!=
nullptr
))
*
ppPage
=
nullptr
,
*
pnSize
=
m_nPageSize
;
}
void
MappedLockBytes
::
deallocate_Impl
(
void
*
pPage
)
...
...
@@ -676,7 +676,7 @@ protected:
}
// namespace store
MemoryLockBytes
::
MemoryLockBytes
()
:
m_pData
(
0
),
m_nSize
(
0
),
m_xAllocator
()
:
m_pData
(
nullptr
),
m_nSize
(
0
),
m_xAllocator
()
{}
MemoryLockBytes
::~
MemoryLockBytes
()
...
...
@@ -715,7 +715,7 @@ storeError MemoryLockBytes::readPageAt_Impl (PageHolder & rPage, sal_uInt32 nOff
storeError
MemoryLockBytes
::
writePageAt_Impl
(
PageHolder
const
&
rPage
,
sal_uInt32
nOffset
)
{
PageData
const
*
pagedata
=
rPage
.
get
();
OSL_PRECOND
(
!
(
pagedata
==
0
),
"contract violation"
);
OSL_PRECOND
(
!
(
pagedata
==
nullptr
),
"contract violation"
);
return
writeAt_Impl
(
nOffset
,
pagedata
,
pagedata
->
size
());
}
...
...
@@ -768,7 +768,7 @@ storeError MemoryLockBytes::setSize_Impl (sal_uInt32 nSize)
if
(
nSize
!=
m_nSize
)
{
sal_uInt8
*
pData
=
static_cast
<
sal_uInt8
*>
(
rtl_reallocateMemory
(
m_pData
,
nSize
));
if
(
pData
!=
0
)
if
(
pData
!=
nullptr
)
{
if
(
nSize
>
m_nSize
)
memset
(
pData
+
m_nSize
,
0
,
sal
::
static_int_cast
<
size_t
>
(
nSize
-
m_nSize
));
...
...
store/source/storbase.cxx
Dosyayı görüntüle @
35b32286
...
...
@@ -50,18 +50,18 @@ SharedCount::Allocator::Allocator()
"store_shared_count_cache"
,
sizeof
(
long
),
0
,
// objalign
0
,
// constructor
0
,
// destructor
0
,
// reclaim
0
,
// userarg
0
,
// default source
nullptr
,
// constructor
nullptr
,
// destructor
nullptr
,
// reclaim
nullptr
,
// userarg
nullptr
,
// default source
0
// flags
);
}
SharedCount
::
Allocator
::~
Allocator
()
{
rtl_cache_destroy
(
m_cache
),
m_cache
=
0
;
rtl_cache_destroy
(
m_cache
),
m_cache
=
nullptr
;
}
/*========================================================================
...
...
@@ -104,7 +104,7 @@ private:
}
// namespace store
PageData
::
Allocator_Impl
::
Allocator_Impl
()
:
m_page_cache
(
0
),
m_page_size
(
0
)
:
m_page_cache
(
nullptr
),
m_page_size
(
0
)
{}
storeError
...
...
@@ -114,7 +114,7 @@ PageData::Allocator_Impl::initialize (sal_uInt16 nPageSize)
sal_Size
size
=
sal
::
static_int_cast
<
sal_Size
>
(
nPageSize
);
(
void
)
snprintf
(
name
,
sizeof
(
name
),
"store_page_alloc_%"
SAL_PRIuUINTPTR
,
size
);
m_page_cache
=
rtl_cache_create
(
name
,
size
,
0
,
0
,
0
,
0
,
0
,
0
,
0
);
m_page_cache
=
rtl_cache_create
(
name
,
size
,
0
,
nullptr
,
nullptr
,
nullptr
,
nullptr
,
nullptr
,
0
);
if
(
!
m_page_cache
)
return
store_E_OutOfMemory
;
...
...
@@ -124,19 +124,19 @@ PageData::Allocator_Impl::initialize (sal_uInt16 nPageSize)
PageData
::
Allocator_Impl
::~
Allocator_Impl
()
{
rtl_cache_destroy
(
m_page_cache
),
m_page_cache
=
0
;
rtl_cache_destroy
(
m_page_cache
),
m_page_cache
=
nullptr
;
}
void
PageData
::
Allocator_Impl
::
allocate_Impl
(
void
**
ppPage
,
sal_uInt16
*
pnSize
)
{
OSL_PRECOND
((
ppPage
!=
0
)
&&
(
pnSize
!=
0
),
"contract violation"
);
if
((
ppPage
!=
0
)
&&
(
pnSize
!=
0
))
OSL_PRECOND
((
ppPage
!=
nullptr
)
&&
(
pnSize
!=
nullptr
),
"contract violation"
);
if
((
ppPage
!=
nullptr
)
&&
(
pnSize
!=
nullptr
))
*
ppPage
=
rtl_cache_alloc
(
m_page_cache
),
*
pnSize
=
m_page_size
;
}
void
PageData
::
Allocator_Impl
::
deallocate_Impl
(
void
*
pPage
)
{
OSL_PRECOND
(
pPage
!=
0
,
"contract violation"
);
OSL_PRECOND
(
pPage
!=
nullptr
,
"contract violation"
);
rtl_cache_free
(
m_page_cache
,
pPage
);
}
...
...
store/source/storbase.hxx
Dosyayı görüntüle @
35b32286
...
...
@@ -124,12 +124,12 @@ public:
SharedCount
()
:
m_pCount
(
Allocator
::
get
().
alloc
())
{
if
(
m_pCount
!=
0
)
(
*
m_pCount
)
=
1
;
if
(
m_pCount
!=
nullptr
)
(
*
m_pCount
)
=
1
;
}
~
SharedCount
()
{
if
(
m_pCount
!=
0
)
if
(
m_pCount
!=
nullptr
)
{
long
new_count
=
--
(
*
m_pCount
);
if
(
new_count
==
0
)
...
...
@@ -145,7 +145,7 @@ public:
SharedCount
(
SharedCount
const
&
rhs
)
// nothrow
:
m_pCount
(
rhs
.
m_pCount
)
{
if
(
m_pCount
!=
0
)
++
(
*
m_pCount
);
if
(
m_pCount
!=
nullptr
)
++
(
*
m_pCount
);
}
SharedCount
&
operator
=
(
SharedCount
const
&
rhs
)
// nothrow
{
...
...
@@ -156,7 +156,7 @@ public:
bool
operator
==
(
long
count
)
const
{
return
(
m_pCount
!=
0
)
&&
(
*
m_pCount
==
count
);
return
(
m_pCount
!=
nullptr
)
&&
(
*
m_pCount
==
count
);
}
};
...
...
@@ -440,7 +440,7 @@ struct PageData
public
:
template
<
class
T
>
T
*
construct
()
{
void
*
page
=
0
;
sal_uInt16
size
=
0
;
void
*
page
=
nullptr
;
sal_uInt16
size
=
0
;
if
(
allocate
(
&
page
,
&
size
))
{
return
new
(
page
)
T
(
size
);
...
...
@@ -451,12 +451,12 @@ struct PageData
bool
allocate
(
void
**
ppPage
,
sal_uInt16
*
pnSize
)
{
allocate_Impl
(
ppPage
,
pnSize
);
return
((
*
ppPage
!=
0
)
&&
(
*
pnSize
!=
0
));
return
((
*
ppPage
!=
nullptr
)
&&
(
*
pnSize
!=
0
));
}
void
deallocate
(
void
*
pPage
)
{
if
(
pPage
!=
0
)
if
(
pPage
!=
nullptr
)
deallocate_Impl
(
pPage
);
}
...
...
@@ -548,17 +548,17 @@ class PageHolder
allocator_type
m_allocator
;
public
:
explicit
PageHolder
(
PageData
*
pagedata
=
0
,
allocator_type
const
&
allocator
=
allocator_type
())
explicit
PageHolder
(
PageData
*
pagedata
=
nullptr
,
allocator_type
const
&
allocator
=
allocator_type
())
:
m_refcount
(),
m_pagedata
(
pagedata
),
m_allocator
(
allocator
)
{
OSL_ENSURE
((
m_pagedata
==
0
)
||
m_allocator
.
is
(),
"store::PageHolder::ctor(): pagedata w/o allocator."
);
OSL_ENSURE
((
m_pagedata
==
nullptr
)
||
m_allocator
.
is
(),
"store::PageHolder::ctor(): pagedata w/o allocator."
);
}
~
PageHolder
()
{
if
((
m_refcount
==
1
)
&&
(
m_pagedata
!=
0
))
if
((
m_refcount
==
1
)
&&
(
m_pagedata
!=
nullptr
))
{
// free pagedata.
OSL_ENSURE
(
m_allocator
.
is
(),
"store::PageHolder::dtor(): pagedata w/o allocator."
);
...
...
@@ -591,23 +591,23 @@ public:
PageData
*
operator
->
()
{
OSL_PRECOND
(
m_pagedata
!=
0
,
"store::PageHolder::operator->(): Null pointer"
);
OSL_PRECOND
(
m_pagedata
!=
nullptr
,
"store::PageHolder::operator->(): Null pointer"
);
return
m_pagedata
;
}
PageData
const
*
operator
->
()
const
{
OSL_PRECOND
(
m_pagedata
!=
0
,
"store::PageHolder::operator->(): Null pointer"
);
OSL_PRECOND
(
m_pagedata
!=
nullptr
,
"store::PageHolder::operator->(): Null pointer"
);
return
m_pagedata
;
}
PageData
&
operator
*
()
{
OSL_PRECOND
(
m_pagedata
!=
0
,
"store::PageHolder::operator*(): Null pointer"
);
OSL_PRECOND
(
m_pagedata
!=
nullptr
,
"store::PageHolder::operator*(): Null pointer"
);
return
*
m_pagedata
;
}
PageData
const
&
operator
*
()
const
{
OSL_PRECOND
(
m_pagedata
!=
0
,
"store::PageHolder::operator*(): Null pointer"
);
OSL_PRECOND
(
m_pagedata
!=
nullptr
,
"store::PageHolder::operator*(): Null pointer"
);
return
*
m_pagedata
;
}
};
...
...
@@ -629,7 +629,7 @@ class PageHolderObject
template
<
class
U
>
static
bool
isA
(
PageData
const
*
p
)
{
return
((
p
!=
0
)
&&
(
p
->
type
()
==
U
::
theTypeId
));
return
((
p
!=
nullptr
)
&&
(
p
->
type
()
==
U
::
theTypeId
));
}
template
<
class
U
>
...
...
store/source/storbios.cxx
Dosyayı görüntüle @
35b32286
...
...
@@ -475,24 +475,24 @@ OStorePageBIOS::AceCache::AceCache()
sizeof
(
OStorePageBIOS
::
Ace
),
0
,
// objalign
reinterpret_cast
<
ace_constructor_type
>
(
OStorePageBIOS
::
Ace
::
constructor
),
0
,
// destructor,
0
,
// reclaim,
0
,
// userarg,
0
,
// default source,
nullptr
,
// destructor,
nullptr
,
// reclaim,
nullptr
,
// userarg,
nullptr
,
// default source,
0
// flags
);
}
OStorePageBIOS
::
AceCache
::~
AceCache
()
{
rtl_cache_destroy
(
m_ace_cache
),
m_ace_cache
=
0
;
rtl_cache_destroy
(
m_ace_cache
),
m_ace_cache
=
nullptr
;
}
OStorePageBIOS
::
Ace
*
OStorePageBIOS
::
AceCache
::
create
(
sal_uInt32
addr
,
sal_uInt32
used
)
{
Ace
*
ace
=
static_cast
<
Ace
*>
(
rtl_cache_alloc
(
m_ace_cache
));
if
(
ace
!=
0
)
if
(
ace
!=
nullptr
)
{
// verify invariant state.
OSL_ASSERT
((
ace
->
m_next
==
ace
)
&&
(
ace
->
m_prev
==
ace
));
...
...
@@ -507,7 +507,7 @@ OStorePageBIOS::AceCache::create (sal_uInt32 addr, sal_uInt32 used)
void
OStorePageBIOS
::
AceCache
::
destroy
(
OStorePageBIOS
::
Ace
*
ace
)
{
if
(
ace
!=
0
)
if
(
ace
!=
nullptr
)
{
// remove from queue (if any).
ace
->
m_next
->
m_prev
=
ace
->
m_prev
,
ace
->
m_prev
->
m_next
=
ace
->
m_next
;
...
...
@@ -529,8 +529,8 @@ OStorePageBIOS::AceCache::destroy (OStorePageBIOS::Ace * ace)
* OStorePageBIOS.
*/
OStorePageBIOS
::
OStorePageBIOS
()
:
m_xLockBytes
(
NULL
),
m_pSuper
(
NULL
),
:
m_xLockBytes
(
nullptr
),
m_pSuper
(
nullptr
),
m_bWriteable
(
false
)
{
}
...
...
@@ -588,7 +588,7 @@ storeError OStorePageBIOS::initialize_Impl (
if
(
eAccessMode
!=
store_AccessCreate
)
{
// Load SuperBlock page.
if
((
m_pSuper
=
new
SuperBlockPage
())
==
0
)
if
((
m_pSuper
=
new
SuperBlockPage
())
==
nullptr
)
return
store_E_OutOfMemory
;
eErrCode
=
read
(
0
,
m_pSuper
,
SuperBlockPage
::
theSize
);
...
...
@@ -627,7 +627,7 @@ storeError OStorePageBIOS::initialize_Impl (
rnPageSize
=
((
rnPageSize
+
STORE_MINIMUM_PAGESIZE
-
1
)
&
~
(
STORE_MINIMUM_PAGESIZE
-
1
));
// Create initial page (w/ SuperBlock).
if
((
m_pSuper
=
new
(
rnPageSize
)
SuperBlockPage
(
rnPageSize
))
==
0
)
if
((
m_pSuper
=
new
(
rnPageSize
)
SuperBlockPage
(
rnPageSize
))
==
nullptr
)
return
store_E_OutOfMemory
;
eErrCode
=
m_pSuper
->
save
(
*
this
,
rnPageSize
);
}
...
...
@@ -667,7 +667,7 @@ void OStorePageBIOS::cleanup_Impl()
}
// Release SuperBlock page.
delete
m_pSuper
,
m_pSuper
=
0
;
delete
m_pSuper
,
m_pSuper
=
nullptr
;
// Release PageCache.
m_xCache
.
clear
();
...
...
store/source/storcach.cxx
Dosyayı görüntüle @
35b32286
...
...
@@ -53,7 +53,7 @@ struct Entry
// Construction
explicit
Entry
(
PageHolder
const
&
rxPage
=
PageHolder
(),
sal_uInt32
nOffset
=
STORE_PAGE_NULL
)
:
m_xPage
(
rxPage
),
m_nOffset
(
nOffset
),
m_pNext
(
0
)
:
m_xPage
(
rxPage
),
m_nOffset
(
nOffset
),
m_pNext
(
nullptr
)
{}
// Destruction
...
...
@@ -96,34 +96,34 @@ EntryCache::EntryCache()
"store_cache_entry_cache"
,
sizeof
(
Entry
),
0
,
// objalign
0
,
// constructor
0
,
// destructor
0
,
// reclaim
0
,
// userarg
0
,
// default source
nullptr
,
// constructor
nullptr
,
// destructor
nullptr
,
// reclaim
nullptr
,
// userarg
nullptr
,
// default source
0
// flags
);
}
EntryCache
::~
EntryCache
()
{
rtl_cache_destroy
(
m_entry_cache
),
m_entry_cache
=
0
;
rtl_cache_destroy
(
m_entry_cache
),
m_entry_cache
=
nullptr
;
}
Entry
*
EntryCache
::
create
(
PageHolder
const
&
rxPage
,
sal_uInt32
nOffset
)
{
void
*
pAddr
=
rtl_cache_alloc
(
m_entry_cache
);
if
(
pAddr
!=
0
)
if
(
pAddr
!=
nullptr
)
{
// construct
return
new
(
pAddr
)
Entry
(
rxPage
,
nOffset
);
}
return
0
;
return
nullptr
;
}
void
EntryCache
::
destroy
(
Entry
*
entry
)
{
if
(
entry
!=
0
)
if
(
entry
!=
nullptr
)
{
// destruct
entry
->~
Entry
();
...
...
@@ -181,9 +181,9 @@ PageCache::~PageCache()
{
int
x
=
0
;
Entry
*
entry
=
m_hash_table
[
i
];
while
(
entry
!=
0
)
while
(
entry
!=
nullptr
)
{
m_hash_table
[
i
]
=
entry
->
m_pNext
,
entry
->
m_pNext
=
0
;
m_hash_table
[
i
]
=
entry
->
m_pNext
,
entry
->
m_pNext
=
nullptr
;
EntryCache
::
get
().
destroy
(
entry
);
entry
=
m_hash_table
[
i
];
x
+=
1
;
...
...
@@ -209,7 +209,7 @@ void PageCache::rescale_Impl (sal_Size new_size)
sal_Size
new_bytes
=
new_size
*
sizeof
(
Entry
*
);
Entry
**
new_table
=
static_cast
<
Entry
**>
(
rtl_allocateMemory
(
new_bytes
));
if
(
new_table
!=
0
)
if
(
new_table
!=
nullptr
)
{
Entry
**
old_table
=
m_hash_table
;
sal_Size
old_size
=
m_hash_size
;
...
...
@@ -230,14 +230,14 @@ void PageCache::rescale_Impl (sal_Size new_size)
for
(
i
=
0
;
i
<
old_size
;
i
++
)
{
Entry
*
curr
=
old_table
[
i
];
while
(
curr
!=
0
)
while
(
curr
!=
nullptr
)
{
Entry
*
next
=
curr
->
m_pNext
;
int
index
=
hash_index_Impl
(
curr
->
m_nOffset
);
curr
->
m_pNext
=
m_hash_table
[
index
],
m_hash_table
[
index
]
=
curr
;
curr
=
next
;
}
old_table
[
i
]
=
0
;
old_table
[
i
]
=
nullptr
;
}
if
(
old_table
!=
m_hash_table_0
)
{
...
...
@@ -250,7 +250,7 @@ void PageCache::rescale_Impl (sal_Size new_size)
Entry
*
PageCache
::
lookup_Impl
(
Entry
*
entry
,
sal_uInt32
nOffset
)
{
int
lookups
=
0
;
while
(
entry
!=
0
)
while
(
entry
!=
nullptr
)
{
if
(
entry
->
m_nOffset
==
nOffset
)
break
;
...
...
@@ -277,7 +277,7 @@ storeError PageCache::lookupPageAt (PageHolder & rxPage, sal_uInt32 nOffset)
int
index
=
hash_index_Impl
(
nOffset
);
Entry
const
*
entry
=
lookup_Impl
(
m_hash_table
[
index
],
nOffset
);
if
(
entry
!=
0
)
if
(
entry
!=
nullptr
)
{
// Existing entry.
rxPage
=
entry
->
m_xPage
;
...
...
@@ -296,8 +296,8 @@ storeError PageCache::insertPageAt (PageHolder const & rxPage, sal_uInt32 nOffse
{
// [SECURITY:ValInput]
PageData
const
*
pagedata
=
rxPage
.
get
();
OSL_PRECOND
(
!
(
pagedata
==
0
),
"store::PageCache::insertPageAt(): invalid Page"
);
if
(
pagedata
==
0
)
OSL_PRECOND
(
!
(
pagedata
==
nullptr
),
"store::PageCache::insertPageAt(): invalid Page"
);
if
(
pagedata
==
nullptr
)
return
store_E_InvalidParameter
;
sal_uInt32
const
offset
=
pagedata
->
location
();
...
...
@@ -310,7 +310,7 @@ storeError PageCache::insertPageAt (PageHolder const & rxPage, sal_uInt32 nOffse
return
store_E_CantSeek
;
Entry
*
entry
=
EntryCache
::
get
().
create
(
rxPage
,
nOffset
);
if
(
entry
!=
0
)
if
(
entry
!=
nullptr
)
{
// Insert new entry.
int
index
=
hash_index_Impl
(
nOffset
);
...
...
@@ -327,8 +327,8 @@ storeError PageCache::updatePageAt (PageHolder const & rxPage, sal_uInt32 nOffse
{
// [SECURITY:ValInput]
PageData
const
*
pagedata
=
rxPage
.
get
();
OSL_PRECOND
(
!
(
pagedata
==
0
),
"store::PageCache::updatePageAt(): invalid Page"
);
if
(
pagedata
==
0
)
OSL_PRECOND
(
!
(
pagedata
==
nullptr
),
"store::PageCache::updatePageAt(): invalid Page"
);
if
(
pagedata
==
nullptr
)
return
store_E_InvalidParameter
;
sal_uInt32
const
offset
=
pagedata
->
location
();
...
...
@@ -342,7 +342,7 @@ storeError PageCache::updatePageAt (PageHolder const & rxPage, sal_uInt32 nOffse
int
index
=
hash_index_Impl
(
nOffset
);
Entry
*
entry
=
lookup_Impl
(
m_hash_table
[
index
],
nOffset
);
if
(
entry
!=
0
)
if
(
entry
!=
nullptr
)
{
// Update existing entry.
entry
->
m_xPage
=
rxPage
;
...
...
@@ -360,7 +360,7 @@ storeError PageCache::removePageAt (sal_uInt32 nOffset)
return
store_E_CantSeek
;
Entry
**
ppEntry
=
&
(
m_hash_table
[
hash_index_Impl
(
nOffset
)]);
while
(
*
ppEntry
!=
0
)
while
(
*
ppEntry
!=
nullptr
)
{
if
((
*
ppEntry
)
->
m_nOffset
==
nOffset
)
{
...
...
@@ -368,7 +368,7 @@ storeError PageCache::removePageAt (sal_uInt32 nOffset)
Entry
*
entry
=
(
*
ppEntry
);
// Dequeue and destroy entry.
(
*
ppEntry
)
=
entry
->
m_pNext
,
entry
->
m_pNext
=
0
;
(
*
ppEntry
)
=
entry
->
m_pNext
,
entry
->
m_pNext
=
nullptr
;
EntryCache
::
get
().
destroy
(
entry
);
// Update stats and leave.
...
...
store/source/stordata.hxx
Dosyayı görüntüle @
35b32286
...
...
@@ -766,13 +766,13 @@ private:
page
&
PAGE
()
{
page
*
pImpl
=
static_cast
<
page
*>
(
m_xPage
.
get
());
OSL_PRECOND
(
pImpl
!=
0
,
"OStoreDirectoryPageObject::PAGE(): Null pointer"
);
OSL_PRECOND
(
pImpl
!=
nullptr
,
"OStoreDirectoryPageObject::PAGE(): Null pointer"
);
return
(
*
pImpl
);
}
page
const
&
PAGE
()
const
{
page
const
*
pImpl
=
static_cast
<
page
const
*>
(
m_xPage
.
get
());
OSL_PRECOND
(
pImpl
!=
0
,
"OStoreDirectoryPageObject::PAGE(): Null pointer"
);
OSL_PRECOND
(
pImpl
!=
nullptr
,
"OStoreDirectoryPageObject::PAGE(): Null pointer"
);
return
(
*
pImpl
);
}
...
...
store/source/stordir.cxx
Dosyayı görüntüle @
35b32286
...
...
@@ -51,7 +51,7 @@ inline sal_Size __store_convertTextToUnicode (
sal_uInt32
nCvtInfo
=
0
;
sal_Size
nCvtBytes
=
0
;
return
rtl_convertTextToUnicode
(
hConverter
,
0
,
hConverter
,
nullptr
,
pSrcBuffer
,
nSrcLength
,
pDstBuffer
,
nDstLength
,
OSTRING_TO_OUSTRING_CVTFLAGS
,
...
...
@@ -72,7 +72,7 @@ OStoreDirectory_Impl::OStoreDirectory_Impl()
:
m_xManager
(),
m_aDescr
(
0
,
0
,
0
),
m_nPath
(
0
),
m_hTextCvt
(
NULL
)
m_hTextCvt
(
nullptr
)
{}
/*
...
...
@@ -154,7 +154,7 @@ storeError OStoreDirectory_Impl::iterate (storeFindData &rFindData)
osl
::
MutexGuard
aGuard
(
*
m_xManager
);
// Check TextConverter.
if
(
m_hTextCvt
==
NULL
)
if
(
m_hTextCvt
==
nullptr
)
m_hTextCvt
=
rtl_createTextToUnicodeConverter
(
RTL_TEXTENCODING_UTF8
);
// Setup iteration key.
...
...
store/source/stordir.hxx
Dosyayı görüntüle @
35b32286
...
...
@@ -110,7 +110,7 @@ SAL_CALL query (OStoreObject *pHandle, SAL_UNUSED_PARAMETER OStoreDirectory_Impl
// Handle is kind of OStoreDirectory_Impl.
return
static_cast
<
OStoreDirectory_Impl
*>
(
pHandle
);
}
return
0
;
return
nullptr
;
}
/*========================================================================
...
...
store/source/store.cxx
Dosyayı görüntüle @
35b32286
...
...
@@ -106,7 +106,7 @@ storeError SAL_CALL store_createMemoryFile (
{
if
(
!
phFile
)
return
store_E_InvalidParameter
;
*
phFile
=
NULL
;
*
phFile
=
nullptr
;
Reference
<
ILockBytes
>
xLockBytes
;
...
...
@@ -141,7 +141,7 @@ storeError SAL_CALL store_openFile (
)
SAL_THROW_EXTERN_C
()
{
if
(
phFile
)
*
phFile
=
NULL
;
*
phFile
=
nullptr
;
if
(
!
(
pFilename
&&
phFile
))
return
store_E_InvalidParameter
;
...
...
@@ -218,7 +218,7 @@ storeError SAL_CALL store_openDirectory (
{
storeError
eErrCode
=
store_E_None
;
if
(
phDirectory
)
*
phDirectory
=
NULL
;
*
phDirectory
=
nullptr
;
OStoreHandle
<
OStorePageManager
>
xManager
(
OStoreHandle
<
OStorePageManager
>::
query
(
hFile
));
...
...
@@ -312,7 +312,7 @@ storeError SAL_CALL store_openStream (
{
storeError
eErrCode
=
store_E_None
;
if
(
phStream
)
*
phStream
=
NULL
;
*
phStream
=
nullptr
;
OStoreHandle
<
OStorePageManager
>
xManager
(
OStoreHandle
<
OStorePageManager
>::
query
(
hFile
));
...
...
store/source/storlckb.hxx
Dosyayı görüntüle @
35b32286
...
...
@@ -135,7 +135,7 @@ SAL_CALL query (OStoreObject *pHandle, SAL_UNUSED_PARAMETER OStoreLockBytes*)
// Handle is kind of OStoreLockBytes.
return
static_cast
<
OStoreLockBytes
*>
(
pHandle
);
}
return
0
;
return
nullptr
;
}
/*========================================================================
...
...
store/source/storpage.hxx
Dosyayı görüntüle @
35b32286
...
...
@@ -158,7 +158,7 @@ SAL_CALL query (OStoreObject *pHandle, SAL_UNUSED_PARAMETER OStorePageManager*)
// Handle is kind of OStorePageManager.
return
static_cast
<
OStorePageManager
*>
(
pHandle
);
}
return
0
;
return
nullptr
;
}
/*========================================================================
...
...
store/source/stortree.cxx
Dosyayı görüntüle @
35b32286
...
...
@@ -299,7 +299,7 @@ storeError OStoreBTreeNodeObject::remove (
*/
void
OStoreBTreeRootObject
::
testInvariant
(
char
const
*
message
)
{
OSL_PRECOND
(
m_xPage
.
get
()
!=
0
,
"OStoreBTreeRootObject::testInvariant(): Null pointer"
);
OSL_PRECOND
(
m_xPage
.
get
()
!=
nullptr
,
"OStoreBTreeRootObject::testInvariant(): Null pointer"
);
SAL_WARN_IF
(
(
m_xPage
->
location
()
-
m_xPage
->
size
())
!=
0
,
"store"
,
message
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment