Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10874
Modified Files:
Tag: desiredata
kernel.c m_pd.h
Log Message:
removed s_ prefix in t_symbol
Index: m_pd.h
===================================================================
RCS file: /cvsroot/pure-data/pd/src/m_pd.h,v
retrieving revision 1.4.4.11.2.33.2.30
retrieving revision 1.4.4.11.2.33.2.31
diff -C2 -d -r1.4.4.11.2.33.2.30 -r1.4.4.11.2.33.2.31
*** m_pd.h 3 Jan 2007 08:51:25 -0000 1.4.4.11.2.33.2.30
--- m_pd.h 3 Jan 2007 19:45:24 -0000 1.4.4.11.2.33.2.31
***************
*** 73,89 ****
typedef struct _symbol {
! char *s_name; /* the const string that represents this symbol */
! t_pd *s_thing; /* pointer to the target of a receive-symbol or to the bindlist of several targets */
! struct _symbol *s_next; /* brochette of all symbols (only for permanent symbols) */
! size_t refcount; /* refcount<0 means that the symbol is permanent */
! size_t s_size; /* size of s_name (support for NUL characters) */
} t_symbol;
typedef struct _list {
struct _atom *at;
! t_pd *s_thing; /* dummy (unused) */
! struct _symbol *s_next; /* brochette of all symbols (only for permanent symbols) */
! size_t refcount; /* refcount<0 means that the symbol is permanent */
! size_t s_size; /* size of s_name (support for NUL characters) */
} t_list;
--- 73,92 ----
typedef struct _symbol {
! char *name; /* the const string that represents this symbol */
! t_pd *thing; /* pointer to the target of a receive-symbol or to the bindlist of several targets */
! struct _symbol *next; /* brochette of all symbols (only for permanent symbols) */
! size_t refcount; /* refcount<0 means that the symbol is permanent */
! size_t n; /* size of name (support for NUL characters) */
} t_symbol;
+ #define s_name name
+ #define s_thing thing
+ #define s_next next
typedef struct _list {
struct _atom *at;
! t_pd *thing; /* dummy (unused) */
! struct _symbol *next; /* dummy (unused) */
! size_t refcount;
! size_t n; /* size of at */
} t_list;
***************
*** 200,204 ****
t_appendix *appendix_new (struct _gobj *master);
void appendix_free(struct _gobj *self);
! void appendix_save (struct _gobj *master, t_binbuf *b);
#ifdef PD_PLUSPLUS_FACE
--- 203,207 ----
t_appendix *appendix_new (struct _gobj *master);
void appendix_free(struct _gobj *self);
! void appendix_save(struct _gobj *master, t_binbuf *b);
#ifdef PD_PLUSPLUS_FACE
***************
*** 321,332 ****
/* -------------------- atoms ----------------------------- */
! #define SETSEMI(atom) ((atom)->a_type = A_SEMI, (atom)->a_w.w_index = 0)
! #define SETCOMMA(atom) ((atom)->a_type = A_COMMA, (atom)->a_w.w_index = 0)
! #define SETPOINTER(atom, gp) ((atom)->a_type = A_POINTER, (atom)->a_w.w_gpointer = (gp)) /* looks unsafe... */
! #define SETFLOAT(atom, f) ((atom)->a_type = A_FLOAT, (atom)->a_w.w_float = (f))
! #define SETSYMBOL(atom, s) ((atom)->a_type = A_SYMBOL, (atom)->a_w.w_symbol = (s))
! #define SETDOLLAR(atom, n) ((atom)->a_type = A_DOLLAR, (atom)->a_w.w_index = (n))
! #define SETDOLLSYM(atom, s) ((atom)->a_type = A_DOLLSYM, (atom)->a_w.w_symbol= (s))
! #define SETSTRING(atom, s) ((atom)->a_type = A_SYMBOL, (atom)->a_w.w_symbol = gensym(s))
EXTERN t_float atom_getfloat( t_atom *a);
--- 324,337 ----
/* -------------------- atoms ----------------------------- */
! #define atom_decref(atom) (void)42
! #define SETATOM(atom,type,field,value) (atom_decref(atom), (atom)->a_type=type, (atom)->a_w.field=value)
! #define SETSEMI(atom) SETATOM(atom,A_SEMI, w_index,0)
! #define SETCOMMA(atom) SETATOM(atom,A_COMMA, w_index,0)
! #define SETPOINTER(atom, gp) SETATOM(atom,A_POINTER,w_gpointer,(gp)) /* looks unsafe... */
! #define SETFLOAT(atom, f) SETATOM(atom,A_FLOAT, w_float,(f))
! #define SETSYMBOL(atom, s) SETATOM(atom,A_SYMBOL, w_symbol,(s))
! #define SETSTRING(atom, s) SETATOM(atom,A_SYMBOL, w_symbol,gensym(s))
! #define SETDOLLAR(atom, n) SETATOM(atom,A_DOLLAR, w_index,(n))
! #define SETDOLLSYM(atom, s) SETATOM(atom,A_DOLLSYM,w_symbol,(s))
EXTERN t_float atom_getfloat( t_atom *a);
***************
*** 564,569 ****
#define MAXSIGSIZE (1 << MAXLOGSIG)
! typedef struct _signal
! {
int s_n; /* number of points in the array */
t_sample *s_vec; /* the array */
--- 569,573 ----
#define MAXSIGSIZE (1 << MAXLOGSIG)
! typedef struct _signal {
int s_n; /* number of points in the array */
t_sample *s_vec; /* the array */
***************
*** 582,586 ****
/* tb: exporting basic arithmetic dsp functions {
* for (n % 8) != 0 */
-
EXTERN t_int *zero_perform(t_int *args);
EXTERN t_int *copy_perform(t_int *args);
--- 586,589 ----
***************
*** 607,612 ****
/* for (n % 8) == 0 && aligned signal vectors
! * check with simd_checkX functions !!!
! */
EXTERN t_int *zero_perf_simd(t_int *args);
EXTERN t_int *copy_perf_simd(t_int *args);
--- 610,614 ----
/* for (n % 8) == 0 && aligned signal vectors
! * check with simd_checkX functions !!! */
EXTERN t_int *zero_perf_simd(t_int *args);
EXTERN t_int *copy_perf_simd(t_int *args);
Index: kernel.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/kernel.c,v
retrieving revision 1.1.2.24
retrieving revision 1.1.2.25
diff -C2 -d -r1.1.2.24 -r1.1.2.25
*** kernel.c 3 Jan 2007 06:39:26 -0000 1.1.2.24
--- kernel.c 3 Jan 2007 19:45:24 -0000 1.1.2.25
***************
*** 181,185 ****
long h = hash_hash(self,k);
t_hashentry *nu;
! // fprintf(stderr,"hash_set %p %s %p\n",self,((t_symbol*)k)->s_name,v);
for (t_hashentry *e=self->tab[h]; e; e=e->next) {if (e->k==k) {e->v=v; return;}}
nu = (t_hashentry *)malloc(sizeof(t_hashentry));
--- 181,185 ----
long h = hash_hash(self,k);
t_hashentry *nu;
! // fprintf(stderr,"hash_set %p %s %p\n",self,((t_symbol*)k)->name,v);
for (t_hashentry *e=self->tab[h]; e; e=e->next) {if (e->k==k) {e->v=v; return;}}
nu = (t_hashentry *)malloc(sizeof(t_hashentry));
***************
*** 281,288 ****
unsigned int len=0;
int quote=0;
! for (sp = a->a_symbol->s_name; *sp; sp++, len++) if (should_quote(sp)) quote = 1;
if (quote) {
char *bp = buf, *ep = buf + (bufsize-2);
! sp = a->a_symbol->s_name;
while (bp < ep && *sp) {
if (should_quote(sp)) *bp++ = '\\';
--- 281,288 ----
unsigned int len=0;
int quote=0;
! for (sp = a->a_symbol->name; *sp; sp++, len++) if (should_quote(sp)) quote = 1;
if (quote) {
char *bp = buf, *ep = buf + (bufsize-2);
! sp = a->a_symbol->name;
while (bp < ep && *sp) {
if (should_quote(sp)) *bp++ = '\\';
***************
*** 293,299 ****
} else {
if (len < bufsize-1) {
! strcpy(buf, a->a_symbol->s_name);
} else {
! strncpy(buf, a->a_symbol->s_name, bufsize - 2);
strcpy(buf + (bufsize - 2), "*");
}
--- 293,299 ----
} else {
if (len < bufsize-1) {
! strcpy(buf, a->a_symbol->name);
} else {
! strncpy(buf, a->a_symbol->name, bufsize - 2);
strcpy(buf + (bufsize - 2), "*");
}
***************
*** 301,305 ****
} break;
case A_DOLLAR: sprintf(buf, "$%ld", a->a_w.w_index); break;
! case A_DOLLSYM: strncpy(buf, a->a_symbol->s_name, bufsize); buf[bufsize-1] = 0; break;
default: bug("atom_string");
}
--- 301,305 ----
} break;
case A_DOLLAR: sprintf(buf, "$%ld", a->a_w.w_index); break;
! case A_DOLLSYM: strncpy(buf, a->a_symbol->name, bufsize); buf[bufsize-1] = 0; break;
default: bug("atom_string");
}
***************
*** 378,391 ****
void pd_bind(t_pd *x, t_symbol *s) {
! if (s->s_thing) {
! if (s->s_thing->_class == bindlist_class) {
! t_bindlist *b = (t_bindlist *)s->s_thing;
b->b_list = bindelem_new(x,b->b_list);
} else {
t_bindlist *b = (t_bindlist *)pd_new(bindlist_class);
! b->b_list = bindelem_new(x,bindelem_new(s->s_thing,0));
! s->s_thing = &b->b_pd;
}
! } else s->s_thing = x;
}
--- 378,391 ----
void pd_bind(t_pd *x, t_symbol *s) {
! if (s->thing) {
! if (s->thing->_class == bindlist_class) {
! t_bindlist *b = (t_bindlist *)s->thing;
b->b_list = bindelem_new(x,b->b_list);
} else {
t_bindlist *b = (t_bindlist *)pd_new(bindlist_class);
! b->b_list = bindelem_new(x,bindelem_new(s->thing,0));
! s->thing = &b->b_pd;
}
! } else s->thing = x;
}
***************
*** 394,400 ****
straight to the remaining element. */
void pd_unbind(t_pd *x, t_symbol *s) {
! if (s->s_thing == x) {s->s_thing = 0; return;}
! if (s->s_thing && s->s_thing->_class == bindlist_class) {
! t_bindlist *b = (t_bindlist *)s->s_thing;
t_bindelem *e, *e2;
if ((e = b->b_list)->who == x) {
--- 394,400 ----
straight to the remaining element. */
void pd_unbind(t_pd *x, t_symbol *s) {
! if (s->thing == x) {s->thing = 0; return;}
! if (s->thing && s->thing->_class == bindlist_class) {
! t_bindlist *b = (t_bindlist *)s->thing;
t_bindelem *e, *e2;
if ((e = b->b_list)->who == x) {
***************
*** 407,426 ****
}
if (!b->b_list->next) {
! s->s_thing = b->b_list->who;
freebytes(b->b_list, sizeof(t_bindelem));
pd_free(&b->b_pd);
}
! } else pd_error(x, "%s: couldn't unbind", s->s_name);
}
t_pd *pd_findbyclass(t_symbol *s, t_class *c) {
t_pd *x = 0;
! if (!s->s_thing) return 0;
! if (s->s_thing->_class == c) return s->s_thing;
! if (s->s_thing->_class == bindlist_class) {
! t_bindlist *b = (t_bindlist *)s->s_thing;
int warned = 0;
bind_each(e,b) if (e->who->_class == c) {
! if (x && !warned) {post("warning: %s: multiply defined", s->s_name); warned = 1;}
x = e->who;
}
--- 407,426 ----
}
if (!b->b_list->next) {
! s->thing = b->b_list->who;
freebytes(b->b_list, sizeof(t_bindelem));
pd_free(&b->b_pd);
}
! } else pd_error(x, "%s: couldn't unbind", s->name);
}
t_pd *pd_findbyclass(t_symbol *s, t_class *c) {
t_pd *x = 0;
! if (!s->thing) return 0;
! if (s->thing->_class == c) return s->thing;
! if (s->thing->_class == bindlist_class) {
! t_bindlist *b = (t_bindlist *)s->thing;
int warned = 0;
bind_each(e,b) if (e->who->_class == c) {
! if (x && !warned) {post("warning: %s: multiply defined", s->name); warned = 1;}
x = e->who;
}
***************
*** 452,467 ****
void pd_pushsym(t_pd *x) {
t_gstack *y = (t_gstack *)t_getbytes(sizeof(*y));
! y->g_what = s__X.s_thing;
y->g_next = gstack_head;
y->g_loadingabstraction = pd_loadingabstraction;
pd_loadingabstraction = 0;
gstack_head = y;
! s__X.s_thing = x;
}
void pd_popsym(t_pd *x) {
! if (!gstack_head || s__X.s_thing != x) {bug("gstack_pop"); return;}
t_gstack *headwas = gstack_head;
! s__X.s_thing = headwas->g_what;
gstack_head = headwas->g_next;
t_freebytes(headwas, sizeof(*headwas));
--- 452,467 ----
void pd_pushsym(t_pd *x) {
t_gstack *y = (t_gstack *)t_getbytes(sizeof(*y));
! y->g_what = s__X.thing;
y->g_next = gstack_head;
y->g_loadingabstraction = pd_loadingabstraction;
pd_loadingabstraction = 0;
gstack_head = y;
! s__X.thing = x;
}
void pd_popsym(t_pd *x) {
! if (!gstack_head || s__X.thing != x) {bug("gstack_pop"); return;}
t_gstack *headwas = gstack_head;
! s__X.thing = headwas->g_what;
gstack_head = headwas->g_next;
t_freebytes(headwas, sizeof(*headwas));
***************
*** 554,558 ****
static void inlet_wrong(t_inlet *x, t_symbol *s) {
! pd_error(x->owner, "inlet: expected '%s' but got '%s'", x->symfrom->s_name, s->s_name);
}
--- 554,558 ----
static void inlet_wrong(t_inlet *x, t_symbol *s) {
! pd_error(x->owner, "inlet: expected '%s' but got '%s'", x->symfrom->name, s->name);
}
***************
*** 562,566 ****
if (num < 0) return "???";
while (num-- && i) i = i->next;
! if (i && i->tip) return i->tip->s_name;
return "?";
}
--- 562,566 ----
if (num < 0) return "???";
while (num-- && i) i = i->next;
! if (i && i->tip) return i->tip->name;
return "?";
}
***************
*** 984,988 ****
static void pd_defaultanything(t_pd *x, t_symbol *s, int argc, t_atom *argv) {
! pd_error(x, "%s: no method for '%s'", x->_class->name->s_name, s->s_name);
}
--- 984,988 ----
static void pd_defaultanything(t_pd *x, t_symbol *s, int argc, t_atom *argv) {
! pd_error(x, "%s: no method for '%s'", x->_class->name->name, s->name);
}
***************
*** 1052,1056 ****
t_class *c;
#ifdef QUALIFIED_NAME
! t_symbol *S=gensym(s->s_name);
#endif
int typeflag = flags & CLASS_TYPEMASK;
--- 1052,1056 ----
t_class *c;
#ifdef QUALIFIED_NAME
! t_symbol *S=gensym(s->name);
#endif
int typeflag = flags & CLASS_TYPEMASK;
***************
*** 1061,1065 ****
while (*vp) {
if (count == MAXPDARG) {
! error("class %s: sorry: only %d creation args allowed", s->s_name, MAXPDARG);
break;
}
--- 1061,1065 ----
while (*vp) {
if (count == MAXPDARG) {
! error("class %s: sorry: only %d creation args allowed", s->name, MAXPDARG);
break;
}
***************
*** 1073,1077 ****
if (pd_library_name) {
char namespacename[MAXPDSTRING];
! sprintf(namespacename, "%s%s%s", pd_library_name, QUALIFIED_NAME, s->s_name);
s=gensym(namespacename);
}
--- 1073,1077 ----
if (pd_library_name) {
char namespacename[MAXPDSTRING];
! sprintf(namespacename, "%s%s%s", pd_library_name, QUALIFIED_NAME, s->name);
s=gensym(namespacename);
}
***************
*** 1084,1090 ****
/* if we're loading an extern it might have been invoked by a
longer file name; in this case, make this an admissible name too. */
! char *loadstring = class_loadsym->s_name,
! l1 = strlen(s->s_name), l2 = strlen(loadstring);
! if (l2 > l1 && !strcmp(s->s_name, loadstring + (l2 - l1)))
class_addmethod(pd_objectmaker._class, (t_method)newmethod, class_loadsym,
vec[0], vec[1], vec[2], vec[3], vec[4], vec[5]);
--- 1084,1090 ----
/* if we're loading an extern it might have been invoked by a
longer file name; in this case, make this an admissible name too. */
! char *loadstring = class_loadsym->name,
! l1 = strlen(s->name), l2 = strlen(loadstring);
! if (l2 > l1 && !strcmp(s->name, loadstring + (l2 - l1)))
class_addmethod(pd_objectmaker._class, (t_method)newmethod, class_loadsym,
vec[0], vec[1], vec[2], vec[3], vec[4], vec[5]);
***************
*** 1136,1140 ****
while (*vp) {
if (count == MAXPDARG) {
! error("class %s: sorry: only %d creation args allowed", s->s_name, MAXPDARG);
break;
}
--- 1136,1140 ----
while (*vp) {
if (count == MAXPDARG) {
! error("class %s: sorry: only %d creation args allowed", s->name, MAXPDARG);
break;
}
***************
*** 1149,1153 ****
if (pd_library_name) {
char namespacename[MAXPDSTRING];
! sprintf(namespacename, "%s%s%s", pd_library_name, QUALIFIED_NAME, s->s_name);
s=gensym(namespacename);
}
--- 1149,1153 ----
if (pd_library_name) {
char namespacename[MAXPDSTRING];
! sprintf(namespacename, "%s%s%s", pd_library_name, QUALIFIED_NAME, s->name);
s=gensym(namespacename);
}
***************
*** 1203,1212 ****
}
if (argtype != A_NULL)
! error("%s_%s: only 5 arguments are typecheckable; use A_GIMME", c->name->s_name, sel->s_name);
m->me_arg[nargs] = A_NULL;
}
return;
phooey:
! bug("class_addmethod: %s_%s: bad argument types\n", c->name->s_name, sel->s_name);
}
--- 1203,1212 ----
}
if (argtype != A_NULL)
! error("%s_%s: only 5 arguments are typecheckable; use A_GIMME", c->name->name, sel->name);
m->me_arg[nargs] = A_NULL;
}
return;
phooey:
! bug("class_addmethod: %s_%s: bad argument types\n", c->name->name, sel->name);
}
***************
*** 1241,1246 ****
void class_addanything(t_class *c, t_method fn) { c->anymethod = (t_anymethod)fn;}
! char *class_getname(t_class *c) {return c->name->s_name;}
! char *class_gethelpname(t_class *c) {return c->helpname->s_name;}
void class_sethelpsymbol(t_class *c, t_symbol *s) {c->helpname = s;}
void class_setdrawcommand(t_class *c) {c->drawcommand = 1;}
--- 1241,1246 ----
void class_addanything(t_class *c, t_method fn) { c->anymethod = (t_anymethod)fn;}
! char *class_getname(t_class *c) {return c->name->name;}
! char *class_gethelpname(t_class *c) {return c->helpname->name;}
void class_sethelpsymbol(t_class *c, t_symbol *s) {c->helpname = s;}
void class_setdrawcommand(t_class *c) {c->drawcommand = 1;}
***************
*** 1253,1257 ****
*(t_sample *)(((char *)x) + offset) = f;
else
! pd_error(x, "%s: float unexpected for signal input", x->_class->name->s_name);
}
--- 1253,1257 ----
*(t_sample *)(((char *)x) + offset) = f;
else
! pd_error(x, "%s: float unexpected for signal input", x->_class->name->name);
}
***************
*** 1260,1264 ****
else {
if (c->floatmethod != pd_defaultfloat)
! post("warning: %s: float method overwritten", c->name->s_name);
c->floatmethod = (t_floatmethod)pd_floatforsignal;
}
--- 1260,1264 ----
else {
if (c->floatmethod != pd_defaultfloat)
! post("warning: %s: float method overwritten", c->name->name);
c->floatmethod = (t_floatmethod)pd_floatforsignal;
}
***************
*** 1267,1271 ****
void class_set_extern_dir(t_symbol *s) {class_extern_dir = s;}
! char *class_gethelpdir(t_class *c) {return c->externdir->s_name;}
static void class_nosavefn(t_gobj *z, t_binbuf *b) {
--- 1267,1271 ----
void class_set_extern_dir(t_symbol *s) {class_extern_dir = s;}
! char *class_gethelpdir(t_class *c) {return c->externdir->name;}
static void class_nosavefn(t_gobj *z, t_binbuf *b) {
***************
*** 1323,1328 ****
#endif
while ((sym2 = *sym1)) {
! if (!strcmp(sym2->s_name, s)) return sym2;
! sym1 = &sym2->s_next;
}
#ifdef THREADSAFE_GENSYM
--- 1323,1328 ----
#endif
while ((sym2 = *sym1)) {
! if (!strcmp(sym2->name, s)) return sym2;
! sym1 = &sym2->next;
}
#ifdef THREADSAFE_GENSYM
***************
*** 1331,1340 ****
while (sym2 = *sym1)
{
! if (!strcmp(sym2->s_name, s))
{
pthread_mutex_unlock(&hash_lock);
return sym2;
}
! sym1 = &sym2->s_next;
}
#endif
--- 1331,1340 ----
while (sym2 = *sym1)
{
! if (!strcmp(sym2->name, s))
{
pthread_mutex_unlock(&hash_lock);
return sym2;
}
! sym1 = &sym2->next;
}
#endif
***************
*** 1343,1352 ****
else {
sym2 = (t_symbol *)t_getbytes(sizeof(*sym2));
! sym2->s_name = (char *)t_getbytes(n+1);
! sym2->s_next = 0;
! sym2->s_thing = 0;
! memcpy(sym2->s_name, s, n);
! sym2->s_name[n]=0;
! sym2->s_size=n;
}
*sym1 = sym2;
--- 1343,1352 ----
else {
sym2 = (t_symbol *)t_getbytes(sizeof(*sym2));
! sym2->name = (char *)t_getbytes(n+1);
! sym2->next = 0;
! sym2->thing = 0;
! memcpy(sym2->name, s, n);
! sym2->name[n]=0;
! sym2->n=n;
}
*sym1 = sym2;
***************
*** 1405,1409 ****
newest = 0;
class_loadsym = s;
! if (sys_load_lib(canvas_getcurrent(), s->s_name))
{
tryingalready = 1;
--- 1405,1409 ----
newest = 0;
class_loadsym = s;
! if (sys_load_lib(canvas_getcurrent(), s->name))
{
tryingalready = 1;
***************
*** 1413,1428 ****
}
class_loadsym = 0;
! current = s__X.s_thing;
! if ((fd = canvas_open(canvas_getcurrent(), s->s_name, ".pd", dirbuf, &nameptr, MAXPDSTRING, 0)) >= 0 ||
! (fd = canvas_open(canvas_getcurrent(), s->s_name, ".pat", dirbuf, &nameptr, MAXPDSTRING, 0)) >= 0) {
close(fd);
if (!pd_setloadingabstraction(s)) {
canvas_setargs(argc, argv); /* bug fix by Krzysztof Czaja */
binbuf_evalfile(gensym(nameptr), gensym(dirbuf));
! if (s__X.s_thing != current)
! canvas_popabstraction((t_canvas *)(s__X.s_thing));
canvas_setargs(0, 0);
}
! else error("%s: can't load abstraction within itself\n", s->s_name);
}
else newest = 0;
--- 1413,1428 ----
}
class_loadsym = 0;
! current = s__X.thing;
! if ((fd = canvas_open(canvas_getcurrent(), s->name, ".pd", dirbuf, &nameptr, MAXPDSTRING, 0)) >= 0 ||
! (fd = canvas_open(canvas_getcurrent(), s->name, ".pat", dirbuf, &nameptr, MAXPDSTRING, 0)) >= 0) {
close(fd);
if (!pd_setloadingabstraction(s)) {
canvas_setargs(argc, argv); /* bug fix by Krzysztof Czaja */
binbuf_evalfile(gensym(nameptr), gensym(dirbuf));
! if (s__X.thing != current)
! canvas_popabstraction((t_canvas *)(s__X.thing));
canvas_setargs(0, 0);
}
! else error("%s: can't load abstraction within itself\n", s->name);
}
else newest = 0;
***************
*** 1563,1567 ****
return;
badarg:
! pd_error(x, "Bad arguments for message '%s' to object '%s'", s->s_name, c->name->s_name);
}
--- 1563,1567 ----
return;
badarg:
! pd_error(x, "Bad arguments for message '%s' to object '%s'", s->name, c->name->name);
}
***************
*** 1613,1617 ****
t_methodentry *m = c->methods;
for (int i=c->nmethod; i--; m++) if (m->me_name == s) return m->me_fun;
! pd_error(x, "%s: no method for message '%s'", c->name->s_name, s->s_name);
return (t_gotfn)nullfn;
}
--- 1613,1617 ----
t_methodentry *m = c->methods;
for (int i=c->nmethod; i--; m++) if (m->me_name == s) return m->me_fun;
! pd_error(x, "%s: no method for message '%s'", c->name->name, s->name);
return (t_gotfn)nullfn;
}
***************
*** 1663,1668 ****
*/
"gobj \"%d\" patchable \"%d\" firstin \"%d\" "
! "firsttip \"%s\" methods {",s->s_name,c->helpname->s_name,c->externdir->s_name,
! c->size,c->gobj,c->patchable,c->firstin,c->firsttip->s_name);
if (c-> bangmethod != pd_defaultbang) sys_vgui("<bang> ");
if (c->pointermethod != pd_defaultpointer) sys_vgui("<pointer> ");
--- 1663,1668 ----
*/
"gobj \"%d\" patchable \"%d\" firstin \"%d\" "
! "firsttip \"%s\" methods {",s->name,c->helpname->name,c->externdir->name,
! c->size,c->gobj,c->patchable,c->firstin,c->firsttip->name);
if (c-> bangmethod != pd_defaultbang) sys_vgui("<bang> ");
if (c->pointermethod != pd_defaultpointer) sys_vgui("<pointer> ");
***************
*** 1671,1676 ****
if (c-> listmethod != pd_defaultlist) sys_vgui("<list> ");
if (c-> anymethod != pd_defaultanything) sys_vgui("<any> ");
! for (int i=0; i<c->nmethod; i++) sys_vgui("%s ",c->methods[i].me_name->s_name);
! sys_vgui("}]; %s %s %s\n",cb_recv->s_name, cb_sel->s_name, s->s_name);
}
--- 1671,1676 ----
if (c-> listmethod != pd_defaultlist) sys_vgui("<list> ");
if (c-> anymethod != pd_defaultanything) sys_vgui("<any> ");
! for (int i=0; i<c->nmethod; i++) sys_vgui("%s ",c->methods[i].me_name->name);
! sys_vgui("}]; %s %s %s\n",cb_recv->name, cb_sel->name, s->name);
}
***************
*** 1925,1930 ****
case A_SYMBOL:
/* FIXME make this general */
! if (!strcmp(ap->a_symbol->s_name, ";")) SETSYMBOL(ap, gensym(";"));
! else if (!strcmp(ap->a_symbol->s_name, ",")) SETSYMBOL(ap, gensym(","));
break;
default:
--- 1925,1930 ----
case A_SYMBOL:
/* FIXME make this general */
! if (!strcmp(ap->a_symbol->name, ";")) SETSYMBOL(ap, gensym(";"));
! else if (!strcmp(ap->a_symbol->name, ",")) SETSYMBOL(ap, gensym(","));
break;
default:
***************
*** 1957,1961 ****
for (ap = x->vec + x->n, i = argc; i--; ap++) {
if (argv->a_type == A_SYMBOL) {
! char *str = argv->a_symbol->s_name, *str2;
if (!strcmp(str, ";")) SETSEMI(ap);
else if (!strcmp(str, ",")) SETCOMMA(ap);
--- 1957,1961 ----
for (ap = x->vec + x->n, i = argc; i--; ap++) {
if (argv->a_type == A_SYMBOL) {
! char *str = argv->a_symbol->name, *str2;
if (!strcmp(str, ";")) SETSEMI(ap);
else if (!strcmp(str, ",")) SETCOMMA(ap);
***************
*** 1970,1974 ****
else {
int dollar = 0;
! sscanf(argv->a_symbol->s_name + 1, "%d", &dollar);
SETDOLLAR(ap, dollar);
}
--- 1970,1974 ----
else {
int dollar = 0;
! sscanf(argv->a_symbol->name + 1, "%d", &dollar);
SETDOLLAR(ap, dollar);
}
***************
*** 2048,2052 ****
char buf[MAXPDSTRING];
char buf2[MAXPDSTRING];
! char*str=s->s_name;
char*substr;
int next=0, i=MAXPDSTRING;
--- 2048,2052 ----
char buf[MAXPDSTRING];
char buf2[MAXPDSTRING];
! char*str=s->name;
char*substr;
int next=0, i=MAXPDSTRING;
***************
*** 2112,2126 ****
s = binbuf_realizedollsym(at->a_symbol, argc, argv, 0);
if (!s) {
! error("$%s: not enough arguments supplied", at->a_symbol->s_name);
goto cleanup;
}
} else s = atom_getsymbol(at);
! target = s->s_thing;
/* IMPD: allows messages to unbound objects, via pointers */
if (!target) {
! if (!sscanf(s->s_name,".x%lx",(long*)&target)) target=0;
if (target) {
if (!hash_exists(object_table,target)) {
! error("%s target is not a currently valid pointer",s->s_name);
return;
}
--- 2112,2126 ----
s = binbuf_realizedollsym(at->a_symbol, argc, argv, 0);
if (!s) {
! error("$%s: not enough arguments supplied", at->a_symbol->name);
goto cleanup;
}
} else s = atom_getsymbol(at);
! target = s->thing;
/* IMPD: allows messages to unbound objects, via pointers */
if (!target) {
! if (!sscanf(s->name,".x%lx",(long*)&target)) target=0;
if (target) {
if (!hash_exists(object_table,target)) {
! error("%s target is not a currently valid pointer",s->name);
return;
}
***************
*** 2128,2132 ****
}
if (!target) {
! error("%s: no such object", s->s_name);
cleanup:
do at++, ac--;
--- 2128,2132 ----
}
if (!target) {
! error("%s: no such object", s->name);
cleanup:
do at++, ac--;
***************
*** 2175,2179 ****
s9 = binbuf_realizedollsym(at->a_symbol, argc, argv, target == &pd_objectmaker);
if (!s9) {
! error("%s: argument number out of range", at->a_symbol->s_name);
SETSYMBOL(msp, at->a_symbol);
}
--- 2175,2179 ----
s9 = binbuf_realizedollsym(at->a_symbol, argc, argv, target == &pd_objectmaker);
if (!s9) {
! error("%s: argument number out of range", at->a_symbol->name);
SETSYMBOL(msp, at->a_symbol);
}
***************
*** 2303,2307 ****
symbols may need extra characters for inserting backslashes. */
if (ap->a_type == A_SYMBOL || ap->a_type == A_DOLLSYM)
! length = 80 + strlen(ap->a_symbol->s_name);
else length = 40;
if (ep - bp < length) {
--- 2303,2307 ----
symbols may need extra characters for inserting backslashes. */
if (ap->a_type == A_SYMBOL || ap->a_type == A_DOLLSYM)
! length = 80 + strlen(ap->a_symbol->name);
else length = 40;
if (ep - bp < length) {
***************
*** 2348,2352 ****
#define ISSYMBOL(a, b) ((a)->a_type == A_SYMBOL && \
! !strcmp((a)->a_symbol->s_name, (b)))
#define GETF(i) atom_getfloatarg(i,natom,nextmess)
--- 2348,2352 ----
#define ISSYMBOL(a, b) ((a)->a_type == A_SYMBOL && \
! !strcmp((a)->a_symbol->name, (b)))
#define GETF(i) atom_getfloatarg(i,natom,nextmess)
***************
*** 2370,2375 ****
if (natom > MAXSTACK-10) natom = MAXSTACK-10;
nextmess = vec + nextindex;
! first = nextmess->a_symbol->s_name;
! second = (nextmess+1)->a_symbol->s_name;
if (maxtopd) { /* case 1: importing a ".pat" file into Pd. */
/* dollar signs in file translate to symbols */
--- 2370,2375 ----
if (natom > MAXSTACK-10) natom = MAXSTACK-10;
nextmess = vec + nextindex;
! first = nextmess->a_symbol->name;
! second = (nextmess+1)->a_symbol->name;
if (maxtopd) { /* case 1: importing a ".pat" file into Pd. */
/* dollar signs in file translate to symbols */
***************
*** 2381,2385 ****
} else if (nextmess[i].a_type == A_DOLLSYM) {
char buf[100];
! sprintf(buf, "%s", nextmess[i].a_symbol->s_name);
SETSYMBOL(nextmess+i, gensym(buf));
}
--- 2381,2385 ----
} else if (nextmess[i].a_type == A_DOLLSYM) {
char buf[100];
! sprintf(buf, "%s", nextmess[i].a_symbol->name);
SETSYMBOL(nextmess+i, gensym(buf));
}
***************
*** 2403,2407 ****
nextmess++;
natom--;
! second = (nextmess+1)->a_symbol->s_name;
}
if (natom >= 7 && !strcmp(second, "newobj")
--- 2403,2407 ----
nextmess++;
natom--;
! second = (nextmess+1)->a_symbol->name;
}
if (natom >= 7 && !strcmp(second, "newobj")
***************
*** 2574,2588 ****
void binbuf_evalfile(t_symbol *name, t_symbol *dir) {
t_binbuf *b = binbuf_new();
! int import = !strcmp(name->s_name + strlen(name->s_name) - 4, ".pat");
/* set filename so that new canvases can pick them up */
int dspstate = canvas_suspend_dsp();
glob_setfilename(0, name, dir);
if (import) {
! if (binbuf_read(b, name->s_name, dir->s_name, 0)) {perror(name->s_name); goto bye;}
t_binbuf *newb = binbuf_convert(b, 1);
binbuf_free(b);
b = newb;
} else {
! if (binbuf_read(b, name->s_name, dir->s_name, 2)) perror(name->s_name);
}
bye:
--- 2574,2588 ----
void binbuf_evalfile(t_symbol *name, t_symbol *dir) {
t_binbuf *b = binbuf_new();
! int import = !strcmp(name->name + strlen(name->name) - 4, ".pat");
/* set filename so that new canvases can pick them up */
int dspstate = canvas_suspend_dsp();
glob_setfilename(0, name, dir);
if (import) {
! if (binbuf_read(b, name->name, dir->name, 0)) {perror(name->name); goto bye;}
t_binbuf *newb = binbuf_convert(b, 1);
binbuf_free(b);
b = newb;
} else {
! if (binbuf_read(b, name->name, dir->name, 2)) perror(name->name);
}
bye:
***************
*** 2600,2604 ****
int dspstate = canvas_suspend_dsp();
binbuf_evalfile(name, dir);
! while ((x != s__X.s_thing) && (x = s__X.s_thing))
vmess(x, gensym("pop"), "i", 1);
pd_doloadbang();
--- 2600,2604 ----
int dspstate = canvas_suspend_dsp();
binbuf_evalfile(name, dir);
! while ((x != s__X.thing) && (x = s__X.thing))
vmess(x, gensym("pop"), "i", 1);
pd_doloadbang();
***************
*** 2626,2630 ****
if (pd_objectmaker._class) bug("ARGH");
for (i=sizeof(symlist)/sizeof(*symlist), sp = symlist; i--; sp++)
! (void) dogensym((*sp)->s_name, strlen((*sp)->s_name), *sp);
pd_objectmaker._class = class_new(gensym("objectmaker"), 0, 0, sizeof(t_pd), CLASS_DEFAULT, A_NULL);
pd_canvasmaker._class = class_new(gensym("canvasmaker"), 0, 0, sizeof(t_pd), CLASS_DEFAULT, A_NULL);
--- 2626,2630 ----
if (pd_objectmaker._class) bug("ARGH");
for (i=sizeof(symlist)/sizeof(*symlist), sp = symlist; i--; sp++)
! (void) dogensym((*sp)->name, strlen((*sp)->name), *sp);
pd_objectmaker._class = class_new(gensym("objectmaker"), 0, 0, sizeof(t_pd), CLASS_DEFAULT, A_NULL);
pd_canvasmaker._class = class_new(gensym("canvasmaker"), 0, 0, sizeof(t_pd), CLASS_DEFAULT, A_NULL);