Skip to content
Snippets Groups Projects
Commit 5372133f authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

recommended by clang-tidy

parent dafa2b27
No related branches found
No related tags found
1 merge request!2184cleanup as suggested by clang-tidy
......@@ -109,7 +109,7 @@ Datafield* Util::RW::readTiff(std::istream& input_stream)
if (buf_size != expected_size)
throw std::runtime_error("Cannot read TIFF file: wrong scanline size" + ref_to_doc);
tdata_t buf = _TIFFmalloc(buf_size);
tdata_t const buf = _TIFFmalloc(buf_size); // tdata_t is void*
if (!buf)
throw std::runtime_error("Cannot read TIFF file: failed allocating buffer" + ref_to_doc);
......@@ -221,7 +221,7 @@ void Util::RW::writeTiff(const Datafield& data, std::ostream& output_stream)
for (unsigned row = 0; row < (uint32_t)m_height; row++) {
for (unsigned col = 0; col < line_buf.size(); ++col)
line_buf[col] = static_cast<sample_t>(data[(m_height - 1 - row) * m_width + col]);
memcpy(buf, &line_buf[0], buf_size);
memcpy(buf, line_buf.data(), buf_size);
if (TIFFWriteScanline(tiffstream, buf, row) < 0)
throw std::runtime_error("Cannot write TIFF file: error in TIFFWriteScanline");
......
......@@ -174,7 +174,7 @@ QVariant DatafilesTree::data(const QModelIndex& index, int role) const
auto* const item = itemForIndex(index);
if (role == Qt::ToolTipRole)
return QString();
return {};
if (role == Qt::DisplayRole)
return item->realItemName();
......
......@@ -272,7 +272,7 @@ QString MaterialEditorDialog::chooseMaterial(QWidget* parent, SampleItem* sample
if (MaterialItem* material = dialog.currentMaterialItem())
return material->identifier();
return QString();
return {};
}
void MaterialEditorDialog::addRefractiveMaterial()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment