diff options
author | Vito Caputo <vcaputo@pengaru.com> | 2023-05-23 22:24:13 -0700 |
---|---|---|
committer | Vito Caputo <vcaputo@pengaru.com> | 2023-05-23 22:24:13 -0700 |
commit | fffa21663da84250469dec2da26062f66a8c171a (patch) | |
tree | 7c138088cd09515efc9c3e6050c57ed672af18d3 | |
parent | e72be78e98b166e5b6dcdc7ec7b22d2b4d9ee5ca (diff) |
libs/sig: mechanical rename sig_t->sig_sig_t
sig_t collides with some signals-related system header on macos.
Just prefix it under the sig namespace.. leaving sig_ops alone
for now, but maybe they'll become sig_sig_ops in the future too.
Note nothing in master actually uses libs/sig currently, but I
have an experimental branch with a dusty module using it.
-rw-r--r-- | src/libs/sig/ops_abs.c | 4 | ||||
-rw-r--r-- | src/libs/sig/ops_add.c | 6 | ||||
-rw-r--r-- | src/libs/sig/ops_ceil.c | 4 | ||||
-rw-r--r-- | src/libs/sig/ops_clamp.c | 8 | ||||
-rw-r--r-- | src/libs/sig/ops_div.c | 6 | ||||
-rw-r--r-- | src/libs/sig/ops_expand.c | 6 | ||||
-rw-r--r-- | src/libs/sig/ops_floor.c | 4 | ||||
-rw-r--r-- | src/libs/sig/ops_inv.c | 4 | ||||
-rw-r--r-- | src/libs/sig/ops_lerp.c | 12 | ||||
-rw-r--r-- | src/libs/sig/ops_max.c | 10 | ||||
-rw-r--r-- | src/libs/sig/ops_min.c | 10 | ||||
-rw-r--r-- | src/libs/sig/ops_mult.c | 10 | ||||
-rw-r--r-- | src/libs/sig/ops_neg.c | 4 | ||||
-rw-r--r-- | src/libs/sig/ops_pow.c | 6 | ||||
-rw-r--r-- | src/libs/sig/ops_round.c | 4 | ||||
-rw-r--r-- | src/libs/sig/ops_scale.c | 10 | ||||
-rw-r--r-- | src/libs/sig/ops_sin.c | 4 | ||||
-rw-r--r-- | src/libs/sig/ops_sub.c | 6 | ||||
-rw-r--r-- | src/libs/sig/sig.c | 64 | ||||
-rw-r--r-- | src/libs/sig/sig.h | 54 |
20 files changed, 118 insertions, 118 deletions
diff --git a/src/libs/sig/ops_abs.c b/src/libs/sig/ops_abs.c index 4adc255..e344c33 100644 --- a/src/libs/sig/ops_abs.c +++ b/src/libs/sig/ops_abs.c @@ -5,7 +5,7 @@ typedef struct ops_abs_ctxt_t { - sig_t *x; + sig_sig_t *x; } ops_abs_ctxt_t; @@ -21,7 +21,7 @@ static void ops_abs_init(void *context, va_list ap) assert(ctxt); - ctxt->x = va_arg(ap, sig_t *); + ctxt->x = va_arg(ap, sig_sig_t *); } diff --git a/src/libs/sig/ops_add.c b/src/libs/sig/ops_add.c index 2b6c41d..56d310c 100644 --- a/src/libs/sig/ops_add.c +++ b/src/libs/sig/ops_add.c @@ -4,7 +4,7 @@ typedef struct ops_add_ctxt_t { - sig_t *a, *b; + sig_sig_t *a, *b; } ops_add_ctxt_t; @@ -20,8 +20,8 @@ static void ops_add_init(void *context, va_list ap) assert(ctxt); - ctxt->a = va_arg(ap, sig_t *); - ctxt->b = va_arg(ap, sig_t *); + ctxt->a = va_arg(ap, sig_sig_t *); + ctxt->b = va_arg(ap, sig_sig_t *); } diff --git a/src/libs/sig/ops_ceil.c b/src/libs/sig/ops_ceil.c index 0944ff1..8179639 100644 --- a/src/libs/sig/ops_ceil.c +++ b/src/libs/sig/ops_ceil.c @@ -5,7 +5,7 @@ typedef struct ops_ceil_ctxt_t { - sig_t *x; + sig_sig_t *x; } ops_ceil_ctxt_t; @@ -21,7 +21,7 @@ static void ops_ceil_init(void *context, va_list ap) assert(ctxt); - ctxt->x = va_arg(ap, sig_t *); + ctxt->x = va_arg(ap, sig_sig_t *); } diff --git a/src/libs/sig/ops_clamp.c b/src/libs/sig/ops_clamp.c index 0afcf0c..fdb0a2c 100644 --- a/src/libs/sig/ops_clamp.c +++ b/src/libs/sig/ops_clamp.c @@ -4,7 +4,7 @@ typedef struct ops_clamp_ctxt_t { - sig_t *value, *min, *max; + sig_sig_t *value, *min, *max; } ops_clamp_ctxt_t; @@ -20,9 +20,9 @@ static void ops_clamp_init(void *context, va_list ap) assert(ctxt); - ctxt->value = va_arg(ap, sig_t *); - ctxt->min = va_arg(ap, sig_t *); - ctxt->max = va_arg(ap, sig_t *); + ctxt->value = va_arg(ap, sig_sig_t *); + ctxt->min = va_arg(ap, sig_sig_t *); + ctxt->max = va_arg(ap, sig_sig_t *); } diff --git a/src/libs/sig/ops_div.c b/src/libs/sig/ops_div.c index d0fe4e3..65fd70f 100644 --- a/src/libs/sig/ops_div.c +++ b/src/libs/sig/ops_div.c @@ -5,7 +5,7 @@ typedef struct ops_div_ctxt_t { - sig_t *a, *b; + sig_sig_t *a, *b; } ops_div_ctxt_t; @@ -21,8 +21,8 @@ static void ops_div_init(void *context, va_list ap) assert(ctxt); - ctxt->a = va_arg(ap, sig_t *); - ctxt->b = va_arg(ap, sig_t *); + ctxt->a = va_arg(ap, sig_sig_t *); + ctxt->b = va_arg(ap, sig_sig_t *); } diff --git a/src/libs/sig/ops_expand.c b/src/libs/sig/ops_expand.c index 76791e4..31602ed 100644 --- a/src/libs/sig/ops_expand.c +++ b/src/libs/sig/ops_expand.c @@ -4,7 +4,7 @@ typedef struct ops_expand_ctxt_t { - sig_t *value; + sig_sig_t *value; } ops_expand_ctxt_t; @@ -14,7 +14,7 @@ static size_t ops_expand_size(va_list ap) } -/* expects a single sig_t: value +/* expects a single sig_sig_t: value * input range is assumed to be 0..1, outputs expanded * range of -1..+1 */ @@ -24,7 +24,7 @@ static void ops_expand_init(void *context, va_list ap) assert(ctxt); - ctxt->value = va_arg(ap, sig_t *); + ctxt->value = va_arg(ap, sig_sig_t *); } diff --git a/src/libs/sig/ops_floor.c b/src/libs/sig/ops_floor.c index 85470c9..3ef3811 100644 --- a/src/libs/sig/ops_floor.c +++ b/src/libs/sig/ops_floor.c @@ -5,7 +5,7 @@ typedef struct ops_floor_ctxt_t { - sig_t *x; + sig_sig_t *x; } ops_floor_ctxt_t; @@ -21,7 +21,7 @@ static void ops_floor_init(void *context, va_list ap) assert(ctxt); - ctxt->x = va_arg(ap, sig_t *); + ctxt->x = va_arg(ap, sig_sig_t *); } diff --git a/src/libs/sig/ops_inv.c b/src/libs/sig/ops_inv.c index 99ef134..81a1d55 100644 --- a/src/libs/sig/ops_inv.c +++ b/src/libs/sig/ops_inv.c @@ -4,7 +4,7 @@ typedef struct ops_inv_ctxt_t { - sig_t *x; + sig_sig_t *x; } ops_inv_ctxt_t; @@ -23,7 +23,7 @@ static void ops_inv_init(void *context, va_list ap) assert(ctxt); - ctxt->x = va_arg(ap, sig_t *); + ctxt->x = va_arg(ap, sig_sig_t *); } diff --git a/src/libs/sig/ops_lerp.c b/src/libs/sig/ops_lerp.c index 5ef6791..373bb1c 100644 --- a/src/libs/sig/ops_lerp.c +++ b/src/libs/sig/ops_lerp.c @@ -4,7 +4,7 @@ typedef struct ops_lerp_ctxt_t { - sig_t *a, *b, *t; + sig_sig_t *a, *b, *t; } ops_lerp_ctxt_t; @@ -14,9 +14,9 @@ static size_t ops_lerp_size(va_list ap) } -/* Supply two sig_t's to be interpolated and another for the t, this sig_t +/* Supply two sig_sig_t's to be interpolated and another for the t, this sig_sig_t * takes ownership of them so they'll be freed on destroy when the ops_lerp - * sig_t is freed. + * sig_sig_t is freed. */ static void ops_lerp_init(void *context, va_list ap) { @@ -24,9 +24,9 @@ static void ops_lerp_init(void *context, va_list ap) assert(ctxt); - ctxt->a = va_arg(ap, sig_t *); - ctxt->b = va_arg(ap, sig_t *); - ctxt->t = va_arg(ap, sig_t *); + ctxt->a = va_arg(ap, sig_sig_t *); + ctxt->b = va_arg(ap, sig_sig_t *); + ctxt->t = va_arg(ap, sig_sig_t *); } diff --git a/src/libs/sig/ops_max.c b/src/libs/sig/ops_max.c index 9065027..f6d97cc 100644 --- a/src/libs/sig/ops_max.c +++ b/src/libs/sig/ops_max.c @@ -4,7 +4,7 @@ typedef struct ops_max_ctxt_t { - sig_t *a, *b; + sig_sig_t *a, *b; } ops_max_ctxt_t; @@ -14,9 +14,9 @@ static size_t ops_max_size(va_list ap) } -/* supply two sig_t's to be multiplied, this sig_t takes +/* supply two sig_sig_t's to be multiplied, this sig_sig_t takes * ownership of them so they'll be freed by the multiplier - * on destroy when that sig_t is freed. + * on destroy when that sig_sig_t is freed. */ static void ops_max_init(void *context, va_list ap) { @@ -24,8 +24,8 @@ static void ops_max_init(void *context, va_list ap) assert(ctxt); - ctxt->a = va_arg(ap, sig_t *); - ctxt->b = va_arg(ap, sig_t *); + ctxt->a = va_arg(ap, sig_sig_t *); + ctxt->b = va_arg(ap, sig_sig_t *); } diff --git a/src/libs/sig/ops_min.c b/src/libs/sig/ops_min.c index bda80d9..9c65165 100644 --- a/src/libs/sig/ops_min.c +++ b/src/libs/sig/ops_min.c @@ -4,7 +4,7 @@ typedef struct ops_min_ctxt_t { - sig_t *a, *b; + sig_sig_t *a, *b; } ops_min_ctxt_t; @@ -14,9 +14,9 @@ static size_t ops_min_size(va_list ap) } -/* supply two sig_t's to be multiplied, this sig_t takes +/* supply two sig_sig_t's to be multiplied, this sig_sig_t takes * ownership of them so they'll be freed by the multiplier - * on destroy when that sig_t is freed. + * on destroy when that sig_sig_t is freed. */ static void ops_min_init(void *context, va_list ap) { @@ -24,8 +24,8 @@ static void ops_min_init(void *context, va_list ap) assert(ctxt); - ctxt->a = va_arg(ap, sig_t *); - ctxt->b = va_arg(ap, sig_t *); + ctxt->a = va_arg(ap, sig_sig_t *); + ctxt->b = va_arg(ap, sig_sig_t *); } diff --git a/src/libs/sig/ops_mult.c b/src/libs/sig/ops_mult.c index 2d4e1ac..5baa9d9 100644 --- a/src/libs/sig/ops_mult.c +++ b/src/libs/sig/ops_mult.c @@ -4,7 +4,7 @@ typedef struct ops_mult_ctxt_t { - sig_t *a, *b; + sig_sig_t *a, *b; } ops_mult_ctxt_t; @@ -14,9 +14,9 @@ static size_t ops_mult_size(va_list ap) } -/* supply two sig_t's to be multiplied, this sig_t takes +/* supply two sig_sig_t's to be multiplied, this sig_sig_t takes * ownership of them so they'll be freed by the multiplier - * on destroy when that sig_t is freed. + * on destroy when that sig_sig_t is freed. */ static void ops_mult_init(void *context, va_list ap) { @@ -24,8 +24,8 @@ static void ops_mult_init(void *context, va_list ap) assert(ctxt); - ctxt->a = va_arg(ap, sig_t *); - ctxt->b = va_arg(ap, sig_t *); + ctxt->a = va_arg(ap, sig_sig_t *); + ctxt->b = va_arg(ap, sig_sig_t *); } diff --git a/src/libs/sig/ops_neg.c b/src/libs/sig/ops_neg.c index 594e394..7e6c236 100644 --- a/src/libs/sig/ops_neg.c +++ b/src/libs/sig/ops_neg.c @@ -4,7 +4,7 @@ typedef struct ops_neg_ctxt_t { - sig_t *x; + sig_sig_t *x; } ops_neg_ctxt_t; @@ -20,7 +20,7 @@ static void ops_neg_init(void *context, va_list ap) assert(ctxt); - ctxt->x = va_arg(ap, sig_t *); + ctxt->x = va_arg(ap, sig_sig_t *); } diff --git a/src/libs/sig/ops_pow.c b/src/libs/sig/ops_pow.c index 6e6176a..04b9cdf 100644 --- a/src/libs/sig/ops_pow.c +++ b/src/libs/sig/ops_pow.c @@ -5,7 +5,7 @@ typedef struct ops_pow_ctxt_t { - sig_t *x, *y; + sig_sig_t *x, *y; } ops_pow_ctxt_t; @@ -21,8 +21,8 @@ static void ops_pow_init(void *context, va_list ap) assert(ctxt); - ctxt->x = va_arg(ap, sig_t *); - ctxt->y = va_arg(ap, sig_t *); + ctxt->x = va_arg(ap, sig_sig_t *); + ctxt->y = va_arg(ap, sig_sig_t *); } diff --git a/src/libs/sig/ops_round.c b/src/libs/sig/ops_round.c index ddf8d66..6fbbb19 100644 --- a/src/libs/sig/ops_round.c +++ b/src/libs/sig/ops_round.c @@ -5,7 +5,7 @@ typedef struct ops_round_ctxt_t { - sig_t *x; + sig_sig_t *x; } ops_round_ctxt_t; @@ -21,7 +21,7 @@ static void ops_round_init(void *context, va_list ap) assert(ctxt); - ctxt->x = va_arg(ap, sig_t *); + ctxt->x = va_arg(ap, sig_sig_t *); } diff --git a/src/libs/sig/ops_scale.c b/src/libs/sig/ops_scale.c index 22c0363..b0f2283 100644 --- a/src/libs/sig/ops_scale.c +++ b/src/libs/sig/ops_scale.c @@ -4,7 +4,7 @@ typedef struct ops_scale_ctxt_t { - sig_t *value, *min, *max; + sig_sig_t *value, *min, *max; } ops_scale_ctxt_t; @@ -14,7 +14,7 @@ static size_t ops_scale_size(va_list ap) } -/* expects three sig_t's: value, min, max. +/* expects three sig_sig_t's: value, min, max. * min is assumed to be always <= max, * and value is assumed to always be 0-1 */ @@ -24,9 +24,9 @@ static void ops_scale_init(void *context, va_list ap) assert(ctxt); - ctxt->value = va_arg(ap, sig_t *); - ctxt->min = va_arg(ap, sig_t *); - ctxt->max = va_arg(ap, sig_t *); + ctxt->value = va_arg(ap, sig_sig_t *); + ctxt->min = va_arg(ap, sig_sig_t *); + ctxt->max = va_arg(ap, sig_sig_t *); } diff --git a/src/libs/sig/ops_sin.c b/src/libs/sig/ops_sin.c index 4acc8e5..71bebc0 100644 --- a/src/libs/sig/ops_sin.c +++ b/src/libs/sig/ops_sin.c @@ -5,7 +5,7 @@ typedef struct ops_sin_ctxt_t { - sig_t *hz; + sig_sig_t *hz; } ops_sin_ctxt_t; @@ -21,7 +21,7 @@ static void ops_sin_init(void *context, va_list ap) assert(ctxt); - ctxt->hz = va_arg(ap, sig_t *); + ctxt->hz = va_arg(ap, sig_sig_t *); } diff --git a/src/libs/sig/ops_sub.c b/src/libs/sig/ops_sub.c index 15fed1b..feee9ff 100644 --- a/src/libs/sig/ops_sub.c +++ b/src/libs/sig/ops_sub.c @@ -4,7 +4,7 @@ typedef struct ops_sub_ctxt_t { - sig_t *a, *b; + sig_sig_t *a, *b; } ops_sub_ctxt_t; @@ -20,8 +20,8 @@ static void ops_sub_init(void *context, va_list ap) assert(ctxt); - ctxt->a = va_arg(ap, sig_t *); - ctxt->b = va_arg(ap, sig_t *); + ctxt->a = va_arg(ap, sig_sig_t *); + ctxt->b = va_arg(ap, sig_sig_t *); } diff --git a/src/libs/sig/sig.c b/src/libs/sig/sig.c index 5d1d657..6eb03cf 100644 --- a/src/libs/sig/sig.c +++ b/src/libs/sig/sig.c @@ -5,7 +5,7 @@ #include "sig.h" /* This is to try ensure ctxt's alignment accomodates all the base type sizes, - * it may waste some space in sig_t but since the caller supplies just a size + * it may waste some space in sig_sig_t but since the caller supplies just a size * via the supplied sig_ops_t.size(), we know nothing of the alignment reqs. * * XXX: If callers start using other types like xmmintrinsics __m128, this @@ -23,19 +23,19 @@ typedef union sig_context_t { void *p; } sig_context_t; -typedef struct sig_t { +typedef struct sig_sig_t { const sig_ops_t *ops; unsigned refcount; sig_context_t ctxt[]; -} sig_t; +} sig_sig_t; /* return a new signal generator of ops type, configured according to va_list */ -sig_t * sig_new(const sig_ops_t *ops, ...) +sig_sig_t * sig_new(const sig_ops_t *ops, ...) { static const sig_ops_t null_ops; size_t ctxt_size = 0; - sig_t *sig; + sig_sig_t *sig; va_list ap; if (!ops) @@ -46,7 +46,7 @@ sig_t * sig_new(const sig_ops_t *ops, ...) ctxt_size = ops->size(ap); va_end(ap); - sig = calloc(1, sizeof(sig_t) + ctxt_size); + sig = calloc(1, sizeof(sig_sig_t) + ctxt_size); if (!sig) return NULL; @@ -65,7 +65,7 @@ sig_t * sig_new(const sig_ops_t *ops, ...) /* add a reference to an existing signal generator, * free/unref using sig_free() just like it had been returned by sig_new() */ -sig_t * sig_ref(sig_t *sig) +sig_sig_t * sig_ref(sig_sig_t *sig) { assert(sig); @@ -78,7 +78,7 @@ sig_t * sig_ref(sig_t *sig) /* free a signal generator, returns sig if sig still has references, * otherwise returns NULL */ -sig_t * sig_free(sig_t *sig) +sig_sig_t * sig_free(sig_sig_t *sig) { if (sig) { assert(sig->refcount > 0); @@ -100,7 +100,7 @@ sig_t * sig_free(sig_t *sig) /* produce the value for time ticks_ms from the supplied signal generator, * the returned value should always be kept in the range 0-1. */ -float sig_output(sig_t *sig, unsigned ticks_ms) +float sig_output(sig_sig_t *sig, unsigned ticks_ms) { assert(sig); assert(sig->ops); @@ -120,91 +120,91 @@ float sig_output(sig_t *sig, unsigned ticks_ms) * they offer type checking of the arguments, as well less verbosity. */ -sig_t * sig_new_abs(sig_t *x) +sig_sig_t * sig_new_abs(sig_sig_t *x) { return sig_new(&sig_ops_abs, x); } -sig_t * sig_new_add(sig_t *a, sig_t *b) +sig_sig_t * sig_new_add(sig_sig_t *a, sig_sig_t *b) { return sig_new(&sig_ops_add, a, b); } -sig_t * sig_new_ceil(sig_t *x) +sig_sig_t * sig_new_ceil(sig_sig_t *x) { return sig_new(&sig_ops_ceil, x); } -sig_t * sig_new_clamp(sig_t *x, sig_t *min, sig_t *max) +sig_sig_t * sig_new_clamp(sig_sig_t *x, sig_sig_t *min, sig_sig_t *max) { return sig_new(&sig_ops_clamp, x, min, max); } -sig_t * sig_new_const(float x) +sig_sig_t * sig_new_const(float x) { return sig_new(&sig_ops_const, x); } -sig_t * sig_new_div(sig_t *a, sig_t *b) +sig_sig_t * sig_new_div(sig_sig_t *a, sig_sig_t *b) { return sig_new(&sig_ops_div, a, b); } -sig_t * sig_new_expand(sig_t *x) +sig_sig_t * sig_new_expand(sig_sig_t *x) { return sig_new(&sig_ops_expand, x); } -sig_t * sig_new_floor(sig_t *x) +sig_sig_t * sig_new_floor(sig_sig_t *x) { return sig_new(&sig_ops_floor, x); } -sig_t * sig_new_inv(sig_t *x) +sig_sig_t * sig_new_inv(sig_sig_t *x) { return sig_new(&sig_ops_inv, x); } -sig_t * sig_new_lerp(sig_t *a, sig_t *b, sig_t *t) +sig_sig_t * sig_new_lerp(sig_sig_t *a, sig_sig_t *b, sig_sig_t *t) { return sig_new(&sig_ops_lerp, a, b, t); } -sig_t * sig_new_max(sig_t *a, sig_t *b) +sig_sig_t * sig_new_max(sig_sig_t *a, sig_sig_t *b) { return sig_new(&sig_ops_max, a, b); } -sig_t * sig_new_min(sig_t *a, sig_t *b) +sig_sig_t * sig_new_min(sig_sig_t *a, sig_sig_t *b) { return sig_new(&sig_ops_min, a, b); } -sig_t * sig_new_mult(sig_t *a, sig_t *b) +sig_sig_t * sig_new_mult(sig_sig_t *a, sig_sig_t *b) { return sig_new(&sig_ops_mult, a, b); } -sig_t * sig_new_neg(sig_t *x) +sig_sig_t * sig_new_neg(sig_sig_t *x) { return sig_new(&sig_ops_neg, x); } -sig_t * sig_new_pow(sig_t *x, sig_t *y) +sig_sig_t * sig_new_pow(sig_sig_t *x, sig_sig_t *y) { return sig_new(&sig_ops_pow, x, y); } @@ -216,43 +216,43 @@ sig_t * sig_new_pow(sig_t *x, sig_t *y) * But that prevents uniqueness across rand sigs at the same tick, which seems obviously * undesirable. */ -sig_t * sig_new_rand(void) +sig_sig_t * sig_new_rand(void) { return sig_new(&sig_ops_rand); } -sig_t * sig_new_round(sig_t *x) +sig_sig_t * sig_new_round(sig_sig_t *x) { return sig_new(&sig_ops_round, x); } -sig_t * sig_new_scale(sig_t *x, sig_t *min, sig_t *max) +sig_sig_t * sig_new_scale(sig_sig_t *x, sig_sig_t *min, sig_sig_t *max) { return sig_new(&sig_ops_scale, x, min, max); } -sig_t * sig_new_sin(sig_t *hz) +sig_sig_t * sig_new_sin(sig_sig_t *hz) { return sig_new(&sig_ops_sin, hz); } -sig_t * sig_new_sqr(sig_t *hz) +sig_sig_t * sig_new_sqr(sig_sig_t *hz) { return sig_new(&sig_ops_sqr, hz); } -sig_t * sig_new_tri(sig_t *hz) +sig_sig_t * sig_new_tri(sig_sig_t *hz) { return sig_new(&sig_ops_tri, hz); } -sig_t * sig_new_sub(sig_t *a, sig_t *b) +sig_sig_t * sig_new_sub(sig_sig_t *a, sig_sig_t *b) { return sig_new(&sig_ops_sub, a, b); } @@ -264,7 +264,7 @@ sig_t * sig_new_sub(sig_t *a, sig_t *b) int main(int argc, char *argv[]) { - sig_t *sig; + sig_sig_t *sig; sig = sig_new(NULL); printf("null output=%f\n", sig_output(sig, 0)); diff --git a/src/libs/sig/sig.h b/src/libs/sig/sig.h index 9be3012..5e085af 100644 --- a/src/libs/sig/sig.h +++ b/src/libs/sig/sig.h @@ -4,7 +4,7 @@ #include <stdarg.h> #include <stddef.h> -typedef struct sig_t sig_t; +typedef struct sig_sig_t sig_sig_t; typedef struct sig_ops_t { size_t (*size)(va_list ap); /* return size of space needed for context for given ap */ @@ -13,33 +13,33 @@ typedef struct sig_ops_t { float (*output)(void *context, unsigned ticks_ms); /* output a value 0-1 from context appropriate @ time ticks_ms */ } sig_ops_t; -sig_t * sig_new(const sig_ops_t *ops, ...); -sig_t * sig_ref(sig_t *sig); -sig_t * sig_free(sig_t *sig); -float sig_output(sig_t *sig, unsigned ticks_ms); +sig_sig_t * sig_new(const sig_ops_t *ops, ...); +sig_sig_t * sig_ref(sig_sig_t *sig); +sig_sig_t * sig_free(sig_sig_t *sig); +float sig_output(sig_sig_t *sig, unsigned ticks_ms); -sig_t * sig_new_abs(sig_t *x); -sig_t * sig_new_add(sig_t *a, sig_t *b); -sig_t * sig_new_ceil(sig_t *x); -sig_t * sig_new_clamp(sig_t *x, sig_t *min, sig_t *max); -sig_t * sig_new_const(float x); -sig_t * sig_new_div(sig_t *a, sig_t *b); -sig_t * sig_new_expand(sig_t *x); -sig_t * sig_new_floor(sig_t *x); -sig_t * sig_new_inv(sig_t *x); -sig_t * sig_new_lerp(sig_t *a, sig_t *b, sig_t *t); -sig_t * sig_new_max(sig_t *a, sig_t *b); -sig_t * sig_new_min(sig_t *a, sig_t *b); -sig_t * sig_new_mult(sig_t *a, sig_t *b); -sig_t * sig_new_neg(sig_t *x); -sig_t * sig_new_pow(sig_t *x, sig_t *y); -sig_t * sig_new_rand(void); -sig_t * sig_new_round(sig_t *x); -sig_t * sig_new_scale(sig_t *x, sig_t *min, sig_t *max); -sig_t * sig_new_sin(sig_t *hz); -sig_t * sig_new_sqr(sig_t *hz); -sig_t * sig_new_tri(sig_t *hz); -sig_t * sig_new_sub(sig_t *a, sig_t *b); +sig_sig_t * sig_new_abs(sig_sig_t *x); +sig_sig_t * sig_new_add(sig_sig_t *a, sig_sig_t *b); +sig_sig_t * sig_new_ceil(sig_sig_t *x); +sig_sig_t * sig_new_clamp(sig_sig_t *x, sig_sig_t *min, sig_sig_t *max); +sig_sig_t * sig_new_const(float x); +sig_sig_t * sig_new_div(sig_sig_t *a, sig_sig_t *b); +sig_sig_t * sig_new_expand(sig_sig_t *x); +sig_sig_t * sig_new_floor(sig_sig_t *x); +sig_sig_t * sig_new_inv(sig_sig_t *x); +sig_sig_t * sig_new_lerp(sig_sig_t *a, sig_sig_t *b, sig_sig_t *t); +sig_sig_t * sig_new_max(sig_sig_t *a, sig_sig_t *b); +sig_sig_t * sig_new_min(sig_sig_t *a, sig_sig_t *b); +sig_sig_t * sig_new_mult(sig_sig_t *a, sig_sig_t *b); +sig_sig_t * sig_new_neg(sig_sig_t *x); +sig_sig_t * sig_new_pow(sig_sig_t *x, sig_sig_t *y); +sig_sig_t * sig_new_rand(void); +sig_sig_t * sig_new_round(sig_sig_t *x); +sig_sig_t * sig_new_scale(sig_sig_t *x, sig_sig_t *min, sig_sig_t *max); +sig_sig_t * sig_new_sin(sig_sig_t *hz); +sig_sig_t * sig_new_sqr(sig_sig_t *hz); +sig_sig_t * sig_new_tri(sig_sig_t *hz); +sig_sig_t * sig_new_sub(sig_sig_t *a, sig_sig_t *b); extern sig_ops_t sig_ops_const; extern sig_ops_t sig_ops_rand; |