aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/JSON.cc
diff options
context:
space:
mode:
authorJay Berkenbilt <jberkenbilt@users.noreply.github.com>2022-07-31 14:33:45 +0200
committerGitHub <noreply@github.com>2022-07-31 14:33:45 +0200
commit4feb10fdaf51bf3f88b853cdb32a1e9b1692ba52 (patch)
treea99925c17b8acddd802c705221ee71b71f891694 /libqpdf/JSON.cc
parentc9cc8cfd74fdb59d5450939e1772dea35d369b04 (diff)
parent073808aa50f0c78e2d6fea4f56f0b814b314eb42 (diff)
downloadqpdf-4feb10fdaf51bf3f88b853cdb32a1e9b1692ba52.tar.zst
Merge pull request #734 from m-holger/nullptr
Code tidy : replace 0 with nullptr or true
Diffstat (limited to 'libqpdf/JSON.cc')
-rw-r--r--libqpdf/JSON.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/libqpdf/JSON.cc b/libqpdf/JSON.cc
index 9b9da656..d380049f 100644
--- a/libqpdf/JSON.cc
+++ b/libqpdf/JSON.cc
@@ -204,7 +204,7 @@ JSON::JSON_blob::write(Pipeline* p, size_t) const
void
JSON::write(Pipeline* p, size_t depth) const
{
- if (0 == this->m->value.get()) {
+ if (nullptr == this->m->value.get()) {
*p << "null";
} else {
this->m->value->write(p, depth);
@@ -270,7 +270,7 @@ JSON
JSON::addDictionaryMember(std::string const& key, JSON const& val)
{
JSON_dictionary* obj = dynamic_cast<JSON_dictionary*>(this->m->value.get());
- if (0 == obj) {
+ if (nullptr == obj) {
throw std::runtime_error(
"JSON::addDictionaryMember called on non-dictionary");
}
@@ -286,7 +286,7 @@ bool
JSON::checkDictionaryKeySeen(std::string const& key)
{
JSON_dictionary* obj = dynamic_cast<JSON_dictionary*>(this->m->value.get());
- if (0 == obj) {
+ if (nullptr == obj) {
throw std::logic_error(
"JSON::checkDictionaryKey called on non-dictionary");
}
@@ -307,7 +307,7 @@ JSON
JSON::addArrayElement(JSON const& val)
{
JSON_array* arr = dynamic_cast<JSON_array*>(this->m->value.get());
- if (0 == arr) {
+ if (nullptr == arr) {
throw std::runtime_error("JSON::addArrayElement called on non-array");
}
if (val.m->value.get()) {