|
1 | 1 | // -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*- |
2 | 2 | //----------------------------------------------------------------------------- |
3 | | -// Copyright 2000-2023 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com) |
| 3 | +// Copyright 2000-2024 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com) |
4 | 4 | // See the top-level COPYRIGHT file for details. |
5 | 5 | // SPDX-License-Identifier: Apache-2.0 |
6 | 6 | //----------------------------------------------------------------------------- |
7 | 7 | /*---------------------------------------------------------------------------*/ |
8 | | -/* Span.h (C) 2000-2023 */ |
| 8 | +/* Span.h (C) 2000-2024 */ |
9 | 9 | /* */ |
10 | 10 | /* Vues sur des tableaux C. */ |
11 | 11 | /*---------------------------------------------------------------------------*/ |
@@ -854,11 +854,11 @@ asSpanInternal(Span<ByteType,Extent> bytes) |
854 | 854 | Int64 size = bytes.size(); |
855 | 855 | if (size==0) |
856 | 856 | return {}; |
857 | | - static constexpr Int64 data_type = static_cast<Int64>(sizeof(data_type)); |
858 | | - static_assert(data_type>0,"Bad datatype size"); |
859 | | - ARCCORE_ASSERT((size%data_type)==0,("Size is not a multiple of sizeof(DataType)")); |
| 857 | + static constexpr Int64 data_type_size = static_cast<Int64>(sizeof(DataType)); |
| 858 | + static_assert(data_type_size>0,"Bad datatype size"); |
| 859 | + ARCCORE_ASSERT((size%data_type_size)==0,("Size is not a multiple of sizeof(DataType)")); |
860 | 860 | auto* ptr = reinterpret_cast<DataType*>(bytes.data()); |
861 | | - return { ptr, size / data_type }; |
| 861 | + return { ptr, size / data_type_size }; |
862 | 862 | } |
863 | 863 |
|
864 | 864 | } |
|
0 commit comments