summaryrefslogtreecommitdiff
path: root/core/fpdfapi
diff options
context:
space:
mode:
authorRyan Harrison <rharrison@chromium.org>2017-09-05 15:33:18 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-09-06 13:53:19 +0000
commit81f9eeef041f2974274751d7508598049ae32db2 (patch)
tree00bdcdddc9d141e4929005a14372bde65c68ee81 /core/fpdfapi
parent3ef61c73a97b31000a21e323e04ad5397e517c4c (diff)
downloadpdfium-81f9eeef041f2974274751d7508598049ae32db2.tar.xz
Convert FX_STRSIZE int->size_t
Change the underlying type for FX_STRSIZE to size_t from int. This will make the value unsigned and thus all values in the range of the type will be valid. This allows for the final remove of negative length strings, but also introduces a some casting and functional errors, since many parts of the code base assume that FX_STRSIZE is int or another signed type. This also CL fixes these errors. BUG=pdfium:828 Change-Id: I231dca59e96fc9330cbb099eecbdfc41fcf86f5b Reviewed-on: https://pdfium-review.googlesource.com/11830 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Diffstat (limited to 'core/fpdfapi')
-rw-r--r--core/fpdfapi/font/cpdf_cmapparser_unittest.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/fpdfapi/font/cpdf_cmapparser_unittest.cpp b/core/fpdfapi/font/cpdf_cmapparser_unittest.cpp
index 0d55aa274d..8d99b0dbff 100644
--- a/core/fpdfapi/font/cpdf_cmapparser_unittest.cpp
+++ b/core/fpdfapi/font/cpdf_cmapparser_unittest.cpp
@@ -45,11 +45,11 @@ TEST(cpdf_cmapparser, CMap_GetCodeRange) {
// m_CharSize must be <= 4
EXPECT_FALSE(CPDF_CMapParser::CMap_GetCodeRange(range, "<aaaaaaaaaa>", ""));
- EXPECT_EQ(5, range.m_CharSize);
+ EXPECT_EQ(5u, range.m_CharSize);
EXPECT_TRUE(
CPDF_CMapParser::CMap_GetCodeRange(range, "<12345678>", "<87654321>"));
- EXPECT_EQ(4, range.m_CharSize);
+ EXPECT_EQ(4u, range.m_CharSize);
{
uint8_t lower[4] = {18, 52, 86, 120};
uint8_t upper[4] = {135, 101, 67, 33};
@@ -59,13 +59,13 @@ TEST(cpdf_cmapparser, CMap_GetCodeRange) {
// Hex characters
EXPECT_TRUE(CPDF_CMapParser::CMap_GetCodeRange(range, "<a1>", "<F3>"));
- EXPECT_EQ(1, range.m_CharSize);
+ EXPECT_EQ(1u, range.m_CharSize);
EXPECT_EQ(161, range.m_Lower[0]);
EXPECT_EQ(243, range.m_Upper[0]);
// The second string should return 0's if it is shorter
EXPECT_TRUE(CPDF_CMapParser::CMap_GetCodeRange(range, "<a1>", ""));
- EXPECT_EQ(1, range.m_CharSize);
+ EXPECT_EQ(1u, range.m_CharSize);
EXPECT_EQ(161, range.m_Lower[0]);
EXPECT_EQ(0, range.m_Upper[0]);
}