Skip to content
This repository has been archived by the owner on Jul 5, 2022. It is now read-only.

Commit

Permalink
added safety for reverse attr set function
Browse files Browse the repository at this point in the history
  • Loading branch information
CircuitMusicLabs committed Aug 17, 2018
1 parent 7376b33 commit e59b1c7
Show file tree
Hide file tree
Showing 16 changed files with 48 additions and 4 deletions.
Binary file modified externals/cm.buffercloud~.mxe
Binary file not shown.
Binary file modified externals/cm.buffercloud~.mxe64
Binary file not shown.
Binary file modified externals/cm.buffercloud~.mxo/Contents/MacOS/cm.buffercloud~
Binary file not shown.
Binary file modified externals/cm.gausscloud~.mxe
Binary file not shown.
Binary file modified externals/cm.gausscloud~.mxe64
Binary file not shown.
Binary file modified externals/cm.gausscloud~.mxo/Contents/MacOS/cm.gausscloud~
Binary file not shown.
Binary file modified externals/cm.indexcloud~.mxe
Binary file not shown.
Binary file modified externals/cm.indexcloud~.mxe64
Binary file not shown.
Binary file modified externals/cm.indexcloud~.mxo/Contents/MacOS/cm.indexcloud~
Binary file not shown.
Binary file modified externals/cm.livecloud~.mxe
Binary file not shown.
Binary file modified externals/cm.livecloud~.mxe64
Binary file not shown.
Binary file modified externals/cm.livecloud~.mxo/Contents/MacOS/cm.livecloud~
Binary file not shown.
13 changes: 12 additions & 1 deletion source/cm.buffercloud~/cm.buffercloud~.c
Original file line number Diff line number Diff line change
Expand Up @@ -1232,7 +1232,18 @@ t_max_err cmbuffercloud_zero_set(t_cmbuffercloud *x, t_object *attr, long ac, t_
/************************************************************************************************************************/
t_max_err cmbuffercloud_reverse_set(t_cmbuffercloud *x, t_object *attr, long ac, t_atom *av) {
if (ac && av) {
x->attr_reverse = atom_getsym(av);
t_symbol *arg = atom_getsym(av);
t_symbol *off = gensym("off");
t_symbol *on = gensym("on");
t_symbol *random = gensym("random");
t_symbol *direction = gensym("direction");
if (arg != off && arg != on && arg != random && arg != direction) {
object_error((t_object *)x, "invalid attribute value");
object_error((t_object *)x, "valid attribute values are off | on | random | direction");
}
else {
x->attr_reverse = arg;
}
}
return MAX_ERR_NONE;
}
Expand Down
13 changes: 12 additions & 1 deletion source/cm.gausscloud~/cm.gausscloud~.c
Original file line number Diff line number Diff line change
Expand Up @@ -1219,7 +1219,18 @@ t_max_err cmgausscloud_zero_set(t_cmgausscloud *x, t_object *attr, long ac, t_at
/************************************************************************************************************************/
t_max_err cmgausscloud_reverse_set(t_cmgausscloud *x, t_object *attr, long ac, t_atom *av) {
if (ac && av) {
x->attr_reverse = atom_getsym(av);
t_symbol *arg = atom_getsym(av);
t_symbol *off = gensym("off");
t_symbol *on = gensym("on");
t_symbol *random = gensym("random");
t_symbol *direction = gensym("direction");
if (arg != off && arg != on && arg != random && arg != direction) {
object_error((t_object *)x, "invalid attribute value");
object_error((t_object *)x, "valid attribute values are off | on | random | direction");
}
else {
x->attr_reverse = arg;
}
}
return MAX_ERR_NONE;
}
Expand Down
13 changes: 12 additions & 1 deletion source/cm.indexcloud~/cm.indexcloud~.c
Original file line number Diff line number Diff line change
Expand Up @@ -1362,7 +1362,18 @@ t_max_err cmindexcloud_zero_set(t_cmindexcloud *x, t_object *attr, long ac, t_at
/************************************************************************************************************************/
t_max_err cmindexcloud_reverse_set(t_cmindexcloud *x, t_object *attr, long ac, t_atom *av) {
if (ac && av) {
x->attr_reverse = atom_getsym(av);
t_symbol *arg = atom_getsym(av);
t_symbol *off = gensym("off");
t_symbol *on = gensym("on");
t_symbol *random = gensym("random");
t_symbol *direction = gensym("direction");
if (arg != off && arg != on && arg != random && arg != direction) {
object_error((t_object *)x, "invalid attribute value");
object_error((t_object *)x, "valid attribute values are off | on | random | direction");
}
else {
x->attr_reverse = arg;
}
}
return MAX_ERR_NONE;
}
Expand Down
13 changes: 12 additions & 1 deletion source/cm.livecloud~/cm.livecloud~.c
Original file line number Diff line number Diff line change
Expand Up @@ -1358,7 +1358,18 @@ t_max_err cmlivecloud_zero_set(t_cmlivecloud *x, t_object *attr, long ac, t_atom
/************************************************************************************************************************/
t_max_err cmlivecloud_reverse_set(t_cmlivecloud *x, t_object *attr, long ac, t_atom *av) {
if (ac && av) {
x->attr_reverse = atom_getsym(av);
t_symbol *arg = atom_getsym(av);
t_symbol *off = gensym("off");
t_symbol *on = gensym("on");
t_symbol *random = gensym("random");
t_symbol *direction = gensym("direction");
if (arg != off && arg != on && arg != random && arg != direction) {
object_error((t_object *)x, "invalid attribute value");
object_error((t_object *)x, "valid attribute values are off | on | random | direction");
}
else {
x->attr_reverse = arg;
}
}
return MAX_ERR_NONE;
}
Expand Down

0 comments on commit e59b1c7

Please sign in to comment.