get rid of a visual studio build warning
lnt-arithmetic-overflow A sub-expression may overflow before being assigned to a wider type
This commit is contained in:
@@ -4327,9 +4327,10 @@ dump_weights(void)
|
|||||||
{
|
{
|
||||||
int i, cnt = 0, nmwidth = 49, mcount = NUMMONS, ocount = NUM_OBJECTS;
|
int i, cnt = 0, nmwidth = 49, mcount = NUMMONS, ocount = NUM_OBJECTS;
|
||||||
char nmbuf[BUFSZ], nmbufbase[BUFSZ];
|
char nmbuf[BUFSZ], nmbufbase[BUFSZ];
|
||||||
|
size_t num_entries = (size_t) (mcount + ocount);
|
||||||
|
|
||||||
weightlist = (struct weight_table_entry *)
|
weightlist = (struct weight_table_entry *)
|
||||||
alloc(sizeof (struct weight_table_entry) * (mcount + ocount));
|
alloc(sizeof (struct weight_table_entry) * num_entries);
|
||||||
decl_globals_init();
|
decl_globals_init();
|
||||||
init_objects();
|
init_objects();
|
||||||
for (i = 0; i < mcount; ++i) {
|
for (i = 0; i < mcount; ++i) {
|
||||||
|
|||||||
Reference in New Issue
Block a user