diff --git a/index.c b/index.c index cd14d30b..2308dc26 100644 --- a/index.c +++ b/index.c @@ -36,7 +36,7 @@ void mm_idx_destroy(mm_idx_t *mi) } for (i = 0; i < mi->n_seq; ++i) free(mi->seq[i].name); - free(mi->seq); free(mi->B); free(mi); + free(mi->seq); free(mi->B); free(mi->S); free(mi); } const uint64_t *mm_idx_get(const mm_idx_t *mi, uint64_t minier, int *n) diff --git a/kalloc.c b/kalloc.c index 2def1bb9..6eb66563 100644 --- a/kalloc.c +++ b/kalloc.c @@ -140,7 +140,7 @@ void *krealloc(void *_km, void *ap, size_t n_bytes) n_units = 1 + (n_bytes + sizeof(size_t) - 1) / sizeof(size_t); p = (size_t*)ap - 1; if (*p >= n_units) return ap; - q = kmalloc(km, n_bytes); + q = (size_t*)kmalloc(km, n_bytes); if (q != ap) memcpy(q, ap, (*p - 1) * sizeof(size_t)); kfree(km, ap); return q; @@ -182,7 +182,7 @@ void *kmalloc(void *_km, size_t n_bytes) void *kcalloc(void *_km, size_t count, size_t size) { kmem_t *km = (kmem_t*)_km; - char *p; + void *p; if (size == 0 || count == 0) return 0; if (km == 0) return calloc(count, size); p = kmalloc(km, count * size); diff --git a/main.c b/main.c index 3dfad8ee..437ebd2e 100644 --- a/main.c +++ b/main.c @@ -131,8 +131,8 @@ int main(int argc, char *argv[]) /* for (i = optind + 1; i < argc; ++i) mm_map_file(mi, argv[i], &opt, n_threads, mini_batch_size); - mm_idx_destroy(mi); */ + mm_idx_destroy(mi); } if (fpw) fclose(fpw); if (fpr) fclose(fpr); diff --git a/sdust.h b/sdust.h index 623899a3..47a71651 100644 --- a/sdust.h +++ b/sdust.h @@ -1,6 +1,8 @@ #ifndef SDUST_H #define SDUST_H +#include + struct sdust_buf_s; typedef struct sdust_buf_s sdust_buf_t;