Fix compilation

This commit is contained in:
Alessandro Ranellucci 2016-11-24 17:54:41 +01:00
parent d88f05945d
commit 048fafb9f9
2 changed files with 9 additions and 1 deletions

View File

@ -57,7 +57,9 @@ typedef struct {
float z;
} stl_vertex;
#ifdef static_assert
static_assert(sizeof(stl_vertex) == 12, "size of stl_vertex incorrect");
#endif
typedef struct {
float x;
@ -65,7 +67,9 @@ typedef struct {
float z;
} stl_normal;
#ifdef static_assert
static_assert(sizeof(stl_normal) == 12, "size of stl_normal incorrect");
#endif
typedef char stl_extra[2];
@ -76,10 +80,12 @@ typedef struct {
} stl_facet;
#define SIZEOF_STL_FACET 50
#ifdef static_assert
static_assert(offsetof(stl_facet, normal) == 0, "stl_facet.normal has correct offset");
static_assert(offsetof(stl_facet, vertex) == 12, "stl_facet.vertex has correct offset");
static_assert(offsetof(stl_facet, extra ) == 48, "stl_facet.extra has correct offset");
static_assert(sizeof(stl_facet) >= SIZEOF_STL_FACET, "size of stl_facet incorrect");
#endif
typedef enum {binary, ascii, inmemory} stl_type;
@ -100,7 +106,9 @@ typedef struct stl_hash_edge {
struct stl_hash_edge *next;
} stl_hash_edge;
#ifdef static_assert
static_assert(offsetof(stl_hash_edge, facet_number) == SIZEOF_EDGE_SORT, "size of stl_hash_edge.key incorrect");
#endif
typedef struct {
// Index of a neighbor facet.

View File

@ -50,7 +50,7 @@ TriangleMesh::TriangleMesh(const TriangleMesh &other)
TriangleMesh& TriangleMesh::operator= (TriangleMesh other)
{
swap(*this, other);
this->swap(other);
return *this;
}