From 21e079dd982f57daa9d5af0d9e48d58189ce35da Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Tue, 10 Nov 2015 09:58:30 -0800 Subject: Remove core/src/fpdfapi/fpdf_font/common.h and use stdint types. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1437603002 . --- core/src/fpdfapi/fpdf_font/common.h | 21 ----- core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp | 4 +- core/src/fpdfapi/fpdf_font/ttgsubtable.cpp | 60 ++++++------- core/src/fpdfapi/fpdf_font/ttgsubtable.h | 121 ++++++++++++++------------- 4 files changed, 93 insertions(+), 113 deletions(-) delete mode 100644 core/src/fpdfapi/fpdf_font/common.h (limited to 'core') diff --git a/core/src/fpdfapi/fpdf_font/common.h b/core/src/fpdfapi/fpdf_font/common.h deleted file mode 100644 index 2888bc455e..0000000000 --- a/core/src/fpdfapi/fpdf_font/common.h +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2014 PDFium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com - -#ifndef CORE_SRC_FPDFAPI_FPDF_FONT_COMMON_H_ -#define CORE_SRC_FPDFAPI_FPDF_FONT_COMMON_H_ - -#include "core/include/fxcrt/fx_system.h" - -typedef signed char TT_int8_t; -typedef unsigned char TT_uint8_t; -typedef signed short TT_int16_t; -typedef unsigned short TT_uint16_t; -typedef int32_t TT_int32_t; -typedef FX_DWORD TT_uint32_t; -typedef int64_t TT_int64_t; -typedef uint64_t TT_uint64_t; - -#endif // CORE_SRC_FPDFAPI_FPDF_FONT_COMMON_H_ diff --git a/core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp b/core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp index bf67aab3e0..1ecb6a6d12 100644 --- a/core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp +++ b/core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp @@ -1445,7 +1445,7 @@ int CPDF_CIDFont::GetGlyphIndex(FX_DWORD unicode, FX_BOOL* pVertGlyph) { } if (index && IsVertWriting()) { if (m_pTTGSUBTable) { - TT_uint32_t vindex = 0; + uint32_t vindex = 0; m_pTTGSUBTable->GetVerticalGlyph(index, &vindex); if (vindex) { index = vindex; @@ -1468,7 +1468,7 @@ int CPDF_CIDFont::GetGlyphIndex(FX_DWORD unicode, FX_BOOL* pVertGlyph) { if (!error && m_Font.GetSubData()) { m_pTTGSUBTable = new CFX_CTTGSUBTable; m_pTTGSUBTable->LoadGSUBTable((FT_Bytes)m_Font.GetSubData()); - TT_uint32_t vindex = 0; + uint32_t vindex = 0; m_pTTGSUBTable->GetVerticalGlyph(index, &vindex); if (vindex) { index = vindex; diff --git a/core/src/fpdfapi/fpdf_font/ttgsubtable.cpp b/core/src/fpdfapi/fpdf_font/ttgsubtable.cpp index 0087bfad56..4786b8be94 100644 --- a/core/src/fpdfapi/fpdf_font/ttgsubtable.cpp +++ b/core/src/fpdfapi/fpdf_font/ttgsubtable.cpp @@ -64,13 +64,13 @@ bool CFX_CTTGSUBTable::LoadGSUBTable(FT_Bytes gsub) { return Parse(&gsub[header.ScriptList], &gsub[header.FeatureList], &gsub[header.LookupList]); } -bool CFX_CTTGSUBTable::GetVerticalGlyph(TT_uint32_t glyphnum, - TT_uint32_t* vglyphnum) { - TT_uint32_t tag[] = { - (TT_uint8_t)'v' << 24 | (TT_uint8_t)'r' << 16 | (TT_uint8_t)'t' << 8 | - (TT_uint8_t)'2', - (TT_uint8_t)'v' << 24 | (TT_uint8_t)'e' << 16 | (TT_uint8_t)'r' << 8 | - (TT_uint8_t)'t', +bool CFX_CTTGSUBTable::GetVerticalGlyph(uint32_t glyphnum, + uint32_t* vglyphnum) { + uint32_t tag[] = { + (uint8_t)'v' << 24 | (uint8_t)'r' << 16 | (uint8_t)'t' << 8 | + (uint8_t)'2', + (uint8_t)'v' << 24 | (uint8_t)'e' << 16 | (uint8_t)'r' << 8 | + (uint8_t)'t', }; if (!m_bFeautureMapLoad) { for (int i = 0; i < ScriptList.ScriptCount; i++) { @@ -111,8 +111,8 @@ bool CFX_CTTGSUBTable::GetVerticalGlyph(TT_uint32_t glyphnum, } return false; } -bool CFX_CTTGSUBTable::GetVerticalGlyphSub(TT_uint32_t glyphnum, - TT_uint32_t* vglyphnum, +bool CFX_CTTGSUBTable::GetVerticalGlyphSub(uint32_t glyphnum, + uint32_t* vglyphnum, struct TFeature* Feature) { for (int i = 0; i < Feature->LookupCount; i++) { int index = Feature->LookupListIndex[i]; @@ -128,8 +128,8 @@ bool CFX_CTTGSUBTable::GetVerticalGlyphSub(TT_uint32_t glyphnum, } return false; } -bool CFX_CTTGSUBTable::GetVerticalGlyphSub2(TT_uint32_t glyphnum, - TT_uint32_t* vglyphnum, +bool CFX_CTTGSUBTable::GetVerticalGlyphSub2(uint32_t glyphnum, + uint32_t* vglyphnum, struct TLookup* Lookup) { for (int i = 0; i < Lookup->SubTableCount; i++) { switch (Lookup->SubTable[i]->SubstFormat) { @@ -156,7 +156,7 @@ bool CFX_CTTGSUBTable::GetVerticalGlyphSub2(TT_uint32_t glyphnum, return false; } int CFX_CTTGSUBTable::GetCoverageIndex(struct TCoverageFormatBase* Coverage, - TT_uint32_t g) { + uint32_t g) { int i = 0; if (Coverage == NULL) { return -1; @@ -165,7 +165,7 @@ int CFX_CTTGSUBTable::GetCoverageIndex(struct TCoverageFormatBase* Coverage, case 1: { TCoverageFormat1* c1 = (TCoverageFormat1*)Coverage; for (i = 0; i < c1->GlyphCount; i++) { - if ((TT_uint32_t)c1->GlyphArray[i] == g) { + if ((uint32_t)c1->GlyphArray[i] == g) { return i; } } @@ -174,9 +174,9 @@ int CFX_CTTGSUBTable::GetCoverageIndex(struct TCoverageFormatBase* Coverage, case 2: { TCoverageFormat2* c2 = (TCoverageFormat2*)Coverage; for (i = 0; i < c2->RangeCount; i++) { - TT_uint32_t s = c2->RangeRecord[i].Start; - TT_uint32_t e = c2->RangeRecord[i].End; - TT_uint32_t si = c2->RangeRecord[i].StartCoverageIndex; + uint32_t s = c2->RangeRecord[i].Start; + uint32_t e = c2->RangeRecord[i].End; + uint32_t si = c2->RangeRecord[i].StartCoverageIndex; if (s <= g && g <= e) { return si + g - s; } @@ -204,7 +204,7 @@ void CFX_CTTGSUBTable::ParseScriptList(FT_Bytes raw, struct TScriptList* rec) { rec->ScriptRecord = new struct TScriptRecord[rec->ScriptCount]; for (i = 0; i < rec->ScriptCount; i++) { rec->ScriptRecord[i].ScriptTag = GetUInt32(sp); - TT_uint16_t offset = GetUInt16(sp); + uint16_t offset = GetUInt16(sp); ParseScript(&raw[offset], &rec->ScriptRecord[i].Script); } } @@ -219,7 +219,7 @@ void CFX_CTTGSUBTable::ParseScript(FT_Bytes raw, struct TScript* rec) { rec->LangSysRecord = new struct TLangSysRecord[rec->LangSysCount]; for (i = 0; i < rec->LangSysCount; i++) { rec->LangSysRecord[i].LangSysTag = GetUInt32(sp); - TT_uint16_t offset = GetUInt16(sp); + uint16_t offset = GetUInt16(sp); ParseLangSys(&raw[offset], &rec->LangSysRecord[i].LangSys); } } @@ -231,8 +231,8 @@ void CFX_CTTGSUBTable::ParseLangSys(FT_Bytes raw, struct TLangSys* rec) { if (rec->FeatureCount <= 0) { return; } - rec->FeatureIndex = new TT_uint16_t[rec->FeatureCount]; - FXSYS_memset(rec->FeatureIndex, 0, sizeof(TT_uint16_t) * rec->FeatureCount); + rec->FeatureIndex = new uint16_t[rec->FeatureCount]; + FXSYS_memset(rec->FeatureIndex, 0, sizeof(uint16_t) * rec->FeatureCount); for (int i = 0; i < rec->FeatureCount; ++i) { rec->FeatureIndex[i] = GetUInt16(sp); } @@ -247,7 +247,7 @@ void CFX_CTTGSUBTable::ParseFeatureList(FT_Bytes raw, TFeatureList* rec) { rec->FeatureRecord = new struct TFeatureRecord[rec->FeatureCount]; for (i = 0; i < rec->FeatureCount; i++) { rec->FeatureRecord[i].FeatureTag = GetUInt32(sp); - TT_uint16_t offset = GetUInt16(sp); + uint16_t offset = GetUInt16(sp); ParseFeature(&raw[offset], &rec->FeatureRecord[i].Feature); } } @@ -259,7 +259,7 @@ void CFX_CTTGSUBTable::ParseFeature(FT_Bytes raw, TFeature* rec) { if (rec->LookupCount <= 0) { return; } - rec->LookupListIndex = new TT_uint16_t[rec->LookupCount]; + rec->LookupListIndex = new uint16_t[rec->LookupCount]; for (i = 0; i < rec->LookupCount; i++) { rec->LookupListIndex[i] = GetUInt16(sp); } @@ -273,7 +273,7 @@ void CFX_CTTGSUBTable::ParseLookupList(FT_Bytes raw, TLookupList* rec) { } rec->Lookup = new struct TLookup[rec->LookupCount]; for (i = 0; i < rec->LookupCount; i++) { - TT_uint16_t offset = GetUInt16(sp); + uint16_t offset = GetUInt16(sp); ParseLookup(&raw[offset], &rec->Lookup[i]); } } @@ -294,13 +294,13 @@ void CFX_CTTGSUBTable::ParseLookup(FT_Bytes raw, TLookup* rec) { return; } for (i = 0; i < rec->SubTableCount; i++) { - TT_uint16_t offset = GetUInt16(sp); + uint16_t offset = GetUInt16(sp); ParseSingleSubst(&raw[offset], &rec->SubTable[i]); } } void CFX_CTTGSUBTable::ParseCoverage(FT_Bytes raw, TCoverageFormatBase** rec) { FT_Bytes sp = raw; - TT_uint16_t Format = GetUInt16(sp); + uint16_t Format = GetUInt16(sp); switch (Format) { case 1: *rec = new TCoverageFormat1(); @@ -321,7 +321,7 @@ void CFX_CTTGSUBTable::ParseCoverageFormat1(FT_Bytes raw, if (rec->GlyphCount <= 0) { return; } - rec->GlyphArray = new TT_uint16_t[rec->GlyphCount]; + rec->GlyphArray = new uint16_t[rec->GlyphCount]; for (i = 0; i < rec->GlyphCount; i++) { rec->GlyphArray[i] = GetUInt16(sp); } @@ -344,7 +344,7 @@ void CFX_CTTGSUBTable::ParseCoverageFormat2(FT_Bytes raw, } void CFX_CTTGSUBTable::ParseSingleSubst(FT_Bytes raw, TSubTableBase** rec) { FT_Bytes sp = raw; - TT_uint16_t Format = GetUInt16(sp); + uint16_t Format = GetUInt16(sp); switch (Format) { case 1: *rec = new TSingleSubstFormat1(); @@ -360,7 +360,7 @@ void CFX_CTTGSUBTable::ParseSingleSubstFormat1(FT_Bytes raw, TSingleSubstFormat1* rec) { FT_Bytes sp = raw; GetUInt16(sp); - TT_uint16_t offset = GetUInt16(sp); + uint16_t offset = GetUInt16(sp); ParseCoverage(&raw[offset], &rec->Coverage); rec->DeltaGlyphID = GetInt16(sp); } @@ -369,13 +369,13 @@ void CFX_CTTGSUBTable::ParseSingleSubstFormat2(FT_Bytes raw, int i; FT_Bytes sp = raw; GetUInt16(sp); - TT_uint16_t offset = GetUInt16(sp); + uint16_t offset = GetUInt16(sp); ParseCoverage(&raw[offset], &rec->Coverage); rec->GlyphCount = GetUInt16(sp); if (rec->GlyphCount <= 0) { return; } - rec->Substitute = new TT_uint16_t[rec->GlyphCount]; + rec->Substitute = new uint16_t[rec->GlyphCount]; for (i = 0; i < rec->GlyphCount; i++) { rec->Substitute[i] = GetUInt16(sp); } diff --git a/core/src/fpdfapi/fpdf_font/ttgsubtable.h b/core/src/fpdfapi/fpdf_font/ttgsubtable.h index dee7a08857..7dd8cce36c 100644 --- a/core/src/fpdfapi/fpdf_font/ttgsubtable.h +++ b/core/src/fpdfapi/fpdf_font/ttgsubtable.h @@ -7,9 +7,10 @@ #ifndef CORE_SRC_FPDFAPI_FPDF_FONT_TTGSUBTABLE_H_ #define CORE_SRC_FPDFAPI_FPDF_FONT_TTGSUBTABLE_H_ +#include + #include -#include "common.h" #include "core/include/fxcrt/fx_basic.h" #include "core/include/fxge/fx_font.h" #include "core/include/fxge/fx_freetype.h" @@ -33,20 +34,20 @@ class CFX_CTTGSUBTable { virtual ~CFX_CTTGSUBTable() {} bool IsOk(void) const { return loaded; } bool LoadGSUBTable(FT_Bytes gsub); - bool GetVerticalGlyph(TT_uint32_t glyphnum, TT_uint32_t* vglyphnum); + bool GetVerticalGlyph(uint32_t glyphnum, uint32_t* vglyphnum); private: struct tt_gsub_header { - TT_uint32_t Version; - TT_uint16_t ScriptList; - TT_uint16_t FeatureList; - TT_uint16_t LookupList; + uint32_t Version; + uint16_t ScriptList; + uint16_t FeatureList; + uint16_t LookupList; }; struct TLangSys { - TT_uint16_t LookupOrder; - TT_uint16_t ReqFeatureIndex; - TT_uint16_t FeatureCount; - TT_uint16_t* FeatureIndex; + uint16_t LookupOrder; + uint16_t ReqFeatureIndex; + uint16_t FeatureCount; + uint16_t* FeatureIndex; TLangSys() : LookupOrder(0), ReqFeatureIndex(0), @@ -59,7 +60,7 @@ class CFX_CTTGSUBTable { TLangSys& operator=(const TLangSys&); }; struct TLangSysRecord { - TT_uint32_t LangSysTag; + uint32_t LangSysTag; struct TLangSys LangSys; TLangSysRecord() : LangSysTag(0) {} @@ -68,8 +69,8 @@ class CFX_CTTGSUBTable { TLangSysRecord& operator=(const TLangSysRecord&); }; struct TScript { - TT_uint16_t DefaultLangSys; - TT_uint16_t LangSysCount; + uint16_t DefaultLangSys; + uint16_t LangSysCount; struct TLangSysRecord* LangSysRecord; TScript() : DefaultLangSys(0), LangSysCount(0), LangSysRecord(NULL) {} ~TScript() { delete[] LangSysRecord; } @@ -79,7 +80,7 @@ class CFX_CTTGSUBTable { TScript& operator=(const TScript&); }; struct TScriptRecord { - TT_uint32_t ScriptTag; + uint32_t ScriptTag; struct TScript Script; TScriptRecord() : ScriptTag(0) {} @@ -88,7 +89,7 @@ class CFX_CTTGSUBTable { TScriptRecord& operator=(const TScriptRecord&); }; struct TScriptList { - TT_uint16_t ScriptCount; + uint16_t ScriptCount; struct TScriptRecord* ScriptRecord; TScriptList() : ScriptCount(0), ScriptRecord(NULL) {} ~TScriptList() { delete[] ScriptRecord; } @@ -98,9 +99,9 @@ class CFX_CTTGSUBTable { TScriptList& operator=(const TScriptList&); }; struct TFeature { - TT_uint16_t FeatureParams; + uint16_t FeatureParams; int LookupCount; - TT_uint16_t* LookupListIndex; + uint16_t* LookupListIndex; TFeature() : FeatureParams(0), LookupCount(0), LookupListIndex(NULL) {} ~TFeature() { delete[] LookupListIndex; } @@ -109,7 +110,7 @@ class CFX_CTTGSUBTable { TFeature& operator=(const TFeature&); }; struct TFeatureRecord { - TT_uint32_t FeatureTag; + uint32_t FeatureTag; struct TFeature Feature; TFeatureRecord() : FeatureTag(0) {} @@ -136,7 +137,7 @@ class CFX_CTTGSUBTable { LOOKUPFLAG_MarkAttachmentType = 0xFF00, }; struct TCoverageFormatBase { - TT_uint16_t CoverageFormat; + uint16_t CoverageFormat; CFX_GlyphMap m_glyphMap; TCoverageFormatBase() : CoverageFormat(0) {} virtual ~TCoverageFormatBase() {} @@ -146,8 +147,8 @@ class CFX_CTTGSUBTable { TCoverageFormatBase& operator=(const TCoverageFormatBase&); }; struct TCoverageFormat1 : public TCoverageFormatBase { - TT_uint16_t GlyphCount; - TT_uint16_t* GlyphArray; + uint16_t GlyphCount; + uint16_t* GlyphArray; TCoverageFormat1() : GlyphCount(0), GlyphArray(NULL) { CoverageFormat = 1; } ~TCoverageFormat1() override { delete[] GlyphArray; } @@ -156,9 +157,9 @@ class CFX_CTTGSUBTable { TCoverageFormat1& operator=(const TCoverageFormat1&); }; struct TRangeRecord { - TT_uint16_t Start; - TT_uint16_t End; - TT_uint16_t StartCoverageIndex; + uint16_t Start; + uint16_t End; + uint16_t StartCoverageIndex; TRangeRecord() : Start(0), End(0), StartCoverageIndex(0) {} friend bool operator>(const TRangeRecord& r1, const TRangeRecord& r2) { return r1.Start > r2.Start; @@ -168,7 +169,7 @@ class CFX_CTTGSUBTable { TRangeRecord(const TRangeRecord&); }; struct TCoverageFormat2 : public TCoverageFormatBase { - TT_uint16_t RangeCount; + uint16_t RangeCount; struct TRangeRecord* RangeRecord; TCoverageFormat2() : RangeCount(0), RangeRecord(NULL) { CoverageFormat = 2; @@ -180,7 +181,7 @@ class CFX_CTTGSUBTable { TCoverageFormat2& operator=(const TCoverageFormat2&); }; struct TClassDefFormatBase { - TT_uint16_t ClassFormat; + uint16_t ClassFormat; TClassDefFormatBase() : ClassFormat(0) {} virtual ~TClassDefFormatBase() {} @@ -189,9 +190,9 @@ class CFX_CTTGSUBTable { TClassDefFormatBase& operator=(const TClassDefFormatBase&); }; struct TClassDefFormat1 : public TClassDefFormatBase { - TT_uint16_t StartGlyph; - TT_uint16_t GlyphCount; - TT_uint16_t* ClassValueArray; + uint16_t StartGlyph; + uint16_t GlyphCount; + uint16_t* ClassValueArray; TClassDefFormat1() : StartGlyph(0), GlyphCount(0), ClassValueArray(NULL) { ClassFormat = 1; } @@ -202,9 +203,9 @@ class CFX_CTTGSUBTable { TClassDefFormat1& operator=(const TClassDefFormat1&); }; struct TClassRangeRecord { - TT_uint16_t Start; - TT_uint16_t End; - TT_uint16_t Class; + uint16_t Start; + uint16_t End; + uint16_t Class; TClassRangeRecord() : Start(0), End(0), Class(0) {} private: @@ -212,7 +213,7 @@ class CFX_CTTGSUBTable { TClassRangeRecord& operator=(const TClassRangeRecord&); }; struct TClassDefFormat2 : public TClassDefFormatBase { - TT_uint16_t ClassRangeCount; + uint16_t ClassRangeCount; struct TClassRangeRecord* ClassRangeRecord; TClassDefFormat2() : ClassRangeCount(0), ClassRangeRecord(NULL) { ClassFormat = 2; @@ -224,9 +225,9 @@ class CFX_CTTGSUBTable { TClassDefFormat2& operator=(const TClassDefFormat2&); }; struct TDevice { - TT_uint16_t StartSize; - TT_uint16_t EndSize; - TT_uint16_t DeltaFormat; + uint16_t StartSize; + uint16_t EndSize; + uint16_t DeltaFormat; TDevice() : StartSize(0), EndSize(0), DeltaFormat(0) {} private: @@ -234,7 +235,7 @@ class CFX_CTTGSUBTable { TDevice& operator=(const TDevice&); }; struct TSubTableBase { - TT_uint16_t SubstFormat; + uint16_t SubstFormat; TSubTableBase() : SubstFormat(0) {} virtual ~TSubTableBase() {} @@ -244,7 +245,7 @@ class CFX_CTTGSUBTable { }; struct TSingleSubstFormat1 : public TSubTableBase { TCoverageFormatBase* Coverage; - TT_int16_t DeltaGlyphID; + int16_t DeltaGlyphID; TSingleSubstFormat1() : Coverage(NULL), DeltaGlyphID(0) { SubstFormat = 1; } ~TSingleSubstFormat1() override { delete Coverage; } @@ -254,8 +255,8 @@ class CFX_CTTGSUBTable { }; struct TSingleSubstFormat2 : public TSubTableBase { TCoverageFormatBase* Coverage; - TT_uint16_t GlyphCount; - TT_uint16_t* Substitute; + uint16_t GlyphCount; + uint16_t* Substitute; TSingleSubstFormat2() : Coverage(NULL), GlyphCount(0), Substitute(NULL) { SubstFormat = 2; } @@ -269,9 +270,9 @@ class CFX_CTTGSUBTable { TSingleSubstFormat2& operator=(const TSingleSubstFormat2&); }; struct TLookup { - TT_uint16_t LookupType; - TT_uint16_t LookupFlag; - TT_uint16_t SubTableCount; + uint16_t LookupType; + uint16_t LookupFlag; + uint16_t SubTableCount; struct TSubTableBase** SubTable; TLookup() : LookupType(0), LookupFlag(0), SubTableCount(0), SubTable(NULL) {} @@ -312,35 +313,35 @@ class CFX_CTTGSUBTable { void ParseSingleSubst(FT_Bytes raw, TSubTableBase** rec); void ParseSingleSubstFormat1(FT_Bytes raw, TSingleSubstFormat1* rec); void ParseSingleSubstFormat2(FT_Bytes raw, TSingleSubstFormat2* rec); - bool GetVerticalGlyphSub(TT_uint32_t glyphnum, - TT_uint32_t* vglyphnum, + bool GetVerticalGlyphSub(uint32_t glyphnum, + uint32_t* vglyphnum, struct TFeature* Feature); - bool GetVerticalGlyphSub2(TT_uint32_t glyphnum, - TT_uint32_t* vglyphnum, + bool GetVerticalGlyphSub2(uint32_t glyphnum, + uint32_t* vglyphnum, struct TLookup* Lookup); - int GetCoverageIndex(struct TCoverageFormatBase* Coverage, TT_uint32_t g); - TT_uint8_t GetUInt8(FT_Bytes& p) const { - TT_uint8_t ret = p[0]; + int GetCoverageIndex(struct TCoverageFormatBase* Coverage, uint32_t g); + uint8_t GetUInt8(FT_Bytes& p) const { + uint8_t ret = p[0]; p += 1; return ret; } - TT_int16_t GetInt16(FT_Bytes& p) const { - TT_uint16_t ret = p[0] << 8 | p[1]; + int16_t GetInt16(FT_Bytes& p) const { + uint16_t ret = p[0] << 8 | p[1]; p += 2; - return *(TT_int16_t*)&ret; + return *(int16_t*)&ret; } - TT_uint16_t GetUInt16(FT_Bytes& p) const { - TT_uint16_t ret = p[0] << 8 | p[1]; + uint16_t GetUInt16(FT_Bytes& p) const { + uint16_t ret = p[0] << 8 | p[1]; p += 2; return ret; } - TT_int32_t GetInt32(FT_Bytes& p) const { - TT_uint32_t ret = p[0] << 24 | p[1] << 16 | p[2] << 8 | p[3]; + int32_t GetInt32(FT_Bytes& p) const { + uint32_t ret = p[0] << 24 | p[1] << 16 | p[2] << 8 | p[3]; p += 4; - return *(TT_int32_t*)&ret; + return *(int32_t*)&ret; } - TT_uint32_t GetUInt32(FT_Bytes& p) const { - TT_uint32_t ret = p[0] << 24 | p[1] << 16 | p[2] << 8 | p[3]; + uint32_t GetUInt32(FT_Bytes& p) const { + uint32_t ret = p[0] << 24 | p[1] << 16 | p[2] << 8 | p[3]; p += 4; return ret; } -- cgit v1.2.3