Commit 94fc67f3 authored by Miller Puckette's avatar Miller Puckette
Browse files

Bug fixes: gfxstub, "send" crash after making templates, pd~ sync problems

parent 55b5efcb
......@@ -466,21 +466,16 @@ static void pd_tilde_tick(t_pd_tilde *x)
static void pd_tilde_anything(t_pd_tilde *x, t_symbol *s,
int argc, t_atom *argv)
{
char msgbuf[MAXPDSTRING], *sp, *ep = msgbuf+MAXPDSTRING;
char msgbuf[MAXPDSTRING];
if (!x->x_outfd)
return;
msgbuf[0] = 0;
strncpy(msgbuf, s->s_name, MAXPDSTRING);
msgbuf[MAXPDSTRING-1] = 0;
sp = msgbuf + strlen(msgbuf);
fprintf(x->x_outfd, "%s ", s->s_name);
while (argc--)
{
if (sp < ep-1)
sp[0] = ' ', sp[1] = 0, sp++;
atom_string(argv++, sp, ep-sp);
sp += strlen(sp);
atom_string(argv++, msgbuf, MAXPDSTRING);
fprintf(x->x_outfd, "%s ", msgbuf);
}
fprintf(x->x_outfd, "%s;\n", msgbuf);
fprintf(x->x_outfd, ";\n");
}
static void *pd_tilde_new(t_symbol *s, int argc, t_atom *argv)
......
......@@ -106,7 +106,7 @@ t_template *template_new(t_symbol *templatesym, int argc, t_atom *argv)
bad:
argc -= 2; argv += 2;
}
if (templatesym->s_name)
if (*templatesym->s_name)
{
x->t_sym = templatesym;
pd_bind(&x->t_pdobj, x->t_sym);
......
......@@ -131,6 +131,7 @@ static void canvas_objtext(t_glist *gl, int xpix, int ypix, int selected,
canvas_unsetcurrent((t_canvas *)gl);
}
extern int sys_noautopatch;
/* utility routine to figure out where to put a new text box from menu
and whether to connect to it automatically */
static void canvas_howputnew(t_canvas *x, int *connectp, int *xpixp, int *ypixp,
......@@ -138,7 +139,7 @@ static void canvas_howputnew(t_canvas *x, int *connectp, int *xpixp, int *ypixp,
{
int xpix, ypix, indx = 0, nobj = 0, n2, x1, x2, y1, y2;
int connectme = (x->gl_editor->e_selection &&
!x->gl_editor->e_selection->sel_next);
!x->gl_editor->e_selection->sel_next && !sys_noautopatch);
if (connectme)
{
t_gobj *g, *selected = x->gl_editor->e_selection->sel_what;
......
bug: go to ~/rep/rand, start pd, use open panel to open ../mark/mark.pd - crash
---------------- dolist --------------------
test:
......@@ -14,6 +16,7 @@ mac:
Gnome: why don't windows pop up when clicked on?
problems:
pd~ "start" followed by messages gives race condition because of "fromgui" biz
get rid of remaining -export-dynamic in makefiles
saving as "x.pd" on mac writes to "x.pd.pd" (can't reproduce this.)
find asdf$1 (e.g.) doesn't work
......
......@@ -81,6 +81,7 @@ int sys_extraflags;
char sys_extraflagsstring[MAXPDSTRING];
int sys_run_scheduler(const char *externalschedlibname,
const char *sys_extraflagsstring);
int sys_noautopatch; /* temporary hack to defeat new 0.42 editing */
/* here the "-1" counts signify that the corresponding vector hasn't been
specified in command line arguments; sys_set_audio_settings will detect it
......@@ -398,6 +399,7 @@ static char *(usagemessage[]) = {
"-schedlib <file> -- plug in external scheduler\n",
"-extraflags <s> -- string argument to send schedlib\n",
"-batch -- run off-line as a batch process\n",
"-noautopatch -- defeat auto-patching new from selected objects\n",
};
static void sys_parsedevlist(int *np, int *vecp, int max, char *str)
......@@ -832,6 +834,11 @@ int sys_argparse(int argc, char **argv)
sys_printtostderr = sys_nogui = 1;
argc--; argv++;
}
else if (!strcmp(*argv, "-noautopatch"))
{
sys_noautopatch = 1;
argc--; argv++;
}
#ifdef UNISTD
else if (!strcmp(*argv, "-rt") || !strcmp(*argv, "-realtime"))
{
......
......@@ -1245,7 +1245,8 @@ static void makefilename_scanformat(t_makefilename *x)
static void *makefilename_new(t_symbol *s)
{
t_makefilename *x = (t_makefilename *)pd_new(makefilename_class);
if (!s || !s->s_name) s = gensym("file.%d");
if (!s || !*s->s_name)
s = gensym("file.%d");
outlet_new(&x->x_obj, &s_symbol);
x->x_format = s;
x->x_accept = A_NULL;
......
......@@ -158,8 +158,7 @@ static void gfxstub_free(t_gfxstub *x)
static void gfxstub_setup(void)
{
gfxstub_class = class_new(gensym("gfxstub"), (t_newmethod)gfxstub_new,
(t_method)gfxstub_free,
gfxstub_class = class_new(gensym("gfxstub"), 0, (t_method)gfxstub_free,
sizeof(t_gfxstub), CLASS_PD, 0);
class_addanything(gfxstub_class, gfxstub_anything);
class_addmethod(gfxstub_class, (t_method)gfxstub_signoff,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment