From: Naffanya Date: Mon, 27 May 2013 16:52:49 +0000 (+0300) Subject: Correcting code X-Git-Url: https://git.stg.codes/stg.git/commitdiff_plain/55e291c991d3132ad4e5b5513a04bbce779e2b6c Correcting code --- diff --git a/include/stg/settings.h b/include/stg/settings.h index 38543988..170f71ca 100644 --- a/include/stg/settings.h +++ b/include/stg/settings.h @@ -26,23 +26,23 @@ class SETTINGS { public: virtual ~SETTINGS() {} - virtual const std::string & GetDirName(size_t num) const = 0; - virtual const std::string & GetScriptsDir() const = 0; - virtual unsigned GetDetailStatWritePeriod() const = 0; - virtual unsigned GetStatWritePeriod() const = 0; - virtual unsigned GetDayFee() const = 0; - virtual bool GetFullFee() const = 0; - virtual unsigned GetDayResetTraff() const = 0; - virtual bool GetSpreadFee() const = 0; - virtual bool GetFreeMbAllowInet() const = 0; - virtual bool GetDayFeeIsLastDay() const = 0; - virtual bool GetWriteFreeMbTraffCost() const = 0; - virtual bool GetShowFeeInCash() const = 0; - virtual unsigned GetMessageTimeout() const = 0; - virtual unsigned GetFeeChargeType() const = 0; - virtual bool GetReconnectOnTariffChange() const = 0; - virtual const std::string & GetMonitorDir() const = 0; - virtual bool GetMonitoring() const = 0; + virtual const std::string & GetDirName(size_t num) const = 0; + virtual const std::string & GetScriptsDir() const = 0; + virtual unsigned GetDetailStatWritePeriod() const = 0; + virtual unsigned GetStatWritePeriod() const = 0; + virtual unsigned GetDayFee() const = 0; + virtual bool GetFullFee() const = 0; + virtual unsigned GetDayResetTraff() const = 0; + virtual bool GetSpreadFee() const = 0; + virtual bool GetFreeMbAllowInet() const = 0; + virtual bool GetDayFeeIsLastDay() const = 0; + virtual bool GetWriteFreeMbTraffCost() const = 0; + virtual bool GetShowFeeInCash() const = 0; + virtual unsigned GetMessageTimeout() const = 0; + virtual unsigned GetFeeChargeType() const = 0; + virtual bool GetReconnectOnTariffChange() const = 0; + virtual const std::string & GetMonitorDir() const = 0; + virtual bool GetMonitoring() const = 0; virtual const std::vector & GetScriptParams() const = 0; }; //----------------------------------------------------------------------------- diff --git a/projects/stargazer/main.cpp b/projects/stargazer/main.cpp index c7bfb4aa..8d0f6d20 100644 --- a/projects/stargazer/main.cpp +++ b/projects/stargazer/main.cpp @@ -270,17 +270,16 @@ if (settings->ReadSettings()) WriteServLog("ReadSettings error. %s", settings->GetStrError().c_str()); exit(1); } -/*************************************************************************************************/ -//вывод scriptParams + /*************************************************************************************************/ printfd(__FILE__, "--- Script params dump ---\n"); std::vector::const_iterator it(settings->GetScriptParams().begin()); while (it != settings->GetScriptParams().end()) - { + { printfd(__FILE__, "%s\n", it->c_str()); - it++; - } + ++it; + } printfd(__FILE__, "--- End dump ---\n"); -/*************************************************************************************************/ + /*************************************************************************************************/ #ifndef NO_DAEMON std::string startFile(settings->GetConfDir() + START_FILE); diff --git a/projects/stargazer/settings_impl.cpp b/projects/stargazer/settings_impl.cpp index 8e4accee..8511794c 100644 --- a/projects/stargazer/settings_impl.cpp +++ b/projects/stargazer/settings_impl.cpp @@ -458,15 +458,12 @@ while (node) } if (strcasecmp(node->getName(), "ScriptParams") == 0) - { - int i; - i=0; - while (node->getValue(i)!=NULL) { + for (int i = 0; node->getValue(i) != NULL; ++i) + { scriptParams.push_back(node->getValue(i)); - i++; + } } - } node = node->getNextNode(); } diff --git a/projects/stargazer/settings_impl.h b/projects/stargazer/settings_impl.h index 3bee1547..42f3541d 100644 --- a/projects/stargazer/settings_impl.h +++ b/projects/stargazer/settings_impl.h @@ -99,7 +99,7 @@ public: const std::vector & GetModulesSettings() const { return modulesSettings; } - const std::vector & GetScriptParams() const {return scriptParams; } + const std::vector & GetScriptParams() const { return scriptParams; } private: