Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: m-labs/flickernoise
base: c037acc
...
head fork: m-labs/flickernoise
compare: 230544d
  • 4 commits
  • 4 files changed
  • 0 commit comments
  • 1 contributor
View
3  src/compiler/compiler.c
@@ -568,7 +568,8 @@ struct patch *patch_copy(struct patch *p)
pixbuf_inc_ref(img->pixbuf);
}
new_patch->stim = stim_get(p->stim);
- stim_redirect(p->stim, new_patch);
+ if(p->stim)
+ stim_redirect(p->stim, new_patch);
return new_patch;
}
View
2  src/compiler/parser.y
@@ -315,7 +315,7 @@ assignment ::= ident(I) TOK_ASSIGN TOK_MIDI TOK_LPAREN expr(A) TOK_COMMA
sym->stim_regs = stim_add_midi_ctrl(stim,
A->contents.constant, B->contents.constant, P);
if(!sym->stim_regs) {
- FAIL("cannot add stimulus for MIDI channel %d control %d\n",
+ FAIL("cannot add stimulus for MIDI channel %d control %d",
(int) A->contents.constant, (int) B->contents.constant);
return;
}
View
88 src/compiler/test/stim
@@ -0,0 +1,88 @@
+#!/bin/sh
+. ./Common
+
+###############################################################################
+
+ptest "stimuli: midi(0, 0)" -c -q << EOF
+foo = midi(0, 0)
+EOF
+expect <<EOF
+EOF
+
+#------------------------------------------------------------------------------
+
+ptest "stimuli: midi(15, 127)" -c -q << EOF
+foo = midi(15, 127)
+EOF
+expect <<EOF
+EOF
+
+#------------------------------------------------------------------------------
+
+ptest_fail "stimuli: midi(16, 0)" -c -q << EOF
+foo = midi(16, 0)
+EOF
+expect <<EOF
+line 2: cannot add stimulus for MIDI channel 16 control 0 near 'EOF'
+EOF
+
+#------------------------------------------------------------------------------
+
+ptest_fail "stimuli: midi(0, 128)" -c -q << EOF
+foo = midi(0, 128)
+EOF
+expect <<EOF
+line 2: cannot add stimulus for MIDI channel 0 control 128 near 'EOF'
+EOF
+
+#------------------------------------------------------------------------------
+
+ptest_fail "stimuli: midi(-1, 0)" -c -q << EOF
+foo = midi(-1, 0)
+EOF
+expect <<EOF
+line 2: cannot add stimulus for MIDI channel -1 control 0 near 'EOF'
+EOF
+
+#------------------------------------------------------------------------------
+
+ptest_fail "stimuli: midi(0, -1)" -c -q << EOF
+foo = midi(0, -1)
+EOF
+expect <<EOF
+line 2: cannot add stimulus for MIDI channel 0 control -1 near 'EOF'
+EOF
+
+#------------------------------------------------------------------------------
+
+ptest "stimuli: midi(0, 0, linear)" -c -q << EOF
+foo = midi(0, 0, linear)
+EOF
+expect <<EOF
+EOF
+
+#------------------------------------------------------------------------------
+
+ptest "stimuli: midi(0, 0, accel_linear)" -c -q << EOF
+foo = midi(0, 0, accel_linear)
+EOF
+expect <<EOF
+EOF
+
+#------------------------------------------------------------------------------
+
+ptest "stimuli: midi(0, 0, accel_unbounded)" -c -q << EOF
+foo = midi(0, 0, accel_unbounded)
+EOF
+expect <<EOF
+EOF
+
+#------------------------------------------------------------------------------
+
+ptest "stimuli: midi(0, 0, accel_cyclic)" -c -q << EOF
+foo = midi(0, 0, accel_cyclic)
+EOF
+expect <<EOF
+EOF
+
+###############################################################################
View
2  src/renderer/stimuli.c
@@ -8,9 +8,9 @@
* the Free Software Foundation, version 3 of the License.
*/
+#include <stddef.h>
#include <stdlib.h>
#include <string.h>
-#include <sys/types.h>
#include "stimuli.h"

No commit comments for this range

Something went wrong with that request. Please try again.