Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
ogs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Chaofan Chen
ogs
Commits
d60e5560
Commit
d60e5560
authored
3 years ago
by
Dmitri Naumov
Browse files
Options
Downloads
Patches
Plain Diff
[MeL/VTK] Move one of if-cnds in static assert.
parent
80f72c23
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
MeshLib/MeshGenerators/VtkMeshConverter.cpp
+11
-27
11 additions, 27 deletions
MeshLib/MeshGenerators/VtkMeshConverter.cpp
with
11 additions
and
27 deletions
MeshLib/MeshGenerators/VtkMeshConverter.cpp
+
11
−
27
View file @
d60e5560
...
@@ -336,8 +336,10 @@ void VtkMeshConverter::convertArray(vtkDataArray& array,
...
@@ -336,8 +336,10 @@ void VtkMeshConverter::convertArray(vtkDataArray& array,
return
;
return
;
}
}
if
constexpr
(
sizeof
(
std
::
int64_t
)
==
sizeof
(
long
long
)
&&
// Ensure, vtkTypeInt64Array and vtkLongLongArray are using the same type.
sizeof
(
long
long
)
==
sizeof
(
long
))
static_assert
(
sizeof
(
std
::
int64_t
)
==
sizeof
(
long
long
));
if
constexpr
(
sizeof
(
long
long
)
==
sizeof
(
long
))
{
{
// This also covers the vtkTypeInt64Array type, which is derived from
// This also covers the vtkTypeInt64Array type, which is derived from
// the vtkLongLongArray type.
// the vtkLongLongArray type.
...
@@ -348,8 +350,7 @@ void VtkMeshConverter::convertArray(vtkDataArray& array,
...
@@ -348,8 +350,7 @@ void VtkMeshConverter::convertArray(vtkDataArray& array,
return
;
return
;
}
}
}
}
else
if
constexpr
(
sizeof
(
std
::
int64_t
)
==
sizeof
(
long
long
)
&&
else
sizeof
(
long
long
)
!=
sizeof
(
long
))
{
{
// This also covers the vtkTypeInt64Array type, which is derived from
// This also covers the vtkTypeInt64Array type, which is derived from
// the vtkLongLongArray type.
// the vtkLongLongArray type.
...
@@ -360,15 +361,6 @@ void VtkMeshConverter::convertArray(vtkDataArray& array,
...
@@ -360,15 +361,6 @@ void VtkMeshConverter::convertArray(vtkDataArray& array,
return
;
return
;
}
}
}
}
else
{
OGS_FATAL
(
"Array '{:s}' in VTU file uses unsupported data type '{:s}' not "
"convertible to long or long long. Size of long is {:d}, size of "
"long long is {:d}."
,
array
.
GetName
(),
array
.
GetDataTypeAsString
(),
sizeof
(
long
),
sizeof
(
long
long
));
}
// This also covers the vtkTypeUInt8Array type, which is derived from the
// This also covers the vtkTypeUInt8Array type, which is derived from the
// vtkUnsignedCharArray type.
// vtkUnsignedCharArray type.
...
@@ -428,8 +420,11 @@ void VtkMeshConverter::convertArray(vtkDataArray& array,
...
@@ -428,8 +420,11 @@ void VtkMeshConverter::convertArray(vtkDataArray& array,
return
;
return
;
}
}
if
constexpr
(
sizeof
(
std
::
uint64_t
)
==
sizeof
(
unsigned
long
long
)
&&
// Ensure, vtkTypeUInt64Array and vtkUnsignedLongLongArray are using the
sizeof
(
unsigned
long
long
)
==
sizeof
(
unsigned
long
))
// same type.
static_assert
(
sizeof
(
std
::
uint64_t
)
==
sizeof
(
unsigned
long
long
));
if
constexpr
(
sizeof
(
unsigned
long
long
)
==
sizeof
(
unsigned
long
))
{
{
// This also covers the vtkTypeUInt64Array type, which is derived from
// This also covers the vtkTypeUInt64Array type, which is derived from
// the vtkUnsignedLongLongArray type.
// the vtkUnsignedLongLongArray type.
...
@@ -441,8 +436,7 @@ void VtkMeshConverter::convertArray(vtkDataArray& array,
...
@@ -441,8 +436,7 @@ void VtkMeshConverter::convertArray(vtkDataArray& array,
return
;
return
;
}
}
}
}
else
if
constexpr
(
sizeof
(
std
::
uint64_t
)
==
sizeof
(
unsigned
long
long
)
&&
else
sizeof
(
unsigned
long
long
)
!=
sizeof
(
unsigned
long
))
{
{
// This also covers the vtkTypeUInt64Array type, which is derived from
// This also covers the vtkTypeUInt64Array type, which is derived from
// the vtkUnsignedLongLongArray type.
// the vtkUnsignedLongLongArray type.
...
@@ -453,16 +447,6 @@ void VtkMeshConverter::convertArray(vtkDataArray& array,
...
@@ -453,16 +447,6 @@ void VtkMeshConverter::convertArray(vtkDataArray& array,
return
;
return
;
}
}
}
}
else
{
OGS_FATAL
(
"Array '{:s}' in VTU file uses unsupported data type '{:s}' "
"not convertible to unsigned long or unsigned long long. Size of "
"unsigned long is {:d}, size of unsigned long long is {:d}, size "
"of std::size_t is {:d}."
,
array
.
GetName
(),
array
.
GetDataTypeAsString
(),
sizeof
(
unsigned
long
),
sizeof
(
unsigned
long
long
),
sizeof
(
std
::
size_t
));
}
WARN
(
WARN
(
"Array '{:s}' in VTU file uses unsupported data type '{:s}' of size "
"Array '{:s}' in VTU file uses unsupported data type '{:s}' of size "
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment