Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Libor Bukata
CMake
Commits
86dc86dd
Commit
86dc86dd
authored
May 24, 2017
by
Pavel Solodovnikov
Browse files
Add const-reference qualifications
parent
76bdb407
Changes
39
Hide whitespace changes
Inline
Side-by-side
Source/cmAddCustomTargetCommand.cxx
View file @
86dc86dd
...
...
@@ -24,7 +24,7 @@ bool cmAddCustomTargetCommand::InitialPass(
return
false
;
}
std
::
string
targetName
=
args
[
0
];
std
::
string
const
&
targetName
=
args
[
0
];
// Check the target name.
if
(
targetName
.
find_first_of
(
"/
\\
"
)
!=
targetName
.
npos
)
{
...
...
Source/cmAddDependenciesCommand.cxx
View file @
86dc86dd
...
...
@@ -19,7 +19,7 @@ bool cmAddDependenciesCommand::InitialPass(
return
false
;
}
std
::
string
target_name
=
args
[
0
];
std
::
string
const
&
target_name
=
args
[
0
];
if
(
this
->
Makefile
->
IsAlias
(
target_name
))
{
std
::
ostringstream
e
;
e
<<
"Cannot add target-level dependencies to alias target
\"
"
...
...
Source/cmAddExecutableCommand.cxx
View file @
86dc86dd
...
...
@@ -24,7 +24,7 @@ bool cmAddExecutableCommand::InitialPass(std::vector<std::string> const& args,
}
std
::
vector
<
std
::
string
>::
const_iterator
s
=
args
.
begin
();
std
::
string
exename
=
*
s
;
std
::
string
const
&
exename
=
*
s
;
++
s
;
bool
use_win32
=
false
;
...
...
Source/cmAddLibraryCommand.cxx
View file @
86dc86dd
...
...
@@ -37,7 +37,7 @@ bool cmAddLibraryCommand::InitialPass(std::vector<std::string> const& args,
std
::
vector
<
std
::
string
>::
const_iterator
s
=
args
.
begin
();
std
::
string
libName
=
*
s
;
std
::
string
const
&
libName
=
*
s
;
++
s
;
...
...
Source/cmAddSubDirectoryCommand.cxx
View file @
86dc86dd
...
...
@@ -20,7 +20,7 @@ bool cmAddSubDirectoryCommand::InitialPass(
}
// store the binpath
std
::
string
srcArg
=
args
[
0
];
std
::
string
const
&
srcArg
=
args
[
0
];
std
::
string
binArg
;
bool
excludeFromAll
=
false
;
...
...
Source/cmAuxSourceDirectoryCommand.cxx
View file @
86dc86dd
...
...
@@ -24,7 +24,7 @@ bool cmAuxSourceDirectoryCommand::InitialPass(
}
std
::
string
sourceListValue
;
std
::
string
templateDirectory
=
args
[
0
];
std
::
string
const
&
templateDirectory
=
args
[
0
];
std
::
string
tdir
;
if
(
!
cmSystemTools
::
FileIsFullPath
(
templateDirectory
.
c_str
()))
{
tdir
=
this
->
Makefile
->
GetCurrentSourceDirectory
();
...
...
@@ -54,7 +54,7 @@ bool cmAuxSourceDirectoryCommand::InitialPass(
std
::
string
ext
=
file
.
substr
(
dotpos
+
1
);
std
::
string
base
=
file
.
substr
(
0
,
dotpos
);
// Process only source files
std
::
vector
<
std
::
string
>
srcExts
=
std
::
vector
<
std
::
string
>
const
&
srcExts
=
this
->
Makefile
->
GetCMakeInstance
()
->
GetSourceExtensions
();
if
(
!
base
.
empty
()
&&
std
::
find
(
srcExts
.
begin
(),
srcExts
.
end
(),
ext
)
!=
srcExts
.
end
())
{
...
...
Source/cmBuildCommand.cxx
View file @
86dc86dd
...
...
@@ -32,7 +32,7 @@ bool cmBuildCommand::MainSignature(std::vector<std::string> const& args)
}
// The cmake variable in which to store the result.
const
char
*
variable
=
args
[
0
]
.
c_str
()
;
std
::
string
const
&
variable
=
args
[
0
];
// Parse remaining arguments.
std
::
string
configuration
;
...
...
@@ -104,7 +104,7 @@ bool cmBuildCommand::TwoArgsSignature(std::vector<std::string> const& args)
return
false
;
}
const
char
*
define
=
args
[
0
]
.
c_str
()
;
std
::
string
const
&
define
=
args
[
0
];
const
char
*
cacheValue
=
this
->
Makefile
->
GetDefinition
(
define
);
std
::
string
configType
;
...
...
Source/cmCMakeHostSystemInformationCommand.cxx
View file @
86dc86dd
...
...
@@ -26,7 +26,7 @@ bool cmCMakeHostSystemInformationCommand::InitialPass(
return
false
;
}
std
::
string
variable
=
args
[
current_index
+
1
];
std
::
string
const
&
variable
=
args
[
current_index
+
1
];
current_index
+=
2
;
if
(
args
.
size
()
<
(
current_index
+
2
)
||
args
[
current_index
]
!=
"QUERY"
)
{
...
...
@@ -41,7 +41,7 @@ bool cmCMakeHostSystemInformationCommand::InitialPass(
std
::
string
result_list
;
for
(
size_t
i
=
current_index
+
1
;
i
<
args
.
size
();
++
i
)
{
std
::
string
key
=
args
[
i
];
std
::
string
const
&
key
=
args
[
i
];
if
(
i
!=
current_index
+
1
)
{
result_list
+=
";"
;
}
...
...
Source/cmConfigureFileCommand.cxx
View file @
86dc86dd
...
...
@@ -19,7 +19,7 @@ bool cmConfigureFileCommand::InitialPass(std::vector<std::string> const& args,
return
false
;
}
const
char
*
inFile
=
args
[
0
]
.
c_str
()
;
std
::
string
const
&
inFile
=
args
[
0
];
if
(
!
cmSystemTools
::
FileIsFullPath
(
inFile
))
{
this
->
InputFile
=
this
->
Makefile
->
GetCurrentSourceDirectory
();
this
->
InputFile
+=
"/"
;
...
...
@@ -38,7 +38,7 @@ bool cmConfigureFileCommand::InitialPass(std::vector<std::string> const& args,
return
false
;
}
const
char
*
outFile
=
args
[
1
]
.
c_str
()
;
std
::
string
const
&
outFile
=
args
[
1
];
if
(
!
cmSystemTools
::
FileIsFullPath
(
outFile
))
{
this
->
OutputFile
=
this
->
Makefile
->
GetCurrentBinaryDirectory
();
this
->
OutputFile
+=
"/"
;
...
...
Source/cmDefinePropertyCommand.cxx
View file @
86dc86dd
...
...
@@ -20,23 +20,25 @@ bool cmDefinePropertyCommand::InitialPass(std::vector<std::string> const& args,
// Get the scope in which to define the property.
cmProperty
::
ScopeType
scope
;
if
(
args
[
0
]
==
"GLOBAL"
)
{
std
::
string
const
&
scope_arg
=
args
[
0
];
if
(
scope_arg
==
"GLOBAL"
)
{
scope
=
cmProperty
::
GLOBAL
;
}
else
if
(
args
[
0
]
==
"DIRECTORY"
)
{
}
else
if
(
scope_arg
==
"DIRECTORY"
)
{
scope
=
cmProperty
::
DIRECTORY
;
}
else
if
(
args
[
0
]
==
"TARGET"
)
{
}
else
if
(
scope_arg
==
"TARGET"
)
{
scope
=
cmProperty
::
TARGET
;
}
else
if
(
args
[
0
]
==
"SOURCE"
)
{
}
else
if
(
scope_arg
==
"SOURCE"
)
{
scope
=
cmProperty
::
SOURCE_FILE
;
}
else
if
(
args
[
0
]
==
"TEST"
)
{
}
else
if
(
scope_arg
==
"TEST"
)
{
scope
=
cmProperty
::
TEST
;
}
else
if
(
args
[
0
]
==
"VARIABLE"
)
{
}
else
if
(
scope_arg
==
"VARIABLE"
)
{
scope
=
cmProperty
::
VARIABLE
;
}
else
if
(
args
[
0
]
==
"CACHED_VARIABLE"
)
{
}
else
if
(
scope_arg
==
"CACHED_VARIABLE"
)
{
scope
=
cmProperty
::
CACHED_VARIABLE
;
}
else
{
std
::
ostringstream
e
;
e
<<
"given invalid scope "
<<
args
[
0
]
<<
". "
e
<<
"given invalid scope "
<<
scope_arg
<<
". "
<<
"Valid scopes are "
<<
"GLOBAL, DIRECTORY, TARGET, SOURCE, "
<<
"TEST, VARIABLE, CACHED_VARIABLE."
;
...
...
Source/cmExtraCodeBlocksGenerator.cxx
View file @
86dc86dd
...
...
@@ -353,7 +353,7 @@ void cmExtraCodeBlocksGenerator::CreateNewProjectFile(
all_files_map_t
allFiles
;
std
::
vector
<
std
::
string
>
cFiles
;
std
::
vector
<
std
::
string
>
srcExts
=
std
::
vector
<
std
::
string
>
const
&
srcExts
=
this
->
GlobalGenerator
->
GetCMakeInstance
()
->
GetSourceExtensions
();
for
(
std
::
vector
<
cmLocalGenerator
*>::
const_iterator
lg
=
lgs
.
begin
();
...
...
@@ -387,7 +387,7 @@ void cmExtraCodeBlocksGenerator::CreateNewProjectFile(
bool
isCFile
=
false
;
std
::
string
lang
=
(
*
si
)
->
GetLanguage
();
if
(
lang
==
"C"
||
lang
==
"CXX"
)
{
std
::
string
srcext
=
(
*
si
)
->
GetExtension
();
std
::
string
const
&
srcext
=
(
*
si
)
->
GetExtension
();
for
(
std
::
vector
<
std
::
string
>::
const_iterator
ext
=
srcExts
.
begin
();
ext
!=
srcExts
.
end
();
++
ext
)
{
...
...
@@ -398,7 +398,7 @@ void cmExtraCodeBlocksGenerator::CreateNewProjectFile(
}
}
std
::
string
fullPath
=
(
*
si
)
->
GetFullPath
();
std
::
string
const
&
fullPath
=
(
*
si
)
->
GetFullPath
();
if
(
isCFile
)
{
cFiles
.
push_back
(
fullPath
);
...
...
@@ -414,7 +414,7 @@ void cmExtraCodeBlocksGenerator::CreateNewProjectFile(
}
}
std
::
vector
<
std
::
string
>
headerExts
=
std
::
vector
<
std
::
string
>
const
&
headerExts
=
this
->
GlobalGenerator
->
GetCMakeInstance
()
->
GetHeaderExtensions
();
// The following loop tries to add header files matching to implementation
...
...
Source/cmExtraCodeLiteGenerator.cxx
View file @
86dc86dd
...
...
@@ -240,7 +240,7 @@ std::string cmExtraCodeLiteGenerator::CollectSourceFiles(
bool
isCFile
=
false
;
std
::
string
lang
=
(
*
si
)
->
GetLanguage
();
if
(
lang
==
"C"
||
lang
==
"CXX"
)
{
std
::
string
srcext
=
(
*
si
)
->
GetExtension
();
std
::
string
const
&
srcext
=
(
*
si
)
->
GetExtension
();
for
(
std
::
vector
<
std
::
string
>::
const_iterator
ext
=
srcExts
.
begin
();
ext
!=
srcExts
.
end
();
++
ext
)
{
if
(
srcext
==
*
ext
)
{
...
...
Source/cmExtraEclipseCDT4Generator.cxx
View file @
86dc86dd
...
...
@@ -453,7 +453,7 @@ void cmExtraEclipseCDT4Generator::WriteGroups(
for
(
std
::
vector
<
const
cmSourceFile
*>::
const_iterator
fileIt
=
sFiles
.
begin
();
fileIt
!=
sFiles
.
end
();
++
fileIt
)
{
std
::
string
fullPath
=
(
*
fileIt
)
->
GetFullPath
();
std
::
string
const
&
fullPath
=
(
*
fileIt
)
->
GetFullPath
();
if
(
!
cmSystemTools
::
FileIsDirectory
(
fullPath
))
{
std
::
string
linkName4
=
linkName3
;
...
...
@@ -508,7 +508,7 @@ void cmExtraEclipseCDT4Generator::CreateLinksForTargets(cmXMLWriter& xml)
for
(
std
::
vector
<
cmSourceFile
*>::
const_iterator
sfIt
=
files
.
begin
();
sfIt
!=
files
.
end
();
sfIt
++
)
{
// Add the file to the list of sources.
std
::
string
source
=
(
*
sfIt
)
->
GetFullPath
();
std
::
string
const
&
source
=
(
*
sfIt
)
->
GetFullPath
();
cmSourceGroup
*
sourceGroup
=
makefile
->
FindSourceGroup
(
source
.
c_str
(),
sourceGroups
);
sourceGroup
->
AssignSource
(
*
sfIt
);
...
...
Source/cmFileCommand.cxx
View file @
86dc86dd
...
...
@@ -110,7 +110,7 @@ bool cmFileCommand::InitialPass(std::vector<std::string> const& args,
this
->
SetError
(
"must be called with at least two arguments."
);
return
false
;
}
std
::
string
subCommand
=
args
[
0
];
std
::
string
const
&
subCommand
=
args
[
0
];
if
(
subCommand
==
"WRITE"
)
{
return
this
->
HandleWriteCommand
(
args
,
false
);
}
...
...
Source/cmFindPackageCommand.cxx
View file @
86dc86dd
...
...
@@ -924,7 +924,7 @@ bool cmFindPackageCommand::FindConfig()
bool
cmFindPackageCommand
::
FindPrefixedConfig
()
{
std
::
vector
<
std
::
string
>&
prefixes
=
this
->
SearchPaths
;
std
::
vector
<
std
::
string
>
const
&
prefixes
=
this
->
SearchPaths
;
for
(
std
::
vector
<
std
::
string
>::
const_iterator
pi
=
prefixes
.
begin
();
pi
!=
prefixes
.
end
();
++
pi
)
{
if
(
this
->
SearchPrefix
(
*
pi
))
{
...
...
@@ -936,7 +936,7 @@ bool cmFindPackageCommand::FindPrefixedConfig()
bool
cmFindPackageCommand
::
FindFrameworkConfig
()
{
std
::
vector
<
std
::
string
>&
prefixes
=
this
->
SearchPaths
;
std
::
vector
<
std
::
string
>
const
&
prefixes
=
this
->
SearchPaths
;
for
(
std
::
vector
<
std
::
string
>::
const_iterator
i
=
prefixes
.
begin
();
i
!=
prefixes
.
end
();
++
i
)
{
if
(
this
->
SearchFrameworkPrefix
(
*
i
))
{
...
...
@@ -948,7 +948,7 @@ bool cmFindPackageCommand::FindFrameworkConfig()
bool
cmFindPackageCommand
::
FindAppBundleConfig
()
{
std
::
vector
<
std
::
string
>&
prefixes
=
this
->
SearchPaths
;
std
::
vector
<
std
::
string
>
const
&
prefixes
=
this
->
SearchPaths
;
for
(
std
::
vector
<
std
::
string
>::
const_iterator
i
=
prefixes
.
begin
();
i
!=
prefixes
.
end
();
++
i
)
{
if
(
this
->
SearchAppBundlePrefix
(
*
i
))
{
...
...
Source/cmGetCMakePropertyCommand.cxx
View file @
86dc86dd
...
...
@@ -20,7 +20,7 @@ bool cmGetCMakePropertyCommand::InitialPass(
return
false
;
}
std
::
string
variable
=
args
[
0
];
std
::
string
const
&
variable
=
args
[
0
];
std
::
string
output
=
"NOTFOUND"
;
if
(
args
[
1
]
==
"VARIABLES"
)
{
...
...
Source/cmGetDirectoryPropertyCommand.cxx
View file @
86dc86dd
...
...
@@ -20,7 +20,7 @@ bool cmGetDirectoryPropertyCommand::InitialPass(
}
std
::
vector
<
std
::
string
>::
const_iterator
i
=
args
.
begin
();
std
::
string
variable
=
*
i
;
std
::
string
const
&
variable
=
*
i
;
++
i
;
// get the directory argument if there is one
...
...
Source/cmGetSourceFilePropertyCommand.cxx
View file @
86dc86dd
...
...
@@ -15,8 +15,8 @@ bool cmGetSourceFilePropertyCommand::InitialPass(
this
->
SetError
(
"called with incorrect number of arguments"
);
return
false
;
}
const
char
*
var
=
args
[
0
]
.
c_str
()
;
const
char
*
file
=
args
[
1
]
.
c_str
()
;
std
::
string
const
&
var
=
args
[
0
];
std
::
string
const
&
file
=
args
[
1
];
cmSourceFile
*
sf
=
this
->
Makefile
->
GetSource
(
file
);
// for the location we must create a source file first
...
...
Source/cmGetTargetPropertyCommand.cxx
View file @
86dc86dd
...
...
@@ -22,8 +22,8 @@ bool cmGetTargetPropertyCommand::InitialPass(
this
->
SetError
(
"called with incorrect number of arguments"
);
return
false
;
}
std
::
string
var
=
args
[
0
];
const
std
::
string
&
targetName
=
args
[
1
];
std
::
string
const
&
var
=
args
[
0
];
std
::
string
const
&
targetName
=
args
[
1
];
std
::
string
prop
;
bool
prop_exists
=
false
;
...
...
Source/cmGetTestPropertyCommand.cxx
View file @
86dc86dd
...
...
@@ -16,8 +16,8 @@ bool cmGetTestPropertyCommand::InitialPass(
return
false
;
}
std
::
string
testName
=
args
[
0
];
std
::
string
var
=
args
[
2
];
std
::
string
const
&
testName
=
args
[
0
];
std
::
string
const
&
var
=
args
[
2
];
cmTest
*
test
=
this
->
Makefile
->
GetTest
(
testName
);
if
(
test
)
{
const
char
*
prop
=
CM_NULLPTR
;
...
...
Prev
1
2
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment