Skip to content

Commit

Permalink
Rename to enum variables to lower-case
Browse files Browse the repository at this point in the history
Those would avoid weird defines from messing with the code.
  • Loading branch information
lunacd committed Oct 25, 2024
1 parent 4fffd18 commit 2844d73
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/cps/pc_compat/pc_base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace cps::pc_compat {
// PackageRequirement is the type of a non-terminal. bison needs
// to do a sizeof on this type and cannot do so with a forward
// declaration.
enum class VersionOperation { LT, LE, NE, EQ, GT, GE };
enum class VersionOperation { lt, le, ne, eq, gt, ge };
struct PackageRequirement {
std::string package;
std::optional<VersionOperation> operation;
Expand Down
12 changes: 6 additions & 6 deletions src/cps/pc_compat/pc_loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,22 @@ namespace cps::pc_compat {
return ost;
}
switch (*version_operation) {
case VersionOperation::EQ:
case VersionOperation::eq:
ost << "=";
break;
case VersionOperation::NE:
case VersionOperation::ne:
ost << "!=";
break;
case VersionOperation::LT:
case VersionOperation::lt:
ost << "<";
break;
case VersionOperation::LE:
case VersionOperation::le:
ost << "<=";
break;
case VersionOperation::GT:
case VersionOperation::gt:
ost << ">";
break;
case VersionOperation::GE:
case VersionOperation::ge:
ost << ">=";
break;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/pc_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ namespace cps::utils::test {
assert_string_value(pc_loader.properties["Cflags"], "-I/home/kaniini/pkg/include/libfoo");
assert_package_requirements(
pc_loader.properties["Requires"],
{PackageRequirement{.package = "libbar", .operation = VersionOperation::GT, .version = "2.0.0"}});
{PackageRequirement{.package = "libbar", .operation = VersionOperation::gt, .version = "2.0.0"}});
}
} // namespace
} // namespace cps::utils::test

0 comments on commit 2844d73

Please sign in to comment.