Commit a2edf27b76cf68474190229dad904ca661e9bb42

Authored by m-holger
1 parent f8e39253

Initialize _qpdf_data members

Showing 1 changed file with 9 additions and 17 deletions
libqpdf/qpdf-c.cc
... ... @@ -27,7 +27,7 @@ struct _qpdf_error
27 27  
28 28 struct _qpdf_data
29 29 {
30   - _qpdf_data();
  30 + _qpdf_data() = default;
31 31 ~_qpdf_data() = default;
32 32  
33 33 std::shared_ptr<QPDF> qpdf;
... ... @@ -39,31 +39,23 @@ struct _qpdf_data
39 39 std::string tmp_string;
40 40  
41 41 // Parameters for functions we call
42   - char const* filename; // or description
43   - char const* buffer;
44   - unsigned long long size;
45   - char const* password;
46   - bool write_memory;
  42 + char const* filename{nullptr}; // or description
  43 + char const* buffer{nullptr};
  44 + unsigned long long size{0};
  45 + char const* password{nullptr};
  46 + bool write_memory{false};
47 47 std::shared_ptr<Buffer> output_buffer;
48 48  
49 49 // QPDFObjectHandle support
50   - bool silence_errors;
51   - bool oh_error_occurred;
  50 + bool silence_errors{false};
  51 + bool oh_error_occurred{false};
52 52 std::map<qpdf_oh, std::shared_ptr<QPDFObjectHandle>> oh_cache;
53   - qpdf_oh next_oh;
  53 + qpdf_oh next_oh{0};
54 54 std::set<std::string> cur_iter_dict_keys;
55 55 std::set<std::string>::const_iterator dict_iter;
56 56 std::string cur_dict_key;
57 57 };
58 58  
59   -_qpdf_data::_qpdf_data() :
60   - write_memory(false),
61   - silence_errors(false),
62   - oh_error_occurred(false),
63   - next_oh(0)
64   -{
65   -}
66   -
67 59 // must set qpdf->filename and qpdf->password
68 60 static void
69 61 call_read(qpdf_data qpdf)
... ...