From 42744fde5b0c9be23293227cdc5fa0f6d90a22b9 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Wed, 13 Dec 2017 12:54:14 +0100 Subject: [PATCH] Remove extraneous whitespace --- icinga-app/icinga.cpp | 20 ++--- icinga-app/icinga.rc | 2 +- icinga-installer/icinga-installer.cpp | 4 +- icinga-studio/forms.cpp | 120 ++++++++++++------------- icinga-studio/forms.h | 30 +++---- icinga-studio/icinga.rc | 2 +- icinga-studio/mainform.cpp | 4 +- lib/base/array.cpp | 4 +- lib/base/base64.cpp | 2 +- lib/base/dictionary.hpp | 2 +- lib/base/json.cpp | 2 +- lib/base/object.hpp | 2 +- lib/base/serializer.cpp | 4 +- lib/base/tlsutility.cpp | 10 +-- lib/base/type.hpp | 4 +- lib/base/typetype-script.cpp | 2 +- lib/base/value.hpp | 2 +- lib/compat/compatlogger.cpp | 8 +- lib/config/config_parser.yy | 2 +- lib/config/configcompiler.hpp | 2 +- lib/config/configitem.hpp | 2 +- lib/config/expression.hpp | 48 +++++----- lib/db_ido/dbevents.cpp | 6 +- lib/icinga/dependency-apply.cpp | 2 +- lib/icinga/dependency.cpp | 4 +- lib/icinga/notification-apply.cpp | 2 +- lib/icinga/scheduleddowntime-apply.cpp | 2 +- lib/icinga/service-apply.cpp | 2 +- lib/livestatus/aggregator.hpp | 4 +- lib/remote/apiclient.hpp | 2 +- lib/remote/apilistener.hpp | 4 +- lib/remote/consolehandler.cpp | 2 +- lib/remote/objectqueryhandler.cpp | 2 +- plugins/check_disk.cpp | 8 +- plugins/check_network.cpp | 12 +-- plugins/check_ping.cpp | 2 +- plugins/check_procs.cpp | 6 +- plugins/check_service.cpp | 4 +- plugins/check_update.cpp | 2 +- plugins/check_uptime.cpp | 6 +- plugins/check_users.cpp | 4 +- plugins/thresholds.cpp | 2 +- 42 files changed, 178 insertions(+), 178 deletions(-) diff --git a/icinga-app/icinga.cpp b/icinga-app/icinga.cpp index acc8f42ab..2dfe71541 100644 --- a/icinga-app/icinga.cpp +++ b/icinga-app/icinga.cpp @@ -59,7 +59,7 @@ static HANDLE l_Job; static std::vector GetLogLevelCompletionSuggestions(const String& arg) { std::vector result; - + String debugLevel = "debug"; if (debugLevel.Find(arg) == 0) result.push_back(debugLevel); @@ -460,10 +460,10 @@ static int Main(void) } else if (command && command->GetImpersonationLevel() == ImpersonateIcinga) { String group = Application::GetRunAsGroup(); String user = Application::GetRunAsUser(); - + errno = 0; struct group *gr = getgrnam(group.CStr()); - + if (!gr) { if (errno == 0) { Log(LogCritical, "cli") @@ -475,7 +475,7 @@ static int Main(void) return EXIT_FAILURE; } } - + if (getgid() != gr->gr_gid) { if (!vm.count("reload-internal") && setgroups(0, NULL) < 0) { Log(LogCritical, "cli") @@ -484,17 +484,17 @@ static int Main(void) << "Please re-run this command as a privileged user or using the \"" << user << "\" account."; return EXIT_FAILURE; } - + if (setgid(gr->gr_gid) < 0) { Log(LogCritical, "cli") << "setgid() failed with error code " << errno << ", \"" << Utility::FormatErrorNumber(errno) << "\""; return EXIT_FAILURE; } } - + errno = 0; struct passwd *pw = getpwnam(user.CStr()); - + if (!pw) { if (errno == 0) { Log(LogCritical, "cli") @@ -506,7 +506,7 @@ static int Main(void) return EXIT_FAILURE; } } - + // also activate the additional groups the configured user is member of if (getuid() != pw->pw_uid) { if (!vm.count("reload-internal") && initgroups(user.CStr(), pw->pw_gid) < 0) { @@ -516,7 +516,7 @@ static int Main(void) << "Please re-run this command as a privileged user or using the \"" << user << "\" account."; return EXIT_FAILURE; } - + if (setuid(pw->pw_uid) < 0) { Log(LogCritical, "cli") << "setuid() failed with error code " << errno << ", \"" << Utility::FormatErrorNumber(errno) << "\""; @@ -780,7 +780,7 @@ static VOID WINAPI ServiceMain(DWORD argc, LPSTR *argv) break; DWORD exitStatus; - + if (!GetExitCodeProcess(pi.hProcess, &exitStatus)) break; diff --git a/icinga-app/icinga.rc b/icinga-app/icinga.rc index 5d7f64722..9294f989b 100644 --- a/icinga-app/icinga.rc +++ b/icinga-app/icinga.rc @@ -26,7 +26,7 @@ BEGIN VALUE "ProductVersion", VERSION END END - + BLOCK "VarFileInfo" BEGIN VALUE "Translation", 0x409, 0x04E4 diff --git a/icinga-installer/icinga-installer.cpp b/icinga-installer/icinga-installer.cpp index 438ddc37d..455ff2831 100644 --- a/icinga-installer/icinga-installer.cpp +++ b/icinga-installer/icinga-installer.cpp @@ -54,7 +54,7 @@ static bool ExecuteCommand(const std::string& app, const std::string& arguments) sei.nShow = SW_HIDE; if (!ShellExecuteEx(&sei)) return false; - + if (!sei.hProcess) return false; @@ -221,7 +221,7 @@ static int UpgradeNSIS(void) return 1; _rmdir(installPath.c_str()); - } + } return 0; } diff --git a/icinga-studio/forms.cpp b/icinga-studio/forms.cpp index b1e052f94..2cf189e22 100644 --- a/icinga-studio/forms.cpp +++ b/icinga-studio/forms.cpp @@ -14,57 +14,57 @@ MainFormBase::MainFormBase( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxFrame( parent, id, title, pos, size, style ) { this->SetSizeHints( wxSize( 800,569 ), wxDefaultSize ); - + m_MenuBar = new wxMenuBar( 0 ); wxMenu* m_FileMenu; m_FileMenu = new wxMenu(); wxMenuItem* m_QuitMenuItem; m_QuitMenuItem = new wxMenuItem( m_FileMenu, wxID_EXIT, wxString( wxT("&Quit") ) , wxEmptyString, wxITEM_NORMAL ); m_FileMenu->Append( m_QuitMenuItem ); - + m_MenuBar->Append( m_FileMenu, wxT("&File") ); - + wxMenu* m_HelpMenu; m_HelpMenu = new wxMenu(); wxMenuItem* m_AboutMenuItem; m_AboutMenuItem = new wxMenuItem( m_HelpMenu, wxID_ABOUT, wxString( wxT("&About Icinga Studio...") ) , wxEmptyString, wxITEM_NORMAL ); m_HelpMenu->Append( m_AboutMenuItem ); - + m_MenuBar->Append( m_HelpMenu, wxT("&Help") ); - + this->SetMenuBar( m_MenuBar ); - + wxBoxSizer* m_DialogSizer; m_DialogSizer = new wxBoxSizer( wxVERTICAL ); - + wxBoxSizer* m_ConnectionDetailsSizer; m_ConnectionDetailsSizer = new wxBoxSizer( wxHORIZONTAL ); - + m_TypesTree = new wxTreeCtrl( this, wxID_ANY, wxDefaultPosition, wxSize( 315,-1 ), wxTR_DEFAULT_STYLE|wxTR_HIDE_ROOT ); m_ConnectionDetailsSizer->Add( m_TypesTree, 0, wxALL|wxEXPAND, 2 ); - + wxBoxSizer* m_ObjectDetailsSizer; m_ObjectDetailsSizer = new wxBoxSizer( wxVERTICAL ); - + m_ObjectsList = new wxListCtrl( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_REPORT ); m_ObjectDetailsSizer->Add( m_ObjectsList, 1, wxALL|wxEXPAND, 2 ); - + m_PropertyGrid = new wxPropertyGrid(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxPG_DEFAULT_STYLE); m_ObjectDetailsSizer->Add( m_PropertyGrid, 1, wxALL|wxEXPAND, 5 ); - - + + m_ConnectionDetailsSizer->Add( m_ObjectDetailsSizer, 1, wxEXPAND, 5 ); - - + + m_DialogSizer->Add( m_ConnectionDetailsSizer, 1, wxEXPAND, 5 ); - - + + this->SetSizer( m_DialogSizer ); this->Layout(); m_StatusBar = this->CreateStatusBar( 1, wxST_SIZEGRIP, wxID_ANY ); - + this->Centre( wxBOTH ); - + // Connect Events this->Connect( m_QuitMenuItem->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFormBase::OnQuitClicked ) ); this->Connect( m_AboutMenuItem->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFormBase::OnAboutClicked ) ); @@ -79,89 +79,89 @@ MainFormBase::~MainFormBase() this->Disconnect( wxID_ABOUT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFormBase::OnAboutClicked ) ); m_TypesTree->Disconnect( wxEVT_COMMAND_TREE_SEL_CHANGED, wxTreeEventHandler( MainFormBase::OnTypeSelected ), NULL, this ); m_ObjectsList->Disconnect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( MainFormBase::OnObjectSelected ), NULL, this ); - + } ConnectFormBase::ConnectFormBase( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) { this->SetSizeHints( wxDefaultSize, wxDefaultSize ); - + wxBoxSizer* m_DialogSizer; m_DialogSizer = new wxBoxSizer( wxVERTICAL ); - + wxPanel* m_ConnectionDetailsPanel; m_ConnectionDetailsPanel = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); wxStaticBoxSizer* m_DetailsSizer; m_DetailsSizer = new wxStaticBoxSizer( new wxStaticBox( m_ConnectionDetailsPanel, wxID_ANY, wxT("Connection Details") ), wxVERTICAL ); - + wxStaticText* m_HostLabel; m_HostLabel = new wxStaticText( m_DetailsSizer->GetStaticBox(), wxID_ANY, wxT("Host:"), wxDefaultPosition, wxDefaultSize, 0 ); m_HostLabel->Wrap( -1 ); m_DetailsSizer->Add( m_HostLabel, 0, wxALL, 5 ); - + m_HostText = new wxTextCtrl( m_DetailsSizer->GetStaticBox(), wxID_OK, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_DetailsSizer->Add( m_HostText, 0, wxALL|wxEXPAND, 5 ); - + wxStaticText* m_PortLabel; m_PortLabel = new wxStaticText( m_DetailsSizer->GetStaticBox(), wxID_ANY, wxT("Port:"), wxDefaultPosition, wxDefaultSize, 0 ); m_PortLabel->Wrap( -1 ); m_DetailsSizer->Add( m_PortLabel, 0, wxALL, 5 ); - + m_PortText = new wxTextCtrl( m_DetailsSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_DetailsSizer->Add( m_PortText, 0, wxALL, 5 ); - + wxStaticText* m_UserLabel; m_UserLabel = new wxStaticText( m_DetailsSizer->GetStaticBox(), wxID_ANY, wxT("API User:"), wxDefaultPosition, wxDefaultSize, 0 ); m_UserLabel->Wrap( -1 ); m_DetailsSizer->Add( m_UserLabel, 0, wxALL, 5 ); - + m_UserText = new wxTextCtrl( m_DetailsSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_DetailsSizer->Add( m_UserText, 0, wxALL|wxEXPAND, 5 ); - + wxStaticText* m_PasswordLabel; m_PasswordLabel = new wxStaticText( m_DetailsSizer->GetStaticBox(), wxID_ANY, wxT("API Password:"), wxDefaultPosition, wxDefaultSize, 0 ); m_PasswordLabel->Wrap( -1 ); m_DetailsSizer->Add( m_PasswordLabel, 0, wxALL, 5 ); - + m_PasswordText = new wxTextCtrl( m_DetailsSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PASSWORD ); m_DetailsSizer->Add( m_PasswordText, 0, wxALL|wxEXPAND, 5 ); - + wxStaticText* m_InfoLabel; m_InfoLabel = new wxStaticText( m_DetailsSizer->GetStaticBox(), wxID_ANY, wxT("You can find the username and password for the default user in /etc/icinga2/conf.d/api-users.conf."), wxDefaultPosition, wxDefaultSize, 0 ); m_InfoLabel->Wrap( 270 ); m_DetailsSizer->Add( m_InfoLabel, 0, wxALL, 5 ); - - + + m_ConnectionDetailsPanel->SetSizer( m_DetailsSizer ); m_ConnectionDetailsPanel->Layout(); m_DetailsSizer->Fit( m_ConnectionDetailsPanel ); m_DialogSizer->Add( m_ConnectionDetailsPanel, 1, wxEXPAND | wxALL, 5 ); - + wxPanel* m_ButtonsPanel; m_ButtonsPanel = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); wxBoxSizer* m_ButtonsSizer; m_ButtonsSizer = new wxBoxSizer( wxHORIZONTAL ); - + m_Buttons = new wxStdDialogButtonSizer(); m_ButtonsOK = new wxButton( m_ButtonsPanel, wxID_OK ); m_Buttons->AddButton( m_ButtonsOK ); m_ButtonsCancel = new wxButton( m_ButtonsPanel, wxID_CANCEL ); m_Buttons->AddButton( m_ButtonsCancel ); m_Buttons->Realize(); - + m_ButtonsSizer->Add( m_Buttons, 1, wxEXPAND, 5 ); - - + + m_ButtonsPanel->SetSizer( m_ButtonsSizer ); m_ButtonsPanel->Layout(); m_ButtonsSizer->Fit( m_ButtonsPanel ); m_DialogSizer->Add( m_ButtonsPanel, 0, wxEXPAND | wxALL, 5 ); - - + + this->SetSizer( m_DialogSizer ); this->Layout(); m_DialogSizer->Fit( this ); - + this->Centre( wxBOTH ); } @@ -172,65 +172,65 @@ ConnectFormBase::~ConnectFormBase() AboutFormBase::AboutFormBase( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) { this->SetSizeHints( wxDefaultSize, wxDefaultSize ); - + wxBoxSizer* m_DialogSizer; m_DialogSizer = new wxBoxSizer( wxVERTICAL ); - + wxBoxSizer* m_InfoSizer; m_InfoSizer = new wxBoxSizer( wxHORIZONTAL ); - + wxStaticBitmap* m_ProductIcon; m_ProductIcon = new wxStaticBitmap( this, wxID_ANY, wxBitmap( icinga_xpm ), wxDefaultPosition, wxDefaultSize, 0 ); m_InfoSizer->Add( m_ProductIcon, 0, wxALL, 5 ); - + wxBoxSizer* m_AboutInfoSizer; m_AboutInfoSizer = new wxBoxSizer( wxVERTICAL ); - + wxStaticText* m_ProductNameLabel; m_ProductNameLabel = new wxStaticText( this, wxID_ANY, wxT("Icinga Studio"), wxDefaultPosition, wxDefaultSize, 0 ); m_ProductNameLabel->Wrap( -1 ); m_AboutInfoSizer->Add( m_ProductNameLabel, 0, wxALL, 5 ); - + m_VersionLabel = new wxStaticText( this, wxID_ANY, wxT("Version"), wxDefaultPosition, wxDefaultSize, 0 ); m_VersionLabel->Wrap( -1 ); m_AboutInfoSizer->Add( m_VersionLabel, 0, wxALL, 5 ); - + wxStaticText* m_CopyrightLabel; m_CopyrightLabel = new wxStaticText( this, wxID_ANY, wxT("Copyright (c) 2015 Icinga Development Team"), wxDefaultPosition, wxDefaultSize, 0 ); m_CopyrightLabel->Wrap( -1 ); m_AboutInfoSizer->Add( m_CopyrightLabel, 0, wxALL, 5 ); - - + + m_InfoSizer->Add( m_AboutInfoSizer, 1, wxEXPAND, 5 ); - - + + m_DialogSizer->Add( m_InfoSizer, 1, wxEXPAND, 5 ); - + wxPanel* m_ButtonsPanel; m_ButtonsPanel = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); wxBoxSizer* m_ButtonsSizer; m_ButtonsSizer = new wxBoxSizer( wxVERTICAL ); - + wxStdDialogButtonSizer* m_Buttons; wxButton* m_ButtonsOK; m_Buttons = new wxStdDialogButtonSizer(); m_ButtonsOK = new wxButton( m_ButtonsPanel, wxID_OK ); m_Buttons->AddButton( m_ButtonsOK ); m_Buttons->Realize(); - + m_ButtonsSizer->Add( m_Buttons, 0, wxEXPAND, 5 ); - - + + m_ButtonsPanel->SetSizer( m_ButtonsSizer ); m_ButtonsPanel->Layout(); m_ButtonsSizer->Fit( m_ButtonsPanel ); m_DialogSizer->Add( m_ButtonsPanel, 0, wxEXPAND | wxALL, 5 ); - - + + this->SetSizer( m_DialogSizer ); this->Layout(); m_DialogSizer->Fit( this ); - + this->Centre( wxBOTH ); } diff --git a/icinga-studio/forms.h b/icinga-studio/forms.h index c125ecbbb..77f6f3f3d 100644 --- a/icinga-studio/forms.h +++ b/icinga-studio/forms.h @@ -42,27 +42,27 @@ class MainFormBase : public wxFrame { private: - + protected: wxMenuBar* m_MenuBar; wxTreeCtrl* m_TypesTree; wxListCtrl* m_ObjectsList; wxPropertyGrid* m_PropertyGrid; wxStatusBar* m_StatusBar; - + // Virtual event handlers, overide them in your derived class virtual void OnQuitClicked( wxCommandEvent& event ) { event.Skip(); } virtual void OnAboutClicked( wxCommandEvent& event ) { event.Skip(); } virtual void OnTypeSelected( wxTreeEvent& event ) { event.Skip(); } virtual void OnObjectSelected( wxListEvent& event ) { event.Skip(); } - - + + public: - + MainFormBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxT("Icinga Studio"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 800,569 ), long style = wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL ); - + ~MainFormBase(); - + }; /////////////////////////////////////////////////////////////////////////////// @@ -71,7 +71,7 @@ class MainFormBase : public wxFrame class ConnectFormBase : public wxDialog { private: - + protected: wxTextCtrl* m_HostText; wxTextCtrl* m_PortText; @@ -80,12 +80,12 @@ class ConnectFormBase : public wxDialog wxStdDialogButtonSizer* m_Buttons; wxButton* m_ButtonsOK; wxButton* m_ButtonsCancel; - + public: - + ConnectFormBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxT("Icinga Studio - Connect"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE ); ~ConnectFormBase(); - + }; /////////////////////////////////////////////////////////////////////////////// @@ -94,15 +94,15 @@ class ConnectFormBase : public wxDialog class AboutFormBase : public wxDialog { private: - + protected: wxStaticText* m_VersionLabel; - + public: - + AboutFormBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxT("About Icinga Studio"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE ); ~AboutFormBase(); - + }; #endif //__FORMS_H__ diff --git a/icinga-studio/icinga.rc b/icinga-studio/icinga.rc index abcda3f4e..554dd6e42 100644 --- a/icinga-studio/icinga.rc +++ b/icinga-studio/icinga.rc @@ -26,7 +26,7 @@ BEGIN VALUE "ProductVersion", VERSION END END - + BLOCK "VarFileInfo" BEGIN VALUE "Translation", 0x409, 0x04E4 diff --git a/icinga-studio/mainform.cpp b/icinga-studio/mainform.cpp index 5f226b4fc..2b4f644de 100644 --- a/icinga-studio/mainform.cpp +++ b/icinga-studio/mainform.cpp @@ -45,7 +45,7 @@ MainForm::MainForm(wxWindow *parent, const Url::Ptr& url) SetTitle(title); m_ObjectsList->InsertColumn(0, "Name", 0, 300); - + m_PropertyGrid->SetColumnCount(3); } @@ -205,7 +205,7 @@ wxPGProperty *MainForm::ValueToProperty(const String& name, const Value& value) return prop; } else if (value.IsObjectType()) { wxStringProperty *prop = new wxStringProperty(name.GetData(), wxPG_LABEL); - + Dictionary::Ptr dict = value; { diff --git a/lib/base/array.cpp b/lib/base/array.cpp index a493e8177..21dcc7613 100644 --- a/lib/base/array.cpp +++ b/lib/base/array.cpp @@ -207,12 +207,12 @@ Array::Ptr Array::ShallowClone(void) const Object::Ptr Array::Clone(void) const { Array::Ptr arr = new Array(); - + ObjectLock olock(this); for (const Value& val : m_Data) { arr->Add(val.Clone()); } - + return arr; } diff --git a/lib/base/base64.cpp b/lib/base/base64.cpp index bbbc9b09e..e430ba512 100644 --- a/lib/base/base64.cpp +++ b/lib/base/base64.cpp @@ -52,7 +52,7 @@ String Base64::Decode(const String& input) BIO_set_flags(bio64, BIO_FLAGS_BASE64_NO_NL); char *outbuf = new char[input.GetLength()]; - + size_t len = 0; int rc; diff --git a/lib/base/dictionary.hpp b/lib/base/dictionary.hpp index 23a0e8e01..298079ba7 100644 --- a/lib/base/dictionary.hpp +++ b/lib/base/dictionary.hpp @@ -113,7 +113,7 @@ public: std::vector GetKeys(void) const; static Object::Ptr GetPrototype(void); - + virtual Object::Ptr Clone(void) const override; virtual String ToString(void) const override; diff --git a/lib/base/json.cpp b/lib/base/json.cpp index 3a6d19ba8..df7508701 100644 --- a/lib/base/json.cpp +++ b/lib/base/json.cpp @@ -291,7 +291,7 @@ static int DecodeEndMapOrArray(void *ctx) static int DecodeStartArray(void *ctx) { JsonContext *context = static_cast(ctx); - + try { context->Push(new Array()); } catch (...) { diff --git a/lib/base/object.hpp b/lib/base/object.hpp index 5418722c7..dcbeff7b8 100644 --- a/lib/base/object.hpp +++ b/lib/base/object.hpp @@ -134,7 +134,7 @@ public: #endif /* I2_DEBUG */ static Object::Ptr GetPrototype(void); - + virtual Object::Ptr Clone(void) const; static intrusive_ptr TypeInstance; diff --git a/lib/base/serializer.cpp b/lib/base/serializer.cpp index f51493aea..c05fdabfd 100644 --- a/lib/base/serializer.cpp +++ b/lib/base/serializer.cpp @@ -115,7 +115,7 @@ static Object::Ptr DeserializeObject(const Object::Ptr& object, const Dictionary return object; Object::Ptr instance; - + if (object) instance = object; else @@ -127,7 +127,7 @@ static Object::Ptr DeserializeObject(const Object::Ptr& object, const Dictionary continue; int fid = type->GetFieldId(kv.first); - + if (fid < 0) continue; diff --git a/lib/base/tlsutility.cpp b/lib/base/tlsutility.cpp index 215dc7de3..04a6bd1ed 100644 --- a/lib/base/tlsutility.cpp +++ b/lib/base/tlsutility.cpp @@ -440,10 +440,10 @@ int MakeX509CSR(const String& cn, const String& keyfile, const String& csrfile, X509_REQ_set_version(req, 0); X509_REQ_set_pubkey(req, key); - + X509_NAME *name = X509_REQ_get_subject_name(req); X509_NAME_add_entry_by_txt(name, "CN", MBSTRING_ASC, (unsigned char *)cn.CStr(), -1, -1, 0); - + if (!ca) { String san = "DNS:" + cn; X509_EXTENSION *subjectAltNameExt = X509V3_EXT_conf_nid(NULL, NULL, NID_subject_alt_name, const_cast(san.CStr())); @@ -457,10 +457,10 @@ int MakeX509CSR(const String& cn, const String& keyfile, const String& csrfile, } X509_REQ_sign(req, key, EVP_sha256()); - + Log(LogInformation, "base") << "Writing certificate signing request to '" << csrfile << "'."; - + bio = BIO_new_file(const_cast(csrfile.CStr()), "w"); if (!bio) { @@ -482,7 +482,7 @@ int MakeX509CSR(const String& cn, const String& keyfile, const String& csrfile, } BIO_free(bio); - + X509_REQ_free(req); } diff --git a/lib/base/type.hpp b/lib/base/type.hpp index b6204b4be..072d28672 100644 --- a/lib/base/type.hpp +++ b/lib/base/type.hpp @@ -103,7 +103,7 @@ public: virtual Value GetField(int id) const override; virtual std::vector GetLoadDependencies(void) const; - + typedef std::function AttributeHandler; virtual void RegisterAttributeHandler(int fieldId, const AttributeHandler& callback); @@ -125,7 +125,7 @@ public: virtual int GetFieldId(const String& name) const override; virtual Field GetFieldInfo(int id) const override; virtual int GetFieldCount(void) const override; - + static Object::Ptr GetPrototype(void); protected: diff --git a/lib/base/typetype-script.cpp b/lib/base/typetype-script.cpp index 21ef5d572..284c26b9c 100644 --- a/lib/base/typetype-script.cpp +++ b/lib/base/typetype-script.cpp @@ -35,7 +35,7 @@ static void TypeRegisterAttributeHandler(const String& fieldName, const Function { ScriptFrame *vframe = ScriptFrame::GetCurrentFrame(); Type::Ptr self = static_cast(vframe->Self); - + int fid = self->GetFieldId(fieldName); self->RegisterAttributeHandler(fid, std::bind(&InvokeAttributeHandlerHelper, callback, _1, _2)); } diff --git a/lib/base/value.hpp b/lib/base/value.hpp index bb32a9b0a..0eab3712c 100644 --- a/lib/base/value.hpp +++ b/lib/base/value.hpp @@ -280,7 +280,7 @@ public: String GetTypeName(void) const; Type::Ptr GetReflectionType(void) const; - + Value Clone(void) const; template diff --git a/lib/compat/compatlogger.cpp b/lib/compat/compatlogger.cpp index f39750095..6ce2891d5 100644 --- a/lib/compat/compatlogger.cpp +++ b/lib/compat/compatlogger.cpp @@ -68,10 +68,10 @@ void CompatLogger::Start(bool runtimeCreated) Downtime::OnDowntimeTriggered.connect(std::bind(&CompatLogger::TriggerDowntimeHandler, this, _1)); Downtime::OnDowntimeRemoved.connect(std::bind(&CompatLogger::RemoveDowntimeHandler, this, _1)); Checkable::OnEventCommandExecuted.connect(std::bind(&CompatLogger::EventCommandHandler, this, _1)); - + Checkable::OnFlappingChanged.connect(std::bind(&CompatLogger::FlappingChangedHandler, this, _1)); Checkable::OnEnableFlappingChanged.connect(std::bind(&CompatLogger::EnableFlappingChangedHandler, this, _1)); - + ExternalCommandProcessor::OnNewExternalCommand.connect(std::bind(&CompatLogger::ExternalCommandHandler, this, _2, _3)); m_RotationTimer = new Timer(); @@ -315,7 +315,7 @@ void CompatLogger::FlappingChangedHandler(const Checkable::Ptr& checkable) String flapping_state_str; String flapping_output; - + if (checkable->IsFlapping()) { flapping_output = "Checkable appears to have started flapping (" + Convert::ToString(checkable->GetFlappingCurrent()) + "% change >= " + Convert::ToString(checkable->GetFlappingThresholdHigh()) + "% threshold)"; flapping_state_str = "STARTED"; @@ -356,7 +356,7 @@ void CompatLogger::EnableFlappingChangedHandler(const Checkable::Ptr& checkable) if (checkable->GetEnableFlapping()) return; - + String flapping_output = "Flap detection has been disabled"; String flapping_state_str = "DISABLED"; diff --git a/lib/config/config_parser.yy b/lib/config/config_parser.yy index 688429a53..af9b2a019 100644 --- a/lib/config/config_parser.yy +++ b/lib/config/config_parser.yy @@ -674,7 +674,7 @@ lterm: T_LIBRARY rterm } | rterm_side_effect ; - + rterm_items: /* empty */ { $$ = new std::vector(); diff --git a/lib/config/configcompiler.hpp b/lib/config/configcompiler.hpp index 08d362c52..5820562cc 100644 --- a/lib/config/configcompiler.hpp +++ b/lib/config/configcompiler.hpp @@ -105,7 +105,7 @@ public: void SetZone(const String& zone); String GetZone(void) const; - + void SetPackage(const String& package); String GetPackage(void) const; diff --git a/lib/config/configitem.hpp b/lib/config/configitem.hpp index e65b8ed32..c61887ff2 100644 --- a/lib/config/configitem.hpp +++ b/lib/config/configitem.hpp @@ -65,7 +65,7 @@ public: Dictionary::Ptr GetScope(void) const; ConfigObject::Ptr GetObject(void) const; - + static ConfigItem::Ptr GetByTypeAndName(const Type::Ptr& type, const String& name); diff --git a/lib/config/expression.hpp b/lib/config/expression.hpp index 9c1509650..c5cd197b3 100644 --- a/lib/config/expression.hpp +++ b/lib/config/expression.hpp @@ -292,7 +292,7 @@ public: BinaryExpression(Expression *operand1, Expression *operand2, const DebugInfo& debugInfo = DebugInfo()) : DebuggableExpression(debugInfo), m_Operand1(operand1), m_Operand2(operand2) { } - + ~BinaryExpression(void) { delete m_Operand1; @@ -325,7 +325,7 @@ private: friend I2_CONFIG_API void BindToScope(Expression *& expr, ScopeSpecifier scopeSpec); }; - + class I2_CONFIG_API NegateExpression : public UnaryExpression { public: @@ -336,7 +336,7 @@ public: protected: virtual ExpressionResult DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const override; }; - + class I2_CONFIG_API LogicalNegateExpression : public UnaryExpression { public: @@ -358,7 +358,7 @@ public: protected: virtual ExpressionResult DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const override; }; - + class I2_CONFIG_API SubtractExpression : public BinaryExpression { public: @@ -369,7 +369,7 @@ public: protected: virtual ExpressionResult DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const override; }; - + class I2_CONFIG_API MultiplyExpression : public BinaryExpression { public: @@ -380,7 +380,7 @@ public: protected: virtual ExpressionResult DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const override; }; - + class I2_CONFIG_API DivideExpression : public BinaryExpression { public: @@ -424,7 +424,7 @@ public: protected: virtual ExpressionResult DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const override; }; - + class I2_CONFIG_API BinaryOrExpression : public BinaryExpression { public: @@ -435,7 +435,7 @@ public: protected: virtual ExpressionResult DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const override; }; - + class I2_CONFIG_API ShiftLeftExpression : public BinaryExpression { public: @@ -446,7 +446,7 @@ public: protected: virtual ExpressionResult DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const override; }; - + class I2_CONFIG_API ShiftRightExpression : public BinaryExpression { public: @@ -457,7 +457,7 @@ public: protected: virtual ExpressionResult DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const override; }; - + class I2_CONFIG_API EqualExpression : public BinaryExpression { public: @@ -468,7 +468,7 @@ public: protected: virtual ExpressionResult DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const override; }; - + class I2_CONFIG_API NotEqualExpression : public BinaryExpression { public: @@ -479,7 +479,7 @@ public: protected: virtual ExpressionResult DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const override; }; - + class I2_CONFIG_API LessThanExpression : public BinaryExpression { public: @@ -490,7 +490,7 @@ public: protected: virtual ExpressionResult DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const override; }; - + class I2_CONFIG_API GreaterThanExpression : public BinaryExpression { public: @@ -501,7 +501,7 @@ public: protected: virtual ExpressionResult DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const override; }; - + class I2_CONFIG_API LessThanOrEqualExpression : public BinaryExpression { public: @@ -512,7 +512,7 @@ public: protected: virtual ExpressionResult DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const override; }; - + class I2_CONFIG_API GreaterThanOrEqualExpression : public BinaryExpression { public: @@ -523,7 +523,7 @@ public: protected: virtual ExpressionResult DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const override; }; - + class I2_CONFIG_API InExpression : public BinaryExpression { public: @@ -534,7 +534,7 @@ public: protected: virtual ExpressionResult DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const override; }; - + class I2_CONFIG_API NotInExpression : public BinaryExpression { public: @@ -545,7 +545,7 @@ public: protected: virtual ExpressionResult DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const override; }; - + class I2_CONFIG_API LogicalAndExpression : public BinaryExpression { public: @@ -556,7 +556,7 @@ public: protected: virtual ExpressionResult DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const override; }; - + class I2_CONFIG_API LogicalOrExpression : public BinaryExpression { public: @@ -567,7 +567,7 @@ public: protected: virtual ExpressionResult DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const override; }; - + class I2_CONFIG_API FunctionCallExpression : public DebuggableExpression { public: @@ -590,7 +590,7 @@ public: Expression *m_FName; std::vector m_Args; }; - + class I2_CONFIG_API ArrayExpression : public DebuggableExpression { public: @@ -610,7 +610,7 @@ protected: private: std::vector m_Expressions; }; - + class I2_CONFIG_API DictExpression : public DebuggableExpression { public: @@ -635,7 +635,7 @@ private: friend I2_CONFIG_API void BindToScope(Expression *& expr, ScopeSpecifier scopeSpec); }; - + class I2_CONFIG_API SetExpression : public BinaryExpression { public: @@ -924,7 +924,7 @@ private: std::map *m_ClosedVars; std::shared_ptr m_Expression; }; - + class I2_CONFIG_API ForExpression : public DebuggableExpression { public: diff --git a/lib/db_ido/dbevents.cpp b/lib/db_ido/dbevents.cpp index d67901c90..d3795e962 100644 --- a/lib/db_ido/dbevents.cpp +++ b/lib/db_ido/dbevents.cpp @@ -1182,7 +1182,7 @@ void DbEvents::AddFlappingChangedLogHistory(const Checkable::Ptr& checkable) { String flapping_state_str; String flapping_output; - + if (checkable->IsFlapping()) { flapping_output = "Service appears to have started flapping (" + Convert::ToString(checkable->GetFlappingCurrent()) + "% change >= " + Convert::ToString(checkable->GetFlappingThresholdHigh()) + "% threshold)"; flapping_state_str = "STARTED"; @@ -1219,7 +1219,7 @@ void DbEvents::AddEnableFlappingChangedLogHistory(const Checkable::Ptr& checkabl { if (!checkable->GetEnableFlapping()) return; - + String flapping_output = "Flap detection has been disabled"; String flapping_state_str = "DISABLED"; @@ -1348,7 +1348,7 @@ void DbEvents::AddEnableFlappingChangedHistory(const Checkable::Ptr& checkable) if (!checkable->GetEnableFlapping()) return; - + fields1->Set("event_type", 1001); fields1->Set("reason_type", 2); diff --git a/lib/icinga/dependency-apply.cpp b/lib/icinga/dependency-apply.cpp index b4df4dd7d..d86b68751 100644 --- a/lib/icinga/dependency-apply.cpp +++ b/lib/icinga/dependency-apply.cpp @@ -136,7 +136,7 @@ bool Dependency::EvaluateApplyRule(const Checkable::Ptr& checkable, const ApplyR } else if (vinstances.IsObjectType()) { if (rule.GetFVVar().IsEmpty()) BOOST_THROW_EXCEPTION(ScriptError("Array iterator requires value to be an array.", di)); - + Dictionary::Ptr dict = vinstances; for (const String& key : dict->GetKeys()) { diff --git a/lib/icinga/dependency.cpp b/lib/icinga/dependency.cpp index 8aec486d2..15e922a81 100644 --- a/lib/icinga/dependency.cpp +++ b/lib/icinga/dependency.cpp @@ -91,7 +91,7 @@ void Dependency::OnAllConfigLoaded(void) else m_Child = childHost->GetServiceByShortName(GetChildServiceName()); } - + if (!m_Child) BOOST_THROW_EXCEPTION(ScriptError("Dependency '" + GetName() + "' references a child host/service which doesn't exist.", GetDebugInfo())); @@ -105,7 +105,7 @@ void Dependency::OnAllConfigLoaded(void) else m_Parent = parentHost->GetServiceByShortName(GetParentServiceName()); } - + if (!m_Parent) BOOST_THROW_EXCEPTION(ScriptError("Dependency '" + GetName() + "' references a parent host/service which doesn't exist.", GetDebugInfo())); diff --git a/lib/icinga/notification-apply.cpp b/lib/icinga/notification-apply.cpp index 7f8930f4e..89c2f327f 100644 --- a/lib/icinga/notification-apply.cpp +++ b/lib/icinga/notification-apply.cpp @@ -135,7 +135,7 @@ bool Notification::EvaluateApplyRule(const Checkable::Ptr& checkable, const Appl } else if (vinstances.IsObjectType()) { if (rule.GetFVVar().IsEmpty()) BOOST_THROW_EXCEPTION(ScriptError("Array iterator requires value to be an array.", di)); - + Dictionary::Ptr dict = vinstances; for (const String& key : dict->GetKeys()) { diff --git a/lib/icinga/scheduleddowntime-apply.cpp b/lib/icinga/scheduleddowntime-apply.cpp index 752ba36d7..42b61e282 100644 --- a/lib/icinga/scheduleddowntime-apply.cpp +++ b/lib/icinga/scheduleddowntime-apply.cpp @@ -134,7 +134,7 @@ bool ScheduledDowntime::EvaluateApplyRule(const Checkable::Ptr& checkable, const } else if (vinstances.IsObjectType()) { if (rule.GetFVVar().IsEmpty()) BOOST_THROW_EXCEPTION(ScriptError("Array iterator requires value to be an array.", di)); - + Dictionary::Ptr dict = vinstances; for (const String& key : dict->GetKeys()) { diff --git a/lib/icinga/service-apply.cpp b/lib/icinga/service-apply.cpp index 360285f3a..5c4f75521 100644 --- a/lib/icinga/service-apply.cpp +++ b/lib/icinga/service-apply.cpp @@ -123,7 +123,7 @@ bool Service::EvaluateApplyRule(const Host::Ptr& host, const ApplyRule& rule) } else if (vinstances.IsObjectType()) { if (rule.GetFVVar().IsEmpty()) BOOST_THROW_EXCEPTION(ScriptError("Array iterator requires value to be an array.", di)); - + Dictionary::Ptr dict = vinstances; for (const String& key : dict->GetKeys()) { diff --git a/lib/livestatus/aggregator.hpp b/lib/livestatus/aggregator.hpp index 36fb792fe..6a613c4ac 100644 --- a/lib/livestatus/aggregator.hpp +++ b/lib/livestatus/aggregator.hpp @@ -49,9 +49,9 @@ public: protected: Aggregator(void); - + Filter::Ptr GetFilter(void) const; - + private: Filter::Ptr m_Filter; }; diff --git a/lib/remote/apiclient.hpp b/lib/remote/apiclient.hpp index 554682694..3777feeed 100644 --- a/lib/remote/apiclient.hpp +++ b/lib/remote/apiclient.hpp @@ -104,7 +104,7 @@ public: typedef std::function ExecuteScriptCompletionCallback; void ExecuteScript(const String& session, const String& command, bool sandboxed, const ExecuteScriptCompletionCallback& callback) const; - + typedef std::function AutocompleteScriptCompletionCallback; void AutocompleteScript(const String& session, const String& command, bool sandboxed, const AutocompleteScriptCompletionCallback& callback) const; diff --git a/lib/remote/apilistener.hpp b/lib/remote/apilistener.hpp index 052209319..ebfd13b59 100644 --- a/lib/remote/apilistener.hpp +++ b/lib/remote/apilistener.hpp @@ -91,12 +91,12 @@ public: /* filesync */ static Value ConfigUpdateHandler(const MessageOrigin::Ptr& origin, const Dictionary::Ptr& params); - + /* configsync */ static void ConfigUpdateObjectHandler(const ConfigObject::Ptr& object, const Value& cookie); static Value ConfigUpdateObjectAPIHandler(const MessageOrigin::Ptr& origin, const Dictionary::Ptr& params); static Value ConfigDeleteObjectAPIHandler(const MessageOrigin::Ptr& origin, const Dictionary::Ptr& params); - + static Value HelloAPIHandler(const MessageOrigin::Ptr& origin, const Dictionary::Ptr& params); static void UpdateObjectAuthority(void); diff --git a/lib/remote/consolehandler.cpp b/lib/remote/consolehandler.cpp index bf69d9559..9004a57ae 100644 --- a/lib/remote/consolehandler.cpp +++ b/lib/remote/consolehandler.cpp @@ -264,7 +264,7 @@ static void AddSuggestions(std::vector& matches, const String& word, con } std::vector ConsoleHandler::GetAutocompletionSuggestions(const String& word, ScriptFrame& frame) -{ +{ std::vector matches; for (const String& keyword : ConfigWriter::GetKeywords()) { diff --git a/lib/remote/objectqueryhandler.cpp b/lib/remote/objectqueryhandler.cpp index db731396a..7de4790a3 100644 --- a/lib/remote/objectqueryhandler.cpp +++ b/lib/remote/objectqueryhandler.cpp @@ -58,7 +58,7 @@ Dictionary::Ptr ObjectQueryHandler::SerializeObjectAttrs(const Object::Ptr& obje ObjectLock olock(attrs); for (const String& attr : attrs) { String userAttr; - + if (isJoin) { String::SizeType dpos = attr.FindFirstOf("."); if (dpos == String::NPos) diff --git a/plugins/check_disk.cpp b/plugins/check_disk.cpp index f38d2cd64..124236847 100644 --- a/plugins/check_disk.cpp +++ b/plugins/check_disk.cpp @@ -51,7 +51,7 @@ INT wmain(INT argc, WCHAR **argv) ret = check_drives(vDrives, printInfo.exclude_drives); else ret = check_drives(vDrives, printInfo); - + if (ret != -1) return ret; @@ -165,7 +165,7 @@ static INT parseArguments(INT ac, WCHAR **av, po::variables_map& vm, printInfoSt return 3; } } - + if (vm.count("path")) printInfo.drives = vm["path"].as>(); @@ -208,7 +208,7 @@ static INT printOutput(printInfoStruct& printInfo, std::vector& vDrives) if (printInfo.showUsed) output = L"DISK OK - used space:"; - + double tCap = 0, tFree = 0, tUsed = 0; for (std::vector::iterator it = vDrives.begin(); it != vDrives.end(); it++) { @@ -249,7 +249,7 @@ static INT printOutput(printInfoStruct& printInfo, std::vector& vDrives) if (state == WARNING) { output = L"DISK WARNING - free space:"; - + if (printInfo.showUsed) output = L"DISK WARNING - used space:"; } diff --git a/plugins/check_network.cpp b/plugins/check_network.cpp index 63e4d45ab..c00e8981d 100644 --- a/plugins/check_network.cpp +++ b/plugins/check_network.cpp @@ -57,7 +57,7 @@ INT wmain(INT argc, WCHAR **argv) ret = check_network(vInterfaces); if (ret != -1) return ret; - + return printOutput(printInfo, vInterfaces, mapNames); } @@ -157,7 +157,7 @@ INT parseArguments(INT ac, WCHAR **av, po::variables_map& vm, printInfoStruct& p return 3; } } - + if (vm.count("debug")) debug = TRUE; @@ -249,11 +249,11 @@ INT check_network(std::vector & vInterfaces) err = PdhAddEnglishCounter(phQuery, perfIn, NULL, &phCounterIn); if (!SUCCEEDED(err)) goto die; - + err = PdhAddEnglishCounter(phQuery, perfOut, NULL, &phCounterOut); if (!SUCCEEDED(err)) goto die; - + if (debug) std::wcout << L"Collecting first batch of query data" << '\n'; @@ -275,13 +275,13 @@ INT check_network(std::vector & vInterfaces) if (debug) std::wcout << L"Creating formatted counter arrays" << '\n'; - + err = PdhGetFormattedCounterArray(phCounterIn, PDH_FMT_LONG, &dwBufferSizeIn, &dwItemCount, pDisplayValuesIn); if (err == PDH_MORE_DATA || SUCCEEDED(err)) pDisplayValuesIn = reinterpret_cast(new BYTE[dwItemCount*dwBufferSizeIn]); else goto die; - + err = PdhGetFormattedCounterArray(phCounterOut, PDH_FMT_LONG, &dwBufferSizeOut, &dwItemCount, pDisplayValuesOut); if (err == PDH_MORE_DATA || SUCCEEDED(err)) pDisplayValuesOut = reinterpret_cast(new BYTE[dwItemCount*dwBufferSizeIn]); diff --git a/plugins/check_ping.cpp b/plugins/check_ping.cpp index 1cbdbe373..2c1ccf506 100644 --- a/plugins/check_ping.cpp +++ b/plugins/check_ping.cpp @@ -454,7 +454,7 @@ INT check_ping6(CONST printInfoStruct& pi, response& response) std::wcout << L"Dropped: echo reply status " << pEchoReply->Status << '\n'; continue; } - + rtt += pEchoReply->RoundTripTime; if (debug) diff --git a/plugins/check_procs.cpp b/plugins/check_procs.cpp index c698ab5fa..70d57e6d7 100644 --- a/plugins/check_procs.cpp +++ b/plugins/check_procs.cpp @@ -292,7 +292,7 @@ INT countProcs(CONST std::wstring user) DomainName = NULL; dwAcctName = 1; dwDomainName = 1; - + if (debug) std::wcout << L"Looking up SID" << '\n'; @@ -301,7 +301,7 @@ INT countProcs(CONST std::wstring user) (LPDWORD)&dwAcctName, DomainName, (LPDWORD)&dwDomainName, &sidNameUse) && GetLastError() != ERROR_INSUFFICIENT_BUFFER) continue; - + AcctName = reinterpret_cast(new WCHAR[dwAcctName]); DomainName = reinterpret_cast(new WCHAR[dwDomainName]); @@ -316,7 +316,7 @@ INT countProcs(CONST std::wstring user) if (debug) std::wcout << L"Is process of " << wuser << L" (" << numProcs << L")" << '\n'; } - + delete[] reinterpret_cast(AcctName); delete[] reinterpret_cast(DomainName); diff --git a/plugins/check_service.cpp b/plugins/check_service.cpp index fbd7ef257..d92b2f7dd 100644 --- a/plugins/check_service.cpp +++ b/plugins/check_service.cpp @@ -132,7 +132,7 @@ INT parseArguments(INT ac, WCHAR **av, po::variables_map& vm, printInfoStruct& p if (vm.count("D")) debug = TRUE; - + return -1; } @@ -269,7 +269,7 @@ DWORD ServiceStatus(CONST printInfoStruct& printInfo) hService = OpenService(hSCM, printInfo.service.c_str(), SERVICE_QUERY_STATUS); if (hService == NULL) goto die; - + QueryServiceStatusEx(hService, SC_STATUS_PROCESS_INFO, NULL, 0, &cbBufSize); if (GetLastError() != ERROR_INSUFFICIENT_BUFFER) goto die; diff --git a/plugins/check_update.cpp b/plugins/check_update.cpp index d739bc636..27af5e1da 100644 --- a/plugins/check_update.cpp +++ b/plugins/check_update.cpp @@ -40,7 +40,7 @@ INT wmain(INT argc, WCHAR **argv) INT ret = parseArguments(argc, argv, vm, printInfo); if (ret != -1) return ret; - + ret = check_update(printInfo); if (ret != -1) return ret; diff --git a/plugins/check_uptime.cpp b/plugins/check_uptime.cpp index 568bb23eb..0eee377a9 100644 --- a/plugins/check_uptime.cpp +++ b/plugins/check_uptime.cpp @@ -35,7 +35,7 @@ INT wmain(INT argc, WCHAR **argv) po::variables_map vm; printInfoStruct printInfo = { }; INT ret = parseArguments(argc, argv, vm, printInfo); - + if (ret != -1) return ret; @@ -51,7 +51,7 @@ INT parseArguments(INT ac, WCHAR **av, po::variables_map& vm, printInfoStruct& p WCHAR *progName = PathFindFileName(namePath); po::options_description desc; - + desc.add_options() ("help,h", "Print help message and exit") ("version,V", "Print version and exit") @@ -198,7 +198,7 @@ VOID getUptime(printInfoStruct& printInfo) std::wcout << L"Getting uptime in milliseconds" << '\n'; boost::chrono::milliseconds uptime = boost::chrono::milliseconds(GetTickCount64()); - + if (debug) std::wcout << L"Converting requested unit (default: seconds)" << '\n'; diff --git a/plugins/check_users.cpp b/plugins/check_users.cpp index 2ee25e154..03f873747 100644 --- a/plugins/check_users.cpp +++ b/plugins/check_users.cpp @@ -185,7 +185,7 @@ INT check_users(printInfoStruct& printInfo) if (debug) std::wcout << L"Trying to enumerate terminal sessions" << '\n'; - + if (!WTSEnumerateSessions(WTS_CURRENT_SERVER_HANDLE, 0, 1, &pSessionInfo, &count)) { std::wcout << L"Failed to enumerate terminal sessions" << '\n'; die(); @@ -218,7 +218,7 @@ INT check_users(printInfoStruct& printInfo) if (!len) continue; - + if (pSessionInfo[index].State == WTSActive || pSessionInfo[index].State == WTSDisconnected) { users++; if (debug) diff --git a/plugins/thresholds.cpp b/plugins/thresholds.cpp index 8070912e6..29aede818 100644 --- a/plugins/thresholds.cpp +++ b/plugins/thresholds.cpp @@ -122,7 +122,7 @@ std::wstring threshold::pString(CONST DOUBLE max) .append(upperStr).append(L"]"); } else s.append(lowerStr); - + return s; }