aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/pdf-invert-images.cc6
-rw-r--r--examples/pdf-mod-info.cc3
-rw-r--r--examples/pdf-split-pages.cc7
3 files changed, 6 insertions, 10 deletions
diff --git a/examples/pdf-invert-images.cc b/examples/pdf-invert-images.cc
index 418598c7..3a0afca4 100644
--- a/examples/pdf-invert-images.cc
+++ b/examples/pdf-invert-images.cc
@@ -160,11 +160,9 @@ int main(int argc, char* argv[])
// Get all images on the page.
std::map<std::string, QPDFObjectHandle> images =
page.getPageImages();
- for (std::map<std::string, QPDFObjectHandle>::iterator iter =
- images.begin();
- iter != images.end(); ++iter)
+ for (auto& iter2: images)
{
- QPDFObjectHandle& image = (*iter).second;
+ QPDFObjectHandle& image = iter2.second;
QPDFObjectHandle image_dict = image.getDict();
QPDFObjectHandle color_space =
image_dict.getKey("/ColorSpace");
diff --git a/examples/pdf-mod-info.cc b/examples/pdf-mod-info.cc
index 0585e9fd..9ffd4ede 100644
--- a/examples/pdf-mod-info.cc
+++ b/examples/pdf-mod-info.cc
@@ -46,8 +46,7 @@ void dumpInfoDict(QPDF& pdf,
{
QPDFObjectHandle elt = info.getKey(*it);
std::string val;
- if (false) {}
- else if (elt.isString())
+ if (elt.isString())
{
val = elt.getStringValue();
}
diff --git a/examples/pdf-split-pages.cc b/examples/pdf-split-pages.cc
index f8997bbe..ea1c92bc 100644
--- a/examples/pdf-split-pages.cc
+++ b/examples/pdf-split-pages.cc
@@ -15,7 +15,6 @@
#include <string>
#include <cstring>
-static char const* whoami = 0;
static bool static_id = false;
static void process(char const* whoami,
@@ -50,7 +49,7 @@ static void process(char const* whoami,
}
}
-void usage()
+void usage(char const* whoami)
{
std::cerr << "Usage: " << whoami << " infile outprefix" << std::endl;
exit(2);
@@ -58,7 +57,7 @@ void usage()
int main(int argc, char* argv[])
{
- whoami = QUtil::getWhoami(argv[0]);
+ char const* whoami = QUtil::getWhoami(argv[0]);
// For libtool's sake....
if (strncmp(whoami, "lt-", 3) == 0)
@@ -75,7 +74,7 @@ int main(int argc, char* argv[])
if (argc != 3)
{
- usage();
+ usage(whoami);
}
try
{