mirror of
https://github.com/qpdf/qpdf.git
synced 2024-09-28 04:59:05 +00:00
Minor code cleanup
* Return rather than exiting from realmain in qpdf.cc * Remove extraneous blank line * Don't assign temporary to const reference
This commit is contained in:
parent
232f5fc9f3
commit
30bb4c64ee
@ -1464,7 +1464,6 @@ QPDF::fixDanglingReferences(bool force)
|
|||||||
queue.push_back(sub);
|
queue.push_back(sub);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2370,7 +2370,7 @@ QPDFWriter::generateObjectStreams()
|
|||||||
|
|
||||||
// This code doesn't do anything with /Extends.
|
// This code doesn't do anything with /Extends.
|
||||||
|
|
||||||
std::vector<QPDFObjGen> const& eligible =
|
std::vector<QPDFObjGen> eligible =
|
||||||
QPDF::Writer::getCompressibleObjGens(this->m->pdf);
|
QPDF::Writer::getCompressibleObjGens(this->m->pdf);
|
||||||
size_t n_object_streams = (eligible.size() + 99U) / 100U;
|
size_t n_object_streams = (eligible.size() + 99U) / 100U;
|
||||||
if (n_object_streams == 0)
|
if (n_object_streams == 0)
|
||||||
|
16
qpdf/qpdf.cc
16
qpdf/qpdf.cc
@ -5730,7 +5730,7 @@ int realmain(int argc, char* argv[])
|
|||||||
{
|
{
|
||||||
// Allow --is-encrypted and --requires-password to
|
// Allow --is-encrypted and --requires-password to
|
||||||
// work when an incorrect password is supplied.
|
// work when an incorrect password is supplied.
|
||||||
exit(0);
|
return 0;
|
||||||
}
|
}
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
@ -5739,22 +5739,22 @@ int realmain(int argc, char* argv[])
|
|||||||
{
|
{
|
||||||
if (pdf.isEncrypted())
|
if (pdf.isEncrypted())
|
||||||
{
|
{
|
||||||
exit(0);
|
return 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
exit(EXIT_IS_NOT_ENCRYPTED);
|
return EXIT_IS_NOT_ENCRYPTED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (o.check_requires_password)
|
else if (o.check_requires_password)
|
||||||
{
|
{
|
||||||
if (pdf.isEncrypted())
|
if (pdf.isEncrypted())
|
||||||
{
|
{
|
||||||
exit(EXIT_CORRECT_PASSWORD);
|
return EXIT_CORRECT_PASSWORD;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
exit(EXIT_IS_NOT_ENCRYPTED);
|
return EXIT_IS_NOT_ENCRYPTED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (! o.page_specs.empty())
|
if (! o.page_specs.empty())
|
||||||
@ -5788,14 +5788,14 @@ int realmain(int argc, char* argv[])
|
|||||||
<< " resulting file may have some problems"
|
<< " resulting file may have some problems"
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
}
|
}
|
||||||
// Still exit with warning code even if warnings were suppressed.
|
// Still return with warning code even if warnings were suppressed.
|
||||||
exit(EXIT_WARNING);
|
return EXIT_WARNING;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (std::exception& e)
|
catch (std::exception& e)
|
||||||
{
|
{
|
||||||
std::cerr << e.what() << std::endl;
|
std::cerr << e.what() << std::endl;
|
||||||
exit(EXIT_ERROR);
|
return EXIT_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user