diff --git a/ryzom/common/src/game_share/generate_module_interface.xslt b/ryzom/common/src/game_share/generate_module_interface.xslt index ee87f6ae4..94750a59e 100644 --- a/ryzom/common/src/game_share/generate_module_interface.xslt +++ b/ryzom/common/src/game_share/generate_module_interface.xslt @@ -19,7 +19,22 @@ - +// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/> +// Copyright (C) 2010-2021 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see <http://www.gnu.org/licenses/>. + ///////////////////////////////////////////////////////////////// // WARNING : this is a generated file, don't change it ! ///////////////////////////////////////////////////////////////// @@ -1676,13 +1691,14 @@ namespace { // cascading deletion for vector child - nlassert(load(connection, __FILE__, __LINE__)); - - const std::vector < Ptr > & childs = get(); - - while (!childs.empty()) + if (load(connection, __FILE__, __LINE__)) { - getByIndex(childs.size()-1)->remove(connection); + const std::vector < Ptr > & childs = get(); + + while (!childs.empty()) + { + getByIndex((uint32)childs.size()-1)->remove(connection); + } } } @@ -1690,72 +1706,77 @@ namespace { // cascading deletion for map child - nlassert(load(connection, __FILE__, __LINE__)); - - const std::map < uint32, Ptr > & childs = get(); - - while (!childs.empty()) + if (load(connection, __FILE__, __LINE__)) { - getById(childs.begin()->first)->remove(connection); + const std::map < uint32, Ptr > & childs = get(); + + while (!childs.empty()) + { + getById(childs.begin()->first)->remove(connection); + } } } { // cascading deletion for single child - nlassert(load(connection, __FILE__, __LINE__)); - - if (get() != NULL) - get()->remove(connection); + if (load(connection, __FILE__, __LINE__)) + { + if (get() != NULL) + get()->remove(connection); + } } { // unreference (and update) for vector child - nlassert(load(connection, __FILE__, __LINE__)); - - const std::vector < Ptr > & childs = get(); - - for (uint i=0; i < childs.size(); ++i) + if (load(connection, __FILE__, __LINE__)) { - - - - getByIndex(i)->set(0); - getByIndex(i)->update(connection); + const std::vector < Ptr > & childs = get(); + + for (uint i=0; i < childs.size(); ++i) + { + + + + getByIndex(i)->set(0); + getByIndex(i)->update(connection); + } } } { // unreference (and update) for map child - nlassert(load(connection, __FILE__, __LINE__)); + if (load(connection, __FILE__, __LINE__)) { - const std::map < uint32, Ptr > & childs = get(); - std::map< uint32, Ptr >::const_iterator first(childs.begin()), last(childs.end()); + const std::map < uint32, Ptr > & childs = get(); + std::map< uint32, Ptr >::const_iterator first(childs.begin()), last(childs.end()); - for (; first != last; ++first) - { - - - - getById(it->first)->set(0); - getById(it->first)->update(connection); + for (; first != last; ++first) + { + + + + getById(it->first)->set(0); + getById(it->first)->update(connection); + } } } { // unreference (and update) for single child - nlassert(load(connection, __FILE__, __LINE__)); - - - - - if (get() != NULL) + if (load(connection, __FILE__, __LINE__)) { - get()->set(0); - get()->update(connection); + + + + if (get() != NULL) + { + get()->set(0); + get()->update(connection); + } } } @@ -1886,7 +1907,7 @@ namespace } else if (cmd == NOPE::cc_instance_count) { - return _ObjectCache.size(); + return (uint32)_ObjectCache.size(); } // default return value @@ -1904,7 +1925,7 @@ namespace TReleasedObject::iterator first(_ReleasedObject.begin()), last(_ReleasedObject.end()); for (; first != last; ++first) { - nbReleased += first->second.size(); + nbReleased += (uint32)first->second.size(); } nlinfo(" There are %u object instances in cache not referenced (waiting deletion or re-use))", nbReleased); @@ -2117,7 +2138,7 @@ ERROR : parent/child relation support only 'map' or 'vector' cont specification return false; } - std::auto_ptr<MSW::CStoreResult> result = connection.storeResult(); + CUniquePtr<MSW::CStoreResult> result(connection.storeResult()); for (uint i=0; i<result->getNumRows(); ++i) { @@ -2195,7 +2216,7 @@ ERROR : parent/child relation support only 'map' or 'vector' cont specification return false; } - std::auto_ptr<MSW::CStoreResult> result = connection.storeResult(); + CUniquePtr<MSW::CStoreResult> result(connection.storeResult()); // check that the data description is consistent with database content nlassert(result->getNumRows() <= 1); @@ -2300,9 +2321,9 @@ ERROR : parent/child relation support only 'map' or 'vector' cont specification } // no object with this id, return a null pointer - static Ptr nil; + static Ptr nilPtr; - return nil; + return nilPtr; } @@ -2321,8 +2342,8 @@ ERROR : parent/child relation support only 'map' or 'vector' cont specification if (it == _->end()) { // no object with this id, return a null pointer - static Ptr nil; - return nil; + static Ptr nilPtr; + return nilPtr; } return const_cast< Ptr & >(it->second);