diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/pdf-count-strings.cc | 5 | ||||
-rw-r--r-- | examples/pdf-create.cc | 14 |
2 files changed, 7 insertions, 12 deletions
diff --git a/examples/pdf-count-strings.cc b/examples/pdf-count-strings.cc index 2061a499..2e2ef8bf 100644 --- a/examples/pdf-count-strings.cc +++ b/examples/pdf-count-strings.cc @@ -26,8 +26,7 @@ usage() class StringCounter: public QPDFObjectHandle::TokenFilter { public: - StringCounter() : - count(0) + StringCounter() { } ~StringCounter() override = default; @@ -36,7 +35,7 @@ class StringCounter: public QPDFObjectHandle::TokenFilter int getCount() const; private: - int count; + int count{0}; }; void diff --git a/examples/pdf-create.cc b/examples/pdf-create.cc index 7b44fb7f..136643d1 100644 --- a/examples/pdf-create.cc +++ b/examples/pdf-create.cc @@ -31,22 +31,18 @@ class ImageProvider: public QPDFObjectHandle::StreamDataProvider size_t getHeight() const; private: - size_t width; - size_t stripe_height; + size_t width{400}; + size_t stripe_height{80}; std::string color_space; std::string filter; - size_t n_stripes; + size_t n_stripes{6}; std::vector<std::string> stripes; - J_COLOR_SPACE j_color_space; + J_COLOR_SPACE j_color_space{JCS_UNKNOWN}; }; ImageProvider::ImageProvider(std::string const& color_space, std::string const& filter) : - width(400), - stripe_height(80), color_space(color_space), - filter(filter), - n_stripes(6), - j_color_space(JCS_UNKNOWN) + filter(filter) { if (color_space == "/DeviceCMYK") { j_color_space = JCS_CMYK; |