@@ -31,8 +31,9 @@ namespace UE
3131 result = static_cast <T>(grow);
3232 }
3333
34- if (a_num > result)
34+ if (a_num > result) {
3535 result = std::numeric_limits<T>::max ();
36+ }
3637
3738 return result;
3839 }
@@ -45,9 +46,10 @@ namespace UE
4546 assert (a_num > 0 );
4647
4748 if (a_allowQuantize) {
48- result = static_cast <T>(FMemory::QuantizeSize (static_cast <std::size_t >(result) * static_cast <std:: size_t >( a_numBytes) , a_alignment) / a_numBytes);
49- if (a_num > result)
49+ result = static_cast <T>(FMemory::QuantizeSize (static_cast <std::size_t >(result) * a_numBytes, a_alignment) / a_numBytes);
50+ if (a_num > result) {
5051 result = std::numeric_limits<T>::max ();
52+ }
5153 }
5254
5355 return result;
@@ -64,8 +66,9 @@ namespace UE
6466 const std::size_t slackBytes = (a_numAlloc - a_num) * a_numBytes;
6567 if ((slackBytes >= 16384 || 3 * a_num < 2 * a_numAlloc) && (slackElements > 64 || !a_num)) {
6668 result = a_num;
67- if (result > 0 && a_allowQuantize)
68- result = (T)(FMemory::QuantizeSize (result * a_numBytes, a_alignment) / a_numBytes);
69+ if (result > 0 && a_allowQuantize) {
70+ result = static_cast <T>((FMemory::QuantizeSize (result * a_numBytes, a_alignment) / a_numBytes));
71+ }
6972 } else {
7073 result = a_numAlloc;
7174 }
@@ -90,8 +93,9 @@ namespace UE
9093
9194 ~ForAnyElementType ()
9295 {
93- if (data)
96+ if (data) {
9497 M::Free (data);
98+ }
9599 }
96100
97101 SizeType CalculateSlackReserve (SizeType a_num, std::size_t a_numBytes) const
@@ -139,13 +143,14 @@ namespace UE
139143 return data;
140144 }
141145
142- void ResizeAllocation (SizeType a_numPrevious , SizeType a_num, std::size_t a_numBytes)
146+ void ResizeAllocation (SizeType, SizeType a_num, std::size_t a_numBytes)
143147 {
144148 if (data || a_num) {
145149 bool invalid = a_num < 0 || a_numBytes < 1 || a_numBytes > static_cast <std::size_t >(std::numeric_limits<std::int32_t >::max ());
146150
147- if constexpr (sizeof (SizeType) == sizeof (std::size_t ))
151+ if constexpr (sizeof (SizeType) == sizeof (std::size_t )) {
148152 invalid = invalid || (static_cast <std::size_t >(static_cast <USizeType>(a_num)) > static_cast <std::size_t >(std::numeric_limits<SizeType>::max ()) / a_numBytes);
153+ }
149154
150155 assert (!invalid);
151156
@@ -158,8 +163,9 @@ namespace UE
158163 if (data || a_num) {
159164 bool invalid = a_num < 0 || a_numBytes < 1 || a_numBytes > static_cast <std::size_t >(std::numeric_limits<std::int32_t >::max ());
160165
161- if constexpr (sizeof (SizeType) == sizeof (std::size_t ))
166+ if constexpr (sizeof (SizeType) == sizeof (std::size_t )) {
162167 invalid = invalid || (static_cast <std::size_t >(static_cast <USizeType>(a_num)) > static_cast <std::size_t >(std::numeric_limits<SizeType>::max ()) / a_numBytes);
168+ }
163169
164170 assert (!invalid);
165171
0 commit comments