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
Rishabh Gupta
purr-data
Commits
39c3c396
Commit
39c3c396
authored
Feb 21, 2013
by
Ivica Bukvic
Browse files
bug fix
http://sourceforge.net/tracker/?func=detail&aid=3605384&group_id=55736&atid=478072
parent
1d659c01
Changes
1
Hide whitespace changes
Inline
Side-by-side
pd/src/x_interface.c
View file @
39c3c396
...
...
@@ -19,24 +19,31 @@ typedef struct _print
t_symbol
*
x_sym
;
}
t_print
;
static
void
*
print_new
(
t_symbol
*
s
,
int
argc
,
t_atom
*
argv
)
static
void
*
print_new
(
t_symbol
*
s
el
,
int
argc
,
t_atom
*
argv
)
{
int
bufsize
;
char
*
buf
;
t_print
*
x
=
(
t_print
*
)
pd_new
(
print_class
);
if
(
argc
)
if
(
argc
==
0
)
x
->
x_sym
=
gensym
(
"print"
);
else
if
(
argc
==
1
&&
argv
->
a_type
==
A_SYMBOL
)
{
t_symbol
*
s
=
atom_getsymbolarg
(
0
,
argc
,
argv
);
if
(
!
strcmp
(
s
->
s_name
,
"-n"
))
x
->
x_sym
=
&
s_
;
else
x
->
x_sym
=
s
;
}
else
{
int
bufsize
;
char
*
buf
;
t_binbuf
*
bb
=
binbuf_new
();
binbuf_add
(
bb
,
argc
,
argv
);
binbuf_gettext
(
bb
,
&
buf
,
&
bufsize
);
buf
=
resizebytes
(
buf
,
bufsize
,
bufsize
+
1
);
buf
[
bufsize
]
=
0
;
x
->
x_sym
=
gensym
(
buf
);
freebytes
(
buf
,
bufsize
+
1
);
binbuf_free
(
bb
);
}
else
{
x
->
x_sym
=
gensym
(
"print"
);
}
return
(
x
);
}
...
...
@@ -58,7 +65,10 @@ static void print_float(t_print *x, t_float f)
static
void
print_list
(
t_print
*
x
,
t_symbol
*
s
,
int
argc
,
t_atom
*
argv
)
{
int
i
;
if
(
argc
&&
argv
->
a_type
!=
A_SYMBOL
)
startpost
(
"%s:"
,
x
->
x_sym
->
s_name
);
if
(
argc
&&
argv
->
a_type
!=
A_SYMBOL
)
startpost
(
"%s%s%g"
,
x
->
x_sym
->
s_name
,
(
*
x
->
x_sym
->
s_name
?
": "
:
""
),
atom_getfloatarg
(
0
,
argc
--
,
argv
++
));
else
startpost
(
"%s: %s"
,
x
->
x_sym
->
s_name
,
(
argc
>
1
?
s_list
.
s_name
:
(
argc
==
1
?
s_symbol
.
s_name
:
s_bang
.
s_name
)));
...
...
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