X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/1347f3d1e04bedd1508589173f577673ee2c5554..8f46a826a07310dbd76e4b3a15f63ae055272542:/projects/stargazer/corps_impl.cpp?ds=sidebyside diff --git a/projects/stargazer/corps_impl.cpp b/projects/stargazer/corps_impl.cpp index a366f466..343df4bc 100644 --- a/projects/stargazer/corps_impl.cpp +++ b/projects/stargazer/corps_impl.cpp @@ -15,16 +15,17 @@ */ /* - * Author : Maxim Mamontov + * Author : Maksym Mamontov */ -#include -#include -#include +#include "corps_impl.h" #include "stg/admin.h" #include "stg/common.h" -#include "corps_impl.h" + +#include +#include +#include //----------------------------------------------------------------------------- CORPORATIONS_IMPL::CORPORATIONS_IMPL(STORE * st) @@ -43,7 +44,7 @@ Read(); //----------------------------------------------------------------------------- int CORPORATIONS_IMPL::Add(const CORP_CONF & corp, const ADMIN * admin) { -STG_LOCKER lock(&mutex, __FILE__, __LINE__); +STG_LOCKER lock(&mutex); const PRIV * priv = admin->GetPriv(); if (!priv->corpChg) @@ -81,7 +82,7 @@ return -1; //----------------------------------------------------------------------------- int CORPORATIONS_IMPL::Del(const std::string & name, const ADMIN * admin) { -STG_LOCKER lock(&mutex, __FILE__, __LINE__); +STG_LOCKER lock(&mutex); const PRIV * priv = admin->GetPriv(); if (!priv->corpChg) @@ -107,7 +108,7 @@ while (csi != searchDescriptors.end()) { if (csi->second == si) (csi->second)++; - csi++; + ++csi; } data.remove(*si); @@ -125,7 +126,7 @@ return 0; //----------------------------------------------------------------------------- int CORPORATIONS_IMPL::Change(const CORP_CONF & corp, const ADMIN * admin) { -STG_LOCKER lock(&mutex, __FILE__, __LINE__); +STG_LOCKER lock(&mutex); const PRIV * priv = admin->GetPriv(); if (!priv->corpChg) @@ -161,7 +162,7 @@ return 0; //----------------------------------------------------------------------------- bool CORPORATIONS_IMPL::Read() { -STG_LOCKER lock(&mutex, __FILE__, __LINE__); +STG_LOCKER lock(&mutex); std::vector corpsList; if (store->GetCorpsList(&corpsList) < 0) { @@ -188,7 +189,7 @@ bool CORPORATIONS_IMPL::Find(const std::string & name, CORP_CONF * corp) { assert(corp != NULL && "Pointer to corporation is not null"); -STG_LOCKER lock(&mutex, __FILE__, __LINE__); +STG_LOCKER lock(&mutex); if (data.empty()) return false; @@ -205,7 +206,7 @@ return true; //----------------------------------------------------------------------------- bool CORPORATIONS_IMPL::Exists(const std::string & name) const { -STG_LOCKER lock(&mutex, __FILE__, __LINE__); +STG_LOCKER lock(&mutex); if (data.empty()) { printfd(__FILE__, "no admin in system!\n"); @@ -222,7 +223,7 @@ return false; //----------------------------------------------------------------------------- int CORPORATIONS_IMPL::OpenSearch() const { -STG_LOCKER lock(&mutex, __FILE__, __LINE__); +STG_LOCKER lock(&mutex); handle++; searchDescriptors[handle] = data.begin(); return handle; @@ -230,7 +231,7 @@ return handle; //----------------------------------------------------------------------------- int CORPORATIONS_IMPL::SearchNext(int h, CORP_CONF * corp) const { -STG_LOCKER lock(&mutex, __FILE__, __LINE__); +STG_LOCKER lock(&mutex); if (searchDescriptors.find(h) == searchDescriptors.end()) { WriteServLog("CORPORATIONS. Incorrect search handle."); @@ -247,7 +248,7 @@ return 0; //----------------------------------------------------------------------------- int CORPORATIONS_IMPL::CloseSearch(int h) const { -STG_LOCKER lock(&mutex, __FILE__, __LINE__); +STG_LOCKER lock(&mutex); if (searchDescriptors.find(h) != searchDescriptors.end()) { searchDescriptors.erase(searchDescriptors.find(h));