Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
CMake
CMake
Commits
5a0784dd
Commit
5a0784dd
authored
Jan 21, 2019
by
wahikihiki
Committed by
Brad King
Jan 22, 2019
Browse files
clang-tidy: Pass by value
parent
bcc9ea2b
Changes
74
Hide whitespace changes
Inline
Side-by-side
.clang-tidy
View file @
5a0784dd
...
...
@@ -11,7 +11,6 @@ misc-*,\
-misc-static-assert,\
modernize-*,\
-modernize-deprecated-headers,\
-modernize-pass-by-value,\
-modernize-raw-string-literal,\
-modernize-return-braced-init-list,\
-modernize-use-auto,\
...
...
Source/CPack/cmCPackDebGenerator.cxx
View file @
5a0784dd
...
...
@@ -23,17 +23,15 @@ namespace {
class
DebGenerator
{
public:
DebGenerator
(
cmCPackLog
*
logger
,
std
::
string
const
&
outputName
,
std
::
string
const
&
workDir
,
std
::
string
const
&
topLevelDir
,
std
::
string
const
&
temporaryDir
,
DebGenerator
(
cmCPackLog
*
logger
,
std
::
string
outputName
,
std
::
string
workDir
,
std
::
string
topLevelDir
,
std
::
string
temporaryDir
,
const
char
*
debianCompressionType
,
const
char
*
debianArchiveType
,
std
::
map
<
std
::
string
,
std
::
string
>
const
&
controlValues
,
bool
genShLibs
,
std
::
string
const
&
shLibsFilename
,
bool
genPostInst
,
std
::
string
const
&
postInst
,
bool
genPostRm
,
std
::
string
const
&
postRm
,
const
char
*
controlExtra
,
bool
permissionStrctPolicy
,
std
::
vector
<
std
::
string
>
const
&
packageFiles
);
std
::
map
<
std
::
string
,
std
::
string
>
controlValues
,
bool
genShLibs
,
std
::
string
shLibsFilename
,
bool
genPostInst
,
std
::
string
postInst
,
bool
genPostRm
,
std
::
string
postRm
,
const
char
*
controlExtra
,
bool
permissionStrctPolicy
,
std
::
vector
<
std
::
string
>
packageFiles
);
bool
generate
()
const
;
...
...
@@ -66,31 +64,29 @@ private:
};
DebGenerator
::
DebGenerator
(
cmCPackLog
*
logger
,
std
::
string
const
&
outputName
,
std
::
string
const
&
workDir
,
std
::
string
const
&
topLevelDir
,
std
::
string
const
&
temporaryDir
,
const
char
*
debianCompressionType
,
const
char
*
debianArchiveType
,
std
::
map
<
std
::
string
,
std
::
string
>
const
&
controlValues
,
bool
genShLibs
,
std
::
string
const
&
shLibsFilename
,
bool
genPostInst
,
std
::
string
const
&
postInst
,
bool
genPostRm
,
std
::
string
const
&
postRm
,
const
char
*
controlExtra
,
bool
permissionStrictPolicy
,
std
::
vector
<
std
::
string
>
const
&
packageFiles
)
cmCPackLog
*
logger
,
std
::
string
outputName
,
std
::
string
workDir
,
std
::
string
topLevelDir
,
std
::
string
temporaryDir
,
const
char
*
debianCompressionType
,
const
char
*
debianArchiveType
,
std
::
map
<
std
::
string
,
std
::
string
>
controlValues
,
bool
genShLibs
,
std
::
string
shLibsFilename
,
bool
genPostInst
,
std
::
string
postInst
,
bool
genPostRm
,
std
::
string
postRm
,
const
char
*
controlExtra
,
bool
permissionStrictPolicy
,
std
::
vector
<
std
::
string
>
packageFiles
)
:
Logger
(
logger
)
,
OutputName
(
outputName
)
,
WorkDir
(
workDir
)
,
TopLevelDir
(
topLevelDir
)
,
TemporaryDir
(
temporaryDir
)
,
OutputName
(
std
::
move
(
outputName
)
)
,
WorkDir
(
std
::
move
(
workDir
)
)
,
TopLevelDir
(
std
::
move
(
topLevelDir
)
)
,
TemporaryDir
(
std
::
move
(
temporaryDir
)
)
,
DebianArchiveType
(
debianArchiveType
?
debianArchiveType
:
"gnutar"
)
,
ControlValues
(
controlValues
)
,
ControlValues
(
std
::
move
(
controlValues
)
)
,
GenShLibs
(
genShLibs
)
,
ShLibsFilename
(
shLibsFilename
)
,
ShLibsFilename
(
std
::
move
(
shLibsFilename
)
)
,
GenPostInst
(
genPostInst
)
,
PostInst
(
postInst
)
,
PostInst
(
std
::
move
(
postInst
)
)
,
GenPostRm
(
genPostRm
)
,
PostRm
(
postRm
)
,
PostRm
(
std
::
move
(
postRm
)
)
,
ControlExtra
(
controlExtra
)
,
PermissionStrictPolicy
(
permissionStrictPolicy
)
,
PackageFiles
(
packageFiles
)
,
PackageFiles
(
std
::
move
(
packageFiles
)
)
{
if
(
!
debianCompressionType
)
{
debianCompressionType
=
"gzip"
;
...
...
Source/CPack/cmCPackFreeBSDGenerator.cxx
View file @
5a0784dd
...
...
@@ -17,6 +17,7 @@
#include
<pkg.h>
#include
<algorithm>
#include
<utility>
cmCPackFreeBSDGenerator
::
cmCPackFreeBSDGenerator
()
:
cmCPackArchiveGenerator
(
cmArchiveWrite
::
CompressXZ
,
"paxr"
)
...
...
@@ -97,8 +98,8 @@ class ManifestKey
public:
std
::
string
key
;
ManifestKey
(
const
std
::
string
&
k
)
:
key
(
k
)
ManifestKey
(
std
::
string
k
)
:
key
(
std
::
move
(
k
)
)
{
}
...
...
@@ -115,9 +116,9 @@ class ManifestKeyValue : public ManifestKey
public:
std
::
string
value
;
ManifestKeyValue
(
const
std
::
string
&
k
,
const
std
::
string
&
v
)
ManifestKeyValue
(
const
std
::
string
&
k
,
std
::
string
v
)
:
ManifestKey
(
k
)
,
value
(
v
)
,
value
(
std
::
move
(
v
)
)
{
}
...
...
Source/CursesDialog/cmCursesMainForm.cxx
View file @
5a0784dd
...
...
@@ -20,15 +20,16 @@
#include
<algorithm>
#include
<stdio.h>
#include
<string.h>
#include
<utility>
inline
int
ctrl
(
int
z
)
{
return
(
z
&
037
);
}
cmCursesMainForm
::
cmCursesMainForm
(
std
::
vector
<
std
::
string
>
const
&
args
,
cmCursesMainForm
::
cmCursesMainForm
(
std
::
vector
<
std
::
string
>
args
,
int
initWidth
)
:
Args
(
args
)
:
Args
(
std
::
move
(
args
)
)
,
InitialWidth
(
initWidth
)
{
this
->
NumberOfPages
=
0
;
...
...
Source/CursesDialog/cmCursesMainForm.h
View file @
5a0784dd
...
...
@@ -26,7 +26,7 @@ class cmCursesMainForm : public cmCursesForm
CM_DISABLE_COPY
(
cmCursesMainForm
)
public:
cmCursesMainForm
(
std
::
vector
<
std
::
string
>
const
&
args
,
int
initwidth
);
cmCursesMainForm
(
std
::
vector
<
std
::
string
>
args
,
int
initwidth
);
~
cmCursesMainForm
()
override
;
/**
...
...
Source/QtDialog/QCMakeWidgets.cxx
View file @
5a0784dd
...
...
@@ -7,10 +7,11 @@
#include
<QFileInfo>
#include
<QResizeEvent>
#include
<QToolButton>
#include
<utility>
QCMakeFileEditor
::
QCMakeFileEditor
(
QWidget
*
p
,
const
QString
&
var
)
QCMakeFileEditor
::
QCMakeFileEditor
(
QWidget
*
p
,
QString
var
)
:
QLineEdit
(
p
)
,
Variable
(
var
)
,
Variable
(
std
::
move
(
var
)
)
{
this
->
ToolButton
=
new
QToolButton
(
this
);
this
->
ToolButton
->
setText
(
"..."
);
...
...
Source/QtDialog/QCMakeWidgets.h
View file @
5a0784dd
...
...
@@ -18,7 +18,7 @@ class QCMakeFileEditor : public QLineEdit
{
Q_OBJECT
public:
QCMakeFileEditor
(
QWidget
*
p
,
const
QString
&
var
);
QCMakeFileEditor
(
QWidget
*
p
,
QString
var
);
protected
slots
:
virtual
void
chooseFile
()
=
0
;
signals:
...
...
Source/cmAlgorithms.h
View file @
5a0784dd
...
...
@@ -61,8 +61,8 @@ struct cmStrCmp
:
m_test
(
test
)
{
}
cmStrCmp
(
const
std
::
string
&
test
)
:
m_test
(
test
)
cmStrCmp
(
std
::
string
test
)
:
m_test
(
std
::
move
(
test
)
)
{
}
...
...
Source/cmComputeLinkInformation.h
View file @
5a0784dd
...
...
@@ -9,6 +9,7 @@
#include
<iosfwd>
#include
<set>
#include
<string>
#include
<utility>
#include
<vector>
class
cmGeneratorTarget
;
...
...
@@ -31,9 +32,8 @@ public:
struct
Item
{
Item
()
{}
Item
(
std
::
string
const
&
v
,
bool
p
,
cmGeneratorTarget
const
*
target
=
nullptr
)
:
Value
(
v
)
Item
(
std
::
string
v
,
bool
p
,
cmGeneratorTarget
const
*
target
=
nullptr
)
:
Value
(
std
::
move
(
v
))
,
IsPath
(
p
)
,
Target
(
target
)
{
...
...
Source/cmConditionEvaluator.cxx
View file @
5a0784dd
...
...
@@ -8,6 +8,7 @@
#include
<stdio.h>
#include
<stdlib.h>
#include
<string.h>
#include
<utility>
#include
"cmAlgorithms.h"
#include
"cmMakefile.h"
...
...
@@ -53,11 +54,11 @@ static std::string const keyVERSION_LESS = "VERSION_LESS";
static
std
::
string
const
keyVERSION_LESS_EQUAL
=
"VERSION_LESS_EQUAL"
;
cmConditionEvaluator
::
cmConditionEvaluator
(
cmMakefile
&
makefile
,
const
cmListFileContext
&
context
,
const
cmListFileBacktrace
&
bt
)
cmListFileContext
context
,
cmListFileBacktrace
bt
)
:
Makefile
(
makefile
)
,
ExecutionContext
(
context
)
,
Backtrace
(
bt
)
,
ExecutionContext
(
std
::
move
(
context
)
)
,
Backtrace
(
std
::
move
(
bt
)
)
,
Policy12Status
(
makefile
.
GetPolicyStatus
(
cmPolicies
::
CMP0012
))
,
Policy54Status
(
makefile
.
GetPolicyStatus
(
cmPolicies
::
CMP0054
))
,
Policy57Status
(
makefile
.
GetPolicyStatus
(
cmPolicies
::
CMP0057
))
...
...
Source/cmConditionEvaluator.h
View file @
5a0784dd
...
...
@@ -21,8 +21,8 @@ class cmConditionEvaluator
public:
typedef
std
::
list
<
cmExpandedCommandArgument
>
cmArgumentList
;
cmConditionEvaluator
(
cmMakefile
&
makefile
,
cmListFileContext
const
&
context
,
cmListFileBacktrace
const
&
bt
);
cmConditionEvaluator
(
cmMakefile
&
makefile
,
cmListFileContext
context
,
cmListFileBacktrace
bt
);
// this is a shared function for both If and Else to determine if the
// arguments were valid, and if so, was the response true. If there is
...
...
Source/cmCustomCommand.cxx
View file @
5a0784dd
...
...
@@ -4,17 +4,19 @@
#include
"cmMakefile.h"
#include
<utility>
cmCustomCommand
::
cmCustomCommand
(
cmMakefile
const
*
mf
,
const
std
::
vector
<
std
::
string
>
&
outputs
,
const
std
::
vector
<
std
::
string
>
&
byproducts
,
const
std
::
vector
<
std
::
string
>
&
depends
,
const
cmCustomCommandLines
&
commandLines
,
std
::
vector
<
std
::
string
>
outputs
,
std
::
vector
<
std
::
string
>
byproducts
,
std
::
vector
<
std
::
string
>
depends
,
cmCustomCommandLines
commandLines
,
const
char
*
comment
,
const
char
*
workingDirectory
)
:
Outputs
(
outputs
)
,
Byproducts
(
byproducts
)
,
Depends
(
depends
)
,
CommandLines
(
commandLines
)
:
Outputs
(
std
::
move
(
outputs
)
)
,
Byproducts
(
std
::
move
(
byproducts
)
)
,
Depends
(
std
::
move
(
depends
)
)
,
CommandLines
(
std
::
move
(
commandLines
)
)
,
Comment
(
comment
?
comment
:
""
)
,
WorkingDirectory
(
workingDirectory
?
workingDirectory
:
""
)
,
HaveComment
(
comment
!=
nullptr
)
...
...
Source/cmCustomCommand.h
View file @
5a0784dd
...
...
@@ -23,12 +23,11 @@ class cmCustomCommand
{
public:
/** Main constructor specifies all information for the command. */
cmCustomCommand
(
cmMakefile
const
*
mf
,
const
std
::
vector
<
std
::
string
>&
outputs
,
const
std
::
vector
<
std
::
string
>&
byproducts
,
const
std
::
vector
<
std
::
string
>&
depends
,
const
cmCustomCommandLines
&
commandLines
,
const
char
*
comment
,
const
char
*
workingDirectory
);
cmCustomCommand
(
cmMakefile
const
*
mf
,
std
::
vector
<
std
::
string
>
outputs
,
std
::
vector
<
std
::
string
>
byproducts
,
std
::
vector
<
std
::
string
>
depends
,
cmCustomCommandLines
commandLines
,
const
char
*
comment
,
const
char
*
workingDirectory
);
/** Get the output file produced by the command. */
const
std
::
vector
<
std
::
string
>&
GetOutputs
()
const
;
...
...
Source/cmCustomCommandGenerator.cxx
View file @
5a0784dd
...
...
@@ -16,10 +16,10 @@
#include
<utility>
cmCustomCommandGenerator
::
cmCustomCommandGenerator
(
cmCustomCommand
const
&
cc
,
const
std
::
string
&
config
,
std
::
string
config
,
cmLocalGenerator
*
lg
)
:
CC
(
cc
)
,
Config
(
config
)
,
Config
(
std
::
move
(
config
)
)
,
LG
(
lg
)
,
OldStyle
(
cc
.
GetEscapeOldStyle
())
,
MakeVars
(
cc
.
GetEscapeAllowMakeVars
())
...
...
Source/cmCustomCommandGenerator.h
View file @
5a0784dd
...
...
@@ -29,8 +29,8 @@ class cmCustomCommandGenerator
const
char
*
GetArgv0Location
(
unsigned
int
c
)
const
;
public:
cmCustomCommandGenerator
(
cmCustomCommand
const
&
cc
,
const
std
::
string
&
config
,
cmLocalGenerator
*
lg
);
cmCustomCommandGenerator
(
cmCustomCommand
const
&
cc
,
std
::
string
config
,
cmLocalGenerator
*
lg
);
~
cmCustomCommandGenerator
();
cmCustomCommand
const
&
GetCC
()
const
{
return
this
->
CC
;
}
unsigned
int
GetNumberOfCommands
()
const
;
...
...
Source/cmDepends.cxx
View file @
5a0784dd
...
...
@@ -13,9 +13,9 @@
#include
<string.h>
#include
<utility>
cmDepends
::
cmDepends
(
cmLocalGenerator
*
lg
,
const
std
::
string
&
targetDir
)
cmDepends
::
cmDepends
(
cmLocalGenerator
*
lg
,
std
::
string
targetDir
)
:
LocalGenerator
(
lg
)
,
TargetDirectory
(
targetDir
)
,
TargetDirectory
(
std
::
move
(
targetDir
)
)
,
Dependee
(
new
char
[
MaxPath
])
,
Depender
(
new
char
[
MaxPath
])
{
...
...
Source/cmDepends.h
View file @
5a0784dd
...
...
@@ -29,7 +29,7 @@ class cmDepends
public:
/** Instances need to know the build directory name and the relative
path from the build directory to the target file. */
cmDepends
(
cmLocalGenerator
*
lg
=
nullptr
,
const
std
::
string
&
targetDir
=
""
);
cmDepends
(
cmLocalGenerator
*
lg
=
nullptr
,
std
::
string
targetDir
=
""
);
/** Set the local generator for the directory in which we are
scanning dependencies. This is not a full local generator; it
...
...
Source/cmExpandedCommandArgument.cxx
View file @
5a0784dd
...
...
@@ -2,13 +2,15 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include
"cmExpandedCommandArgument.h"
#include
<utility>
cmExpandedCommandArgument
::
cmExpandedCommandArgument
()
{
}
cmExpandedCommandArgument
::
cmExpandedCommandArgument
(
std
::
string
const
&
value
,
cmExpandedCommandArgument
::
cmExpandedCommandArgument
(
std
::
string
value
,
bool
quoted
)
:
Value
(
value
)
:
Value
(
std
::
move
(
value
)
)
,
Quoted
(
quoted
)
{
}
...
...
Source/cmExpandedCommandArgument.h
View file @
5a0784dd
...
...
@@ -18,7 +18,7 @@ class cmExpandedCommandArgument
{
public:
cmExpandedCommandArgument
();
cmExpandedCommandArgument
(
std
::
string
const
&
value
,
bool
quoted
);
cmExpandedCommandArgument
(
std
::
string
value
,
bool
quoted
);
std
::
string
const
&
GetValue
()
const
;
...
...
Source/cmExportSet.h
View file @
5a0784dd
...
...
@@ -6,6 +6,7 @@
#include
"cmConfigure.h"
// IWYU pragma: keep
#include
<string>
#include
<utility>
#include
<vector>
class
cmInstallExportGenerator
;
...
...
@@ -17,8 +18,8 @@ class cmExportSet
{
public:
/// Construct an empty export set named \a name
cmExportSet
(
const
std
::
string
&
name
)
:
Name
(
name
)
cmExportSet
(
std
::
string
name
)
:
Name
(
std
::
move
(
name
)
)
{
}
/// Destructor
...
...
Prev
1
2
3
4
Next
Brad King
@brad.king
mentioned in commit
a7f5cd45
·
Jan 23, 2019
mentioned in commit
a7f5cd45
mentioned in commit a7f5cd45e135dd51d67176fc40e2d769ac5f7db8
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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