Skip to content

Commit

Permalink
Cleared SVN headers
Browse files Browse the repository at this point in the history
Deleted unused variables
  • Loading branch information
grrrr committed Apr 16, 2015
1 parent 52ff9e4 commit 7b2e54c
Show file tree
Hide file tree
Showing 12 changed files with 357 additions and 144 deletions.
300 changes: 272 additions & 28 deletions py.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

8 changes: 2 additions & 6 deletions source/main.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
/*
/*
py/pyext - python script object for PD and MaxMSP
Copyright (c)2002-2011 Thomas Grill ([email protected])
Copyright (c)2002-2015 Thomas Grill ([email protected])
For information on usage and redistribution, and for a DISCLAIMER OF ALL
WARRANTIES, see the file, "license.txt," in this distribution.
$LastChangedRevision: 26 $
$LastChangedDate$
$LastChangedBy$
*/

#ifndef __MAIN_H
Expand Down
9 changes: 3 additions & 6 deletions source/pyatom.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
/*
/*
py/pyext - python script object for PD and Max/MSP
Copyright (c)2002-2008 Thomas Grill ([email protected])
Copyright (c)2002-2015 Thomas Grill ([email protected])
For information on usage and redistribution, and for a DISCLAIMER OF ALL
WARRANTIES, see the file, "license.txt," in this distribution.
$LastChangedRevision: 26 $
$LastChangedDate$
$LastChangedBy$
*/

#include "main.h"
Expand All @@ -19,3 +15,4 @@ class PyAtom
static PyObject *Retrieve(size_t id);
static void Collect();
};

