Skip to content

Commit acfd3b4

Browse files
Address review comments.
1 parent 39d2244 commit acfd3b4

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/app/util/attribute-storage-null-handling.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ struct NumericAttributeTraits
138138

139139
if (isNullable)
140140
{
141-
// Smallest negative value is excluded for nullable types.
141+
// Smallest negative value is excluded for nullable signed types.
142142
return static_cast<WorkingType>(std::numeric_limits<WorkingType>::min() + 1);
143143
}
144144

@@ -154,7 +154,7 @@ struct NumericAttributeTraits
154154

155155
if (isNullable)
156156
{
157-
// Largest value is excluded for nullable types.
157+
// Largest value is excluded for nullable unsigned types.
158158
return static_cast<WorkingType>(std::numeric_limits<WorkingType>::max() - 1);
159159
}
160160

src/app/util/odd-sized-integers.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ struct NumericAttributeTraits<OddSizedInteger<ByteSize, IsSigned>, IsBigEndian>
221221
constexpr WorkingType signedMin = -(static_cast<WorkingType>(1) << (8 * ByteSize - 1));
222222
if (isNullable)
223223
{
224-
// We have one fewer value.
224+
// Smallest negative value is excluded for nullable signed types.
225225
return signedMin + 1;
226226
}
227227

@@ -237,10 +237,10 @@ struct NumericAttributeTraits<OddSizedInteger<ByteSize, IsSigned>, IsBigEndian>
237237
return (static_cast<WorkingType>(1) << (8 * ByteSize - 1)) - 1;
238238
}
239239

240-
constexpr WorkingType unsignedMax = (static_cast<WorkingType>(1) << (8 * ByteSize));
240+
constexpr WorkingType unsignedMax = (static_cast<WorkingType>(1) << (8 * ByteSize)) - 1;
241241
if (isNullable)
242242
{
243-
// Largest value is excluded for nullable types.
243+
// Largest value is excluded for nullable unsigned types.
244244
return unsignedMax - 1;
245245
}
246246

0 commit comments

Comments
 (0)