Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a smattering of errors and warnings with newer compilers #461

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion include/forcing/DataProviderSelectors.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,9 @@ class CSVDataSelector : public CatchmentAggrDataSelector
CatchmentAggrDataSelector(std::string(), var, start, dur, units)
{}

#if GCC_VERSION < 8 && !defined(__llvm__)
Copy link
Contributor Author

@mattw-nws mattw-nws Oct 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Finally tried this with GCC6... I did not see the warnings and it compiled... so it looks like 8 is the right version to break this on (maybe 7 but 🤷 ).

operator const CatchmentAggrDataSelector&() const { return *this; }
#endif

private:
};
Expand All @@ -147,7 +149,9 @@ class BMIDataSelector : public CatchmentAggrDataSelector
CatchmentAggrDataSelector(std::string(), var, start, dur, units)
{}

#if GCC_VERSION < 8 && !defined(__llvm__)
operator const CatchmentAggrDataSelector&() const { return *this; }
#endif

private:
};
Expand All @@ -170,8 +174,9 @@ class NetCDFDataSelector : public CatchmentAggrDataSelector

}

#if GCC_VERSION < 8 && !defined(__llvm__)
operator const CatchmentAggrDataSelector&() const { return *this; }

#endif

private:
};
Expand Down
10 changes: 5 additions & 5 deletions include/forcing/NetCDFPerFeatureDataProvider.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ namespace data_access

/** Return the variables that are accessable by this data provider */

const std::vector<std::string>& get_avaliable_variable_names()
const std::vector<std::string>& get_avaliable_variable_names() override
{
return variable_names;
}
Expand All @@ -310,19 +310,19 @@ namespace data_access

/** Return the first valid time for which data from the request variable can be requested */

long get_data_start_time()
long get_data_start_time() override
{
return start_time;
}

/** Return the last valid time for which data from the requested variable can be requested */

long get_data_stop_time()
long get_data_stop_time() override
{
return stop_time;
}

long record_duration()
long record_duration() override
{
return time_stride;
}
Expand All @@ -336,7 +336,7 @@ namespace data_access
* @return The index of the forcing time step that contains the given point in time.
* @throws std::out_of_range If the given point is not in any time step.
*/
size_t get_ts_index_for_time(const time_t &epoch_time)
size_t get_ts_index_for_time(const time_t &epoch_time) override
{
if (start_time <= epoch_time && epoch_time < stop_time)
{
Expand Down
2 changes: 1 addition & 1 deletion include/realizations/catchment/Bmi_Module_Formulation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ namespace realization {
* @see ForcingProvider
*/
//const vector<std::string> &get_available_forcing_outputs() {
const vector<std::string> &get_avaliable_variable_names() {
const vector<std::string> &get_avaliable_variable_names() override {
if (is_model_initialized() && available_forcings.empty()) {
for (const std::string &output_var_name : get_bmi_model()->GetOutputVarNames()) {
available_forcings.push_back(output_var_name);
Expand Down
2 changes: 1 addition & 1 deletion include/realizations/catchment/Bmi_Multi_Formulation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ namespace realization {
*/
//const vector<std::string> &get_available_forcing_outputs();
//const vector<std::string> &get_avaliable_variable_names() override { return get_available_forcing_outputs(); }
const vector<std::string> &get_avaliable_variable_names();
const vector<std::string> &get_avaliable_variable_names() override;

/**
* Get the input variables of
Expand Down
2 changes: 1 addition & 1 deletion test/core/nexus/NexusTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ TEST_F(Nexus_Test, TestInit0)
//HY_HydroLocationType type(HY_HydroLocationType::undefined); //!< Test data type
//HY_IndirectPosition pos;
//std::shared_ptr<HY_HydroLocation>location = std::make_shared<HY_HydroLocation>(point, type, pos);
std::vector<string> contrib = {"cat-1"};
std::vector<std::string> contrib = {"cat-1"};
//HY_PointHydroNexus("nex-0", location, std::vector<string>(), contrib);
HY_PointHydroNexus("nex-0", contrib);
ASSERT_TRUE( true );
Expand Down
2 changes: 1 addition & 1 deletion test/googletest
Submodule googletest updated 225 files