Clean up some warnings.
This commit is contained in:
parent
a19567508e
commit
dba6a91ec1
25 changed files with 453 additions and 431 deletions
|
@ -35,7 +35,7 @@ private:
|
|||
|
||||
std::string mVersion {"1.7"};
|
||||
PdfXRefTablePtr mXRefTable;
|
||||
unsigned mXRefOffset{0};
|
||||
std::size_t mXRefOffset{0};
|
||||
PdfDocumentCatalogPtr mCatalog;
|
||||
};
|
||||
|
||||
|
|
|
@ -16,8 +16,8 @@ std::string PdfXRefTable::toString()
|
|||
content += "\n";
|
||||
for (const auto& record : section.mRecords)
|
||||
{
|
||||
auto offsetString = StringUtils::toPaddedString(10, record.mOffsetBytes);
|
||||
auto generationString = StringUtils::toPaddedString(5, record.mGenerationNumber);
|
||||
auto offsetString = StringUtils::toPaddedString(10, static_cast<unsigned>(record.mOffsetBytes));
|
||||
auto generationString = StringUtils::toPaddedString(5, static_cast<unsigned>(record.mGenerationNumber));
|
||||
auto freeString = record.mIsFree ? "f" : "n";
|
||||
|
||||
content += offsetString + " " + generationString + " " + freeString + "\n";
|
||||
|
@ -27,7 +27,7 @@ std::string PdfXRefTable::toString()
|
|||
return content;
|
||||
}
|
||||
|
||||
unsigned PdfXRefTable::getNextOffset()
|
||||
std::size_t PdfXRefTable::getNextOffset()
|
||||
{
|
||||
auto lastNumRecords = mSections[mSections.size() - 1].mRecords.size();
|
||||
if (lastNumRecords > 0)
|
||||
|
@ -45,7 +45,7 @@ unsigned PdfXRefTable::getNextOffset()
|
|||
}
|
||||
}
|
||||
|
||||
void PdfXRefTable::addRecord(unsigned numBytes, unsigned generation, unsigned isFree)
|
||||
void PdfXRefTable::addRecord(std::size_t numBytes, std::size_t generation, unsigned isFree)
|
||||
{
|
||||
XRefRecord record;
|
||||
|
||||
|
@ -56,9 +56,9 @@ void PdfXRefTable::addRecord(unsigned numBytes, unsigned generation, unsigned is
|
|||
mLastAddedBytes = numBytes;
|
||||
}
|
||||
|
||||
unsigned PdfXRefTable::getNumEntries()
|
||||
std::size_t PdfXRefTable::getNumEntries()
|
||||
{
|
||||
unsigned count = 0;
|
||||
std::size_t count = 0;
|
||||
for (const auto& section : mSections)
|
||||
{
|
||||
count += section.mRecords.size();
|
||||
|
|
|
@ -6,14 +6,14 @@
|
|||
|
||||
struct XRefRecord
|
||||
{
|
||||
unsigned mOffsetBytes{0};
|
||||
unsigned mGenerationNumber{0};
|
||||
std::size_t mOffsetBytes{0};
|
||||
std::size_t mGenerationNumber{0};
|
||||
bool mIsFree{false};
|
||||
};
|
||||
|
||||
struct TableSubSection
|
||||
{
|
||||
unsigned mStartIndex{0};
|
||||
std::size_t mStartIndex{0};
|
||||
std::vector<XRefRecord> mRecords;
|
||||
};
|
||||
|
||||
|
@ -22,14 +22,14 @@ class PdfXRefTable
|
|||
public:
|
||||
PdfXRefTable();
|
||||
|
||||
void addRecord(unsigned numBytes, unsigned generation, unsigned isFree);
|
||||
void addRecord(std::size_t numBytes, std::size_t generation, unsigned isFree);
|
||||
|
||||
unsigned getNextOffset();
|
||||
std::size_t getNextOffset();
|
||||
|
||||
unsigned getNumEntries();
|
||||
std::size_t getNumEntries();
|
||||
|
||||
std::string toString();
|
||||
private:
|
||||
unsigned mLastAddedBytes{0};
|
||||
std::size_t mLastAddedBytes{0};
|
||||
std::vector<TableSubSection> mSections;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue