Commit a2edf27b76cf68474190229dad904ca661e9bb42
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,7 +27,7 @@ struct _qpdf_error | ||
| 27 | 27 | ||
| 28 | struct _qpdf_data | 28 | struct _qpdf_data |
| 29 | { | 29 | { |
| 30 | - _qpdf_data(); | 30 | + _qpdf_data() = default; |
| 31 | ~_qpdf_data() = default; | 31 | ~_qpdf_data() = default; |
| 32 | 32 | ||
| 33 | std::shared_ptr<QPDF> qpdf; | 33 | std::shared_ptr<QPDF> qpdf; |
| @@ -39,31 +39,23 @@ struct _qpdf_data | @@ -39,31 +39,23 @@ struct _qpdf_data | ||
| 39 | std::string tmp_string; | 39 | std::string tmp_string; |
| 40 | 40 | ||
| 41 | // Parameters for functions we call | 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 | std::shared_ptr<Buffer> output_buffer; | 47 | std::shared_ptr<Buffer> output_buffer; |
| 48 | 48 | ||
| 49 | // QPDFObjectHandle support | 49 | // QPDFObjectHandle support |
| 50 | - bool silence_errors; | ||
| 51 | - bool oh_error_occurred; | 50 | + bool silence_errors{false}; |
| 51 | + bool oh_error_occurred{false}; | ||
| 52 | std::map<qpdf_oh, std::shared_ptr<QPDFObjectHandle>> oh_cache; | 52 | std::map<qpdf_oh, std::shared_ptr<QPDFObjectHandle>> oh_cache; |
| 53 | - qpdf_oh next_oh; | 53 | + qpdf_oh next_oh{0}; |
| 54 | std::set<std::string> cur_iter_dict_keys; | 54 | std::set<std::string> cur_iter_dict_keys; |
| 55 | std::set<std::string>::const_iterator dict_iter; | 55 | std::set<std::string>::const_iterator dict_iter; |
| 56 | std::string cur_dict_key; | 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 | // must set qpdf->filename and qpdf->password | 59 | // must set qpdf->filename and qpdf->password |
| 68 | static void | 60 | static void |
| 69 | call_read(qpdf_data qpdf) | 61 | call_read(qpdf_data qpdf) |