WaE: "PAGE_SIZE" redefined
No wonder such a generic-sounding term is defined in some system header, like in the Android NDK's <asm/page.h>. Change-Id: Id813afb836d358a3749a8a9fb1c9fb162f881c04
This commit is contained in:
@@ -150,7 +150,7 @@ sal_Bool ODbaseIndex::openIndexFile()
|
||||
if(m_pFileStream)
|
||||
{
|
||||
m_pFileStream->SetNumberFormatInt(NUMBERFORMAT_INT_LITTLEENDIAN);
|
||||
m_pFileStream->SetBufferSize(PAGE_SIZE);
|
||||
m_pFileStream->SetBufferSize(DINDEX_PAGE_SIZE);
|
||||
(*m_pFileStream) >> *this;
|
||||
}
|
||||
}
|
||||
@@ -349,7 +349,7 @@ ONDXPage* ODbaseIndex::CreatePage(sal_uInt32 nPagePos, ONDXPage* pParent, sal_Bo
|
||||
SvStream& connectivity::dbase::operator >> (SvStream &rStream, ODbaseIndex& rIndex)
|
||||
{
|
||||
rStream.Seek(0);
|
||||
rStream.Read(&rIndex.m_aHeader,PAGE_SIZE);
|
||||
rStream.Read(&rIndex.m_aHeader,DINDEX_PAGE_SIZE);
|
||||
|
||||
rIndex.m_nRootPage = rIndex.m_aHeader.db_rootpage;
|
||||
rIndex.m_nPageCount = rIndex.m_aHeader.db_pagecount;
|
||||
@@ -359,7 +359,7 @@ SvStream& connectivity::dbase::operator >> (SvStream &rStream, ODbaseIndex& rInd
|
||||
SvStream& connectivity::dbase::operator << (SvStream &rStream, ODbaseIndex& rIndex)
|
||||
{
|
||||
rStream.Seek(0);
|
||||
OSL_VERIFY_EQUALS( rStream.Write(&rIndex.m_aHeader,PAGE_SIZE), PAGE_SIZE, "Write not successful: Wrong header size for dbase index!");
|
||||
OSL_VERIFY_EQUALS( rStream.Write(&rIndex.m_aHeader,DINDEX_PAGE_SIZE), DINDEX_PAGE_SIZE, "Write not successful: Wrong header size for dbase index!");
|
||||
return rStream;
|
||||
}
|
||||
// -------------------------------------------------------------------------
|
||||
@@ -496,7 +496,7 @@ sal_Bool ODbaseIndex::CreateImpl()
|
||||
}
|
||||
|
||||
m_pFileStream->SetNumberFormatInt(NUMBERFORMAT_INT_LITTLEENDIAN);
|
||||
m_pFileStream->SetBufferSize(PAGE_SIZE);
|
||||
m_pFileStream->SetBufferSize(DINDEX_PAGE_SIZE);
|
||||
|
||||
// firstly the result must be sorted
|
||||
utl::SharedUNOComponent<XStatement> xStmt;
|
||||
@@ -545,13 +545,13 @@ sal_Bool ODbaseIndex::CreateImpl()
|
||||
m_aHeader.db_keytype = (nType == DataType::VARCHAR || nType == DataType::CHAR) ? 0 : 1;
|
||||
m_aHeader.db_keylen = (m_aHeader.db_keytype) ? 8 : (sal_uInt16)getINT32(xTableCol->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_PRECISION)));
|
||||
m_aHeader.db_keylen = (( m_aHeader.db_keylen - 1) / 4 + 1) * 4;
|
||||
m_aHeader.db_maxkeys = (PAGE_SIZE - 4) / (8 + m_aHeader.db_keylen);
|
||||
m_aHeader.db_maxkeys = (DINDEX_PAGE_SIZE - 4) / (8 + m_aHeader.db_keylen);
|
||||
if ( m_aHeader.db_maxkeys < 3 )
|
||||
{
|
||||
impl_killFileAndthrowError_throw(STR_COULD_NOT_CREATE_INDEX_KEYSIZE,sFile);
|
||||
}
|
||||
|
||||
m_pFileStream->SetStreamSize(PAGE_SIZE);
|
||||
m_pFileStream->SetStreamSize(DINDEX_PAGE_SIZE);
|
||||
|
||||
rtl::OString aCol(rtl::OUStringToOString(aName, m_pTable->getConnection()->getTextEncoding()));
|
||||
strncpy(m_aHeader.db_name, aCol.getStr(), std::min<size_t>(sizeof(m_aHeader.db_name), aCol.getLength()));
|
||||
|
@@ -57,11 +57,11 @@ sdbcx::ObjectType ODbaseIndexes::createObject(const ::rtl::OUString& _rName)
|
||||
if(pFileStream)
|
||||
{
|
||||
pFileStream->SetNumberFormatInt(NUMBERFORMAT_INT_LITTLEENDIAN);
|
||||
pFileStream->SetBufferSize(PAGE_SIZE);
|
||||
pFileStream->SetBufferSize(DINDEX_PAGE_SIZE);
|
||||
ODbaseIndex::NDXHeader aHeader;
|
||||
|
||||
pFileStream->Seek(0);
|
||||
pFileStream->Read(&aHeader,PAGE_SIZE);
|
||||
pFileStream->Read(&aHeader,DINDEX_PAGE_SIZE);
|
||||
delete pFileStream;
|
||||
|
||||
ODbaseIndex* pIndex = new ODbaseIndex(m_pTable,aHeader,_rName);
|
||||
|
@@ -834,7 +834,7 @@ static sal_uInt32 nValue;
|
||||
//------------------------------------------------------------------
|
||||
SvStream& connectivity::dbase::operator >> (SvStream &rStream, ONDXPage& rPage)
|
||||
{
|
||||
rStream.Seek(rPage.GetPagePos() * PAGE_SIZE);
|
||||
rStream.Seek(rPage.GetPagePos() * DINDEX_PAGE_SIZE);
|
||||
rStream >> nValue >> rPage.aChild;
|
||||
rPage.nCount = sal_uInt16(nValue);
|
||||
|
||||
@@ -847,17 +847,17 @@ SvStream& connectivity::dbase::operator >> (SvStream &rStream, ONDXPage& rPage)
|
||||
SvStream& connectivity::dbase::operator << (SvStream &rStream, const ONDXPage& rPage)
|
||||
{
|
||||
// Page doesn't exist yet
|
||||
sal_uIntPtr nSize = (rPage.GetPagePos() + 1) * PAGE_SIZE;
|
||||
sal_uIntPtr nSize = (rPage.GetPagePos() + 1) * DINDEX_PAGE_SIZE;
|
||||
if (nSize > rStream.Seek(STREAM_SEEK_TO_END))
|
||||
{
|
||||
rStream.SetStreamSize(nSize);
|
||||
rStream.Seek(rPage.GetPagePos() * PAGE_SIZE);
|
||||
rStream.Seek(rPage.GetPagePos() * DINDEX_PAGE_SIZE);
|
||||
|
||||
char aEmptyData[PAGE_SIZE];
|
||||
memset(aEmptyData,0x00,PAGE_SIZE);
|
||||
rStream.Write((sal_uInt8*)aEmptyData,PAGE_SIZE);
|
||||
char aEmptyData[DINDEX_PAGE_SIZE];
|
||||
memset(aEmptyData,0x00,DINDEX_PAGE_SIZE);
|
||||
rStream.Write((sal_uInt8*)aEmptyData,DINDEX_PAGE_SIZE);
|
||||
}
|
||||
sal_uIntPtr nCurrentPos = rStream.Seek(rPage.GetPagePos() * PAGE_SIZE);
|
||||
sal_uIntPtr nCurrentPos = rStream.Seek(rPage.GetPagePos() * DINDEX_PAGE_SIZE);
|
||||
OSL_UNUSED( nCurrentPos );
|
||||
|
||||
nValue = rPage.nCount;
|
||||
@@ -870,7 +870,7 @@ SvStream& connectivity::dbase::operator << (SvStream &rStream, const ONDXPage& r
|
||||
// check if we have to fill the stream with '\0'
|
||||
if(i < rPage.rIndex.getHeader().db_maxkeys)
|
||||
{
|
||||
sal_uIntPtr nTell = rStream.Tell() % PAGE_SIZE;
|
||||
sal_uIntPtr nTell = rStream.Tell() % DINDEX_PAGE_SIZE;
|
||||
sal_uInt16 nBufferSize = rStream.GetBufferSize();
|
||||
sal_uIntPtr nRemainSize = nBufferSize - nTell;
|
||||
if ( nRemainSize <= nBufferSize )
|
||||
|
@@ -26,7 +26,7 @@
|
||||
#include <tools/ref.hxx>
|
||||
|
||||
#define NODE_NOTFOUND 0xFFFF
|
||||
#define PAGE_SIZE 512
|
||||
#define DINDEX_PAGE_SIZE 512
|
||||
|
||||
namespace connectivity
|
||||
{
|
||||
|
Reference in New Issue
Block a user