summaryrefslogtreecommitdiff
path: root/core/src/fpdfapi/fpdf_font
diff options
context:
space:
mode:
authorNico Weber <thakis@chromium.org>2014-07-29 10:13:17 -0700
committerNico Weber <thakis@chromium.org>2014-07-29 10:13:17 -0700
commit6c55495fcaf634e7f788f4dfe77fa1a106c9cd55 (patch)
tree3fe8612d47f51ff551e480a2088a48349cd9bdf7 /core/src/fpdfapi/fpdf_font
parentc77e8f73397613f278eaeef2cae44debc6a684c8 (diff)
downloadpdfium-6c55495fcaf634e7f788f4dfe77fa1a106c9cd55.tar.xz
Fix a few more warnings in chromium_code mode.
No intended behavior change. - Remove more unused variables, functions, member variables. - Put a few constructor initializers in the order they execute in. - Add braces for subobject initializers. - Fix a handful of signed / unsigned comparisons. BUG=pdfium:29 R=bo_xu@foxitsoftware.com Review URL: https://codereview.chromium.org/429593005
Diffstat (limited to 'core/src/fpdfapi/fpdf_font')
-rw-r--r--core/src/fpdfapi/fpdf_font/fpdf_font.cpp2
-rw-r--r--core/src/fpdfapi/fpdf_font/fpdf_font_utility.cpp7
-rw-r--r--core/src/fpdfapi/fpdf_font/ttgsubtable.h6
3 files changed, 7 insertions, 8 deletions
diff --git a/core/src/fpdfapi/fpdf_font/fpdf_font.cpp b/core/src/fpdfapi/fpdf_font/fpdf_font.cpp
index b7ca5b1b7d..36b6ce2b5b 100644
--- a/core/src/fpdfapi/fpdf_font/fpdf_font.cpp
+++ b/core/src/fpdfapi/fpdf_font/fpdf_font.cpp
@@ -995,7 +995,7 @@ FX_BOOL CPDF_SimpleFont::LoadCommon()
}
if (m_Flags & PDFFONT_ALLCAP) {
unsigned char lowercases[] = {'a', 'z', 0xe0, 0xf6, 0xf8, 0xfd};
- for (int range = 0; range < sizeof lowercases / 2; range ++) {
+ for (size_t range = 0; range < sizeof lowercases / 2; range ++) {
for (int i = lowercases[range * 2]; i <= lowercases[range * 2 + 1]; i ++) {
if (m_GlyphIndex[i] != 0xffff && m_pFontFile != NULL) {
continue;
diff --git a/core/src/fpdfapi/fpdf_font/fpdf_font_utility.cpp b/core/src/fpdfapi/fpdf_font/fpdf_font_utility.cpp
index b10bff7ebe..d7c725cc2f 100644
--- a/core/src/fpdfapi/fpdf_font/fpdf_font_utility.cpp
+++ b/core/src/fpdfapi/fpdf_font/fpdf_font_utility.cpp
@@ -22,7 +22,7 @@ FX_LPVOID FXFC_LoadPackage(FX_LPCSTR name)
return NULL;
}
FX_BYTE buf[256];
- size_t read = FXSYS_fread(buf, 1, 20, file);
+ FXSYS_fread(buf, 1, 20, file);
if (*(FX_DWORD*)buf != 0x43465846) {
FXSYS_fclose(file);
return NULL;
@@ -45,15 +45,14 @@ FX_BOOL FXFC_LoadFile(FX_LPVOID p, FX_LPCSTR name, FX_LPBYTE& pBuffer, FX_DWORD&
FXFC_PACKAGE* pPackage = (FXFC_PACKAGE*)p;
FXSYS_fseek(pPackage->m_pFile, pPackage->m_IndexOffset, FXSYS_SEEK_SET);
FX_BYTE buf[128];
- size_t read = 0;
for (int i = 0; i < pPackage->m_nFiles; i ++) {
- read = FXSYS_fread(buf, pPackage->m_IndexSize, 1, pPackage->m_pFile);
+ FXSYS_fread(buf, pPackage->m_IndexSize, 1, pPackage->m_pFile);
if (FXSYS_stricmp((FX_LPCSTR)buf, name) == 0) {
FX_DWORD offset = *(FX_DWORD*)&buf[64];
size = *(FX_DWORD*)&buf[68];
pBuffer = FX_Alloc(FX_BYTE, size);
FXSYS_fseek(pPackage->m_pFile, offset, FXSYS_SEEK_SET);
- read = FXSYS_fread(pBuffer, size, 1, pPackage->m_pFile);
+ FXSYS_fread(pBuffer, size, 1, pPackage->m_pFile);
if (buf[72]) {
FX_DWORD orig_size;
FX_LPBYTE comp_buf = pBuffer;
diff --git a/core/src/fpdfapi/fpdf_font/ttgsubtable.h b/core/src/fpdfapi/fpdf_font/ttgsubtable.h
index 26f67fbd18..cc7f8c8752 100644
--- a/core/src/fpdfapi/fpdf_font/ttgsubtable.h
+++ b/core/src/fpdfapi/fpdf_font/ttgsubtable.h
@@ -22,8 +22,8 @@ protected:
class CFX_CTTGSUBTable : public CFX_Object
{
public:
- CFX_CTTGSUBTable(void): loaded(false), m_bFeautureMapLoad(FALSE) {};
- CFX_CTTGSUBTable(FT_Bytes gsub): loaded(false), m_bFeautureMapLoad(FALSE)
+ CFX_CTTGSUBTable(void): m_bFeautureMapLoad(FALSE), loaded(false) {};
+ CFX_CTTGSUBTable(FT_Bytes gsub): m_bFeautureMapLoad(FALSE), loaded(false)
{
LoadGSUBTable(gsub);
}
@@ -274,7 +274,7 @@ private:
struct TSingleSubstFormat1: public TSubTableBase {
TCoverageFormatBase *Coverage;
TT_int16_t DeltaGlyphID;
- TSingleSubstFormat1(): DeltaGlyphID(0), Coverage(NULL)
+ TSingleSubstFormat1(): Coverage(NULL), DeltaGlyphID(0)
{
SubstFormat = 1;
}