Skip to content

Commit

Permalink
Fix return function and unsigned/sign comparaison
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomasb81 committed Feb 5, 2024
1 parent d748672 commit b5cc581
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions cola/libdialect/ortho.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,9 @@ std::string Compass::dirToString(CompassDir d) {
case CompassDir::SW: return "SW";
case CompassDir::NW: return "NW";
case CompassDir::NE: return "NE";
default :
COLA_ASSERT(false);
return "EAST";
}
}

Expand Down
4 changes: 2 additions & 2 deletions cola/libdialect/quadaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ string Assignment::toString() const {
return s;
}

Quad::Quad(unsigned num) : num(num) {
Quad::Quad(unsigned int num) : num(num) {
// The only valid num's for quadrants are 0, 1, 2, 3.
COLA_ASSERT(0U <= num && num <= 3U);
COLA_ASSERT(0 <= (int) num && num <= 3);
}

void Quad::sortAndComputeCosts() {
Expand Down
2 changes: 1 addition & 1 deletion cola/libdialect/quadaction.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ struct Quad {
//! @brief Standard constructor.
//!
//! @param[in] num The number of this quadrant in {0, 1, 2, 3}
Quad(unsigned num);
Quad(unsigned int num);

//! @brief Add a neighbour.
void addNbr(const Nbr_SP &nbr) { nbrs.push_back(nbr); }
Expand Down
2 changes: 1 addition & 1 deletion cola/libdialect/routing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ void RoutingAdapter::recordRoutes(bool refine) {
vector<Point> refined_pts;
size_t N = pts.size() - 2; // the number of interior points
// We expect that there are at least two route points.
COLA_ASSERT(N >= 0U);
COLA_ASSERT((int) N >= 0);
size_t i = 0;
// We always keep the first route point.
refined_pts.push_back(pts[0]);
Expand Down

0 comments on commit b5cc581

Please sign in to comment.