diff --git a/src/lib/geogram/basic/attributes.h b/src/lib/geogram/basic/attributes.h index 772f4f15827d..9367b130381e 100644 --- a/src/lib/geogram/basic/attributes.h +++ b/src/lib/geogram/basic/attributes.h @@ -1078,7 +1078,7 @@ namespace GEO { * instance by passing it by-value to a function). * Use copy() instead. */ - AttributesManager(const AttributesManager& rhs); + AttributesManager(const AttributesManager& rhs) = delete; /** * \brief Forbids copy. @@ -1087,7 +1087,7 @@ namespace GEO { * instance by passing it by-value to a function). * Use copy() instead. */ - const AttributesManager& operator=(const AttributesManager& rhs); + const AttributesManager& operator=(const AttributesManager& rhs) = delete; private: index_t size_; @@ -1442,6 +1442,7 @@ namespace GEO { * \return a modifiable reference to the \p i%th element */ T& operator[](index_t i) { + geo_debug_assert(superclass::is_bound()); geo_debug_assert(i < superclass::nb_elements()); return ((T*)(void*)superclass::base_addr_)[i]; } @@ -1452,6 +1453,7 @@ namespace GEO { * \return a const reference to the \p i%th element */ const T& operator[](index_t i) const { + geo_debug_assert(superclass::is_bound()); geo_debug_assert(i < superclass::nb_elements()); return ((const T*)(void*)superclass::base_addr_)[i]; } @@ -1462,6 +1464,7 @@ namespace GEO { * \param[in] val the value */ void fill(const T& val) { + geo_debug_assert(superclass::is_bound()); for(index_t i=0; i& rhs); + Attribute(const Attribute& rhs) = delete; /** * \brief Forbids copy. */ - Attribute& operator=(const Attribute& rhs); + Attribute& operator=(const Attribute& rhs) = delete; }; /*********************************************************************/ @@ -1705,11 +1708,11 @@ namespace GEO { /** * \brief Forbids copy. */ - Attribute(const Attribute& rhs); + Attribute(const Attribute& rhs) = delete; /** * \brief Forbids copy. */ - Attribute& operator=(const Attribute& rhs); + Attribute& operator=(const Attribute& rhs) = delete; } ; /***********************************************************/ diff --git a/src/lib/geogram/basic/geofile.cpp b/src/lib/geogram/basic/geofile.cpp index b2c778831c57..50491000d133 100644 --- a/src/lib/geogram/basic/geofile.cpp +++ b/src/lib/geogram/basic/geofile.cpp @@ -161,6 +161,10 @@ namespace { #else + // Normally it will not get there (64 bit file offsets are supported under + // Linux, Mac and Windows), but I keep the fallback here (for Android and + // Emscripten for instance). + #ifdef GEO_OS_WINDOWS typedef GEO::Numeric::int64 ssize_t; #endif diff --git a/src/lib/geogram/basic/geofile.h b/src/lib/geogram/basic/geofile.h index 2f8b0c2460cf..17de904354c7 100644 --- a/src/lib/geogram/basic/geofile.h +++ b/src/lib/geogram/basic/geofile.h @@ -536,7 +536,7 @@ namespace GEO { * \brief Reads a 32-bit integer from the file. * \details Checks that I/O was completed and throws a * GeoFileException if the file is truncated. - * \return the read integer + * \return the read integer converted to index_t */ index_t read_index_t_32(); diff --git a/src/lib/geogram/mesh/mesh.h b/src/lib/geogram/mesh/mesh.h index b3ff62e0de42..dd461128589d 100644 --- a/src/lib/geogram/mesh/mesh.h +++ b/src/lib/geogram/mesh/mesh.h @@ -2754,7 +2754,9 @@ namespace GEO { * \brief Copies a mesh onto this one * \param[in] rhs a const reference to the mesh to be copied * \param[in] copy_attributes if true, all the attributes are - * copied. + * copied. If not set, all attributes of this mesh are + * deleted, and Attribute instances connected to this mesh + * are unbound. * \param[in] what a combination of MESH_VERTICES, MESH_EDGES, * MESH_FACETS, MESH_CELLS flags. Set to MESH_ALL_ELEMENTS * to copy everything (default). If MESH_VERTICES is not set, diff --git a/src/lib/geogram/mesh/mesh_io.cpp b/src/lib/geogram/mesh/mesh_io.cpp index d9c88af907fa..59a161a5ca51 100644 --- a/src/lib/geogram/mesh/mesh_io.cpp +++ b/src/lib/geogram/mesh/mesh_io.cpp @@ -380,8 +380,8 @@ namespace GEO { facet_tex_vertices.size() != facet_vertices.size() ) { Logger::err("I/O") - << "Line " << in.line_number() - << ": some facet vertices do not have tex vertices" + << "Line " << in.line_number() << ": " + << "some facet vertices do not have tex vertices" << std::endl; unbind_attributes(); return false; @@ -3748,12 +3748,13 @@ namespace GEO { in.current_attribute().element_type ) ) { - Logger::warn("I/O") << "Skipping attribute " - << in.current_attribute().name - << ":" - << demangle(in.current_attribute().element_type) - << " (unknown type)" - << std::endl; + Logger::warn("I/O") + << "Skipping attribute " + << in.current_attribute().name + << ":" + << demangle(in.current_attribute().element_type) + << " (unknown type)" + << std::endl; return; } AttributeStore* store = diff --git a/src/lib/geogram/numerics/multi_precision.cpp b/src/lib/geogram/numerics/multi_precision.cpp index 42d0a3182586..3b958bb70744 100644 --- a/src/lib/geogram/numerics/multi_precision.cpp +++ b/src/lib/geogram/numerics/multi_precision.cpp @@ -455,7 +455,7 @@ namespace { // into code, indices in the article go from 1 to m, and in the // code they go from 0 to m-1 !!! // /!\ there is a bug in the original article, - // line 14 of the algorigthm should be h_top <= q (small q and not capital Q) + // line 14 of the algorithm should be h_top <= q (small q and not capital Q) /** * \brief Compresses an expansion