feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5pitchshiftsamplertimestretchyinfft+
Last change
on this file since 053495b was
158e031,
checked in by Paul Brossier <piem@piem.org>, 11 years ago
|
tests/: add void to prototypes to build with -Wstrict-prototypes
|
-
Property mode set to
100644
|
File size:
988 bytes
|
Line | |
---|
1 | #include <time.h> |
---|
2 | #include <stdlib.h> |
---|
3 | #include <stdio.h> |
---|
4 | #include <math.h> |
---|
5 | #include <assert.h> |
---|
6 | #include "config.h" |
---|
7 | |
---|
8 | #define PRINT_ERR(format, args...) fprintf(stderr, "AUBIO-TESTS ERROR: " format , ##args) |
---|
9 | #define PRINT_MSG(format, args...) fprintf(stdout, format , ##args) |
---|
10 | #define PRINT_DBG(format, args...) fprintf(stderr, format , ##args) |
---|
11 | #define PRINT_WRN(format, args...) fprintf(stderr, "AUBIO-TESTS WARNING: " format, ##args) |
---|
12 | |
---|
13 | #ifdef HAVE_WIN_HACKS |
---|
14 | // http://en.wikipedia.org/wiki/Linear_congruential_generator |
---|
15 | // no srandom/random on win32 |
---|
16 | |
---|
17 | uint_t srandom_seed = 1029; |
---|
18 | |
---|
19 | void srandom(uint_t new_seed) { |
---|
20 | srandom_seed = new_seed; |
---|
21 | } |
---|
22 | |
---|
23 | uint_t random(void) { |
---|
24 | srandom_seed = 1664525 * srandom_seed + 1013904223; |
---|
25 | return srandom_seed; |
---|
26 | } |
---|
27 | #endif |
---|
28 | |
---|
29 | void utils_init_random (void); |
---|
30 | |
---|
31 | void utils_init_random (void) { |
---|
32 | time_t now = time(0); |
---|
33 | struct tm *tm_struct = localtime(&now); |
---|
34 | int seed = tm_struct->tm_sec; |
---|
35 | //PRINT_WRN("current seed: %d\n", seed); |
---|
36 | srandom (seed); |
---|
37 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.