static void matrix_debugsums(t_matrix *x) { int i; loudbug_startpost("nblock %d (max %d), vectors:", x->x_nblock, x->x_maxblock); for (i = 0; i < x->x_noutlets; i++) loudbug_startpost(" %x", (int)x->x_osums[i]); loudbug_endpost(); }
static void curve_float(t_curve *x, t_float f) { if (x->x_deltaset) { x->x_deltaset = 0; x->x_target = f; x->x_nsegs = 1; x->x_curseg = x->x_segs; x->x_curseg->s_target = f; x->x_curseg->s_delta = x->x_delta; #ifdef CURVE_DEBUG loudbug_startpost("single segment: "); #endif curve_cc(x, x->x_curseg, x->x_ccinput); x->x_retarget = 1; } else { x->x_value = x->x_target = f; x->x_nsegs = 0; x->x_curseg = 0; x->x_nleft = 0; x->x_retarget = 0; } }
void qtree_debug(t_qtree *tree, int level, t_qnode_vshowhook hook) { t_qnode *np; int count; loudbug_post("------------------------"); count = qtree_checktraversal(tree); if (level) { for (np = tree->t_first; np; np = np->n_next) qnode_post(tree, np, hook, 0); if (level > 1) { loudbug_post("************"); for (np = tree->t_last; np; np = np->n_prev) loudbug_startpost("%g ", np->n_key); loudbug_endpost(); } } if (tree->t_root) { t_qnode *first = tree->t_root, *last = tree->t_root; while (first->n_left && first->n_left != tree->t_root) first = first->n_left; while (last->n_right && last->n_right != tree->t_root) last = last->n_right; loudbug_post("count %d, height %d, root %g", count, qnode_height(tree->t_root), tree->t_root->n_key); loudbug_post("first %g, root->left* %g, last %g, root->right* %g", (tree->t_first ? tree->t_first->n_key : 0), first->n_key, (tree->t_last ? tree->t_last->n_key : 0), last->n_key); } else loudbug_post("empty"); loudbug_post("...verified (black-height is %d)", qtree_verify(tree)); loudbug_post("------------------------"); }
/* only for debugging (never call, unless certain that nobody references wt) */ static void widgettype_free(t_masterwidget *mw, t_widgettype *wt) { loudbug_startpost("widgettype free... "); if (wt->wt_requirements) freebytes(wt->wt_requirements, strlen(wt->wt_requirements) + 1); dict_unbind(mw->mw_typemap, (t_pd *)wt, wt->wt_typekey); props_freeall(wt->wt_options); scriptlet_free(wt->wt_auxscript); widgethandlers_free(wt->wt_scripts); pd_free((t_pd *)wt); loudbug_post("done"); }
/* Search for a property, replace its value if found, otherwise add. If 'filter' contains an exact copy, do nothing. Assuming 'keysym' is valid. Returning nafter - nbefore. */ static int props_update(t_props *pp, int mode, t_props *filter, t_symbol *keysym, int ac, t_atom *av, int doit) { int nadd, ndiff, ibeg, iend = 0; t_atom *ap; for (nadd = 0, ap = av; nadd < ac; nadd++, ap++) if (ap->a_type == A_SYMBOL && props_iskey(pp, mode, ap->a_w.w_symbol->s_name) != PROPS_NONE) break; if (!nadd) { pp->p_badupdate = 1; return (0); } pp->p_badupdate = 0; nadd++; if (filter) { int acf; t_atom *apf = props_getone(filter, keysym, &acf); if (acf == nadd) { int i; #ifdef PROPS_DEBUG loudbug_startpost("checking %s", keysym->s_name); loudbug_postatom(nadd - 1, av); #endif for (i = 1, ap = av, apf++; i < nadd; i++, ap++, apf++) if (ap->a_type != apf->a_type || ap->a_w.w_symbol != apf->a_w.w_symbol) break; if (i == nadd) #ifndef PROPS_DEBUG return (0); #else { loudbug_post(" ... filtered"); return (0); } else loudbug_post(" ... updated"); #endif }
static void qnode_post(t_qtree *tree, t_qnode *np, t_qnode_vshowhook hook, char *message) { loudbug_startpost("%g ", np->n_key); if (tree->t_valuetype == QTREETYPE_FLOAT) loudbug_startpost("%g ", QNODE_GETFLOAT(np)); else if (tree->t_valuetype == QTREETYPE_SYMBOL) loudbug_startpost("%s ", QNODE_GETSYMBOL(np)->s_name); else if (tree->t_valuetype == QTREETYPE_ATOM) { t_atom *ap = QNODE_GETATOMPTR(np); if (ap->a_type == A_FLOAT) loudbug_startpost("%g ", ap->a_w.w_float); else if (ap->a_type == A_SYMBOL) loudbug_startpost("%s ", ap->a_w.w_symbol->s_name); } else if (hook) { char buf[MAXPDSTRING]; (*hook)(np, buf, MAXPDSTRING); loudbug_startpost("%s ", buf); } else loudbug_startpost("0x%08x ", (int)QNODE_GETSYMBOL(np)); loudbug_startpost("%s ", (np->n_black ? "black" : "red")); if (qnode_checkmulti(np, np->n_parent) || qnode_checkmulti(np, np->n_left) || qnode_checkmulti(np, np->n_right) || qnode_checkmulti(np->n_parent, np->n_left) || qnode_checkmulti(np->n_parent, np->n_right) || qnode_checkmulti(np->n_left, np->n_right)) loudbug_startpost("multi "); if (np->n_parent) loudbug_startpost("(%g -> ", np->n_parent->n_key); else loudbug_startpost("(nul -> "); if (np->n_left) loudbug_startpost("%g, ", np->n_left->n_key); else loudbug_startpost("nul, "); if (np->n_right) loudbug_startpost("%g)", np->n_right->n_key); else loudbug_startpost("nul)"); if (message) loudbug_post(": %s", message); else loudbug_endpost(); }