Skip to content

Commit 29e03ad

Browse files
committed
Fix compiler warnings.
1 parent 75930f2 commit 29e03ad

File tree

4 files changed

+6
-13
lines changed

4 files changed

+6
-13
lines changed

src/LinearAlgebra/SparsityPattern/Variable.hpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
/*!
22
\file Variable.hpp
33
*/
4-
#ifndef SAD_VARIABLE_HPP
5-
#define SAD_VARIABLE_HPP
4+
#pragma once
65

76
#include <map>
87
#include <vector>
@@ -264,7 +263,7 @@ namespace Sparse
264263
bool isFixed_; ///< Constant parameter flag.
265264

266265
mutable DependencyMap* dependencies_;
267-
static const size_t INVALID_VAR_NUMBER = -1;
266+
static const size_t INVALID_VAR_NUMBER = static_cast<const size_t>(-1);
268267
};
269268

270269
//------------------------------------
@@ -336,4 +335,3 @@ namespace Sparse
336335
#include "VariableImplementation.hpp"
337336
#include "VariableOperators.hpp"
338337

339-
#endif // SAD_VARIABLE_HPP

src/LinearAlgebra/SparsityPattern/VariableImplementation.hpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
\file VariableImplementation.hpp
33
*/
44

5-
#ifndef SAD_VARIABLE_IMPLEMENTATION_HPP
6-
#define SAD_VARIABLE_IMPLEMENTATION_HPP
5+
#pragma once
76

87
namespace GridKit
98
{
@@ -213,5 +212,3 @@ namespace Sparse
213212
} // namespace Sparse
214213
} // namespace GridKit
215214

216-
217-
#endif // SAD_VARIABLE_IMPLEMENTATION_HPP

src/LinearAlgebra/SparsityPattern/VariableOperators.hpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
\file VariableOperators.hpp
33
44
*/
5-
#ifndef SAD_VARIABLE_OPERATORS_HPP
6-
#define SAD_VARIABLE_OPERATORS_HPP
5+
#pragma once
76

87
// Define derivatives of standard library mathematical functions here.
98
// These definitions could be used to add smoothing in cases where
@@ -361,5 +360,3 @@ namespace std
361360

362361
} // namespace std
363362

364-
365-
#endif // SAD_VARIABLE_OPERATORS_HPP

src/Utilities/Testing.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ inline bool isEqual(PowerSystemData::GenCostData<RealT, IdxT> a,
9999
PowerSystemData::GenCostData<RealT, IdxT> b,
100100
RealT tol = tol_)
101101
{
102+
(void) tol; // suppress warning
102103
int fail = 0;
103104
fail += a.kind != b.kind;
104105
fail += a.startup != b.startup;
@@ -232,7 +233,7 @@ inline bool isEqual(std::vector<T> a, std::vector<T> b, double tol = tol_)
232233

233234
int fail = 0;
234235
for (std::size_t i = 0; i < a.size(); i++) {
235-
if (!isEqual(a[i], b[i])) {
236+
if (!isEqual(a[i], b[i], tol)) {
236237
fail++;
237238
errs() << "[isEqual<vector<T>>]: Got failure with i=" << i << ".\n";
238239
}

0 commit comments

Comments
 (0)