Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Jonathan Wilkes
lyonpotpourri3.0
Commits
b1bf43a3
Commit
b1bf43a3
authored
Aug 21, 2017
by
Jonathan Wilkes
Browse files
use static functions to protect from namespace pollution
parent
52319ac3
Changes
1
Hide whitespace changes
Inline
Side-by-side
counter~.c
View file @
b1bf43a3
...
...
@@ -17,13 +17,13 @@ typedef struct _counter
short
direction
;
}
t_counter
;
void
*
counter_new
(
t_symbol
*
s
,
int
argc
,
t_atom
*
argv
);
static
void
*
counter_new
(
t_symbol
*
s
,
int
argc
,
t_atom
*
argv
);
t_int
*
counter_perform
(
t_int
*
w
);
void
counter_dsp
(
t_counter
*
x
,
t_signal
**
sp
);
void
counter_setnext
(
t_counter
*
x
,
t_floatarg
val
);
void
counter_direction
(
t_counter
*
x
,
t_floatarg
d
);
void
counter_minmax
(
t_counter
*
x
,
t_floatarg
min
,
t_floatarg
max
);
void
counter_version
(
t_counter
*
x
);
static
void
counter_dsp
(
t_counter
*
x
,
t_signal
**
sp
);
static
void
counter_setnext
(
t_counter
*
x
,
t_floatarg
val
);
static
void
counter_direction
(
t_counter
*
x
,
t_floatarg
d
);
static
void
counter_minmax
(
t_counter
*
x
,
t_floatarg
min
,
t_floatarg
max
);
static
void
counter_version
(
t_counter
*
x
);
void
counter_tilde_setup
(
void
)
{
...
...
@@ -38,21 +38,21 @@ void counter_tilde_setup(void)
potpourri_announce
(
OBJECT_NAME
);
}
void
counter_setnext
(
t_counter
*
x
,
t_floatarg
val
)
static
void
counter_setnext
(
t_counter
*
x
,
t_floatarg
val
)
{
if
(
val
<
x
->
min
||
val
>
x
->
max
)
return
;
x
->
current
=
(
long
)
val
;
}
void
counter_direction
(
t_counter
*
x
,
t_floatarg
d
)
static
void
counter_direction
(
t_counter
*
x
,
t_floatarg
d
)
{
if
(
(
d
!=
COUNTER_UP
)
&&
(
d
!=
COUNTER_DOWN
)
)
return
;
x
->
direction
=
(
short
)
d
;
}
void
counter_minmax
(
t_counter
*
x
,
t_floatarg
min
,
t_floatarg
max
)
static
void
counter_minmax
(
t_counter
*
x
,
t_floatarg
min
,
t_floatarg
max
)
{
if
(
min
<
1
){
return
;
...
...
@@ -64,7 +64,7 @@ void counter_minmax(t_counter *x, t_floatarg min, t_floatarg max)
x
->
max
=
max
;
}
void
*
counter_new
(
t_symbol
*
s
,
int
argc
,
t_atom
*
argv
)
static
void
*
counter_new
(
t_symbol
*
s
,
int
argc
,
t_atom
*
argv
)
{
float
farg
;
t_symbol
*
fraud
;
...
...
@@ -86,7 +86,7 @@ void *counter_new(t_symbol *s, int argc, t_atom *argv)
return
x
;
}
t_int
*
counter_perform
(
t_int
*
w
)
static
t_int
*
counter_perform
(
t_int
*
w
)
{
t_counter
*
x
=
(
t_counter
*
)
(
w
[
1
]);
t_float
*
in_vec
=
(
t_float
*
)(
w
[
2
]);
...
...
@@ -121,7 +121,7 @@ t_int *counter_perform(t_int *w)
return
w
+
5
;
}
void
counter_dsp
(
t_counter
*
x
,
t_signal
**
sp
)
static
void
counter_dsp
(
t_counter
*
x
,
t_signal
**
sp
)
{
dsp_add
(
counter_perform
,
4
,
x
,
sp
[
0
]
->
s_vec
,
sp
[
1
]
->
s_vec
,
sp
[
0
]
->
s_n
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment