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

Unified Diff: src/cff.cc

Issue 512923003: Fix MSVC warnings about possible value truncation. (Closed) Base URL: https://chromium.googlesource.com/external/ots.git@master
Patch Set: Created 6 years, 4 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 | « no previous file | src/cff_type2_charstring.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/cff.cc
diff --git a/src/cff.cc b/src/cff.cc
index a9368df5efe0cbc6980e62aa301249a74ba6d027..7866614ced2cf27830be5bcf83ec01064008efad 100644
--- a/src/cff.cc
+++ b/src/cff.cc
@@ -472,7 +472,7 @@ bool ParseDictData(const uint8_t *data, size_t table_length,
FONT_FORMAT font_format = FORMAT_UNKNOWN;
bool have_ros = false;
- size_t glyphs = 0;
+ uint16_t glyphs = 0;
size_t charset_offset = 0;
while (table.offset() < dict_length) {
@@ -692,7 +692,7 @@ bool ParseDictData(const uint8_t *data, size_t table_length,
return OTS_FAILURE();
}
if (format == 0) {
- for (size_t j = 0; j < glyphs; ++j) {
+ for (uint16_t j = 0; j < glyphs; ++j) {
uint8_t fd_index = 0;
if (!table.ReadU8(&fd_index)) {
return OTS_FAILURE();
@@ -836,7 +836,7 @@ bool ParseDictData(const uint8_t *data, size_t table_length,
}
switch (format) {
case 0:
- for (unsigned j = 1 /* .notdef is omitted */; j < glyphs; ++j) {
+ for (uint16_t j = 1 /* .notdef is omitted */; j < glyphs; ++j) {
uint16_t sid = 0;
if (!table.ReadU16(&sid)) {
return OTS_FAILURE();
« no previous file with comments | « no previous file | src/cff_type2_charstring.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698