8 changes: 4 additions & 4 deletions source/pybase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -875,16 +875,16 @@ void pybase::pyworker(thr_params *)
void pybase::quworker(thr_params *)
{
FifoEl *el;
ThrState my = FindThreadState(),state;
ThrState my = FindThreadState();

for(;;) {
while((el = qufifo.Get())) {
++el->th->thrcount; // \todo this should be atomic
{
ThrLock lock(my);
el->th->docall(el->fun,el->args);
Py_XDECREF(el->fun);
Py_XDECREF(el->args);
el->th->docall(el->fun,el->args);
Py_XDECREF(el->fun);
Py_XDECREF(el->args);
}
--el->th->thrcount; // \todo this should be atomic
qufifo.Free(el);
Expand Down
8 changes: 2 additions & 6 deletions source/pybase.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
/*
/*
py/pyext - python script object for PD and MaxMSP
Copyright (c)2002-2008 Thomas Grill ([email protected])
Copyright (c)2002-2015 Thomas Grill ([email protected])
For information on usage and redistribution, and for a DISCLAIMER OF ALL
WARRANTIES, see the file, "license.txt," in this distribution.
$LastChangedRevision: 26 $
$LastChangedDate$
$LastChangedBy$
*/

#ifndef __PYBASE_H
Expand Down
6 changes: 3 additions & 3 deletions source/pybuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ static int buffer_ass_slice(PyObject *s,Py_ssize_t ilow,Py_ssize_t ihigh,PyObjec
}
else if(self->buf) {
const int n = self->buf->Frames();
const int c = self->buf->Channels();
// const int c = self->buf->Channels();
if(ilow < 0) ilow += n;
if(ilow >= n) ilow = n-1;
if(ihigh < 0) ihigh += n;
Expand Down Expand Up @@ -463,7 +463,7 @@ static PySequenceMethods buffer_as_seq = {

static PyObject *buffer_iter(PyObject *s)
{
pySamplebuffer *self = reinterpret_cast<pySamplebuffer *>(s);
// pySamplebuffer *self = reinterpret_cast<pySamplebuffer *>(s);
PyObject *nobj = buffer_slice(s);
if(nobj) {
PyObject *it = PyObject_GetIter(nobj);
Expand Down Expand Up @@ -589,7 +589,7 @@ static PyObject *buffer_negative(PyObject *s)

static PyObject *buffer_pos(PyObject *s)
{
pySamplebuffer *self = reinterpret_cast<pySamplebuffer *>(s);
// pySamplebuffer *self = reinterpret_cast<pySamplebuffer *>(s);
PyObject *nobj = buffer_slice(s);
if(nobj) {
PyObject *ret = PyNumber_Positive(nobj);
Expand Down
8 changes: 2 additions & 6 deletions source/pybuffer.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
/*
/*
py/pyext - python script object for PD and Max/MSP
Copyright (c)2002-2008 Thomas Grill ([email protected])
Copyright (c)2002-2015 Thomas Grill ([email protected])
For information on usage and redistribution, and for a DISCLAIMER OF ALL
WARRANTIES, see the file, "license.txt," in this distribution.
$LastChangedRevision: 26 $
$LastChangedDate$
$LastChangedBy$
*/

#ifndef __PYBUFFER_H
Expand Down
8 changes: 2 additions & 6 deletions source/pybundle.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
/*
/*
py/pyext - python script object for PD and Max/MSP
Copyright (c)2002-2008 Thomas Grill ([email protected])
Copyright (c)2002-2015 Thomas Grill ([email protected])
For information on usage and redistribution, and for a DISCLAIMER OF ALL
WARRANTIES, see the file, "license.txt," in this distribution.
$LastChangedRevision: 26 $
$LastChangedDate$
$LastChangedBy$
*/

#ifndef __PYBUNDLE_H
Expand Down
124 changes: 60 additions & 64 deletions source/pyext.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
/*
/*
py/pyext - python external object for PD and MaxMSP
Copyright (c)2002-2008 Thomas Grill ([email protected])
Copyright (c)2002-2015 Thomas Grill ([email protected])
For information on usage and redistribution, and for a DISCLAIMER OF ALL
WARRANTIES, see the file, "license.txt," in this distribution.
$LastChangedRevision: 26 $
$LastChangedDate$
$LastChangedBy$
*/

#ifndef __PYEXT_H
Expand All @@ -19,34 +15,34 @@ class pyext
: public pybase
, public flext_dsp
{
FLEXT_HEADER_S(pyext,flext_dsp,Setup)
FLEXT_HEADER_S(pyext,flext_dsp,Setup)

public:
pyext(int argc,const t_atom *argv,bool sig = false);
pyext(int argc,const t_atom *argv,bool sig = false);

static PyObject *pyext__str__(PyObject *,PyObject *args);
static PyObject *pyext__str__(PyObject *,PyObject *args);

static PyObject *pyext_outlet(PyObject *,PyObject *args);
static PyObject *pyext_outlet(PyObject *,PyObject *args);
#if FLEXT_SYS == FLEXT_SYS_PD
static PyObject *pyext_tocanvas(PyObject *,PyObject *args);
static PyObject *pyext_tocanvas(PyObject *,PyObject *args);
#endif

static PyObject *pyext_setattr(PyObject *,PyObject *args);
static PyObject *pyext_getattr(PyObject *,PyObject *args);
static PyObject *pyext_setattr(PyObject *,PyObject *args);
static PyObject *pyext_getattr(PyObject *,PyObject *args);

static PyObject *pyext_detach(PyObject *,PyObject *args);
static PyObject *pyext_stop(PyObject *,PyObject *args);
static PyObject *pyext_isthreaded(PyObject *,PyObject *);
static PyObject *pyext_detach(PyObject *,PyObject *args);
static PyObject *pyext_stop(PyObject *,PyObject *args);
static PyObject *pyext_isthreaded(PyObject *,PyObject *);

static PyObject *pyext_inbuf(PyObject *,PyObject *args);
static PyObject *pyext_invec(PyObject *,PyObject *args);
static PyObject *pyext_outbuf(PyObject *,PyObject *args);
static PyObject *pyext_outvec(PyObject *,PyObject *args);
static PyObject *pyext_inbuf(PyObject *,PyObject *args);
static PyObject *pyext_invec(PyObject *,PyObject *args);
static PyObject *pyext_outbuf(PyObject *,PyObject *args);
static PyObject *pyext_outvec(PyObject *,PyObject *args);

int Inlets() const { return inlets; }
int Outlets() const { return outlets; }
int Inlets() const { return inlets; }
int Outlets() const { return outlets; }

static pyext *GetThis(PyObject *self);
static pyext *GetThis(PyObject *self);

protected:

Expand All @@ -60,7 +56,7 @@ class pyext

virtual void DumpOut(const t_symbol *sym,int argc,const t_atom *argv);

bool work(int n,const t_symbol *s,int argc,const t_atom *argv);
bool work(int n,const t_symbol *s,int argc,const t_atom *argv);

void m_help();

Expand All @@ -71,54 +67,54 @@ class pyext
void mg_dir_(AtomList &lst) { GetDir(pyobj,lst); }
void m_doc_() { m__doc(((PyInstanceObject *)pyobj)->in_class->cl_dict); }

void m_get(const t_symbol *s);
void m_set(int argc,const t_atom *argv);
void m_get(const t_symbol *s);
void m_set(int argc,const t_atom *argv);

const t_symbol *methname;
PyObject *pyobj;
int inlets,outlets;
const t_symbol *methname;
PyObject *pyobj;
int inlets,outlets;
int siginlets,sigoutlets;

flext::AtomList initargs;

virtual void LoadModule();
virtual void UnloadModule();
virtual void LoadModule();
virtual void UnloadModule();

virtual void Load();
virtual void Unload();
virtual void Load();
virtual void Unload();

virtual bool DoInit();
virtual void DoExit();
virtual bool DoInit();
virtual void DoExit();

virtual PyObject *GetSig(int ix,bool in);

private:
static void Setup(t_classid);
static void Setup(t_classid);

void SetThis();
void ClearThis();
void SetThis();
void ClearThis();

void ClearBinding();
bool MakeInstance();
void ClearBinding();
bool MakeInstance();
bool InitInOut(int &inlets,int &outlets);

static PyObject *class_obj,*class_dict;
static PyMethodDef attr_tbl[],meth_tbl[];
static const char *pyext_doc;
static PyObject *class_obj,*class_dict;
static PyMethodDef attr_tbl[],meth_tbl[];
static const char *pyext_doc;

// -------- bind stuff ------------------
static PyObject *pyext_bind(PyObject *,PyObject *args);
static PyObject *pyext_unbind(PyObject *,PyObject *args);
// -------- bind stuff ------------------
static PyObject *pyext_bind(PyObject *,PyObject *args);
static PyObject *pyext_unbind(PyObject *,PyObject *args);

// ---------------------------
// ---------------------------

bool call(const char *meth,int inlet,const t_symbol *s,int argc,const t_atom *argv);
bool call(const char *meth,int inlet,const t_symbol *s,int argc,const t_atom *argv);

virtual void callpy(PyObject *fun,PyObject *args);
static bool stcallpy(PyObject *fun,PyObject *args);

#ifndef PY_USE_GIL
ThrState pythr;
ThrState pythr;
#endif

private:
Expand All @@ -127,28 +123,28 @@ class pyext
FLEXT_CALLBACK(m_help)

FLEXT_CALLBACK(m_reload)
FLEXT_CALLBACK_V(m_reload_)
FLEXT_CALLBACK(m_dir_)
FLEXT_CALLGET_V(mg_dir_)
FLEXT_CALLBACK(m_doc_)
FLEXT_CALLBACK_V(m_reload_)
FLEXT_CALLBACK(m_dir_)
FLEXT_CALLGET_V(mg_dir_)
FLEXT_CALLBACK(m_doc_)

FLEXT_ATTRGET_V(initargs)
FLEXT_CALLSET_V(ms_initargs)

FLEXT_CALLBACK_S(m_get)
FLEXT_CALLBACK_V(m_set)
FLEXT_CALLBACK_S(m_get)
FLEXT_CALLBACK_V(m_set)

// callbacks
FLEXT_ATTRVAR_I(detach)
FLEXT_ATTRVAR_B(pymsg)
FLEXT_ATTRVAR_B(respond)
// callbacks
FLEXT_ATTRVAR_I(detach)
FLEXT_ATTRVAR_B(pymsg)
FLEXT_ATTRVAR_B(respond)

FLEXT_CALLBACK_V(m_stop)
FLEXT_CALLBACK(m_dir)
FLEXT_CALLGET_V(mg_dir)
FLEXT_CALLBACK(m_doc)
FLEXT_CALLBACK_V(m_stop)
FLEXT_CALLBACK(m_dir)
FLEXT_CALLGET_V(mg_dir)
FLEXT_CALLBACK(m_doc)

FLEXT_CALLBACK(CbClick)
FLEXT_CALLBACK(CbClick)

#ifdef FLEXT_THREADS
FLEXT_CALLBACK_T(tick)
Expand Down
8 changes: 2 additions & 6 deletions source/pyprefix.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
/*
/*
py/pyext - python script object for PD and MaxMSP
Copyright (c)2002-2009 Thomas Grill ([email protected])
Copyright (c)2002-2015 Thomas Grill ([email protected])
For information on usage and redistribution, and for a DISCLAIMER OF ALL
WARRANTIES, see the file, "license.txt," in this distribution.
$LastChangedRevision: 26 $
$LastChangedDate$
$LastChangedBy$
*/

#ifndef __PYPREFIX_H
Expand Down
6 changes: 3 additions & 3 deletions source/pysymbol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ static PyObject *symbol_slice(PyObject *s,Py_ssize_t ilow = 0,Py_ssize_t ihigh =

static PyObject *symbol_concat(PyObject *s,PyObject *op)
{
pySymbol *self = reinterpret_cast<pySymbol *>(s);
// pySymbol *self = reinterpret_cast<pySymbol *>(s);
PyObject *nobj = symbol_slice(s); // take all
if(nobj) {
PyObject *ret = PySequence_Concat(nobj,op);
Expand All @@ -138,7 +138,7 @@ static PyObject *symbol_concat(PyObject *s,PyObject *op)

static PyObject *symbol_repeat(PyObject *s,Py_ssize_t rep)
{
pySymbol *self = reinterpret_cast<pySymbol *>(s);
// pySymbol *self = reinterpret_cast<pySymbol *>(s);
PyObject *nobj = symbol_slice(s); // take all
if(nobj) {
PyObject *ret = PySequence_Repeat(nobj,rep);
Expand All @@ -161,7 +161,7 @@ static PySequenceMethods symbol_as_seq = {

static PyObject *symbol_iter(PyObject *s)
{
pySymbol *self = reinterpret_cast<pySymbol *>(s);
// pySymbol *self = reinterpret_cast<pySymbol *>(s);
PyObject *nobj = symbol_slice(s);
if(nobj) {
PyObject *it = PyObject_GetIter(nobj);
Expand Down
8 changes: 2 additions & 6 deletions source/pysymbol.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
/*
/*
py/pyext - python script object for PD and Max/MSP
Copyright (c)2002-2008 Thomas Grill ([email protected])
Copyright (c)2002-2015 Thomas Grill ([email protected])
For information on usage and redistribution, and for a DISCLAIMER OF ALL
WARRANTIES, see the file, "license.txt," in this distribution.
$LastChangedRevision: 26 $
$LastChangedDate$
$LastChangedBy$
*/

#ifndef __PYSYMBOL_H
Expand Down

0 comments on commit 7b2e54c

Please sign in to comment.