Skip to content

Commit

Permalink
Various include fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
joto committed Jan 9, 2025
1 parent 08580be commit 3725ba0
Show file tree
Hide file tree
Showing 40 changed files with 52 additions and 14 deletions.
1 change: 1 addition & 0 deletions benchmarks/osmium_benchmark_count.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

#include <cstdint>
#include <cstdlib>
#include <exception>
#include <iostream>
#include <string>

Expand Down
1 change: 1 addition & 0 deletions benchmarks/osmium_benchmark_count_tag.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

#include <cstdint>
#include <cstdlib>
#include <exception>
#include <iostream>
#include <string>

Expand Down
3 changes: 2 additions & 1 deletion benchmarks/osmium_benchmark_index_map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@
*/

#include <osmium/handler.hpp>
#include <osmium/handler/node_locations_for_ways.hpp>
#include <osmium/index/map/all.hpp>
#include <osmium/io/any_input.hpp>
#include <osmium/visitor.hpp>

#include <cstdlib>
#include <exception>
#include <iostream>
#include <memory>
#include <string>

using index_type = osmium::index::map::Map<osmium::unsigned_object_id_type, osmium::Location>;
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/osmium_benchmark_mercator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
#include <osmium/io/any_input.hpp>
#include <osmium/visitor.hpp>

#include <cstdint>
#include <cstdlib>
#include <exception>
#include <iostream>
#include <string>

Expand Down
4 changes: 3 additions & 1 deletion benchmarks/osmium_benchmark_static_vs_dynamic_index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
*/

#include <osmium/handler.hpp>
#include <osmium/handler/node_locations_for_ways.hpp>
#include <osmium/index/map/all.hpp>
#include <osmium/io/any_input.hpp>
Expand All @@ -26,8 +25,11 @@
#include <chrono>
#include <cmath>
#include <cstdlib>
#include <exception>
#include <iostream>
#include <limits>
#include <memory>
#include <ratio>
#include <string>

using static_index_type = osmium::index::map::SparseMemArray<osmium::unsigned_object_id_type, osmium::Location>;
Expand Down
8 changes: 5 additions & 3 deletions benchmarks/osmium_benchmark_write_pbf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@
*/

#include <osmium/io/any_input.hpp>
#include <osmium/io/any_output.hpp>

#include <cstdlib>
#include <exception>
#include <iostream>
#include <string>

#include <osmium/io/any_input.hpp>
#include <osmium/io/any_output.hpp>
#include <utility>

