summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorVitaly Stakhovsky <vvs31415@gitlab.org>2020-04-27 07:00:00 -0400
committerVitaly Stakhovsky <vvs31415@gitlab.org>2020-04-27 07:38:47 -0400
commit4fd28b9911934553e3dde77ff395f4e9494eaa2e (patch)
tree3ad2bc9ede9fc8cb4dd3b59f68730b57b3574868 /Source
parenta4071b53da1d1356f98685e2065bd3d8904d4930 (diff)
downloadcmake-4fd28b9911934553e3dde77ff395f4e9494eaa2e.tar.gz
cmOutputConverter::GetFortranFormat(): delete const char* overload
Diffstat (limited to 'Source')
-rw-r--r--Source/cmCommonTargetGenerator.cxx7
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx7
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx2
-rw-r--r--Source/cmOutputConverter.cxx9
-rw-r--r--Source/cmOutputConverter.h1
5 files changed, 8 insertions, 18 deletions
diff --git a/Source/cmCommonTargetGenerator.cxx b/Source/cmCommonTargetGenerator.cxx
index 673936cc2d..fbb942916d 100644
--- a/Source/cmCommonTargetGenerator.cxx
+++ b/Source/cmCommonTargetGenerator.cxx
@@ -73,11 +73,12 @@ void cmCommonTargetGenerator::AddModuleDefinitionFlag(
void cmCommonTargetGenerator::AppendFortranFormatFlags(
std::string& flags, cmSourceFile const& source)
{
- cmProp srcfmt = source.GetProperty("Fortran_FORMAT");
+ const std::string srcfmt = source.GetSafeProperty("Fortran_FORMAT");
cmOutputConverter::FortranFormat format =
- cmOutputConverter::GetFortranFormat(srcfmt ? srcfmt->c_str() : nullptr);
+ cmOutputConverter::GetFortranFormat(srcfmt);
if (format == cmOutputConverter::FortranFormatNone) {
- const char* tgtfmt = this->GeneratorTarget->GetProperty("Fortran_FORMAT");
+ const std::string tgtfmt =
+ this->GeneratorTarget->GetSafeProperty("Fortran_FORMAT");
format = cmOutputConverter::GetFortranFormat(tgtfmt);
}
const char* var = nullptr;
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 1a753e2492..f305246275 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -808,9 +808,8 @@ cmXCodeObject* cmGlobalXCodeGenerator::CreateXCodeSourceFile(
// Add flags from target and source file properties.
std::string flags;
- cmProp srcfmt = sf->GetProperty("Fortran_FORMAT");
- switch (
- cmOutputConverter::GetFortranFormat(srcfmt ? srcfmt->c_str() : nullptr)) {
+ const std::string srcfmt = sf->GetSafeProperty("Fortran_FORMAT");
+ switch (cmOutputConverter::GetFortranFormat(srcfmt)) {
case cmOutputConverter::FortranFormatFixed:
flags = "-fixed " + flags;
break;
@@ -2290,7 +2289,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt,
// Add Fortran source format attribute if property is set.
const char* format = nullptr;
- const char* tgtfmt = gtgt->GetProperty("Fortran_FORMAT");
+ const std::string tgtfmt = gtgt->GetSafeProperty("Fortran_FORMAT");
switch (cmOutputConverter::GetFortranFormat(tgtfmt)) {
case cmOutputConverter::FortranFormatFixed:
format = "fixed";
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index 95c798ba82..8daffa0204 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -672,7 +672,7 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(
if (this->FortranProject) {
switch (cmOutputConverter::GetFortranFormat(
- target->GetProperty("Fortran_FORMAT"))) {
+ target->GetSafeProperty("Fortran_FORMAT"))) {
case cmOutputConverter::FortranFormatFixed:
flags += " -fixed";
break;
diff --git a/Source/cmOutputConverter.cxx b/Source/cmOutputConverter.cxx
index 68bf3af756..dc324ccb58 100644
--- a/Source/cmOutputConverter.cxx
+++ b/Source/cmOutputConverter.cxx
@@ -170,15 +170,6 @@ cmOutputConverter::FortranFormat cmOutputConverter::GetFortranFormat(
return format;
}
-cmOutputConverter::FortranFormat cmOutputConverter::GetFortranFormat(
- const char* value)
-{
- if (!value) {
- return FortranFormatNone;
- }
- return GetFortranFormat(cm::string_view(value));
-}
-
void cmOutputConverter::SetLinkScriptShell(bool linkScriptShell)
{
this->LinkScriptShell = linkScriptShell;
diff --git a/Source/cmOutputConverter.h b/Source/cmOutputConverter.h
index 6583ab5cb9..28582df04c 100644
--- a/Source/cmOutputConverter.h
+++ b/Source/cmOutputConverter.h
@@ -94,7 +94,6 @@ public:
FortranFormatFree
};
static FortranFormat GetFortranFormat(cm::string_view value);
- static FortranFormat GetFortranFormat(const char* value);
private:
cmState* GetState() const;