Skip to content

Commit

Permalink
GCC: "error: operands to ?: have different types"
Browse files Browse the repository at this point in the history
Without type casts in this commit.

- Tried on GCC 7 and 8 with -std=gnu++14 and 17
- Even with latest as of now nlohmann/json@c05bd90
- While no errors on Visual Studio and Xcode without those casts
  • Loading branch information
berezins committed Jun 13, 2020
1 parent 508e4f9 commit f7e6799
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/crowdin_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ dispatch::future<CrowdinClient::ProjectInfo> CrowdinClient::GetProjectInfo(const
{
auto url = "projects/" + std::to_string(project_id);
auto prj = std::make_shared<ProjectInfo>();
enum { NO_ID = -1 };
enum : int { NO_ID = -1 };

return m_api->get(url)
.then([this, url, prj](json r)
Expand All @@ -273,8 +273,8 @@ dispatch::future<CrowdinClient::ProjectInfo> CrowdinClient::GetProjectInfo(const
prj->files.push_back({
L'/' + str::to_wstring(d["name"]),
d["id"],
dir.is_null() ? NO_ID : dir,
branch.is_null() ? NO_ID : branch
dir.is_null() ? NO_ID : int(dir),
branch.is_null() ? NO_ID : int(branch)
});
}
}
Expand All @@ -297,7 +297,7 @@ dispatch::future<CrowdinClient::ProjectInfo> CrowdinClient::GetProjectInfo(const
d["id"],
{
d["name"],
parent.is_null() ? NO_ID : parent
parent.is_null() ? NO_ID : int(parent)
}
});
}
Expand Down

0 comments on commit f7e6799

Please sign in to comment.