int main(int argc, char* argv[]) {
if (argc != 3) {
Expand Down
1 change: 1 addition & 0 deletions examples/osmium_amenity_list.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
*/

#include <cstdio> // for std::printf
#include <exception>
#include <iostream> // for std::cerr
#include <string> // for std::string

Expand Down
2 changes: 2 additions & 0 deletions examples/osmium_area_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@
*/

#include <cstring> // for std::strcmp
#include <exception>
#include <iostream> // for std::cout, std::cerr
#include <vector>

// For assembling multipolygons
#include <osmium/area/assembler.hpp>
Expand Down
1 change: 1 addition & 0 deletions examples/osmium_convert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <exception> // for std::exception
#include <iostream> // for std::cout, std::cerr
#include <string> // for std::string
#include <utility>

// Allow any format of input files (XML, PBF, ...)
#include <osmium/io/any_input.hpp>
Expand Down
1 change: 1 addition & 0 deletions examples/osmium_count.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/

#include <cstdint> // for std::uint64_t
#include <exception>
#include <iostream> // for std::cout, std::cerr

// Allow any format of input files (XML, PBF, ...)
Expand Down
1 change: 1 addition & 0 deletions examples/osmium_debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
*/

#include <exception>
#include <iostream> // for std::cout, std::cerr
#include <string> // for std::string

Expand Down
2 changes: 2 additions & 0 deletions examples/osmium_dump_internal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@

#include <cerrno> // for errno
#include <cstring> // for std::strerror
#include <exception>
#include <iostream> // for std::cout, std::cerr
#include <string> // for std::string
#include <system_error>
#include <sys/stat.h> // for open
#include <sys/types.h> // for open

Expand Down
1 change: 1 addition & 0 deletions examples/osmium_filter_discussions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
*/

#include <algorithm> // for std::copy_if
#include <exception>
#include <iostream> // for std::cout, std::cerr

// We want to read OSM files in XML format
Expand Down
3 changes: 1 addition & 2 deletions examples/osmium_index_lookup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,11 @@
#include <algorithm> // for std::all_of, std::equal_range
#include <cstdlib> // for std::exit
#include <cstring> // for std::strcmp
#include <exception>
#include <fcntl.h> // for open
#include <iostream> // for std::cout, std::cerr
#include <memory> // for std::unique_ptr
#include <string> // for std::string
#include <sys/stat.h> // for open
#include <sys/types.h> // for open
#include <vector> // for std::vector

#ifdef _WIN32
Expand Down
1 change: 1 addition & 0 deletions examples/osmium_location_cache_create.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

#include <cerrno> // for errno
#include <cstring> // for strerror
#include <exception>
#include <fcntl.h> // for open
#include <iostream> // for std::cout, std::cerr
#include <string> // for std::string
Expand Down
1 change: 1 addition & 0 deletions examples/osmium_location_cache_use.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

#include <cerrno> // for errno
#include <cstring> // for strerror
#include <exception>
#include <fcntl.h> // for open
#include <iostream> // for std::cout, std::cerr
#include <string> // for std::string
Expand Down
1 change: 1 addition & 0 deletions examples/osmium_pub_names.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
*/

#include <cstring> // for std::strncmp
#include <exception>
#include <iostream> // for std::cout, std::cerr

// Allow any format of input files (XML, PBF, ...)
Expand Down
1 change: 1 addition & 0 deletions examples/osmium_read.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
*/

#include <exception>
#include <iostream> // for std::cerr

// Allow any format of input files (XML, PBF, ...)
Expand Down
1 change: 1 addition & 0 deletions examples/osmium_read_with_progress.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
*/

#include <exception>
#include <iostream> // for std::cerr

// Allow any format of input files (XML, PBF, ...)
Expand Down
1 change: 1 addition & 0 deletions examples/osmium_road_length.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
*/

#include <exception>
#include <iostream> // for std::cout, std::cerr

// Allow any format of input files (XML, PBF, ...)
Expand Down
1 change: 1 addition & 0 deletions test/data-tests/testdata-multipolygon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include <gdalcpp.hpp>

#include <cstring>
#include <exception>
#include <fstream>
#include <iostream>
#include <map>
Expand Down
1 change: 1 addition & 0 deletions test/data-tests/testdata-overview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

#include <gdalcpp.hpp>

#include <exception>
#include <iostream>
#include <string>

Expand Down
1 change: 1 addition & 0 deletions test/data-tests/testdata-testcases.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include "testdata-testcases.hpp"

#include <exception>
#include <iostream>
#include <string>

Expand Down
5 changes: 3 additions & 2 deletions test/data-tests/testdata-xml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,16 @@
#include <osmium/io/gzip_compression.hpp>
#include <osmium/io/xml_input.hpp>
#include <osmium/util/misc.hpp>
#include <osmium/visitor.hpp>

#include <atomic>
#include <cassert>
#include <cstdlib>
#include <cstring>
#include <future>
#include <iostream>
#include <iterator>
#include <stdexcept>
#include <string>
#include <utility>

namespace {

Expand Down
1 change: 0 additions & 1 deletion test/t/geom/test_ogr_wkb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include <osmium/util/endian.hpp>

#include <memory>
#include <sstream>
#include <string>

#if __BYTE_ORDER == __LITTLE_ENDIAN
Expand Down
2 changes: 2 additions & 0 deletions test/t/index/test_dump_and_load_index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
#include <osmium/osm/location.hpp>
#include <osmium/osm/types.hpp>

#include <functional>

using dense_file_array = osmium::index::map::DenseFileArray<osmium::unsigned_object_id_type, osmium::Location>;
using sparse_file_array = osmium::index::map::SparseFileArray<osmium::unsigned_object_id_type, osmium::Location>;

Expand Down
1 change: 1 addition & 0 deletions test/t/index/test_dump_sparse_as_array.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <osmium/osm/types.hpp>
#include <osmium/util/file.hpp>

#include <algorithm>
#include <vector>

using dense_file_array = osmium::index::map::DenseFileArray<osmium::unsigned_object_id_type, osmium::Location>;
Expand Down
2 changes: 2 additions & 0 deletions test/t/index/test_id_set.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#include <osmium/index/id_set.hpp>
#include <osmium/osm/types.hpp>

#include <algorithm>

TEST_CASE("Basic functionality of IdSetDense") {
osmium::index::IdSetDense<osmium::unsigned_object_id_type> s;

Expand Down
1 change: 1 addition & 0 deletions test/t/io/test_gzip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <osmium/io/gzip_compression.hpp>

#include <string>
#include <system_error>

TEST_CASE("Invalid file descriptor of gzip-compressed file") {
REQUIRE_THROWS_AS(osmium::io::GzipDecompressor{-1}, osmium::gzip_error);
Expand Down
1 change: 1 addition & 0 deletions test/t/io/test_nocompression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <osmium/io/compression.hpp>

#include <string>
#include <system_error>

TEST_CASE("Invalid file descriptor of uncompressed file") {
osmium::io::NoDecompressor decomp{-1};
Expand Down
1 change: 1 addition & 0 deletions test/t/io/test_opl_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <cstring>
#include <initializer_list>
#include <string>
#include <utility>
#include <vector>

namespace oid = osmium::io::detail;
Expand Down
2 changes: 2 additions & 0 deletions test/t/io/test_output_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

#include <osmium/io/detail/string_util.hpp>

#include <cctype>
#include <cstring>
#include <iterator>
#include <locale>
#include <stdexcept>
Expand Down
1 change: 1 addition & 0 deletions test/t/io/test_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <osmium/memory/buffer.hpp>
#include <osmium/visitor.hpp>

#include <array>
#include <iterator>
#include <stdexcept>
#include <vector>
Expand Down
1 change: 0 additions & 1 deletion test/t/io/test_reader_with_mock_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#include <osmium/builder/osm_object_builder.hpp>
#include <osmium/io/compression.hpp>
#include <osmium/io/detail/input_format.hpp>
#include <osmium/io/detail/queue_util.hpp>
#include <osmium/io/file_format.hpp>
#include <osmium/io/header.hpp>
#include <osmium/io/reader.hpp>
Expand Down
1 change: 1 addition & 0 deletions test/t/osm/test_changeset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <osmium/osm/changeset.hpp>
#include <osmium/osm/crc.hpp>

#include <ctime>
#include <string>

using namespace osmium::builder::attr; // NOLINT(google-build-using-namespace)
Expand Down
1 change: 0 additions & 1 deletion test/t/osm/test_location.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include <limits>
#include <sstream>
#include <string>
#include <type_traits>

// fails on MSVC and doesn't really matter
// static_assert(std::is_literal_type<osmium::Location>::value, "osmium::Location not literal type");
Expand Down
1 change: 1 addition & 0 deletions test/t/osm/test_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <osmium/osm/crc.hpp>
#include <osmium/osm/node.hpp>

#include <ctime>
#include <string>

using namespace osmium::builder::attr; // NOLINT(google-build-using-namespace)
Expand Down
1 change: 1 addition & 0 deletions test/t/osm/test_relation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <osmium/osm/relation.hpp>

#include <cstdint>
#include <ctime>
#include <string>

using namespace osmium::builder::attr; // NOLINT(google-build-using-namespace)
Expand Down
1 change: 1 addition & 0 deletions test/t/osm/test_way.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <osmium/osm/crc.hpp>
#include <osmium/osm/way.hpp>

#include <ctime>
#include <string>

using namespace osmium::builder::attr; // NOLINT(google-build-using-namespace)
Expand Down
3 changes: 2 additions & 1 deletion test/t/tags/test_tag_list.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <osmium/memory/buffer.hpp>
#include <osmium/osm/tag.hpp>

#include <cstring>
#include <map>
#include <string>
#include <utility>
Expand Down Expand Up @@ -62,7 +63,7 @@ TEST_CASE("create tag list") {
SECTION("with TagListBuilder from char* with length") {
{
osmium::builder::TagListBuilder builder(buffer);
builder.add_tag("highway", strlen("highway"), "primary", strlen("primary"));
builder.add_tag("highway", std::strlen("highway"), "primary", std::strlen("primary"));
builder.add_tag("nameXX", 4, "Main Street", 11);
}
buffer.commit();
Expand Down

0 comments on commit 3725ba0

Please sign in to comment.