Skip to content

Commit 4c97d35

Browse files
authored
Fix C++ warnings (#156)
* Fix C++ warnings Signed-off-by: Christian Vetter <[email protected]>
1 parent fd34db5 commit 4c97d35

File tree

5 files changed

+8
-4
lines changed

5 files changed

+8
-4
lines changed

flatdata-cpp/examples/coappearances/coappearances.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ convert( const char* json_path, const char* archive_path )
220220
// Note: The linear search below is slow for big graphs for obvious reasons, where it is much better
221221
// to build a lookup table. However, for our small graph this works fine.
222222
std::vector< uint32_t >
223-
get_neighbors( co::Graph graph, uint32_t vertex_ref )
223+
get_neighbors( const co::Graph& graph, uint32_t vertex_ref )
224224
{
225225
std::vector< uint32_t > neighbors;
226226
for ( auto e : graph.edges( ) )
@@ -238,7 +238,7 @@ get_neighbors( co::Graph graph, uint32_t vertex_ref )
238238
}
239239

240240
size_t
241-
calculate_num_connected_components( co::Graph graph )
241+
calculate_num_connected_components( const co::Graph& graph )
242242
{
243243
size_t num_connected_components = 0;
244244

flatdata-cpp/examples/fibonacci.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ main( int argc, char const* argv[] )
7777
return 1;
7878
}
7979
}
80-
catch ( std::runtime_error err )
80+
catch ( const std::runtime_error& err )
8181
{
8282
std::cerr << "Error: " << err.what( ) << std::endl;
8383
}

flatdata-cpp/examples/graph.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ main( int argc, char const* argv[] )
9595
return 1;
9696
}
9797
}
98-
catch ( std::runtime_error err )
98+
catch ( const std::runtime_error& err )
9999
{
100100
std::cerr << "Error: " << err.what( ) << std::endl;
101101
}

flatdata-cpp/include/flatdata/Archive.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* See the LICENSE file in the root of this project for license details.
44
*/
55

6+
#pragma once
7+
68
#include "ResourceStorage.h"
79

810
#include <boost/optional.hpp>

flatdata-cpp/include/flatdata/internal/ArchiveUtils.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* See the LICENSE file in the root of this project for license details.
44
*/
55

6+
#pragma once
7+
68
#include <string>
79

810
namespace flatdata

0 commit comments

Comments
 (0)