[PD-dev] object creation bug?

Thomas Grill t.grill at gmx.net
Sat Aug 3 13:28:13 CEST 2002


Hi Miller, hi all,
i'm stuck with the following codelet:

--
snip -----------------------------------------------------------------------
-----

#include "m_pd.h"

struct simple_t { t_object obj;  };
static struct _class * simple1_class;

_class* class_simple1 (float arg1, t_symbol *arg2)
{
/* arg1 and arg2 are invalid!! */
 post("arguments: %f %s",arg1,arg2->s_name); /* seg fault!! */
    return 0;
}

extern "C" __declspec(dllexport) void simple1_setup()
{
 simple1_class = class_new( gensym("simple1"),
(t_newmethod)class_simple1,NULL,sizeof(simple_t), 0, A_FLOAT, A_SYMBOL,
A_NULL);
}

--
snip -----------------------------------------------------------------------
-----

It's simple as can be. I defined a object having a float and a symbol a
creation arguments.
The new method "class_simple1" gets invalid values for arg1 and arg2,
though.
It's the same for 0.34-4 and 0.35
If it's a PD bug then it's strange that noone noticed it before.....

greetings,
Thomas






More information about the Pd-dev mailing list