Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: m-labs/flickernoise
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: c037acc
Choose a base ref
...
head repository: m-labs/flickernoise
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 230544d
Choose a head ref
  • 4 commits
  • 4 files changed
  • 1 contributor

Commits on Jan 30, 2012

  1. Copy the full SHA
    a602258 View commit details
  2. Copy the full SHA
    41804a4 View commit details
  3. Copy the full SHA
    c1f5d02 View commit details
  4. Copy the full SHA
    230544d View commit details
Showing with 92 additions and 3 deletions.
  1. +2 −1 src/compiler/compiler.c
  2. +1 −1 src/compiler/parser.y
  3. +88 −0 src/compiler/test/stim
  4. +1 −1 src/renderer/stimuli.c
3 changes: 2 additions & 1 deletion src/compiler/compiler.c
Original file line number Diff line number Diff line change
@@ -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;
}

2 changes: 1 addition & 1 deletion src/compiler/parser.y
Original file line number Diff line number Diff line change
@@ -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;
}
88 changes: 88 additions & 0 deletions src/compiler/test/stim
Original file line number Diff line number Diff line change
@@ -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

###############################################################################
2 changes: 1 addition & 1 deletion src/renderer/stimuli.c
Original file line number Diff line number Diff line change
@@ -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"