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 -Wshadow warnings between parammappings.cpp and singleoperation.cpp with unity builds #4304

Merged
merged 1 commit into from
Nov 1, 2024
Merged
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
32 changes: 16 additions & 16 deletions src/iso19111/operation/parammappings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ static const ParamMapping *const paramsGeographicTopocentric[] = {
&paramLatTopoOrigin, &paramLongTopoOrigin, &paramHeightTopoOriginWithH0,
nullptr};

static const MethodMapping projectionMethodMappings[] = {
static const MethodMapping gProjectionMethodMappings[] = {
{EPSG_NAME_METHOD_TRANSVERSE_MERCATOR, EPSG_CODE_METHOD_TRANSVERSE_MERCATOR,
"Transverse_Mercator", "tmerc", nullptr, paramsNatOriginScaleK},

Expand Down Expand Up @@ -945,9 +945,9 @@ static const MethodMapping projectionMethodMappings[] = {
};

const MethodMapping *getProjectionMethodMappings(size_t &nElts) {
nElts =
sizeof(projectionMethodMappings) / sizeof(projectionMethodMappings[0]);
return projectionMethodMappings;
nElts = sizeof(gProjectionMethodMappings) /
sizeof(gProjectionMethodMappings[0]);
return gProjectionMethodMappings;
}

#define METHOD_NAME_CODE(method) \
Expand Down Expand Up @@ -1050,7 +1050,7 @@ const MethodNameCode *getMethodNameCodes(size_t &nElts) {
#define PARAM_NAME_CODE(method) \
{ EPSG_NAME_PARAMETER_##method, EPSG_CODE_PARAMETER_##method }

const struct ParamNameCode paramNameCodes[] = {
const struct ParamNameCode gParamNameCodes[] = {
// Parameters of projection methods
PARAM_NAME_CODE(COLATITUDE_CONE_AXIS),
PARAM_NAME_CODE(LATITUDE_OF_NATURAL_ORIGIN),
Expand Down Expand Up @@ -1131,8 +1131,8 @@ const struct ParamNameCode paramNameCodes[] = {
};

const ParamNameCode *getParamNameCodes(size_t &nElts) {
nElts = sizeof(paramNameCodes) / sizeof(paramNameCodes[0]);
return paramNameCodes;
nElts = sizeof(gParamNameCodes) / sizeof(gParamNameCodes[0]);
return gParamNameCodes;
}

static const ParamMapping paramUnitConversionScalar = {
Expand Down Expand Up @@ -1475,7 +1475,7 @@ static const ParamMapping *const paramsPoleRotationNetCDFCFConvention[] = {
&paramGridNorthPoleLatitudeNetCDF, &paramGridNorthPoleLongitudeNetCDF,
&paramNorthPoleGridLongitudeNetCDF, nullptr};

static const MethodMapping otherMethodMappings[] = {
static const MethodMapping gOtherMethodMappings[] = {
{EPSG_NAME_METHOD_CHANGE_VERTICAL_UNIT,
EPSG_CODE_METHOD_CHANGE_VERTICAL_UNIT, nullptr, nullptr, nullptr,
paramsChangeVerticalUnit},
Expand Down Expand Up @@ -1641,14 +1641,14 @@ static const MethodMapping otherMethodMappings[] = {
};

const MethodMapping *getOtherMethodMappings(size_t &nElts) {
nElts = sizeof(otherMethodMappings) / sizeof(otherMethodMappings[0]);
return otherMethodMappings;
nElts = sizeof(gOtherMethodMappings) / sizeof(gOtherMethodMappings[0]);
return gOtherMethodMappings;
}

// ---------------------------------------------------------------------------

PROJ_NO_INLINE const MethodMapping *getMapping(int epsg_code) noexcept {
for (const auto &mapping : projectionMethodMappings) {
for (const auto &mapping : gProjectionMethodMappings) {
if (mapping.epsg_code == epsg_code) {
return &mapping;
}
Expand All @@ -1661,7 +1661,7 @@ PROJ_NO_INLINE const MethodMapping *getMapping(int epsg_code) noexcept {
const MethodMapping *getMapping(const OperationMethod *method) noexcept {
const std::string &name(method->nameStr());
const int epsg_code = method->getEPSGCode();
for (const auto &mapping : projectionMethodMappings) {
for (const auto &mapping : gProjectionMethodMappings) {
if ((epsg_code != 0 && mapping.epsg_code == epsg_code) ||
metadata::Identifier::isEquivalentName(mapping.wkt2_name,
name.c_str())) {
Expand All @@ -1679,7 +1679,7 @@ const MethodMapping *getMappingFromWKT1(const std::string &wkt1_name) noexcept {
return getMapping(EPSG_CODE_METHOD_TRANSVERSE_MERCATOR);
}

for (const auto &mapping : projectionMethodMappings) {
for (const auto &mapping : gProjectionMethodMappings) {
if (mapping.wkt1_name && metadata::Identifier::isEquivalentName(
mapping.wkt1_name, wkt1_name.c_str())) {
return &mapping;
Expand All @@ -1690,13 +1690,13 @@ const MethodMapping *getMappingFromWKT1(const std::string &wkt1_name) noexcept {
// ---------------------------------------------------------------------------

const MethodMapping *getMapping(const char *wkt2_name) noexcept {
for (const auto &mapping : projectionMethodMappings) {
for (const auto &mapping : gProjectionMethodMappings) {
if (metadata::Identifier::isEquivalentName(mapping.wkt2_name,
wkt2_name)) {
return &mapping;
}
}
for (const auto &mapping : otherMethodMappings) {
for (const auto &mapping : gOtherMethodMappings) {
if (metadata::Identifier::isEquivalentName(mapping.wkt2_name,
wkt2_name)) {
return &mapping;
Expand All @@ -1710,7 +1710,7 @@ const MethodMapping *getMapping(const char *wkt2_name) noexcept {
std::vector<const MethodMapping *>
getMappingsFromPROJName(const std::string &projName) {
std::vector<const MethodMapping *> res;
for (const auto &mapping : projectionMethodMappings) {
for (const auto &mapping : gProjectionMethodMappings) {
if (mapping.proj_name_main && projName == mapping.proj_name_main) {
res.push_back(&mapping);
}
Expand Down
Loading