comparison src/init.c @ 211:ef80f7c52c6d

add VC2012 project to compile static and dynamic lib, also fix some C issues
author Q <andrea@nocte.co.uk>
date Thu, 27 Mar 2014 09:48:26 +0000
parents f262144347e7
children d383a8c66b5d
comparison
equal deleted inserted replaced
210:c99c00e1c508 211:ef80f7c52c6d
41 41
42 42
43 #ifdef USE_OOURA 43 #ifdef USE_OOURA
44 void xtract_init_ooura_data(xtract_ooura_data *ooura_data, unsigned int N) 44 void xtract_init_ooura_data(xtract_ooura_data *ooura_data, unsigned int N)
45 { 45 {
46 ooura_data->ooura_ip = (int *)calloc(2 + sqrt(N), sizeof(int)); 46 ooura_data->ooura_ip = (int *)calloc(2 + sqrt((double)N), sizeof(int));
47 ooura_data->ooura_w = (double *)calloc(N * 5 / 4, sizeof(double)); 47 ooura_data->ooura_w = (double *)calloc(N * 5 / 4, sizeof(double));
48 ooura_data->initialised = true; 48 ooura_data->initialised = true;
49 } 49 }
50 50
51 void xtract_free_ooura_data(xtract_ooura_data *ooura_data) 51 void xtract_free_ooura_data(xtract_ooura_data *ooura_data)
395 395
396 double *xtract_init_window(const int N, const int type) 396 double *xtract_init_window(const int N, const int type)
397 { 397 {
398 double *window; 398 double *window;
399 399
400 window = malloc(N * sizeof(double)); 400 window = (double*)malloc(N * sizeof(double));
401 401
402 switch (type) 402 switch (type)
403 { 403 {
404 case XTRACT_GAUSS: 404 case XTRACT_GAUSS:
405 gauss(window, N, 0.4); 405 gauss(window, N, 0.4);
442 } 442 }
443 443
444 #ifdef __GNUC__ 444 #ifdef __GNUC__
445 __attribute__((constructor)) void init() 445 __attribute__((constructor)) void init()
446 #else 446 #else
447 void _init()ยท 447 void _init()
448 #endif 448 #endif
449 { 449 {
450 #ifdef USE_OOURA 450 #ifdef USE_OOURA
451 ooura_data_dct.initialised = false; 451 ooura_data_dct.initialised = false;
452 ooura_data_spectrum.initialised = false; 452 ooura_data_spectrum.initialised = false;