aboutsummaryrefslogtreecommitdiff
path: root/pd/src
diff options
context:
space:
mode:
authorMiller Puckette <millerpuckette@users.sourceforge.net>2006-08-24 15:23:52 +0000
committerMiller Puckette <millerpuckette@users.sourceforge.net>2006-08-24 15:23:52 +0000
commitfd6fc182230d0440fc698e118514dd635c533fc8 (patch)
treeb386f5905c2b6ef7c83ab0e832ebee149e3b1b0e /pd/src
parentbbbc57756c00f26cdfacf42d53d0a7f844a4c3ef (diff)
sync for pd 0.40-0test05. Bug fix (empty DSP chains crashed Pd).
svn path=/trunk/; revision=5730
Diffstat (limited to 'pd/src')
-rw-r--r--pd/src/configure.in1
-rw-r--r--pd/src/d_ugen.c2
-rw-r--r--pd/src/m_binbuf.c9
-rw-r--r--pd/src/m_pd.h2
-rw-r--r--pd/src/makefile.in4
-rw-r--r--pd/src/notes.txt2
-rw-r--r--pd/src/x_connective.c2
-rw-r--r--pd/src/x_list.c51
8 files changed, 62 insertions, 11 deletions
diff --git a/pd/src/configure.in b/pd/src/configure.in
index e0571a96..08ad6204 100644
--- a/pd/src/configure.in
+++ b/pd/src/configure.in
@@ -256,6 +256,7 @@ then
else
MORECFLAGS="-arch i386 -arch ppc -Wno-error"
EXTERNTARGET=d_fat
+ LDFLAGS=$LDFLAGS" -arch i386 -arch ppc"
fi
SYSSRC="s_midi_pm.c s_audio_pa.c \
s_audio_pablio.c \
diff --git a/pd/src/d_ugen.c b/pd/src/d_ugen.c
index 1edf5ccb..f7f27aa7 100644
--- a/pd/src/d_ugen.c
+++ b/pd/src/d_ugen.c
@@ -571,7 +571,7 @@ void ugen_start(void)
ugen_stop();
ugen_sortno++;
dsp_chain = (t_int *)getbytes(sizeof(*dsp_chain));
- dsp_chain[0] = 0;
+ dsp_chain[0] = (t_int)dsp_done;
dsp_chainsize = 1;
if (ugen_currentcontext) bug("ugen_start");
}
diff --git a/pd/src/m_binbuf.c b/pd/src/m_binbuf.c
index 4bea4942..3d417560 100644
--- a/pd/src/m_binbuf.c
+++ b/pd/src/m_binbuf.c
@@ -169,7 +169,7 @@ void binbuf_text(t_binbuf *x, char *text, size_t size)
dollar = 0;
if (dollar)
SETDOLLAR(ap, atoi(buf+1));
- else post("dollsym %s", buf), SETDOLLSYM(ap, gensym(buf));
+ else SETDOLLSYM(ap, gensym(buf));
}
else SETSYMBOL(ap, gensym(buf));
}
@@ -649,8 +649,11 @@ void binbuf_eval(t_binbuf *x, t_pd *target, int argc, t_atom *argv)
s9 = binbuf_realizedollsym(at->a_w.w_symbol, argc, argv,
target == &pd_objectmaker);
if (!s9)
- goto broken;
- SETSYMBOL(msp, s9);
+ {
+ error("%s: argument number out of range", at->a_w.w_symbol->s_name);
+ SETSYMBOL(msp, at->a_w.w_symbol);
+ }
+ else SETSYMBOL(msp, s9);
break;
default:
bug("bad item in binbuf");
diff --git a/pd/src/m_pd.h b/pd/src/m_pd.h
index 8369c73b..d6b6877f 100644
--- a/pd/src/m_pd.h
+++ b/pd/src/m_pd.h
@@ -11,7 +11,7 @@ extern "C" {
#define PD_MAJOR_VERSION 0
#define PD_MINOR_VERSION 40
#define PD_BUGFIX_VERSION 0
-#define PD_TEST_VERSION "test03"
+#define PD_TEST_VERSION "test05"
/* old name for "MSW" flag -- we have to take it for the sake of many old
"nmakefiles" for externs, which will define NT and not MSW */
diff --git a/pd/src/makefile.in b/pd/src/makefile.in
index d733547e..4339da57 100644
--- a/pd/src/makefile.in
+++ b/pd/src/makefile.in
@@ -101,7 +101,7 @@ $(BIN_DIR):
test -d $(BIN_DIR) || mkdir -p $(BIN_DIR)
$(BIN_DIR)/pd-watchdog: s_watchdog.c $(BIN_DIR)
- $(CC) -O2 $(STRIPFLAG) -o $(BIN_DIR)/pd-watchdog s_watchdog.c
+ $(CC) $(CFLAGS) $(STRIPFLAG) -o $(BIN_DIR)/pd-watchdog s_watchdog.c
$(BIN_DIR)/pdsend: u_pdsend.c $(BIN_DIR)
$(CC) $(CFLAGS) $(STRIPFLAG) -o $(BIN_DIR)/pdsend u_pdsend.c
@@ -122,7 +122,7 @@ $(BIN_DIR)/pd.tk: u_main.tk
#this is for Max OSX only...
$(BIN_DIR)/libPdTcl.dylib: $(GOBJ) $(GSRC)
- cd ../obj && $(CC) -dynamiclib -read_only_relocs warning \
+ cd ../obj && $(CC) $(CFLAGS) -dynamiclib -read_only_relocs warning \
-o $(BIN_DIR)/libPdTcl.dylib $(GOBJ) \
-F@TCLTK_FRAMEWORKS_PATH@ \
-framework Tcl -framework Tk -framework System \
diff --git a/pd/src/notes.txt b/pd/src/notes.txt
index f3deafe1..07067182 100644
--- a/pd/src/notes.txt
+++ b/pd/src/notes.txt
@@ -33,6 +33,8 @@ block resampling arguments
document tabwrite~_start
"list" to signal inlet (e.g., "*~") or float inlet (f) complains.
$-expansion changed
+list length
+send inlet
problems:
open_via_path call in d_soundfile.c isn't threadsafe
diff --git a/pd/src/x_connective.c b/pd/src/x_connective.c
index c50e27c8..3b2bbba5 100644
--- a/pd/src/x_connective.c
+++ b/pd/src/x_connective.c
@@ -234,6 +234,8 @@ static void send_anything(t_send *x, t_symbol *s, int argc, t_atom *argv)
static void *send_new(t_symbol *s)
{
t_send *x = (t_send *)pd_new(send_class);
+ if (!*s->s_name)
+ symbolinlet_new(&x->x_obj, &x->x_sym);
x->x_sym = s;
return (x);
}
diff --git a/pd/src/x_list.c b/pd/src/x_list.c
index 16de0286..be37a375 100644
--- a/pd/src/x_list.c
+++ b/pd/src/x_list.c
@@ -22,17 +22,19 @@ extern t_pd *newest;
list split - first n elements to first outlet, rest to second outlet
list trim - trim off "list" selector
list length - output number of items in list
- list nth - nth item in list, counting from zero
-Not sure we need these:
- list cat - build a list by accumulating elements
- list foreach - spit out elements of a list one by one
+Need to think more about:
+ list foreach - spit out elements of a list one by one (also in reverse?)
list array - get items from a named array as a list
list reverse - permute elements of a list back to front
list pack - synonym for 'pack'
list unpack - synonym for 'unpack'
+ list cat - build a list by accumulating elements
+
+Probably don't need:
list first - output first n elements.
list last - output last n elements
+ list nth - nth item in list, counting from zero
*/
/* -------------- utility functions: storage, copying -------------- */
@@ -383,6 +385,44 @@ static void list_trim_setup(void)
class_sethelpsymbol(list_trim_class, &s_list);
}
+/* ------------- list length --------------------- */
+
+t_class *list_length_class;
+
+typedef struct _list_length
+{
+ t_object x_obj;
+} t_list_length;
+
+static void *list_length_new( void)
+{
+ t_list_length *x = (t_list_length *)pd_new(list_length_class);
+ outlet_new(&x->x_obj, &s_float);
+ return (x);
+}
+
+static void list_length_list(t_list_length *x, t_symbol *s,
+ int argc, t_atom *argv)
+{
+ outlet_float(x->x_obj.ob_outlet, (float)argc);
+}
+
+static void list_length_anything(t_list_length *x, t_symbol *s,
+ int argc, t_atom *argv)
+{
+ outlet_float(x->x_obj.ob_outlet, (float)argc);
+}
+
+static void list_length_setup(void)
+{
+ list_length_class = class_new(gensym("list length"),
+ (t_newmethod)list_length_new, 0,
+ sizeof(t_list_length), 0, 0);
+ class_addlist(list_length_class, list_length_list);
+ class_addanything(list_length_class, list_length_anything);
+ class_sethelpsymbol(list_length_class, &s_list);
+}
+
/* ------------- list ------------------- */
static void *list_new(t_pd *dummy, t_symbol *s, int argc, t_atom *argv)
@@ -400,6 +440,8 @@ static void *list_new(t_pd *dummy, t_symbol *s, int argc, t_atom *argv)
newest = list_split_new(atom_getfloatarg(1, argc, argv));
else if (s2 == gensym("trim"))
newest = list_trim_new();
+ else if (s2 == gensym("length"))
+ newest = list_length_new();
else
{
error("list %s: unknown function", s2->s_name);
@@ -416,5 +458,6 @@ void x_list_setup(void)
list_prepend_setup();
list_split_setup();
list_trim_setup();
+ list_length_setup();
class_addcreator((t_newmethod)list_new, &s_list, A_GIMME, 0);
}