Commit 77aa3a00 authored by Albert Astals Cid's avatar Albert Astals Cid
Browse files

Enable modernize-use-emplace

Not claiming copyright since it's a mechanical change
parent fb285d2c
Pipeline #84617 passed with stages
in 10 minutes and 41 seconds
......@@ -40,7 +40,7 @@ build_clang_libcpp:
script:
- git clone --branch ${CI_COMMIT_REF_NAME} --depth 1 ${TEST_DATA_URL} test-data || git clone --depth 1 ${UPSTREAM_TEST_DATA_URL} test-data
- mkdir -p build && cd build
- CC=clang CXX=clang++ cmake -G Ninja -DCMAKE_CXX_FLAGS=-stdlib=libc++ -DTESTDATADIR=$PWD/../test-data -DCMAKE_CXX_CLANG_TIDY="clang-tidy;-header-filter=.;-checks=-*,performance-*,,bugprone-*,readability-inconsistent-declaration-parameter-name,readability-string-compare,modernize-deprecated-headers,modernize-make-unique,modernize-make-shared,modernize-use-override,modernize-use-equals-delete,-bugprone-narrowing-conversions,-bugprone-macro-parentheses,-bugprone-suspicious-string-compare,-bugprone-incorrect-roundings,-bugprone-undefined-memory-manipulation;-warnings-as-errors=*" ..
- CC=clang CXX=clang++ cmake -G Ninja -DCMAKE_CXX_FLAGS=-stdlib=libc++ -DTESTDATADIR=$PWD/../test-data -DCMAKE_CXX_CLANG_TIDY="clang-tidy;-header-filter=.;-checks=-*,performance-*,,bugprone-*,readability-inconsistent-declaration-parameter-name,readability-string-compare,modernize-deprecated-headers,modernize-make-unique,modernize-make-shared,modernize-use-override,modernize-use-equals-delete,modernize-use-emplace,-bugprone-narrowing-conversions,-bugprone-macro-parentheses,-bugprone-suspicious-string-compare,-bugprone-incorrect-roundings,-bugprone-undefined-memory-manipulation;-warnings-as-errors=*" ..
- ninja
- ctest --output-on-failure
......
......@@ -480,16 +480,16 @@ std::vector<std::string> image::supported_image_formats()
{
std::vector<std::string> formats;
#if defined(ENABLE_LIBPNG)
formats.push_back("png");
formats.emplace_back("png");
#endif
#if defined(ENABLE_LIBJPEG)
formats.push_back("jpeg");
formats.push_back("jpg");
formats.emplace_back("jpeg");
formats.emplace_back("jpg");
#endif
#if defined(ENABLE_LIBTIFF)
formats.push_back("tiff");
formats.emplace_back("tiff");
#endif
formats.push_back("pnm");
formats.emplace_back("pnm");
return formats;
}
......
......@@ -384,7 +384,7 @@ std::vector<text_box> page::text_list() const
tb.m_data->char_bboxes.reserve(word->getLength());
for (int j = 0; j < word->getLength(); j ++) {
word->getCharBBox(j, &xMin, &yMin, &xMax, &yMax);
tb.m_data->char_bboxes.push_back({xMin, yMin, xMax-xMin, yMax-yMin});
tb.m_data->char_bboxes.emplace_back(xMin, yMin, xMax-xMin, yMax-yMin);
}
output_list.push_back(std::move(tb));
......
......@@ -125,7 +125,7 @@ ViewerPreferences::ViewerPreferences(Dict *prefDict)
if (obj2.isInt() && (pageNumber1 = obj2.getInt()) >= 1 &&
obj3.isInt() && (pageNumber2 = obj3.getInt()) >= 1 &&
pageNumber1 < pageNumber2) {
printPageRange.push_back(std::pair<int, int>(pageNumber1, pageNumber2));
printPageRange.emplace_back(pageNumber1, pageNumber2);
} else {
printPageRange.clear();
break;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment