mirror of https://github.com/Icinga/icinga2.git
Whitespace fix
What does this change? * Remove use of spaces for formatting These could be found by using `grep -r -l -P '^\t+ +[^*]' * Removal of training whitespaces * A few lines longer than 120 chars
This commit is contained in:
parent
df88da5836
commit
2636e6a77a
|
@ -194,16 +194,13 @@ namespace Icinga
|
|||
string master_host, master_port;
|
||||
GetMasterHostPort(out master_host, out master_port);
|
||||
|
||||
args += " --master_host " + master_host
|
||||
+ "," + master_port;
|
||||
args += " --master_host " + master_host + "," + master_port;
|
||||
|
||||
foreach (ListViewItem lvi in lvwEndpoints.Items) {
|
||||
args += " --endpoint " + lvi.SubItems[0].Text.Trim();
|
||||
|
||||
if (lvi.SubItems.Count > 1) {
|
||||
args += "," + lvi.SubItems[1].Text.Trim()
|
||||
+ "," + lvi.SubItems[2].Text.Trim();
|
||||
}
|
||||
if (lvi.SubItems.Count > 1)
|
||||
args += "," + lvi.SubItems[1].Text.Trim() + "," + lvi.SubItems[2].Text.Trim();
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -179,11 +179,9 @@ protected:
|
|||
private:
|
||||
static Application::Ptr m_Instance; /**< The application instance. */
|
||||
|
||||
static bool m_ShuttingDown; /**< Whether the application is in the process of
|
||||
shutting down. */
|
||||
static bool m_ShuttingDown; /**< Whether the application is in the process of shutting down. */
|
||||
static bool m_RequestRestart; /**< A restart was requested through SIGHUP */
|
||||
static pid_t m_ReloadProcess; /**< The PID of a subprocess doing a reload,
|
||||
only valid when l_Restarting==true */
|
||||
static pid_t m_ReloadProcess; /**< The PID of a subprocess doing a reload, only valid when l_Restarting==true */
|
||||
static bool m_RequestReopenLogs; /**< Whether we should re-open log files. */
|
||||
|
||||
static int m_ArgC; /**< The number of command-line arguments. */
|
||||
|
|
|
@ -89,8 +89,7 @@ private:
|
|||
|
||||
public:
|
||||
template <typename FuncType, int Arity>
|
||||
auto operator() (FuncType f, const std::vector<Value>& args)
|
||||
-> decltype(Invoke(f, args, BuildIndices<Arity>{}))
|
||||
auto operator() (FuncType f, const std::vector<Value>& args) -> decltype(Invoke(f, args, BuildIndices<Arity>{}))
|
||||
{
|
||||
return Invoke(f, args, BuildIndices<Arity>{});
|
||||
}
|
||||
|
|
|
@ -143,9 +143,7 @@ void StackTrace::Print(std::ostream& fp, int ignoreFrames) const
|
|||
# endif /* HAVE_BACKTRACE_SYMBOLS */
|
||||
#else /* _WIN32 */
|
||||
for (int i = ignoreFrames + 1; i < m_Count; i++) {
|
||||
fp << "\t(" << i - ignoreFrames - 1 << "): "
|
||||
<< Utility::GetSymbolName(m_Frames[i])
|
||||
<< std::endl;
|
||||
fp << "\t(" << i - ignoreFrames - 1 << "): " << Utility::GetSymbolName(m_Frames[i]) << std::endl;
|
||||
}
|
||||
#endif /* _WIN32 */
|
||||
}
|
||||
|
|
|
@ -50,7 +50,8 @@ typedef int SOCKET;
|
|||
|
||||
#ifndef SUN_LEN
|
||||
/* TODO: Ideally this should take into the account how
|
||||
long the socket path really is. */
|
||||
* long the socket path really is.
|
||||
*/
|
||||
# define SUN_LEN(sun) (sizeof(sockaddr_un))
|
||||
#endif /* SUN_LEN */
|
||||
|
||||
|
|
|
@ -773,7 +773,8 @@ void Utility::RemoveDirRecursive(const String& path)
|
|||
Utility::GlobRecursive(path, "*", std::bind(&Utility::CollectPaths, _1, std::ref(paths)), GlobFile | GlobDirectory);
|
||||
|
||||
/* This relies on the fact that GlobRecursive lists the parent directory
|
||||
first before recursing into subdirectories. */
|
||||
* first before recursing into subdirectories.
|
||||
*/
|
||||
std::reverse(paths.begin(), paths.end());
|
||||
|
||||
for (const String& path : paths) {
|
||||
|
@ -1801,12 +1802,13 @@ String Utility::CreateTempFile(const String& path, int mode, std::fstream& fp)
|
|||
|
||||
#ifdef _WIN32
|
||||
/* mkstemp extracted from libc/sysdeps/posix/tempname.c. Copyright
|
||||
(C) 1991-1999, 2000, 2001, 2006 Free Software Foundation, Inc.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version. */
|
||||
* (C) 1991-1999, 2000, 2001, 2006 Free Software Foundation, Inc.
|
||||
*
|
||||
* The GNU C Library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*/
|
||||
|
||||
#define _O_EXCL 0x0400
|
||||
#define _O_CREAT 0x0100
|
||||
|
@ -1818,9 +1820,10 @@ String Utility::CreateTempFile(const String& path, int mode, std::fstream& fp)
|
|||
static const char letters[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
|
||||
|
||||
/* Generate a temporary file name based on TMPL. TMPL must match the
|
||||
rules for mk[s]temp (i.e. end in "XXXXXX"). The name constructed
|
||||
does not exist at the time of the call to mkstemp. TMPL is
|
||||
overwritten with the result. */
|
||||
* rules for mk[s]temp (i.e. end in "XXXXXX"). The name constructed
|
||||
* does not exist at the time of the call to mkstemp. TMPL is
|
||||
* overwritten with the result.
|
||||
*/
|
||||
int Utility::MksTemp(char *tmpl)
|
||||
{
|
||||
int len;
|
||||
|
@ -1832,15 +1835,17 @@ int Utility::MksTemp(char *tmpl)
|
|||
int save_errno = errno;
|
||||
|
||||
/* A lower bound on the number of temporary files to attempt to
|
||||
generate. The maximum total number of temporary file names that
|
||||
can exist for a given template is 62**6. It should never be
|
||||
necessary to try all these combinations. Instead if a reasonable
|
||||
number of names is tried (we define reasonable as 62**3) fail to
|
||||
give the system administrator the chance to remove the problems. */
|
||||
* generate. The maximum total number of temporary file names that
|
||||
* can exist for a given template is 62**6. It should never be
|
||||
* necessary to try all these combinations. Instead if a reasonable
|
||||
* number of names is tried (we define reasonable as 62**3) fail to
|
||||
* give the system administrator the chance to remove the problems.
|
||||
*/
|
||||
#define ATTEMPTS_MIN (62 * 62 * 62)
|
||||
|
||||
/* The number of times to attempt to generate a temporary file. To
|
||||
conform to POSIX, this must be no smaller than TMP_MAX. */
|
||||
/* The number of times to attempt to generate a temporary file
|
||||
* To conform to POSIX, this must be no smaller than TMP_MAX.
|
||||
*/
|
||||
#if ATTEMPTS_MIN < TMP_MAX
|
||||
unsigned int attempts = TMP_MAX;
|
||||
#else
|
||||
|
|
|
@ -272,8 +272,7 @@ void WorkQueue::WorkerThreadProc(void)
|
|||
m_ExceptionCallback(boost::current_exception());
|
||||
}
|
||||
|
||||
/* clear the task so whatever other resources it holds are released
|
||||
_before_ we re-acquire the mutex */
|
||||
/* clear the task so whatever other resources it holds are released _before_ we re-acquire the mutex */
|
||||
task = Task();
|
||||
|
||||
IncreaseTaskCount();
|
||||
|
|
|
@ -74,8 +74,7 @@ public:
|
|||
static bool ParseCommand(int argc, char **argv, boost::program_options::options_description& visibleDesc,
|
||||
boost::program_options::options_description& hiddenDesc,
|
||||
boost::program_options::positional_options_description& positionalDesc,
|
||||
boost::program_options::variables_map& vm, String& cmdname,
|
||||
CLICommand::Ptr& command, bool autocomplete);
|
||||
boost::program_options::variables_map& vm, String& cmdname, CLICommand::Ptr& command, bool autocomplete);
|
||||
|
||||
static void ShowCommands(int argc, char **argv,
|
||||
boost::program_options::options_description *visibleDesc = nullptr,
|
||||
|
|
|
@ -144,8 +144,7 @@ void StatusDataWriter::DumpTimePeriod(std::ostream& fp, const TimePeriod::Ptr& t
|
|||
}
|
||||
}
|
||||
|
||||
fp << "\t" "}" "\n"
|
||||
"\n";
|
||||
fp << "\t" "}" "\n" "\n";
|
||||
}
|
||||
|
||||
void StatusDataWriter::DumpCommand(std::ostream& fp, const Command::Ptr& command)
|
||||
|
@ -161,8 +160,7 @@ void StatusDataWriter::DumpCommand(std::ostream& fp, const Command::Ptr& command
|
|||
|
||||
DumpCustomAttributes(fp, command);
|
||||
|
||||
fp << "\n" "\t" "}" "\n"
|
||||
"\n";
|
||||
fp << "\n" "\t" "}" "\n" "\n";
|
||||
}
|
||||
|
||||
void StatusDataWriter::DumpDowntimes(std::ostream& fp, const Checkable::Ptr& checkable)
|
||||
|
@ -205,8 +203,7 @@ void StatusDataWriter::DumpDowntimes(std::ostream& fp, const Checkable::Ptr& che
|
|||
|
||||
void StatusDataWriter::DumpHostStatus(std::ostream& fp, const Host::Ptr& host)
|
||||
{
|
||||
fp << "hoststatus {" << "\n"
|
||||
<< "\t" << "host_name=" << host->GetName() << "\n";
|
||||
fp << "hoststatus {" "\n" "\t" "host_name=" << host->GetName() << "\n";
|
||||
|
||||
{
|
||||
ObjectLock olock(host);
|
||||
|
@ -218,8 +215,7 @@ void StatusDataWriter::DumpHostStatus(std::ostream& fp, const Host::Ptr& host)
|
|||
"\t" "last_time_down=" << host->GetLastStateDown() << "\n"
|
||||
"\t" "last_time_unreachable=" << host->GetLastStateUnreachable() << "\n";
|
||||
|
||||
fp << "\t" "}" "\n"
|
||||
"\n";
|
||||
fp << "\t" "}" "\n" "\n";
|
||||
|
||||
DumpDowntimes(fp, host);
|
||||
DumpComments(fp, host);
|
||||
|
@ -327,8 +323,7 @@ void StatusDataWriter::DumpHostObject(std::ostream& fp, const Host::Ptr& host)
|
|||
|
||||
DumpCustomAttributes(fp, host);
|
||||
|
||||
fp << "\t" "}" "\n"
|
||||
"\n";
|
||||
fp << "\t" "}" "\n" "\n";
|
||||
}
|
||||
|
||||
void StatusDataWriter::DumpCheckableStatusAttrs(std::ostream& fp, const Checkable::Ptr& checkable)
|
||||
|
@ -415,8 +410,7 @@ void StatusDataWriter::DumpServiceStatus(std::ostream& fp, const Service::Ptr& s
|
|||
DumpCheckableStatusAttrs(fp, service);
|
||||
}
|
||||
|
||||
fp << "\t" "}" "\n"
|
||||
"\n";
|
||||
fp << "\t" "}" "\n" "\n";
|
||||
|
||||
DumpDowntimes(fp, service);
|
||||
DumpComments(fp, service);
|
||||
|
@ -512,8 +506,7 @@ void StatusDataWriter::DumpServiceObject(std::ostream& fp, const Service::Ptr& s
|
|||
|
||||
DumpCustomAttributes(fp, service);
|
||||
|
||||
fp << "\t" "}" "\n"
|
||||
"\n";
|
||||
fp << "\t" "}" "\n" "\n";
|
||||
}
|
||||
|
||||
void StatusDataWriter::DumpCustomAttributes(std::ostream& fp, const CustomVarObject::Ptr& object)
|
||||
|
@ -599,8 +592,7 @@ void StatusDataWriter::UpdateObjectsCache(void)
|
|||
|
||||
tempobjectfp << "\t" "members" "\t";
|
||||
DumpNameList(tempobjectfp, hg->GetMembers());
|
||||
tempobjectfp << "\n"
|
||||
"\t" "}" "\n";
|
||||
tempobjectfp << "\n" "\t" "}" "\n";
|
||||
|
||||
objectfp << tempobjectfp.str();
|
||||
}
|
||||
|
@ -640,8 +632,7 @@ void StatusDataWriter::UpdateObjectsCache(void)
|
|||
|
||||
DumpStringList(tempobjectfp, sglist);
|
||||
|
||||
tempobjectfp << "\n"
|
||||
"}" "\n";
|
||||
tempobjectfp << "\n" "}" "\n";
|
||||
|
||||
objectfp << tempobjectfp.str();
|
||||
}
|
||||
|
|
|
@ -416,7 +416,8 @@ object:
|
|||
}
|
||||
|
||||
$$ = new ObjectExpression(abstract, std::unique_ptr<Expression>($3), std::unique_ptr<Expression>($4),
|
||||
std::move(filter), context->GetZone(), context->GetPackage(), std::move(*$5), $6, $7, std::unique_ptr<Expression>($9), DebugInfoRange(@2, @7));
|
||||
std::move(filter), context->GetZone(), context->GetPackage(), std::move(*$5), $6, $7,
|
||||
std::unique_ptr<Expression>($9), DebugInfoRange(@2, @7));
|
||||
delete $5;
|
||||
}
|
||||
;
|
||||
|
|
|
@ -477,8 +477,9 @@ void Checkable::ExecuteCheck(void)
|
|||
listener->SyncSendMessage(endpoint, message);
|
||||
|
||||
/* Re-schedule the check so we don't run it again until after we've received
|
||||
a check result from the remote instance. The check will be re-scheduled
|
||||
using the proper check interval once we've received a check result. */
|
||||
* a check result from the remote instance. The check will be re-scheduled
|
||||
* using the proper check interval once we've received a check result.
|
||||
*/
|
||||
SetNextCheck(Utility::GetTime() + GetCheckCommand()->GetTimeout() + 30);
|
||||
} else if (!endpoint->GetSyncing() && Application::GetInstance()->GetStartTime() < Utility::GetTime() - 300) {
|
||||
/* fail to perform check on unconnected endpoint */
|
||||
|
|
|
@ -178,8 +178,7 @@ Dictionary::Ptr LivestatusLogUtility::GetAttributes(const String& text)
|
|||
}
|
||||
|
||||
return bag;
|
||||
} else if (type.Contains("HOST DOWNTIME ALERT") ||
|
||||
type.Contains("HOST FLAPPING ALERT")) {
|
||||
} else if (type.Contains("HOST DOWNTIME ALERT") || type.Contains("HOST FLAPPING ALERT")) {
|
||||
if (tokens.size() < 3)
|
||||
return bag;
|
||||
|
||||
|
|
|
@ -318,8 +318,7 @@ String InfluxdbWriter::EscapeValue(const Value& value)
|
|||
{
|
||||
if (value.IsObjectType<InfluxdbInteger>()) {
|
||||
std::ostringstream os;
|
||||
os << static_cast<InfluxdbInteger::Ptr>(value)->GetValue()
|
||||
<< "i";
|
||||
os << static_cast<InfluxdbInteger::Ptr>(value)->GetValue() << "i";
|
||||
return os.str();
|
||||
}
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
using namespace icinga;
|
||||
|
||||
ApiFunction::ApiFunction(const Callback& function)
|
||||
: m_Callback(function)
|
||||
: m_Callback(function)
|
||||
{ }
|
||||
|
||||
Value ApiFunction::Invoke(const MessageOrigin::Ptr& origin, const Dictionary::Ptr& arguments)
|
||||
|
|
|
@ -59,7 +59,8 @@ void HttpClientConnection::Reconnect(void)
|
|||
else
|
||||
ASSERT(!"Non-TLS HTTP connections not supported.");
|
||||
/* m_Stream = new NetworkStream(socket);
|
||||
-- does not currently work because the NetworkStream class doesn't support async I/O */
|
||||
* -- does not currently work because the NetworkStream class doesn't support async I/O
|
||||
*/
|
||||
|
||||
/* the stream holds an owning reference to this object through the callback we're registering here */
|
||||
m_Stream->RegisterDataHandler(std::bind(&HttpClientConnection::DataAvailableHandler, HttpClientConnection::Ptr(this), _1));
|
||||
|
|
|
@ -44,8 +44,7 @@ static Timer::Ptr l_HeartbeatTimer;
|
|||
JsonRpcConnection::JsonRpcConnection(const String& identity, bool authenticated,
|
||||
const TlsStream::Ptr& stream, ConnectionRole role)
|
||||
: m_ID(l_JsonRpcConnectionNextID++), m_Identity(identity), m_Authenticated(authenticated), m_Stream(stream),
|
||||
m_Role(role), m_Timestamp(Utility::GetTime()), m_Seen(Utility::GetTime()),
|
||||
m_NextHeartbeat(0), m_HeartbeatTimeout(0)
|
||||
m_Role(role), m_Timestamp(Utility::GetTime()), m_Seen(Utility::GetTime()), m_NextHeartbeat(0), m_HeartbeatTimeout(0)
|
||||
{
|
||||
boost::call_once(l_JsonRpcConnectionOnceFlag, &JsonRpcConnection::StaticInitialize);
|
||||
|
||||
|
|
|
@ -152,8 +152,7 @@ BOOL ParseArguments(CONST INT ac, WCHAR **av, po::variables_map& vm, printInfoSt
|
|||
}
|
||||
|
||||
BOOL GetIntstancesAndCountersOfObject(CONST std::wstring wsObject,
|
||||
std::vector<std::wstring>& vecInstances,
|
||||
std::vector<std::wstring>& vecCounters)
|
||||
std::vector<std::wstring>& vecInstances, std::vector<std::wstring>& vecCounters)
|
||||
{
|
||||
LPWSTR szDataSource = NULL, szMachineName = NULL,
|
||||
mszCounterList = NULL, mszInstanceList = NULL;
|
||||
|
@ -315,8 +314,8 @@ BOOL QueryPerfData(printInfoStruct& pI)
|
|||
goto die;
|
||||
|
||||
/*
|
||||
/* Most counters need two queries to provide a value.
|
||||
/* Those which need only one will return the second.
|
||||
* Most counters need two queries to provide a value.
|
||||
* Those which need only one will return the second.
|
||||
*/
|
||||
Sleep(pI.dwPerformanceWait);
|
||||
|
||||
|
@ -324,14 +323,12 @@ BOOL QueryPerfData(printInfoStruct& pI)
|
|||
if (FAILED(status))
|
||||
goto die;
|
||||
|
||||
status = PdhGetFormattedCounterArray(hCounter, pI.dwRequestedType,
|
||||
&dwBufferSize, &dwItemCount, pDisplayValues);
|
||||
status = PdhGetFormattedCounterArray(hCounter, pI.dwRequestedType, &dwBufferSize, &dwItemCount, pDisplayValues);
|
||||
if (status != PDH_MORE_DATA)
|
||||
goto die;
|
||||
|
||||
pDisplayValues = reinterpret_cast<PDH_FMT_COUNTERVALUE_ITEM*>(new BYTE[dwBufferSize]);
|
||||
status = PdhGetFormattedCounterArray(hCounter, pI.dwRequestedType,
|
||||
&dwBufferSize, &dwItemCount, pDisplayValues);
|
||||
status = PdhGetFormattedCounterArray(hCounter, pI.dwRequestedType, &dwBufferSize, &dwItemCount, pDisplayValues);
|
||||
|
||||
if (FAILED(status))
|
||||
goto die;
|
||||
|
|
|
@ -191,7 +191,7 @@ INT printOutput(printInfoStruct& printInfo)
|
|||
return state;
|
||||
}
|
||||
|
||||
INT check_swap(printInfoStruct& printInfo)
|
||||
INT check_swap(printInfoStruct& printInfo
|
||||
{
|
||||
MEMORYSTATUSEX MemBuf;
|
||||
MemBuf.dwLength = sizeof(MemBuf);
|
||||
|
|
|
@ -183,10 +183,10 @@ INT check_update(printInfoStruct& printInfo)
|
|||
pSession->CreateUpdateSearcher(&pSearcher);
|
||||
|
||||
/*
|
||||
IsInstalled = 0: All updates, including languagepacks and features
|
||||
BrowseOnly = 0: No features or languagepacks, security and unnamed
|
||||
BrowseOnly = 1: Nothing, broken
|
||||
RebootRequired = 1: Reboot required
|
||||
* IsInstalled = 0: All updates, including languagepacks and features
|
||||
* BrowseOnly = 0: No features or languagepacks, security and unnamed
|
||||
* BrowseOnly = 1: Nothing, broken
|
||||
* RebootRequired = 1: Reboot required
|
||||
*/
|
||||
|
||||
criteria = SysAllocString(CRITERIA);
|
||||
|
|
|
@ -114,7 +114,7 @@ std::wstring threshold::pString(CONST DOUBLE max)
|
|||
upperAbs = upper / 100.0 * max;
|
||||
}
|
||||
|
||||
std::wstring s, lowerStr = removeZero(lowerAbs),
|
||||
std::wstring s, lowerStr = removeZero(lowerAbs)
|
||||
upperStr = removeZero(upperAbs);
|
||||
|
||||
if (lower != upper) {
|
||||
|
|
|
@ -47,8 +47,9 @@ static void LogFlapping(const Checkable::Ptr& obj)
|
|||
std::bitset<20> stateChangeBuf = obj->GetFlappingBuffer();
|
||||
int oldestIndex = (obj->GetFlappingBuffer() & 0xFF00000) >> 20;
|
||||
|
||||
std::cout << "Flapping: " << obj->IsFlapping() << "\nHT: " << obj->GetFlappingThresholdHigh() << " LT: " << obj->GetFlappingThresholdLow()
|
||||
<< "\nOur value: " << obj->GetFlappingCurrent() << "\nPtr: " << oldestIndex << " Buf: " << stateChangeBuf.to_ulong() << '\n';
|
||||
std::cout << "Flapping: " << obj->IsFlapping() << "\nHT: " << obj->GetFlappingThresholdHigh() << " LT: "
|
||||
<< obj->GetFlappingThresholdLow() << "\nOur value: " << obj->GetFlappingCurrent() << "\nPtr: " << oldestIndex
|
||||
<< " Buf: " << stateChangeBuf.to_ulong() << '\n';
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -113,9 +113,8 @@ int yylex(YYSTYPE *lvalp, YYLTYPE *llocp, void *scanner);
|
|||
|
||||
void yyerror(YYLTYPE *locp, ClassCompiler *, const char *err)
|
||||
{
|
||||
std::cerr << "in " << locp->path << " at " << locp->first_line << ":" << locp->first_column << "-" << locp->last_line << ":" << locp->last_column << ": "
|
||||
<< err
|
||||
<< std::endl;
|
||||
std::cerr << "in " << locp->path << " at " << locp->first_line << ":" << locp->first_column << "-"
|
||||
<< locp->last_line << ":" << locp->last_column << ": " << err << std::endl;
|
||||
std::exit(1);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue