Skip to content

Commit 24cf27a

Browse files
committed
Fix warnings
1 parent cbc6512 commit 24cf27a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

c/tskit/genotypes.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ tsk_haplotype_build_mutation_index(tsk_haplotype_t *self)
212212
}
213213
self->node_mutation_offsets[0] = 0;
214214
for (j = 0; j < self->num_nodes; j++) {
215-
total_mutations += counts[j];
215+
total_mutations += (tsk_size_t) counts[j];
216216
if (total_mutations > INT32_MAX) {
217217
ret = tsk_trace_error(TSK_ERR_UNSUPPORTED_OPERATION);
218218
goto out;
@@ -281,7 +281,7 @@ tsk_haplotype_build_ancestral_states(tsk_haplotype_t *self)
281281
}
282282

283283
self->ancestral_states
284-
= tsk_malloc(self->num_sites * sizeof(*self->ancestral_states));
284+
= tsk_malloc((tsk_size_t) self->num_sites * sizeof(*self->ancestral_states));
285285
if (self->ancestral_states == NULL) {
286286
return tsk_trace_error(TSK_ERR_NO_MEMORY);
287287
}

0 commit comments

Comments
 (0)