aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHanspeter Portner <dev@open-music-kontrollers.ch>2017-03-19 16:32:34 +0100
committerHanspeter Portner <dev@open-music-kontrollers.ch>2017-03-19 16:32:34 +0100
commitae68004f247ccd5f608de676674f9ee8f3eaeaa8 (patch)
tree838438a7f00b74d4d9f43257cbf506b7d644a15a
parentbc5d4c26369306d64d2afc9298c97e5e7ec76897 (diff)
downloadvm.lv2-ae68004f247ccd5f608de676674f9ee8f3eaeaa8.tar.xz
osx: rename stack_t, mingw: remove exp10.
-rw-r--r--vm.c24
-rw-r--r--vm.h3
-rw-r--r--vm.ttl3
-rw-r--r--vm_ui.c1
4 files changed, 9 insertions, 22 deletions
diff --git a/vm.c b/vm.c
index 5e8eaed..dd186c7 100644
--- a/vm.c
+++ b/vm.c
@@ -25,12 +25,12 @@
#define SLOT_MAX 32
#define REG_MAX 32
-typedef struct _stack_t stack_t;
+typedef struct _vm_stack_t vm_stack_t;
typedef struct _plughandle_t plughandle_t;
typedef double num_t;
-struct _stack_t {
+struct _vm_stack_t {
num_t slots [SLOT_MAX];
num_t regs [REG_MAX];
};
@@ -60,7 +60,7 @@ struct _plughandle_t {
uint32_t graph_size;
opcode_t opcode;
- stack_t stack;
+ vm_stack_t stack;
bool recalc;
bool sync;
bool is_dynamic;
@@ -72,14 +72,14 @@ struct _plughandle_t {
};
static inline void
-_stack_clear(stack_t *stack)
+_stack_clear(vm_stack_t *stack)
{
for(unsigned i = 0; i < SLOT_MAX; i++)
stack->slots[i] = 0.f;
}
static inline void
-_stack_push(stack_t *stack, num_t val)
+_stack_push(vm_stack_t *stack, num_t val)
{
for(unsigned i = SLOT_MAX - 1; i >= 1; i--)
stack->slots[i] = stack->slots[i - 1];
@@ -88,7 +88,7 @@ _stack_push(stack_t *stack, num_t val)
}
static inline num_t
-_stack_pop(stack_t *stack)
+_stack_pop(vm_stack_t *stack)
{
const num_t val = stack->slots[0];
@@ -101,7 +101,7 @@ _stack_pop(stack_t *stack)
}
static inline void
-_stack_push_num(stack_t *stack, const num_t *val, unsigned num)
+_stack_push_num(vm_stack_t *stack, const num_t *val, unsigned num)
{
for(unsigned i = SLOT_MAX - 1; i >= num; i--)
stack->slots[i] = stack->slots[i - num];
@@ -111,7 +111,7 @@ _stack_push_num(stack_t *stack, const num_t *val, unsigned num)
}
static inline void
-_stack_pop_num(stack_t *stack, num_t *val, unsigned num)
+_stack_pop_num(vm_stack_t *stack, num_t *val, unsigned num)
{
for(unsigned i = 0; i < num; i++)
val[i] = stack->slots[i];
@@ -124,7 +124,7 @@ _stack_pop_num(stack_t *stack, num_t *val, unsigned num)
}
static inline num_t
-_stack_peek(stack_t *stack)
+_stack_peek(vm_stack_t *stack)
{
const num_t val = stack->slots[0];
@@ -411,12 +411,6 @@ run(LV2_Handle instance, uint32_t nsamples)
const num_t c = exp2(a);
_stack_push(&handle->stack, c);
} break;
- case OP_EXP_10:
- {
- const num_t a = _stack_pop(&handle->stack);
- const num_t c = exp10(a);
- _stack_push(&handle->stack, c);
- } break;
case OP_LOG:
{
const num_t a = _stack_pop(&handle->stack);
diff --git a/vm.h b/vm.h
index 3501630..2a9cb8d 100644
--- a/vm.h
+++ b/vm.h
@@ -51,7 +51,6 @@
#define VM__opMod VM_PREFIX"opMod"
#define VM__opExp VM_PREFIX"opExp"
#define VM__opExp2 VM_PREFIX"opExp2"
-#define VM__opExp10 VM_PREFIX"opExp10"
#define VM__opLog VM_PREFIX"opLog"
#define VM__opLog2 VM_PREFIX"opLog2"
#define VM__opLog10 VM_PREFIX"opLog10"
@@ -105,7 +104,6 @@ enum _opcode_enum_t{
OP_MOD,
OP_EXP,
OP_EXP_2,
- OP_EXP_10,
OP_LOG,
OP_LOG_2,
OP_LOG_10,
@@ -181,7 +179,6 @@ static const char *opcode_uris [OP_MAX] = {
[OP_MOD] = VM__opMod,
[OP_EXP] = VM__opExp,
[OP_EXP_2] = VM__opExp2,
- [OP_EXP_10] = VM__opExp10,
[OP_LOG] = VM__opLog,
[OP_LOG_2] = VM__opLog2,
[OP_LOG_10] = VM__opLog10,
diff --git a/vm.ttl b/vm.ttl
index 95ef9f9..7357312 100644
--- a/vm.ttl
+++ b/vm.ttl
@@ -95,9 +95,6 @@ vm:opExp
vm:opExp2
a rdfs:Class, owl:Class ;
rdfs:label "Exponentiation base 2" .
-vm:opExp10
- a rdfs:Class, owl:Class ;
- rdfs:label "Exponentiation base 10" .
vm:opLog
a rdfs:Class, owl:Class ;
rdfs:label "Logarithm" .
diff --git a/vm_ui.c b/vm_ui.c
index e83e414..2efc850 100644
--- a/vm_ui.c
+++ b/vm_ui.c
@@ -100,7 +100,6 @@ static const char *op_labels [OP_MAX] = {
[OP_MOD] = "Mod (2:1)",
[OP_EXP] = "Exp (1:1)",
[OP_EXP_2] = "Exp2 (1:1)",
- [OP_EXP_10] = "Exp10 (1:1)",
[OP_LOG] = "Log (1:1)",
[OP_LOG_2] = "Log2 (1:1)",
[OP_LOG_10] = "Log10 (1:1)",