summaryrefslogtreecommitdiff
path: root/core/fpdfapi
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2017-05-22 17:05:40 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-05-23 00:18:13 +0000
commitb45324bfb414acc595e478dc7dc63ac43c792580 (patch)
tree90af2bb4c6386b2b2825c80d7405dace0416c69b /core/fpdfapi
parent4cb82ee95256f110489f2b503e70729c44419e74 (diff)
downloadpdfium-b45324bfb414acc595e478dc7dc63ac43c792580.tar.xz
Use NOTREACHED() in more places.
Change-Id: I88466943171f19259f84add69679741d44c8e123 Reviewed-on: https://pdfium-review.googlesource.com/5551 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'core/fpdfapi')
-rw-r--r--core/fpdfapi/font/cpdf_font.cpp3
-rw-r--r--core/fpdfapi/page/cpdf_streamcontentparser.cpp3
-rw-r--r--core/fpdfapi/page/fpdf_page_colors.cpp9
-rw-r--r--core/fpdfapi/page/fpdf_page_func.cpp5
-rw-r--r--core/fpdfapi/parser/cpdf_array.cpp2
-rw-r--r--core/fpdfapi/parser/cpdf_object.cpp3
-rw-r--r--core/fpdfapi/parser/fpdf_parser_utility.cpp3
-rw-r--r--core/fpdfapi/render/cpdf_renderstatus.cpp3
8 files changed, 19 insertions, 12 deletions
diff --git a/core/fpdfapi/font/cpdf_font.cpp b/core/fpdfapi/font/cpdf_font.cpp
index 193ee4a331..1a7fb60b0b 100644
--- a/core/fpdfapi/font/cpdf_font.cpp
+++ b/core/fpdfapi/font/cpdf_font.cpp
@@ -25,6 +25,7 @@
#include "core/fpdfapi/parser/cpdf_stream_acc.h"
#include "core/fxcrt/fx_memory.h"
#include "core/fxge/fx_freetype.h"
+#include "third_party/base/logging.h"
#include "third_party/base/ptr_util.h"
#include "third_party/base/stl_util.h"
@@ -434,7 +435,7 @@ const char* CPDF_Font::GetAdobeCharName(
const std::vector<CFX_ByteString>& charnames,
int charcode) {
if (charcode < 0 || charcode >= 256) {
- ASSERT(false);
+ NOTREACHED();
return nullptr;
}
diff --git a/core/fpdfapi/page/cpdf_streamcontentparser.cpp b/core/fpdfapi/page/cpdf_streamcontentparser.cpp
index a5af1dbee0..e8594b927b 100644
--- a/core/fpdfapi/page/cpdf_streamcontentparser.cpp
+++ b/core/fpdfapi/page/cpdf_streamcontentparser.cpp
@@ -36,6 +36,7 @@
#include "core/fpdfapi/parser/fpdf_parser_decode.h"
#include "core/fxcrt/fx_safe_types.h"
#include "core/fxge/cfx_graphstatedata.h"
+#include "third_party/base/logging.h"
#include "third_party/base/ptr_util.h"
namespace {
@@ -389,7 +390,7 @@ CPDF_Object* CPDF_StreamContentParser::GetObject(uint32_t index) {
if (param.m_Type == ContentParam::OBJECT)
return param.m_pObject.get();
- ASSERT(false);
+ NOTREACHED();
return nullptr;
}
diff --git a/core/fpdfapi/page/fpdf_page_colors.cpp b/core/fpdfapi/page/fpdf_page_colors.cpp
index 3ba833f1ef..1526b75041 100644
--- a/core/fpdfapi/page/fpdf_page_colors.cpp
+++ b/core/fpdfapi/page/fpdf_page_colors.cpp
@@ -18,6 +18,7 @@
#include "core/fpdfapi/parser/cpdf_stream_acc.h"
#include "core/fpdfapi/parser/cpdf_string.h"
#include "core/fxcodec/fx_codec.h"
+#include "third_party/base/logging.h"
#include "third_party/base/stl_util.h"
namespace {
@@ -105,7 +106,7 @@ bool CPDF_DeviceCS::GetRGB(float* pBuf, float* R, float* G, float* B) const {
}
return true;
default:
- ASSERT(false);
+ NOTREACHED();
return false;
}
}
@@ -141,7 +142,7 @@ bool CPDF_DeviceCS::SetRGB(float* pBuf, float R, float G, float B) const {
sRGB_to_AdobeCMYK(R, G, B, pBuf[0], pBuf[1], pBuf[2], pBuf[3]);
return true;
default:
- ASSERT(false);
+ NOTREACHED();
return false;
}
}
@@ -164,7 +165,7 @@ bool CPDF_DeviceCS::v_SetCMYK(float* pBuf,
pBuf[3] = k;
return true;
default:
- ASSERT(false);
+ NOTREACHED();
return false;
}
}
@@ -213,7 +214,7 @@ void CPDF_DeviceCS::TranslateImageLine(uint8_t* pDestBuf,
}
break;
default:
- ASSERT(false);
+ NOTREACHED();
break;
}
}
diff --git a/core/fpdfapi/page/fpdf_page_func.cpp b/core/fpdfapi/page/fpdf_page_func.cpp
index bc66adf726..48cd41c090 100644
--- a/core/fpdfapi/page/fpdf_page_func.cpp
+++ b/core/fpdfapi/page/fpdf_page_func.cpp
@@ -20,6 +20,7 @@
#include "core/fpdfapi/parser/cpdf_stream.h"
#include "core/fpdfapi/parser/cpdf_stream_acc.h"
#include "core/fxcrt/fx_safe_types.h"
+#include "third_party/base/logging.h"
#include "third_party/base/ptr_util.h"
#include "third_party/base/stl_util.h"
@@ -127,13 +128,13 @@ class CPDF_PSOP {
if (m_op == PSOP_CONST)
return m_value;
- ASSERT(false);
+ NOTREACHED();
return 0;
}
CPDF_PSProc* GetProc() const {
if (m_op == PSOP_PROC)
return m_proc.get();
- ASSERT(false);
+ NOTREACHED();
return nullptr;
}
diff --git a/core/fpdfapi/parser/cpdf_array.cpp b/core/fpdfapi/parser/cpdf_array.cpp
index 698cd6d0d0..4caad10631 100644
--- a/core/fpdfapi/parser/cpdf_array.cpp
+++ b/core/fpdfapi/parser/cpdf_array.cpp
@@ -162,7 +162,7 @@ CPDF_Object* CPDF_Array::SetAt(size_t i, std::unique_ptr<CPDF_Object> pObj) {
ASSERT(IsArray());
ASSERT(!pObj || pObj->IsInline());
if (i >= m_Objects.size()) {
- ASSERT(false);
+ NOTREACHED();
return nullptr;
}
CPDF_Object* pRet = pObj.get();
diff --git a/core/fpdfapi/parser/cpdf_object.cpp b/core/fpdfapi/parser/cpdf_object.cpp
index f0ff81eeed..82c3b09416 100644
--- a/core/fpdfapi/parser/cpdf_object.cpp
+++ b/core/fpdfapi/parser/cpdf_object.cpp
@@ -14,6 +14,7 @@
#include "core/fpdfapi/parser/cpdf_parser.h"
#include "core/fpdfapi/parser/fpdf_parser_decode.h"
#include "core/fxcrt/fx_string.h"
+#include "third_party/base/logging.h"
#include "third_party/base/stl_util.h"
CPDF_Object::~CPDF_Object() {}
@@ -59,7 +60,7 @@ CPDF_Dictionary* CPDF_Object::GetDict() const {
}
void CPDF_Object::SetString(const CFX_ByteString& str) {
- ASSERT(false);
+ NOTREACHED();
}
bool CPDF_Object::IsArray() const {
diff --git a/core/fpdfapi/parser/fpdf_parser_utility.cpp b/core/fpdfapi/parser/fpdf_parser_utility.cpp
index af109e35aa..0cd4ca9225 100644
--- a/core/fpdfapi/parser/fpdf_parser_utility.cpp
+++ b/core/fpdfapi/parser/fpdf_parser_utility.cpp
@@ -16,6 +16,7 @@
#include "core/fpdfapi/parser/cpdf_string.h"
#include "core/fpdfapi/parser/fpdf_parser_decode.h"
#include "core/fxcrt/fx_extension.h"
+#include "third_party/base/logging.h"
// Indexed by 8-bit character code, contains either:
// 'W' - for whitespace: NUL, TAB, CR, LF, FF, SPACE, 0x80, 0xff
@@ -215,7 +216,7 @@ CFX_ByteTextBuf& operator<<(CFX_ByteTextBuf& buf, const CPDF_Object* pObj) {
break;
}
default:
- ASSERT(false);
+ NOTREACHED();
break;
}
return buf;
diff --git a/core/fpdfapi/render/cpdf_renderstatus.cpp b/core/fpdfapi/render/cpdf_renderstatus.cpp
index e6b01eff3b..9f4bda1409 100644
--- a/core/fpdfapi/render/cpdf_renderstatus.cpp
+++ b/core/fpdfapi/render/cpdf_renderstatus.cpp
@@ -53,6 +53,7 @@
#include "core/fxge/cfx_pathdata.h"
#include "core/fxge/cfx_renderdevice.h"
#include "core/fxge/ifx_renderdevicedriver.h"
+#include "third_party/base/logging.h"
#include "third_party/base/numerics/safe_math.h"
#include "third_party/base/ptr_util.h"
#include "third_party/base/stl_util.h"
@@ -1733,7 +1734,7 @@ bool CPDF_RenderStatus::ProcessText(CPDF_TextObject* textobj,
case TextRenderingMode::MODE_INVISIBLE:
// Already handled above, but the compiler is not smart enough to
// realize it. Fall through.
- ASSERT(false);
+ NOTREACHED();
case TextRenderingMode::MODE_CLIP:
return true;
}