Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Jonathan Wilkes
purr-data
Commits
263341a3
Commit
263341a3
authored
Jul 01, 2020
by
Jonathan Wilkes
Browse files
move symbol_can_float to x_connective.c
parent
7295f1a3
Changes
2
Hide whitespace changes
Inline
Side-by-side
pd/src/m_class.c
View file @
263341a3
...
...
@@ -43,19 +43,7 @@ t_classtable *ct;
static
t_symbol
*
class_extern_dir
=
&
s_
;
int
symbol_can_float
(
t_symbol
*
s
,
t_float
*
f
)
{
char
c
;
if
(
!
s
||
s
==
&
s_
)
return
0
;
c
=
s
->
s_name
[
0
];
if
(
c
!=
'-'
&&
c
!=
'+'
&&
c
<
48
&&
c
>
57
)
return
0
;
char
*
str_end
=
NULL
;
*
f
=
strtod
(
s
->
s_name
,
&
str_end
);
/* Add error checking here like in cxc/hex2dec */
if
(
*
f
==
0
&&
s
->
s_name
==
str_end
)
return
0
;
return
1
;
}
int
symbol_can_float
(
t_symbol
*
s
,
t_float
*
f
);
char
*
type_hint
(
t_symbol
*
s
,
int
argc
,
t_atom
*
argv
)
{
...
...
pd/src/x_connective.c
View file @
263341a3
...
...
@@ -86,7 +86,19 @@ static void pdfloat_float(t_pdfloat *x, t_float f)
outlet_float
(
x
->
x_obj
.
ob_outlet
,
x
->
x_f
=
f
);
}
int
symbol_can_float
(
t_symbol
*
s
,
t_float
*
f
);
int
symbol_can_float
(
t_symbol
*
s
,
t_float
*
f
)
{
char
c
;
if
(
!
s
||
s
==
&
s_
)
return
0
;
c
=
s
->
s_name
[
0
];
if
(
c
!=
'-'
&&
c
!=
'+'
&&
c
<
48
&&
c
>
57
)
return
0
;
char
*
str_end
=
NULL
;
*
f
=
strtod
(
s
->
s_name
,
&
str_end
);
/* Add error checking here like in cxc/hex2dec */
if
(
*
f
==
0
&&
s
->
s_name
==
str_end
)
return
0
;
return
1
;
}
char
*
type_hint
(
t_symbol
*
s
,
int
argc
,
t_atom
*
argv
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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