Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(526)

Unified Diff: core/src/fxcrt/fx_basic_buffer.cpp

Issue 1172793002: Merge to XFA: Use stdint.h types throughout PDFium. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/src/fxcrt/fx_basic_bstring.cpp ('k') | core/src/fxcrt/fx_basic_coords.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fxcrt/fx_basic_buffer.cpp
diff --git a/core/src/fxcrt/fx_basic_buffer.cpp b/core/src/fxcrt/fx_basic_buffer.cpp
index 06ba9413a55d1ef26013b5684d7e19e282f49857..7d45a431289af35255cdd69321d94f75f1cffa9f 100644
--- a/core/src/fxcrt/fx_basic_buffer.cpp
+++ b/core/src/fxcrt/fx_basic_buffer.cpp
@@ -18,7 +18,7 @@ CFX_BinaryBuf::CFX_BinaryBuf(FX_STRSIZE size)
, m_DataSize(size)
, m_AllocSize(size)
{
- m_pBuffer = FX_Alloc(FX_BYTE, size);
+ m_pBuffer = FX_Alloc(uint8_t, size);
}
CFX_BinaryBuf::~CFX_BinaryBuf()
{
@@ -84,9 +84,9 @@ void CFX_BinaryBuf::ExpandBuf(FX_STRSIZE add_size)
new_size = (new_size + alloc_step - 1) / alloc_step * alloc_step;
FX_LPBYTE pNewBuffer = m_pBuffer;
if (pNewBuffer) {
- pNewBuffer = FX_Realloc(FX_BYTE, m_pBuffer, new_size);
+ pNewBuffer = FX_Realloc(uint8_t, m_pBuffer, new_size);
} else {
- pNewBuffer = FX_Alloc(FX_BYTE, new_size);
+ pNewBuffer = FX_Alloc(uint8_t, new_size);
}
m_pBuffer = pNewBuffer;
m_AllocSize = new_size;
@@ -126,7 +126,7 @@ void CFX_BinaryBuf::InsertBlock(FX_STRSIZE pos, const void* pBuf, FX_STRSIZE siz
}
m_DataSize += size;
}
-void CFX_BinaryBuf::AppendFill(FX_BYTE byte, FX_STRSIZE count)
+void CFX_BinaryBuf::AppendFill(uint8_t byte, FX_STRSIZE count)
{
ExpandBuf(count);
if (!m_pBuffer) {
@@ -242,7 +242,7 @@ CFX_WideStringC CFX_WideTextBuf::GetWideString() const
{
return CFX_WideStringC((FX_LPCWSTR)m_pBuffer, m_DataSize / sizeof(FX_WCHAR));
}
-CFX_ArchiveSaver& CFX_ArchiveSaver::operator << (FX_BYTE i)
+CFX_ArchiveSaver& CFX_ArchiveSaver::operator << (uint8_t i)
{
if (m_pStream) {
m_pStream->WriteBlock(&i, 1);
@@ -325,7 +325,7 @@ FX_BOOL CFX_ArchiveLoader::IsEOF()
{
return m_LoadingPos >= m_LoadingSize;
}
-CFX_ArchiveLoader& CFX_ArchiveLoader::operator >> (FX_BYTE& i)
+CFX_ArchiveLoader& CFX_ArchiveLoader::operator >> (uint8_t& i)
{
if (m_LoadingPos >= m_LoadingSize) {
return *this;
@@ -447,13 +447,13 @@ FX_BOOL IFX_BufferArchive::Flush()
m_Length = 0;
return bRet;
}
-FX_INT32 IFX_BufferArchive::AppendBlock(const void* pBuf, size_t size)
+int32_t IFX_BufferArchive::AppendBlock(const void* pBuf, size_t size)
{
if (!pBuf || size < 1) {
return 0;
}
if (!m_pBuffer) {
- m_pBuffer = FX_Alloc(FX_BYTE, m_BufSize);
+ m_pBuffer = FX_Alloc(uint8_t, m_BufSize);
}
FX_LPBYTE buffer = (FX_LPBYTE)pBuf;
FX_STRSIZE temp_size = (FX_STRSIZE)size;
@@ -469,19 +469,19 @@ FX_INT32 IFX_BufferArchive::AppendBlock(const void* pBuf, size_t size)
temp_size -= buf_size;
buffer += buf_size;
}
- return (FX_INT32)size;
+ return (int32_t)size;
}
-FX_INT32 IFX_BufferArchive::AppendByte(FX_BYTE byte)
+int32_t IFX_BufferArchive::AppendByte(uint8_t byte)
{
return AppendBlock(&byte, 1);
}
-FX_INT32 IFX_BufferArchive::AppendDWord(FX_DWORD i)
+int32_t IFX_BufferArchive::AppendDWord(FX_DWORD i)
{
char buf[32];
FXSYS_itoa(i, buf, 10);
return AppendBlock(buf, (size_t)FXSYS_strlen(buf));
}
-FX_INT32 IFX_BufferArchive::AppendString(FX_BSTR lpsz)
+int32_t IFX_BufferArchive::AppendString(FX_BSTR lpsz)
{
return AppendBlock(lpsz.GetPtr(), lpsz.GetLength());
}
« no previous file with comments | « core/src/fxcrt/fx_basic_bstring.cpp ('k') | core/src/fxcrt/fx_basic_coords.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698