File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -13,14 +13,14 @@ template <class T>
13
13
class WeightedTable
14
14
{
15
15
public:
16
- WeightedTable () :
16
+ WeightedTable () noexcept :
17
17
entries (nullptr ), size(0 )
18
18
{
19
19
}
20
20
21
21
void AddWeightedEntry (T value, unsigned int weight)
22
22
{
23
- T * newEntries = static_cast <T *>(realloc (entries, (size + weight) * sizeof (T)));
23
+ T * newEntries = static_cast <T *>(realloc (entries, (( size_t ) size + weight) * sizeof (T)));
24
24
if (newEntries == nullptr )
25
25
{
26
26
// Should throw something better
Original file line number Diff line number Diff line change 54
54
#pragma warning(disable:25040) // False Constant Expr in OR, e.g., <expr> || 0.
55
55
#pragma warning(disable:25041) // 'if' condition is always true
56
56
#pragma warning(disable:25042) // 'if' condition is always false
57
+ #pragma warning(disable:26434) // function definition hides a non-virtual function
57
58
#pragma warning(disable:26437) // avoid slicing - this is more of a guideline than a rule, and we don't do it often regardless
58
59
#pragma warning(disable:26439) // noexcept specifier implied
59
60
#pragma warning(disable:26451) // doing math on smaller types than possible
You can’t perform that action at this time.
0 commit comments