From 5af9cc14b70f907f0d10a75aa28ad04bbd65ec0d Mon Sep 17 00:00:00 2001 From: "N.N." Date: Fri, 10 Dec 2004 20:47:06 +0000 Subject: restricted debug garbage to krzYszcz, few fixes in toxy svn path=/trunk/externals/miXed/; revision=2364 --- shared/common/binport.c | 4 +++- shared/common/dict.c | 24 ++++++++++++++---------- shared/common/mifi.c | 2 ++ shared/common/port.c | 2 ++ shared/common/props.c | 2 ++ shared/common/vefl.c | 8 +++----- shared/hammer/gui.c | 24 +++++++++++++++--------- shared/sickle/sic.c | 9 ++++++--- shared/toxy/plusbob.c | 2 ++ shared/toxy/scriptlet.c | 9 +++++++-- shared/unstable/forky.c | 6 ++++-- shared/unstable/fringe.c | 6 ++++-- 12 files changed, 64 insertions(+), 34 deletions(-) (limited to 'shared') diff --git a/shared/common/binport.c b/shared/common/binport.c index cb3d201..4fe46e8 100644 --- a/shared/common/binport.c +++ b/shared/common/binport.c @@ -28,9 +28,11 @@ #include "unstable/standalone.h" -#define BINPORT_VERBOSE +#ifdef KRZYSZCZ //#define BINPORT_DEBUG #endif +#define BINPORT_VERBOSE +#endif #include "common/lex.h" #include "binport.h" diff --git a/shared/common/dict.c b/shared/common/dict.c index 0871f81..f2dd838 100644 --- a/shared/common/dict.c +++ b/shared/common/dict.c @@ -10,8 +10,10 @@ #include "m_pd.h" #include "common/dict.h" -#define DICT_VERBOSE +#ifdef KRZYSZCZ //#define DICT_DEBUG +#endif +#define DICT_VERBOSE #define DICT_HASHSIZE_DEFAULT 1024 #define DICT_HASHSIZE_MIN 8 @@ -62,7 +64,8 @@ t_dict *dict_new(size_t hashsize) else for (sz = DICT_HASHSIZE_MAX; sz > DICT_HASHSIZE_MIN; sz >>= 1) if (sz <= hashsize) break; #ifdef DICT_DEBUG - post("allocating dictionary with %d-element hashtable", sz); + fprintf(stderr, + "allocating dictionary with %d-element hashtable\n", sz); #endif if (x->d_hashtable = getbytes((x->d_hashsize = sz) * sizeof(*x->d_hashtable))) @@ -91,7 +94,7 @@ t_symbol *dict_dokey(t_dict *x, char *s, t_symbol *oldsym) char *s2 = s; int mask = x->d_hashsize - 1; #ifdef DICT_DEBUG - startpost("make symbol-key from \"%s\"", s); + fprintf(stderr, "make symbol-key from \"%s\"", s); #endif while (*s2) { @@ -102,17 +105,17 @@ t_symbol *dict_dokey(t_dict *x, char *s, t_symbol *oldsym) } sym1 = x->d_hashtable + (hash2 & mask); #ifdef DICT_DEBUG - post(" in slot %d", (hash2 & mask)); + fprintf(stderr, " in slot %d\n", (hash2 & mask)); #endif while (sym2 = *sym1) { #ifdef DICT_DEBUG - post("try \"%s\"", sym2->s_name); + fprintf(stderr, "try \"%s\"\n", sym2->s_name); #endif if (!strcmp(sym2->s_name, s)) { #ifdef DICT_DEBUG - post("found at address %x", (int)sym2); + fprintf(stderr, "found at address %x\n", (int)sym2); #endif return(sym2); } @@ -129,7 +132,7 @@ t_symbol *dict_dokey(t_dict *x, char *s, t_symbol *oldsym) } *sym1 = sym2; #ifdef DICT_DEBUG - post("appended at address %x", (int)sym2); + fprintf(stderr, "appended at address %x\n", (int)sym2); #endif return (sym2); } @@ -144,12 +147,12 @@ t_symbol *dict_key(t_dict *x, char *s) void dict_bind(t_dict *x, t_pd *obj, t_symbol *s) { #ifdef DICT_DEBUG - post("bind %x to \"%s\" at %x", (int)obj, s->s_name, (int)s); + fprintf(stderr, "bind %x to \"%s\" at %x\n", (int)obj, s->s_name, (int)s); #endif if (s->s_thing) { #ifdef DICT_DEBUG - post("(next one)"); + fprintf(stderr, "(next one)\n"); #endif if (*s->s_thing == x->d_bindlist_class) { @@ -183,7 +186,8 @@ void dict_bind(t_dict *x, t_pd *obj, t_symbol *s) void dict_unbind(t_dict *x, t_pd *obj, t_symbol *s) { #ifdef DICT_DEBUG - post("unbind %x from \"%s\" at %x", (int)obj, s->s_name, (int)s); + fprintf(stderr, "unbind %x from \"%s\" at %x\n", + (int)obj, s->s_name, (int)s); #endif if (s->s_thing == obj) s->s_thing = 0; else if (s->s_thing && *s->s_thing == x->d_bindlist_class) diff --git a/shared/common/mifi.c b/shared/common/mifi.c index 1b9d367..ac491f5 100644 --- a/shared/common/mifi.c +++ b/shared/common/mifi.c @@ -69,7 +69,9 @@ typedef unsigned char uchar; #endif #endif +#ifdef KRZYSZCZ #define MIFI_DEBUG +#endif #define MIFI_VERBOSE #define MIFI_SHORTESTEVENT 2 /* singlebyte delta and one databyte */ diff --git a/shared/common/port.c b/shared/common/port.c index 99f8211..5c14acb 100644 --- a/shared/common/port.c +++ b/shared/common/port.c @@ -26,7 +26,9 @@ #include "common/binport.h" #include "common/port.h" +#ifdef KRZYSZCZ //#define PORT_DEBUG +#endif #define PORT_LOG #define PORT_DUMP /* fill separate files with ignored data, e.g. pictures */ diff --git a/shared/common/props.c b/shared/common/props.c index 6079308..f5f2763 100644 --- a/shared/common/props.c +++ b/shared/common/props.c @@ -7,7 +7,9 @@ #include "common/grow.h" #include "common/props.h" +#ifdef KRZYSZCZ //#define PROPS_DEBUG +#endif #define PROPS_INISIZE 32 /* LATER rethink */ #define PROPS_MAXOTHERS 32 diff --git a/shared/common/vefl.c b/shared/common/vefl.c index 19f37a2..b7230d5 100644 --- a/shared/common/vefl.c +++ b/shared/common/vefl.c @@ -19,12 +19,10 @@ #include "common/loud.h" #include "common/vefl.h" -#if 1 -#define VEFL_VERBOSE -#if 0 -#define VEFL_DEBUG -#endif +#ifdef KRZYSZCZ +//#define VEFL_DEBUG #endif +#define VEFL_VERBOSE /* on failure *vszp is not modified */ t_float *vefl_get(t_symbol *name, int *vszp, int indsp, t_pd *complain) diff --git a/shared/hammer/gui.c b/shared/hammer/gui.c index 7106a0a..388b14b 100644 --- a/shared/hammer/gui.c +++ b/shared/hammer/gui.c @@ -10,7 +10,9 @@ #include "g_canvas.h" #include "hammer/gui.h" +#ifdef KRZYSZCZ //#define HAMMERGUI_DEBUG +#endif static t_class *hammergui_class = 0; static t_hammergui *hammergui_sink = 0; @@ -27,6 +29,7 @@ static void hammergui_anything(t_hammergui *snk, needed in order to keep Pd's message system happy in a ``gray period'' -- after last master is unbound, and before gui bindings are cleared. */ #ifdef HAMMERGUI_DEBUG + /* FIXME */ startpost("%s", s->s_name); postatom(ac, av); post(" (sink %x)", (int)snk); @@ -37,7 +40,7 @@ static void hammergui_anything(t_hammergui *snk, static void hammergui__up(t_hammergui *snk, t_floatarg f) { #ifdef HAMMERGUI_DEBUG - post("_up %g (sink %x)", f, (int)snk); + fprintf(stderr, "_up %g (sink %x)\n", f, (int)snk); #endif if (!snk->g_psmouse) { @@ -75,7 +78,8 @@ static void hammergui__up(t_hammergui *snk, t_floatarg f) static void hammergui__focus(t_hammergui *snk, t_symbol *s, t_floatarg f) { #ifdef HAMMERGUI_DEBUG - post("_focus %s %g (sink %x)", (s ? s->s_name : "???"), f, (int)snk); + fprintf(stderr, "_focus %s %g (sink %x)\n", + (s ? s->s_name : "???"), f, (int)snk); #endif if (!snk->g_psfocus) { @@ -94,7 +98,8 @@ static void hammergui__focus(t_hammergui *snk, t_symbol *s, t_floatarg f) static void hammergui__vised(t_hammergui *snk, t_symbol *s, t_floatarg f) { #ifdef HAMMERGUI_DEBUG - post("_vised %s %g (sink %x)", (s ? s->s_name : "???"), f, (int)snk); + fprintf(stderr, "_vised %s %g (sink %x)\n", + (s ? s->s_name : "???"), f, (int)snk); #endif if (!snk->g_psvised) { @@ -120,7 +125,7 @@ static void hammergui__vised(t_hammergui *snk, t_symbol *s, t_floatarg f) static void hammergui_dobindmouse(t_hammergui *snk) { #ifdef HAMMERGUI_DEBUG - post("dobindmouse (sink %x)", (int)snk); + fprintf(stderr, "dobindmouse (sink %x)\n", (int)snk); #endif #if 0 /* How to be notified about changes of button state, prior to gui objects @@ -185,7 +190,7 @@ static void hammergui__refocus(t_hammergui *snk) static void hammergui_dobindvised(t_hammergui *snk) { #ifdef HAMMERGUI_DEBUG - post("dobindvised (sink %x)", (int)snk); + fprintf(stderr, "dobindvised (sink %x)\n", (int)snk); #endif sys_vgui("bind Canvas <> \ {if {[hammergui_ispatcher %%W]} \ @@ -224,8 +229,9 @@ static int hammergui_setup(void) { char *cname = class_getname(*ps_hashhammergui->s_thing); #ifdef HAMMERGUI_DEBUG - post("'%s' already registered as the global hammergui sink ", - (cname ? cname : "???")); + fprintf(stderr, + "'%s' already registered as the global hammergui sink \n", + (cname ? cname : "???")); #endif if (strcmp(cname, ps__hammergui->s_name)) { @@ -417,7 +423,7 @@ static int hammergui_visedvalidate(int dosetup) void hammergui_bindmouse(t_pd *master) { #ifdef HAMMERGUI_DEBUG - post("bindmouse, master %x", (int)master); + fprintf(stderr, "bindmouse, master %x\n", (int)master); #endif hammergui_validate(1); hammergui_mousevalidate(1); @@ -506,7 +512,7 @@ void hammergui_unbindfocus(t_pd *master) void hammergui_bindvised(t_pd *master) { #ifdef HAMMERGUI_DEBUG - post("bindvised, master %x", (int)master); + fprintf(stderr, "bindvised, master %x\n", (int)master); #endif hammergui_validate(1); hammergui_visedvalidate(1); diff --git a/shared/sickle/sic.c b/shared/sickle/sic.c index 003120e..4557c4b 100644 --- a/shared/sickle/sic.c +++ b/shared/sickle/sic.c @@ -10,7 +10,9 @@ #include "common/loud.h" #include "sickle/sic.h" +#ifdef KRZYSZCZ //#define SIC_DEBUG +#endif #if defined(NT) || defined(MACOSX) /* cf pd/src/x_arithmetic.c */ @@ -58,8 +60,9 @@ t_float *sic_makecostable(int *sizep) if (sz >= *sizep) break; #ifdef SIC_DEBUG - post("request for a costable of %d points (effective %d, ndx %d)", - *sizep, sz, ndx); + fprintf(stderr, + "request for a costable of %d points (effective %d, ndx %d)\n", + *sizep, sz, ndx); #endif *sizep = sz; if (sic_costables[ndx]) @@ -74,7 +77,7 @@ t_float *sic_makecostable(int *sizep) if (table) { #ifdef SIC_DEBUG - post("got %d points of a costable", cnt); + fprintf(stderr, "got %d points of a costable\n", cnt); #endif while (cnt--) { diff --git a/shared/toxy/plusbob.c b/shared/toxy/plusbob.c index fb587cc..4ea96e2 100644 --- a/shared/toxy/plusbob.c +++ b/shared/toxy/plusbob.c @@ -7,7 +7,9 @@ #include "common/loud.h" #include "plusbob.h" +#ifdef KRZYSZCZ //#define PLUSBOB_DEBUG +#endif /* LATER let there be a choice of using either fake-symbols, or gpointers. The gpointer layout would be such: gs_un points to a plusbob-like diff --git a/shared/toxy/scriptlet.c b/shared/toxy/scriptlet.c index be5ff41..7d5146c 100644 --- a/shared/toxy/scriptlet.c +++ b/shared/toxy/scriptlet.c @@ -17,7 +17,9 @@ #include "common/props.h" #include "scriptlet.h" -#define SCRIPTLET_DEBUG +#ifdef KRZYSZCZ +//#define SCRIPTLET_DEBUG +#endif #define SCRIPTLET_INISIZE 1024 #define SCRIPTLET_INIDOTSIZE 256 @@ -641,6 +643,9 @@ static int scriptlet_doread(t_scriptlet *sp, t_pd *caller, FILE *fp, else builtin++; } } + else for (ptr = buf; *ptr; ptr++) + if (*ptr == '\r') + *ptr = ' '; /* LATER rethink */ ptr = buf; while (*ptr == ' ' || *ptr == '\t') ptr++; if (*ptr == '#') @@ -669,7 +674,7 @@ static int scriptlet_doread(t_scriptlet *sp, t_pd *caller, FILE *fp, else if (newsp != outsp) { outsp->s_locked = 0; - scriptlet_reset(outsp = newsp); + outsp = newsp; } } } diff --git a/shared/unstable/forky.c b/shared/unstable/forky.c index 2e17253..fcdbd61 100644 --- a/shared/unstable/forky.c +++ b/shared/unstable/forky.c @@ -14,7 +14,9 @@ #include "unstable/pd_imp.h" #endif +#ifdef KRZYSZCZ //#define FORKY_DEBUG +#endif t_pd *forky_newobject(t_symbol *s, int ac, t_atom *av) { @@ -36,7 +38,7 @@ void forky_setsavefn(t_class *c, t_forkysavefn fn) /* cloning is necessary, because class_setwidget has not been called */ t_widgetbehavior *wb = getbytes(sizeof(*wb)); /* never freed */ #ifdef FORKY_DEBUG - post("cloning widgetbehavior..."); + fprintf(stderr, "cloning widgetbehavior...\n"); #endif *wb = *c->c_wb; wb->w_savefn = fn; @@ -97,7 +99,7 @@ t_int forky_getbitmask(int ac, t_atom *av) } /* CHECKED missing are zero */ #ifdef FORKY_DEBUG - post("mask set to %.8x", result); + fprintf(stderr, "mask set to %.8x\n", result); #endif } else bug("sizeof(shared_t_bitmask)"); diff --git a/shared/unstable/fringe.c b/shared/unstable/fringe.c index 913d201..2bfe478 100644 --- a/shared/unstable/fringe.c +++ b/shared/unstable/fringe.c @@ -9,7 +9,9 @@ #include "unstable/forky.h" #include "unstable/fringe.h" +#ifdef KRZYSZCZ //#define FRINGE_DEBUG +#endif static int gobj_getindex(t_glist *gl, t_gobj *ob) { @@ -60,7 +62,7 @@ static void gobj_stowconnections(t_glist *gl, t_gobj *ob, t_binbuf *bb) gobj_getindex(gl, (t_gobj *)lt.tr_ob2), lt.tr_inno); } #ifdef FRINGE_DEBUG - post("packed connections:"); + fprintf(stderr, "packed connections:\n"); binbuf_print(bb); #endif } @@ -68,7 +70,7 @@ static void gobj_stowconnections(t_glist *gl, t_gobj *ob, t_binbuf *bb) static void gobj_restoreconnections(t_glist *gl, t_binbuf *bb) { #ifdef FRINGE_DEBUG - post("restoring connections:"); + fprintf(stderr, "restoring connections:\n"); binbuf_print(bb); #endif canvas_setcurrent(gl); -- cgit v1.2.1