ref: 7939860c62433745bc57f9077c1266edd2174e2a
parent: 820bb5a5a1f99dced91a8d53dec417857cb15286
author: Paul Batchelor <[email protected]>
date: Sun Feb 7 02:49:41 EST 2021
removed sp_ftbl_init
--- a/h/ftbl.h
+++ b/h/ftbl.h
@@ -7,7 +7,6 @@
} sp_ftbl;
int sp_ftbl_create(sp_data *sp, sp_ftbl **ft, size_t size);
-int sp_ftbl_init(sp_data *sp, sp_ftbl *ft, size_t size);
int sp_ftbl_bind(sp_data *sp, sp_ftbl **ft, SPFLOAT *tbl, size_t size);
int sp_ftbl_destroy(sp_ftbl **ft);
int sp_ftbl_loadfile(sp_data *sp, sp_ftbl **ft, const char *filename);
--- a/lib/spa/spa.c
+++ b/lib/spa/spa.c
@@ -85,7 +85,7 @@
size = spa.header.len;
ftp->tbl = malloc(sizeof(SPFLOAT) * (size + 1));
- sp_ftbl_init(sp, ftp, size);
+ ftp->size = size;
spa_read_buf(sp, &spa, ftp->tbl, ftp->size);
spa_close(&spa);
--- a/modules/ftbl.c
+++ b/modules/ftbl.c
@@ -14,13 +14,6 @@
#define tpd360 0.0174532925199433
-int sp_ftbl_init(sp_data *sp, sp_ftbl *ft, size_t size)
-{
- ft->size = size;
- memset(ft->tbl, 0, sizeof(SPFLOAT) * size);
- return SP_OK;
-}
-
int sp_ftbl_create(sp_data *sp, sp_ftbl **ft, size_t size)
{
sp_ftbl *ftp;
@@ -27,7 +20,7 @@
*ft = malloc(sizeof(sp_ftbl));
ftp = *ft;
ftp->tbl = calloc(1, sizeof(SPFLOAT) * (size + 1));
- sp_ftbl_init(sp, ftp, size);
+ ftp->size = size;
return SP_OK;
}
--- a/modules/loadwav.c
+++ b/modules/loadwav.c
@@ -18,8 +18,8 @@
*ft = malloc(sizeof(sp_ftbl));
ftp = *ft;
ftp->tbl = calloc(1, sizeof(SPFLOAT) * size);
+ ftp->size = size;
tbl = ftp->tbl;
- sp_ftbl_init(sp, ftp, size);
sp_drwav_read_f32(wav, size, tbl);
sp_drwav_uninit(wav);
free(wav);