diff options
author | m-holger <m-holger@kubitscheck.org> | 2023-06-01 15:12:39 +0200 |
---|---|---|
committer | m-holger <m-holger@kubitscheck.org> | 2023-06-09 16:43:21 +0200 |
commit | 5906dd5c1f050af5d6eb2b9e9e5a0099e44b3ae6 (patch) | |
tree | 31854ee87338d294782f185a459dae43e96c15f8 /examples | |
parent | 7bc0f1d828eccbc5a277b75aedc85b7523919f87 (diff) | |
download | qpdf-5906dd5c1f050af5d6eb2b9e9e5a0099e44b3ae6.tar.zst |
Code tidy - Clang-Tidy rule modernize-use-default-member-init
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; |